npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

neon-onchain-ai

v1.0.0

Published

An AI-powered blockchain agent that can interact with EVM blockchains

Readme

Neon Onchain AI

An AI-powered blockchain agent that can interact with any EVM blockchain. Built with OpenAI's Assistant API and viem.

Installation

npm install neon-onchain-ai

Quick Start

import { BlockchainAgent } from 'neon-onchain-ai';

function MyApp() {
  return (
    <BlockchainAgent 
      openaiApiKey="your-openai-key-here"
    />
  );
}

Using with MetaMask and Wagmi

import { useAccount, useNetwork } from 'wagmi';
import { useOnchainAgent } from 'neon-onchain-ai';

function BlockchainAssistant() {
  const { address } = useAccount();
  const { chain } = useNetwork();
  
  const { messages, sendMessage, isLoading } = useOnchainAgent({
    openaiApiKey: "your-openai-key-here",
    account: address ? { 
      address: address as `0x${string}`, 
      type: 'json-rpc' 
    } : undefined,
    chain: chain
  });

  // Your custom UI implementation
}

Direct SDK Usage

import { OnchainAgentSDK } from 'neon-onchain-ai';
import { polygon } from 'viem/chains';

async function main() {
  const agent = new OnchainAgentSDK({
    openaiApiKey: "your-openai-key",
    chain: polygon,
    // Account will come from MetaMask or private key
  });

  await agent.initialize();
  const response = await agent.sendMessage("Deploy an ERC20 token");
  console.log(response.value);
}

Direct Blockchain Access

You can directly access the blockchain clients for operations:

import { OnchainAgentSDK } from 'neon-onchain-ai';
import { polygon } from 'viem/chains';
import { privateKeyToAccount } from 'viem/accounts';

// Create the SDK
const account = privateKeyToAccount('0x...');
const sdk = new OnchainAgentSDK({
  openaiApiKey: "your-openai-key",
  chain: polygon,
  account
});

// Get the clients for direct access
const publicClient = sdk.getPublicClient();
const walletClient = sdk.getWalletClient();

// Example: Check balance
async function checkBalance(address) {
  const balance = await publicClient.getBalance({ address });
  console.log(`Balance: ${balance} wei`);
}

// Example: Send a transaction
async function sendTransaction(to, value) {
  // Convert ETH to wei (assuming value is in ETH)
  const valueInWei = BigInt(Math.floor(Number(value) * 1e18));
  
  const hash = await walletClient.sendTransaction({
    to,
    value: valueInWei
  });
  
  console.log(`Transaction hash: ${hash}`);
}

AI Assistant Capabilities

The AI assistant can handle the following blockchain operations through natural language:

  • Read Operations:

    • Get ETH balance of an address
    • Get ERC20 token balance
    • Get wallet address
    • Read data from contracts
    • Get transaction receipts
  • Write Operations:

    • Deploy ERC20 tokens
    • Send transactions
    • Write to contracts
    • Approve token allowances
    • Create liquidity pools

Simply use natural language to request these operations:

// Example operations through natural language
await sdk.sendMessage("What's my current ETH balance?");
await sdk.sendMessage("Deploy an ERC20 token named 'MyToken' with symbol 'MTK'");
await sdk.sendMessage("Send 0.1 ETH to 0x123...");

Documentation

For detailed usage instructions and examples, see the full documentation.

Features

  • AI Assistant powered by OpenAI's Assistant API
  • Direct blockchain interactions through Viem
  • Direct access to all blockchain tools
  • React integration with custom hooks and components
  • Support for:
    • Any EVM-compatible chain
    • MetaMask and other wallet providers
    • Private key authentication
    • ERC20 token deployments and interactions
    • Contract reading and writing
    • Balance checking
    • Transaction management
    • Uniswap V3 pool creation

License

ISC