skills/blockchain/wallet-integration/SKILL.md
Integrates blockchain wallets for secure cryptocurrency transactions and asset management.
npx skillsauth add alphaonedev/openclaw-graph wallet-integrationInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill integrates blockchain wallets to enable secure cryptocurrency transactions, asset management, and key handling for networks like Ethereum and Bitcoin. It abstracts wallet interactions, ensuring secure key management and transaction signing.
Use this skill when building applications that require wallet connectivity, such as dApps for token transfers, NFT management, or querying blockchain balances. Apply it in scenarios involving user authentication with wallets (e.g., MetaMask integration) or automated scripts for asset tracking.
Always initialize the wallet with a network and authentication method. Use environment variables for keys to avoid hardcoding. For CLI, prefix commands with claw wallet. In code, import the OpenClaw library and create a wallet instance. Handle asynchronous operations with async/await for network calls. Test integrations in a sandbox environment before production.
Use the following CLI commands or API endpoints for wallet operations. Set authentication via $WALLET_API_KEY environment variable.
CLI Command: claw wallet connect --network ethereum --key $ETH_PRIVATE_KEY --rpc-url https://mainnet.infura.io/v3/your-project-id
--network specifies chain (e.g., ethereum, bitcoin); --key uses a hex string; --rpc-url for custom nodes.API Endpoint: POST /api/v1/wallet/connect
{"network": "ethereum", "privateKey": "$ETH_PRIVATE_KEY", "rpcUrl": "https://mainnet.infura.io/v3/your-project-id"}{ "status": "connected", "address": "0xYourAddress" }.CLI Command: claw wallet send --to 0xRecipientAddress --amount 0.1 --network ethereum
--to for recipient; --amount in ETH; adds --gas-limit 21000 for custom gas.API Endpoint: POST /api/v1/wallet/transaction
{"to": "0xRecipientAddress", "amount": "0.1", "network": "ethereum", "gasLimit": 21000}import requests
import os
response = requests.post('https://api.openclaw.com/api/v1/wallet/transaction',
json={"to": "0xRecipient", "amount": "0.1"},
headers={"Authorization": f"Bearer {os.environ['WALLET_API_KEY']}"})
print(response.json())
CLI Command: claw wallet balance --address 0xYourAddress --network bitcoin
--address for query; supports --unit satoshi for precision.Config Format: Use JSON for wallet configs, e.g.,
{
"network": "ethereum",
"rpcUrl": "https://mainnet.infura.io/v3/your-id",
"privateKeyEnv": "ETH_PRIVATE_KEY"
}
Load via CLI: claw wallet load-config path/to/config.json.
Always use $WALLET_API_KEY for authentication in API calls or CLI commands to prevent exposure. Install dependencies like web3.py for Ethereum or bitcoinlib for Bitcoin via pip install openclaw-blockchain. For multi-chain support, specify networks explicitly in configs. Avoid storing keys in code; use secure vaults or hardware devices. If integrating with other services, chain wallet events to OpenClaw's event bus using WebSockets (e.g., ws://api.openclaw.com/events). Validate inputs (e.g., check address formats with web3.utils.isAddress()) before operations.
Catch common errors like network failures, invalid keys, or insufficient funds. Use try-except blocks for API calls. For CLI, check exit codes.
Error: Invalid private key – Code: 400 Bad Request
if not wallet.validate_key(key): raise ValueError("Invalid key")try:
wallet.connect(key=os.environ['ETH_PRIVATE_KEY'])
except ConnectionError as e:
print(f"Network error: {e}. Retrying in 5s...")
time.sleep(5)
Error: Insufficient funds – Code: 402 Payment Required
claw wallet balance and abort if low.claw wallet balance --address 0xAddr && claw wallet send || echo "Funds low"Always log errors with context (e.g., network and timestamp) and retry transient errors up to 3 times with exponential backoff.
Example 1: Connecting and Sending ETH To connect a wallet and send 0.1 ETH:
export ETH_PRIVATE_KEY=0xYourHexKeyclaw wallet connect --network ethereum --key $ETH_PRIVATE_KEYclaw wallet send --to 0xRecipient --amount 0.1
import openclaw
wallet = openclaw.Wallet(network='ethereum')
wallet.connect(key=os.environ['ETH_PRIVATE_KEY'])
tx_hash = wallet.send(to='0xRecipient', amount=0.1)
print(f"Transaction sent: {tx_hash}")
Example 2: Querying and Managing Bitcoin Assets To check balance and transfer BTC:
export BTC_PRIVATE_KEY=YourBitcoinKeyclaw wallet balance --address bc1YourAddress --network bitcoinclaw wallet send --to bc1Recipient --amount 0.001 --network bitcoin
import openclaw
wallet = openclaw.Wallet(network='bitcoin')
wallet.connect(key=os.environ['BTC_PRIVATE_KEY'])
balance = wallet.get_balance(address='bc1YourAddress')
if balance > 0.001:
tx_id = wallet.send(to='bc1Recipient', amount=0.001)
print(f"Transferred: {tx_id}")
tools
Root web development: project structure, tooling selection, deployment decisions
development
WebAssembly: Rust/Go/C to WASM, wasm-bindgen, Emscripten, WASM Component Model
development
Vue 3: Composition API script setup, Pinia, Vue Router 4, SFCs, Vite, Nuxt 3
tools
Tailwind CSS 4: utility classes, config, JIT, arbitrary values, darkMode, plugins, shadcn/ui