@zbdpay/agent-wallet ships the zbdw CLI and is the fastest way to operationalize agent payments.
Repository
Source code, release history, and examples.
NPM Package
Install globally or execute with npx.
Install
Environment Variables
| Variable | Default | Purpose |
|---|---|---|
ZBD_API_KEY | none | API key for wallet and payments requests |
ZBD_API_BASE_URL | https://api.zbdpay.com | Override ZBD API host |
ZBD_AI_BASE_URL | https://zbd.ai | Registration service host |
ZBD_WALLET_CONFIG | ~/.zbd-wallet/config.json | Wallet config path |
ZBD_WALLET_PAYMENTS | ~/.zbd-wallet/payments.json | Local payments log path |
ZBD_WALLET_TOKEN_CACHE | ~/.zbd-wallet/token-cache.json | L402 token cache path |
Command Reference
Destination Types (send)
| Destination | Example | Route |
|---|---|---|
| BOLT11 invoice | lnbc... | /v0/payments |
| Lightning Address | name@domain.com | /v0/ln-address/send-payment |
| ZBD Gamertag | @player | /v0/gamertag/send-payment |
| LNURL | lnurl... | /v0/ln-address/send-payment |
JSON Output Contract
Success and failure responses are always JSON on stdout.Paylink lifecycle values:
created | active | paid | expired | dead. Terminal states (paid, expired, dead) are permanent.
zbdw paylink get also syncs the latest payment attempt to local payments.json.Storage Layout
zbdw fetch uses @zbdpay/agent-fetch under the hood, including token caching and max payment guardrails.Companion Runnable Examples
agent-wallet does not currently ship its own examples/ directory. For a full runnable flow, pair it with:
agent-pay/examples/http-server.mjsagent-fetch/examples/zbd-agent-fetch.mjs
Troubleshooting
Command not found: zbdw
Command not found: zbdw
Build and alias the local binary, or install globally with
npm install -g @zbdpay/agent-wallet.register_failed during init
register_failed during init
Confirm
ZBD_AI_BASE_URL points to a reachable zbd-ai service and your API key is valid.wallet_response_invalid
wallet_response_invalid
Verify your configured API base URL returns wallet balance fields in expected shape.