Issue a wallet and set its limits
For the owner: give an agent a wallet, change what it may do, and freeze it.
Issue
- Go to Wallets and press Issue wallet.
- Enter a name of up to 24 bytes, a limit per payment, a limit per day, and what the wallet may pay for.
- Sign. The app shows the agent's key once. Copy it into the agent.
- The wallet appears in the list with nothing spent.
The app makes the agent's key in your browser. If the agent already has a key, call the program with its public key instead:
await program.methods
.addAgent("researcher", new BN(5_000_000), new BN(8_000_000), 0b011)
.accounts({ owner: owner.publicKey, book, agent: agent.publicKey })
.rpc();Change limits
- Open the wallet from the Wallets page.
- Edit the two limits and the categories under Limits.
- Press Save limits and sign.
set_limits replaces all four values at once, so send the ones you are keeping as well.
Freeze
Switch on Freeze this wallet and save. Every spend from that wallet is then refused with Frozen until you switch it off. Freezing does not touch the shared balance or other wallets.
await program.methods
.setLimits(new BN(5_000_000), new BN(8_000_000), 0b011, true) // frozen
.accounts({ owner: owner.publicKey, book, wallet })
.rpc();NextSpend from an agent