USDC Payments¶
Lango provides a blockchain payment system for USDC on Base L2 (EVM). The agent can send USDC, check balances, view transaction history, and manage wallets through built-in payment tools.
Experimental
The payments system is under active development. Enable it with payment.enabled: true.
Payment Tools¶
| Tool | Description | Safety Level |
|---|---|---|
payment_send |
Send USDC to recipient with linked transaction receipt | Dangerous |
payment_balance |
Check wallet USDC balance | Safe |
payment_history |
View recent transactions | Safe |
payment_limits |
View spending limits and daily usage | Safe |
payment_wallet_info |
Show wallet address and network info | Safe |
payment_create_wallet |
Create new blockchain wallet | Dangerous |
payment_x402_fetch |
HTTP request with automatic X402 payment | Dangerous |
Tool Approval
Tools marked Dangerous require explicit user approval before execution unless auto-approve policies are configured. See Tool Approval for details.
Direct Payment Execution Gate
payment_send and p2p_pay now run behind a receipt-backed direct payment execution gate. Direct payment execution requires a linked transaction_receipt_id, uses the transaction's current canonical submission when submission_receipt_id is omitted, and allows execution only when the canonical payment approval state is approved with a prepay settlement hint. If transaction_receipt_id is missing, the tool now fails immediately with an actionable missing-parameter error instead of deferring that check deeper into the payment gate. See Actual Payment Execution Gating.
Wallet Providers¶
| Provider | Description |
|---|---|
local |
Default. Private key derived from encrypted secrets stored on disk. |
rpc |
Remote signer. Delegates signing to an external RPC endpoint. |
composite |
Tries rpc first, falls back to local if unavailable. |
CLI Examples¶
Check wallet balance:
lango payment balance
View recent transactions:
lango payment history --limit 10
View spending limits and daily usage:
lango payment limits
Show wallet address and network info:
lango payment info
Send USDC to a recipient:
lango payment send --to 0x1234...abcd --amount 0.50 --purpose "API access"
Skip confirmation prompt with --force:
lango payment send --to 0x1234...abcd --amount 0.50 --purpose "API access" --force
The interactive confirmation summary and Confirm [y/N]: prompt are written through the Cobra command streams, so wrappers can drive the interaction via command input/output. In non-interactive runs, pass --force instead of attempting a prompt.
JSON output for scripting:
lango payment balance --output json
Configuration¶
Settings:
lango settings→ Payment
{
"payment": {
"enabled": true,
"walletProvider": "local",
"network": {
"chainId": 84532,
"rpcUrl": "https://sepolia.base.org",
"usdcContract": "0x..."
},
"limits": {
"maxPerTx": 10.0,
"maxDaily": 100.0,
"autoApproveBelow": 0.10
}
}
}
| Key | Type | Default | Description |
|---|---|---|---|
payment.enabled |
bool |
false |
Enable the payment system |
payment.walletProvider |
string |
local |
Wallet provider: local, rpc, or composite |
payment.network.chainId |
int |
84532 |
Chain ID (84532 = Base Sepolia, 8453 = Base mainnet) |
payment.network.rpcUrl |
string |
-- | RPC endpoint URL for the target network |
payment.network.usdcContract |
string |
-- | USDC token contract address |
payment.limits.maxPerTx |
float64 |
10.0 |
Maximum USDC per transaction |
payment.limits.maxDaily |
float64 |
100.0 |
Maximum USDC per 24-hour rolling window |
payment.limits.autoApproveBelow |
float64 |
0.10 |
Auto-approve threshold (no confirmation prompt) |
P2P Integration
The autoApproveBelow threshold also applies to P2P payment flows:
- Outbound:
p2p_payandpayment_sendtransactions below the threshold are auto-approved without user confirmation. - Inbound: When a remote peer invokes a paid tool, the owner's approval pipeline checks the tool price against the spending limiter. If the price is below
autoApproveBelowand within daily limits, the invocation is auto-approved.
See P2P Network — Approval Pipeline for the full inbound gate flow.
Testnet First
Start with Base Sepolia (chainId: 84532) for testing. Switch to Base mainnet (chainId: 8453) only after verifying your configuration. See the Production Checklist for mainnet deployment guidance.
Related¶
- X402 Protocol -- Automatic HTTP 402 payment handling
- Production Checklist -- Mainnet deployment guidance
- Tool Approval -- Approval policies for dangerous tools