Published to npm as @mdlog/agentgate@0.1.2.
Changes
- New command:
agentgate buy <id>— the buyer side in one command. Runs the full x402 exchange: fetch the402invoice, pay it with a native CSPR transfer carrying the invoice nonce astransfer_id, retry with theX-PAYMENTproof. Response body goes to stdout (pipeable); the payment receipt (price, deploy hash, explorer link, settlement) goes to stderr. --max <cspr>budget cap — refuses any invoice priced above it (PRICE_EXCEEDED), checked against both the on-chain price (before any HTTP) and the 402 invoice (before paying). Unknown (SERVICE_NOT_FOUND) and paused (SERVICE_INACTIVE) services fail fast before a single mote moves; non-JSON--bodyis rejected up front.- Buyer signer per mode:
MOCK_BUYER_ACCOUNT(mock),--pem/BUYER_SIGNER_PEM_PATH(live) — forbuy,--pemmeans the buyer key. @agentgate/clientis now inlined into the published bundle, keepingnpxself-contained.- Docs: full
buyreference on the docs site, buyer-guide one-liner,docs/BUY-QUICKSTART.md. - No contract change — payment is a plain native transfer; the deployed registry is untouched.
Install
npx @mdlog/agentgate@latest buy 1 --pem ./buyer.pem --max 5