@tetherto/wdk-cli
A multi-chain crypto wallet for AI agents, built on WDK (Wallet Development Kit) by Tether. Designed to be operated by AI agents (e.g. Claude, ChatGPT, OpenClaw).
AI agents: see SKILL.md for the complete operational guide — commands, workflows, error handling, and safety rules.
See the WDK CLI documentation.
Architecture
┌───────────┐ ┌───────────────────────────────────┐
│ wdk-cli │──IPC──▶│ wdk-daemon │
│ (CLI) │ │ (wallet daemon) │
└───────────┘ │ │
│ Holds WDK instances in memory │
┌───────────┐ │ Handles wallet operations: │
│ wdk-mcp │──IPC──▶│ derivation, signing, balances │
│ (MCP) │ │ Auto-locks after TTL expires │
└───────────┘ │ │
│ Signs tx locally, then submits │
└───────────┬───────────────────────┘
│
│ submits signed tx
▼
┌──────────────┐
│ Blockchain │
│ (RPC/P2P) │
└──────────────┘
wdk-daemon (Wallet Daemon):
- Starts empty — wallets unlocked individually via socket requests
- Holds WDK instances in memory — owns all signing
- Listens on a Unix socket (
daemon.sock, 0700 permissions)
- Exposes:
unlock_wallet, lock_wallet, get_address, get_balance, estimate_fee, send, call_method, sign_message, verify_message, get_transaction, quote_swap, quote_bridge, execute_swap, execute_bridge, list_wallets, status, lock
- Per-wallet TTL — each wallet has its own timeout (default: 5 min, maximum: 10080 min / 7 days,
--ttl 0 for unlimited)
- Auto-exits when last wallet is locked
wdk-cli (CLI):
- Commands that take a passphrase handle the seed in the CLI process, e.g.
wallet unlock and wallet export decrypt it
- Parses user commands, sends requests to daemon, formats and displays results
- Only interface for passphrase-protected operations: unlock wallet, export seed, delete wallet
wdk-mcp (MCP Server):
- Thin client — no crypto, no keys
- Exposes structured wallet tools to AI agents via Model Context Protocol
- Routes all operations through the daemon
Features
- Wallet — Multiple named wallets with per-wallet passphrases and BIP-39 seed phrases, encrypted at rest with AES-256-GCM. Background daemon holds keys in memory after unlock, with per-wallet TTL
- Network — Bitcoin, Ethereum, Polygon, Arbitrum, Base, BSC, Avalanche, Solana, Tron, Spark, Smart Account (ERC-4337) + testnets. Add custom networks with
network create
- Token — Built-in registry of tokens per network (symbol, decimals, address, indexer/MoonPay/Transak/price-feed mappings). Add your own with
token add
- Get — Derive wallet addresses, check balances, and view transaction history across all networks
- Send — Native and token transfers with fee estimation and dry-run preview. Decimal amounts by default
- Buy/Sell — On/off ramp via MoonPay or Transak (buy crypto with fiat, sell crypto for fiat)
- Config — Per-network configuration with env var overrides
Requirements
Install
npm install -g @tetherto/wdk-cli
From source:
git clone https://github.com/tetherto/wdk-cli.git
cd wdk-cli
npm install
npm link # makes `wdk` available globally
Quick Start
# Create wallets (each has its own passphrase)
wdk wallet create --name trading --words 24
wdk wallet create --name savings --words 12
# List all wallets
wdk wallet list
# Unlock wallets individually (starts daemon on first unlock)
wdk wallet unlock --name trading --ttl 0 # unlimited session
wdk wallet unlock --name savings --ttl 60 # 60 min session
# Set default wallet
wdk wallet default --name trading
# Get all wallet addresses across networks
wdk get address --all
# Get address for a specific network
wdk get address --network ethereum
# Use a specific wallet
wdk get address --network ethereum --wallet trading
# Check all balances across networks (with USD totals)
wdk get balance --all
# Check balance for a specific wallet
wdk get balance --all --wallet savings
# Send 1.23456 ETH (decimal default; add --base-units to send in wei)
wdk send --to 0x000000000000000000000000000000000000dEaD --amount 1.23456 --network ethereum
# Send 100.5 USDT (registered token ticker — see `wdk token list`)
wdk send --to 0x... --amount 100.5 --token usdt --network ethereum --wallet trading
# Swap 100 USDT for ETH via the best available protocol (preview first)
wdk swap --network ethereum --from-token usdt --to-token eth --amount-in 100 --dry-run
# Bridge 100 USDT from Ethereum to Avalanche
wdk bridge --network ethereum --token usdt --to-network avalanche --amount 100 --dry-run
# Show network details and config
wdk network info --network ethereum
# List supported networks
wdk network list
# Lock a single wallet
wdk wallet lock --name trading
# Lock all wallets when done
wdk wallet lock --all
Commands
Wallet
Wallet commands that require passphrase input (create, import, unlock, export, delete) are interactive by default. Set WDK_PASSPHRASE env var to skip the interactive prompt for automation and --json output. Two commands take an extra flag for non-interactive use: import reads the seed phrase from stdin with --seed-stdin, and change-passphrase reads the new passphrase from stdin with --new-passphrase-stdin (WDK_PASSPHRASE supplies only the current passphrase, never the new one).
wdk wallet create --name <name> [--words 12|24] # Create a new wallet with a generated seed phrase
wdk wallet import --name <name> [--seed-stdin] # Import a wallet from an existing seed phrase
wdk wallet export --name <name> # Display the seed phrase of an existing wallet
wdk wallet list # List all wallets with lock/default status
wdk wallet unlock --name <name> [--ttl <minutes>] # Unlock a wallet for signing transactions (max 10080)
wdk wallet lock --name <name> # Lock a single wallet
wdk wallet lock --all # Lock all wallets (stops daemon)
wdk wallet delete --name <name> # Delete a wallet (requires passphrase)
wdk wallet change-passphrase --name <name> [--new-passphrase-stdin] # Change the wallet passphrase (requires current passphrase)
wdk wallet default --name <name> # Set the default wallet
wdk wallet rename --name <old> --new-name <new> # Rename a wallet
Supports multiple named wallets with per-wallet passphrases. Each wallet is stored as ~/.config/wdk-cli/wallets/<name>/seed.enc. The first wallet created is auto-set as default. Use --wallet <name> on other commands to target a specific wallet (defaults to the default wallet).
Passphrase is optional (empty for none). If provided, it encrypts the seed phrase with AES-256-GCM + scrypt.
wdk wallet unlock unlocks a single wallet and starts the daemon if not running. Each wallet has its own TTL, up to 10080 minutes (7 days). --ttl 0 means no expiry, so the wallet stays unlocked until someone locks it, and any process running as you can sign and send until then (see Trust model). Give AI agents a bounded session. The daemon auto-exits when the last wallet is locked.
Networks
wdk network list # List all networks (built-in + custom)
wdk network list --testnet # Show only testnets
wdk network list --mainnet # Show only mainnets
wdk network info --network <network> # Show network details and config
wdk network delete --name <name> # Delete a custom network (requires unlocked wallet)
wdk network disable --name <name> # Hide a network
wdk network enable --name <name> # Bring it back
delete permanently removes a network you created; disable hides any network reversibly (see Module for how overrides are stored).
Adding Custom Networks
wdk network create <data> takes a single argument — either an inline JSON string or a path to a JSON file. Requires an unlocked wallet.
# Inline JSON
wdk network create '{"network":"optimism","module":"@tetherto/wdk-wallet-evm","indexerSlug":"ethereum","config":{"provider":"https://mainnet.optimism.io","chainId":10}}'
# Or from a file
wdk network create ./optimism.json
Example spec file:
{
"network": "optimism",
"module": "@tetherto/wdk-wallet-evm",
"displayName": "Optimism",
"testnet": false,
"indexerSlug": "ethereum",
"config": { "provider": "https://mainnet.optimism.io", "chainId": 10 },
"tokens": [
{
"token": "eth",
"symbol": "ETH",
"decimals": 18,
"isNative": true,
"metadata": { "slugs": { "moonpay": "eth" } }
},
{
"token": "usdt",
"symbol": "USDT",
"decimals": 6,
"isNative": false,
"address": "0x...",
"metadata": { "slugs": { "indexer": "usdt", "moonpay": "usdt", "bitfinex": "UST" } }
}
]
}
Spec fields:
| Field |
Required |
Description |
network |
Yes |
Network identifier (lowercase, hyphens allowed) |
module |
Yes |
Wallet module: @tetherto/wdk-wallet-evm, @tetherto/wdk-wallet-btc, @tetherto/wdk-wallet-solana, @tetherto/wdk-wallet-spark, @tetherto/wdk-wallet-tron, @tetherto/wdk-wallet-evm-erc-4337 |
displayName |
No |
Human-readable name (defaults to network) |
testnet |
No |
true to mark as a testnet |
indexerSlug |
Required for indexer support |
Chain slug used by the WDK indexer API (e.g. ethereum, polygon, bitcoin). If omitted, the indexer is disabled for this network and wdk get history will error with NETWORK_NOT_SUPPORTED. For most networks the slug equals the network name; smart-account / forked networks point at the underlying chain (e.g. smart-account-ethereum uses "indexerSlug": "ethereum"). |
config |
No |
SDK config object (provider URL, chainId, etc.). May be set later via wdk config set --network <name>. |
tokens |
No |
Token registry entries to register atomically with the network. At most one entry may have isNative: true. Each entry's shape matches the Tokens spec. |
The spec is parsed and validated atomically: if any token in tokens[] fails validation, the network is not created (full rollback). Unknown top-level fields pass through silently (so you can annotate specs with comments, tags, owner, etc.).
Deleting a custom network (wdk network delete --name <n>) also removes its registered tokens.
Tokens
The CLI ships with a registry (wdk.tokens.json) of all known tokens per network — symbol, decimals, contract address, and provider mappings (indexer code, MoonPay asset code, price-feed currency code). The --token flag on get balance / send / get history / buy / sell resolves against this registry.
wdk token list # All tokens, grouped by network
wdk token list --network ethereum # Filter to one network
wdk token info --network ethereum --token usdt # Show full entry
# Add a token from inline JSON or a file
wdk token add '{"network":"ethereum","token":"dai","symbol":"DAI","decimals":18,"isNative":false,"address":"0x..."}'
wdk token add ./dai-on-ethereum.json
wdk token delete --network <n> --token <t> # Remove a custom entry
wdk token disable --network <n> --token <t> # Hide an entry (built-in or custom)
wdk token enable --network <n> --token <t> # Bring it back
wdk token add <data> takes a single argument — inline JSON or a path to a JSON file. delete permanently removes an entry you added; disable hides any entry reversibly (native tokens cannot be disabled — disable the network instead).
Token entry fields — and why each one is needed:
| Field |
Required |
What the CLI does with it |
network |
Yes |
Parent network the token belongs to. Must already exist. |
token |
Yes |
Registry key (lowercased) used by --token <ticker> flags across the CLI. |
symbol |
Yes |
Display label shown in get balance, send previews, fee lines, and tables (e.g. 1.5 ETH, 100 USDT). |
decimals |
Yes |
Used to convert between the CLI's decimal --amount (e.g. 1.5) and the SDK's base units (wei / satoshi / lamport). Integer 0–24. |
isNative |
Yes |
Routes transfers through the native-coin path (no contract call) vs the token-contract path. Each network can have at most one native entry. |
address |
If !isNative |
Contract / mint address used by the SDK to call transfer / getBalance on the right token. Required for ERC-20 / SPL / TRC-20; omit for native. |