LinkexLinkex Docs
Integrations

Binance Agentic Wallet

Install the binance-skills-hub skill and top up Linkex with `baw x402-payment` — end to end.

Binance Agentic Wallet (baw) is Binance's CLI for agent-driven Web3 wallets. It speaks x402 v2 natively, which makes it a drop-in signer for Linkex top-up orders. This guide walks the complete path: install → sign in → create a Linkex order → sign → submit → verify.

Prerequisites

  • Node.js ≥ 18 (for npx)
  • The Binance app on your phone (to approve wallet sign-in)
  • A Linkex API key (sk-...) — an agent key is recommended so spend caps apply
  • USDT/USDC/$U on BNB Chain, or USDC on Base/Solana, in your Binance Web3 wallet

Install the skill

For agent runtimes that support the skills ecosystem (Claude Code, OpenClaw, etc.):

npx skills add binance/binance-skills-hub/skills/binance-web3/binance-agentic-wallet

This installs the skill from the binance-skills-hub repository and the baw CLI (npm package @binance/agentic-wallet). To install just the CLI:

npm install -g @binance/agentic-wallet

Sign in to the wallet

baw auth signin --json

The response contains a urlForWeb and a pairingCode. Open the URL, verify the pairing code matches, and confirm the sign-in in your Binance app. Then verify:

baw auth verify --qrCodeId <qrCodeId-from-signin> --json

baw wallet status should now report a connected wallet; baw wallet balance shows your token balances.

Create a Linkex top-up order

curl -s -X POST https://linkex.ai/api/user/topup/x402/orders \
  -H "Authorization: Bearer sk-YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"amount_usd": 5, "network": "eip155:56"}'

The response's data.challenge is an x402 v2 PaymentRequired object. Save it — it's the input for the next step. (network is optional; BNB Chain shown here since B402 settlement is Binance-native.)

Preview the payment

Feed the challenge to baw:

baw x402-payment preview --paymentRequirements '<challenge JSON>' --json

The response lists payment options with a 1-based index, each marked:

  • READY_TO_SIGN — sign it directly
  • ACTION_REQUIRED — e.g. INSUFFICIENT_BALANCE; fund the wallet first
  • NOT_SIGNABLE — e.g. unsupported network; pick another option

Note the paymentId and your chosen option's index.

Sign

baw x402-payment sign --paymentId <paymentId> --selectedIndex 1 --json

Returns paymentHeaderValue — a base64-encoded signed x402 payload. If approveTxHash is non-null (first Permit2 payment for USDT/USDC on BSC), wait for that approval to confirm before proceeding; on BSC the approval gas is sponsored.

Submit to Linkex

The paymentHeaderValue decodes to the JSON payload the pay endpoint expects:

echo '<paymentHeaderValue>' | base64 -d > payload.json

curl -s -X POST https://linkex.ai/api/x402/pay/<order_id> \
  -H "Content-Type: application/json" \
  -d @payload.json

A successful response reports "status": "settled" (or credit_pending — credited within a couple of minutes).

Verify the credit

curl -s https://linkex.ai/api/user/self/balance \
  -H "Authorization: Bearer sk-YOUR_KEY"

quota_usd should have increased by the order amount. Done — your agent paid for its own inference budget.

Troubleshooting

SymptomFix
preview marks the only option INSUFFICIENT_BALANCEFund the Binance Web3 wallet with the listed token on the listed chain
sign fails with a daily-limit reasonBLOCKED_DAILY_LIMIT_REACHED — raise the wallet's x402 daily limit (baw wallet settings) or wait for reset
Pay endpoint returns ORDER_EXPIREDOrders live 10 minutes; create a new one and re-run preview/sign
Pay endpoint returns PAYLOAD_MISMATCHThe signed option doesn't match the order (wrong network/token) — pick the option whose network/asset equal the challenge's
Signature expiredSignatures are single-use and expire (signatureExpiresAt); restart from preview

Beyond top-ups

baw can also send tokens, swap, run limit orders, manage approvals, and more — see the skill repository for the full command surface. Only the x402 payment path above is required for Linkex.

On this page