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

agent-crypto-wallet

v1.0.0

Published

Cryptocurrency wallet system for AI agents. Secure storage and management of Bitcoin (BTC), USDT (ERC20/TRC20), and USDC (Base). Payments between agents via x402 protocol, trading on major exchanges (Binance, Coinbase), and non-custodial MPC wallet operat

Downloads

101

Readme

Agent Crypto Wallet

Cryptocurrency wallet system for AI agents. Enables secure storage and management of Bitcoin (BTC), USDT (ERC20/TRC20), and USDC (Base), with support for agent-to-agent payments via x402 protocol and trading on major exchanges.

Features

  • Multi-Chain Support: Bitcoin, Ethereum, Base, and TRON networks
  • Secure Storage: AES-256-GCM encryption for all credentials
  • MPC Wallets: Non-custodial key management via Coinbase CDP
  • Agent Payments: x402 protocol for seamless agent-to-agent transactions
  • Exchange Trading: Trade on Binance and Coinbase
  • HD Wallets: BIP39/BIP44 hierarchical deterministic wallets
  • OpenClaw Integration: Ready-to-use skill for OpenClaw agents

Installation

npm install -g agent-crypto-wallet

Quick Start

Initialize Wallet

import AgentWallet from 'agent-crypto-wallet';

// Create or load wallet
const wallet = new AgentWallet({
  agentId: 'my-agent',
  mpc: { provider: 'cdp' }
});

// Initialize with existing wallet or generate new
await wallet.initialize({
  password: 'secure-password',
  generateSeed: true  // Set to false to load existing
});

Check Balances

// Get all addresses
const addresses = wallet.getAllAddresses();
console.log(addresses);
// { bitcoin: 'bc1q...', ethereum: '0x...', base: '0x...', tron: 'T...' }

// Get balance for specific asset
const btcBalance = await wallet.getBalance('BTC');
console.log(`BTC: ${btcBalance}`);

Send Payments

// Send payment via x402 protocol
await wallet.sendPayment({
  to: '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb',
  amount: '100',
  asset: 'USDC-Base',
  protocol: 'x402'
});

// Send native payment
await wallet.sendPayment({
  to: 'bc1q...',
  amount: '0.001',
  asset: 'BTC',
  protocol: 'native'
});

Trade on Exchanges

// Buy BTC on Binance
await wallet.createOrder({
  exchange: 'binance',
  symbol: 'BTC/USDT',
  side: 'buy',
  amount: 0.001,
  type: 'market'
});

// Sell on Coinbase
await wallet.createOrder({
  exchange: 'coinbase',
  symbol: 'BTC-USD',
  side: 'sell',
  amount: 0.001,
  type: 'limit',
  price: 45000
});

Configuration

Environment Variables

# MPC Wallet (Coinbase CDP)
COINBASE_CDP_API_KEY=your_api_key
COINBASE_CDP_API_SECRET=your_secret

# Exchange APIs
BINANCE_API_KEY=your_key
BINANCE_API_SECRET=your_secret
COINBASE_API_KEY=your_key
COINBASE_API_SECRET=your_secret

# Node URLs (optional)
ETHEREUM_NODE=https://eth-mainnet.alchemyapi.io/v2/YOUR_KEY
BASE_NODE=https://mainnet.base.org
TRON_NODE=https://api.trongrid.io

Supported Assets

| Asset | Network | Address | |-------|---------|---------| | BTC | Bitcoin | Native | | USDT | Ethereum (ERC20) | 0xdAC17F958D2ee523a2206206994597C13D831ec7 | | USDT | TRON (TRC20) | TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t | | USDC | Base | 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 |

OpenClaw Skill Usage

After installation, the wallet skill is automatically registered with OpenClaw. Use these commands:

"Initialize my crypto wallet"
"Show my wallet addresses"
"Check my BTC balance"
"Send 100 USDC to 0x742d..."
"Buy 0.001 BTC on Binance"

Security

  • Encryption: All credentials encrypted with AES-256-GCM
  • MPC Support: Multi-party computation for enhanced security
  • Key Storage: Private keys never stored in plain text
  • Sandboxed: All wallet operations run in isolated context

API Reference

AgentWallet

Constructor

new AgentWallet(options)

Options:

  • agentId (string): Unique identifier for the agent
  • mpc.provider (string): MPC provider ('cdp' or 'agentpayy')
  • mpc.enabled (boolean): Enable MPC wallet (default: true)

Methods

initialize(options)

Initialize the wallet.

Options:

  • password (string, required): Encryption password
  • seedPhrase (string, optional): Existing seed phrase
  • generateSeed (boolean, optional): Generate new seed (default: false)
  • forceNew (boolean, optional): Create new wallet even if exists
getAddress(chain)

Get address for specific chain.

Parameters:

  • chain (string): 'bitcoin', 'ethereum', 'base', 'tron'
getBalance(asset)

Get balance for specific asset.

Parameters:

  • asset (string): 'BTC', 'USDT-ERC20', 'USDT-TRC20', 'USDC-Base'
sendPayment(params)

Send payment to another address.

Parameters:

  • to (string, required): Recipient address
  • amount (string|number, required): Amount to send
  • asset (string, required): Asset to send
  • protocol (string): 'x402' or 'native' (default: 'x402')
createOrder(params)

Create trading order on exchange.

Parameters:

  • exchange (string, required): 'binance' or 'coinbase'
  • symbol (string, required): Trading pair (e.g., 'BTC/USDT')
  • side (string, required): 'buy' or 'sell'
  • amount (number, required): Order amount
  • type (string): 'market' or 'limit' (default: 'market')
  • price (number): Required for limit orders

Development

# Clone repository
git clone https://github.com/clawfin/agent-crypto-wallet.git
cd agent-crypto-wallet

# Install dependencies
npm install

# Run tests
npm test

# Link for local development
npm link

License

MIT

Contributing

Contributions welcome! Please read our contributing guidelines.

Support

  • GitHub Issues: https://github.com/clawfin/agent-crypto-wallet/issues
  • Documentation: https://github.com/clawfin/agent-crypto-wallet/wiki