Skip to main content
ConceptsMeta-tools

codespar_wallet

The agent's governed funds — check balance and Pix key, read the wallet ledger, mint a Pix copia-e-cola to top up. Buy-side companion to codespar_pay.

1 min read
View MarkdownEdit on GitHub

codespar_wallet

Meta-tool

Buy-side. Your agent is the spender: this is the wallet it spends FROM. codespar_wallet reads and funds the consumer's governed wallet — balance and Pix key, ledger statement, and top-up via a minted Pix copia-e-cola. Distinct from codespar_ledger (the double-entry books) and from codespar_pay (spending OUT). Fund with receive, then spend with codespar_pay.

Actions

actionPurpose
balance (default)The spendable funds: wallet balance + the Pix key bound to it
statementThe wallet ledger (funds, holds, debits), newest first
receiveMint a Pix copia-e-cola a payer pays to TOP UP the wallet; settlement credits the wallet via the inbound webhook

Arguments

FieldTypeDescription
actionstringbalance | statement | receive (default balance)
consumer_idstring?Whose wallet; defaults to the session user
amountnumber?Top-up amount in minor units (centavos for BRL); action=receive
descriptionstring?Charge description shown to the payer; action=receive
dynamicboolean?action=receive: mint a DYNAMIC copia-e-cola (location URL) instead of a static QR. Default false
limitnumber?Max ledger entries (1..100, default 20); action=statement

The multi-slot wallet

A consumer's wallet is ONE wallet with per-currency slots (for example BRL + USDC) minted from a single mandate signature. There is no FX inside the wallet: each slot has its own cap and settled-spend ledger, and the payee type routes a payment to the matching slot (a URL or 0x address routes to USDC; a Pix key or copia-e-cola routes to BRL). The REST surface behind this tool is documented in the consumer wallet API, including moving balance between slots.

Example flow (fund, check, spend)

1. codespar_wallet action=receive amount=15000 description="Top up"
   → { pix_copia_e_cola: "00020126...", ... }   ← payer pays this
2. (webhook settles → wallet credited)
3. codespar_wallet action=balance
   → { balance, pix_key, ... }
4. codespar_pay recipient=<pix key or copia-e-cola> amount=...
   → spend, gated by the signed mandate

The settlement's receipt is the Control Record: mandate, payment and delivery bound in one signed document:

Agentic receipt
rcp_8f2a41c9
signed · Ed25519
Mandate — the permission
mandatecm_gWEZO68q
capBRL 500.00 / month
spent after thisBRL 179.90
Payment — the settlement
railpix
amountBRL 179.90
end-to-end refE18236120…7401
Delivery — the proof
evidencestore order #1049-B confirmed
chain a91c…04be 7d2f…c918verifiable offline via did:web
A signed agentic receipt binding the mandate, the settled payment, and the delivery proof, chained into the audit ledger and verifiable offline.

Every spend out of the wallet is mandate-gated server-side (per-currency caps, per-transaction caps, allowlists, expiry). The wallet holds the funds; the mandate holds the permission.

codespar_wallet | CodeSpar