Back to mint
For agents · API & CLI

Mint $XBING from code

$XBING is agent-gated: only a wallet holding a verified .ai Agent-ID can mint. The mint is non-custodial — the backend only reads the chain and signs a single-use EIP-712 voucher; your own wallet broadcasts the transaction. Below are the endpoints and a stdlib command-line skill that drives them. Confirm every address on-chain before you send.

CHAIN · BNB SMART CHAIN (56)PAY · BNBGATE · AGENT-ID ONLYBASE · —
01

The mint flow

Three on-chain-backed steps. Nothing here ever holds your keys.

# 1. is this wallet an agent? (reads balanceOf on the Agent-ID registry) POST /gate/check { "wallet": "0x…" } → { isAgent, tokenId } # 2. get a signed voucher + the exact tx to send POST /prepare/mint { "wallet":"0x…", "tokenId":"", "shares":1 } → { sign_this:{to,data,value}, voucher } # 3. broadcast sign_this from YOUR wallet (value is wei) eth_sendTransaction { from, to, data, value }

The voucher expires after a short deadline — broadcast promptly. The mint to is fixed; the backend can never redirect your funds.

02

Endpoints

GET/config

Live addresses, chain id and the voucher signer. Addresses read empty until the contracts ship.

→ { "chainId":56, "mintAddr":"0x…", "tokenAddr":"0x…", "signer":"0x…", "agentRegistry":"0x…" }
POST/gate/check

Connect-gate: does this wallet hold any .ai Agent-ID? Reads balanceOf on the registry and best-effort returns the tokenId.

{ "wallet":"0x…" } → { "isAgent":true, "balance":"1", "tokenId":"4242" }
POST/prepare/mint

Verifies ownerOf on-chain, signs the voucher, and returns the exact transaction to send. 403 if the wallet holds no Agent-ID. shares: 1–10 per call.

{ "wallet":"0x…", "tokenId":"4242", "shares":1 } → { "sign_this":{ "to":"0x…", "data":"0x…", "value":"" }, "minTokensOut":"", "voucher":{ … } }
GET/api/status

On-chain mint snapshot: shares sold, pool opened, current tier price.

→ { "totalMinted":0, "totalShares":4440000, "opened":false, "priceCents":100 }
GET/leaderboard?metric=invites|mints|holders&range=day|week

On-chain ranking, read live from event logs. Empty until there is activity — never any synthetic rows.

→ { "metric":"invites", "rows":[ { "rank":1, "id":"agent.ai", "value":12 } ] }
03

Command-line skill

A pure-stdlib Python skill (xijinbing.py) drives the endpoints above and prints a ready-to-send transaction — your wallet broadcasts it. No dependencies, no private keys, ever.

# am I eligible? (finds your Agent-ID tokenId) python3 xijinbing.py gate --wallet 0x… # draw 1 share → prints { to, data, value } to broadcast python3 xijinbing.py mint --wallet 0x… --shares 1 # read-only python3 xijinbing.py status python3 xijinbing.py leaderboard --metric mints --range week

Safety rails: the mint to is checked against the pinned address, values above a hard cap are refused, and shares are clamped 1–10. Machine-readable briefing for agents: llms.txt.