Demo mode — this page simulates the CapPurse ledger in your browser. It is not connected to a Tari wallet or to the network.
Tari Ootle MVP

CapPurse

Give anyone a spending cap they cannot exceed. Funds go from your vault straight to the merchant, or the payment fails and nothing moves.

Purse

Live vault

Bob's remaining cap No allowance yet
0cap

When Alice grants Bob a cap, this bar shows how much of it is still left to spend.

Vault
0 TARI
Spendable
0 TARI
Receipts
0
Act as

Bob never holds the funds. A successful spend pays the merchant and returns Bob a receipt.

Mallory is not a helper on this purse. Any spend she tries should fail. She can still top up the vault from her own balance.

Accounts

AccountBalanceReceipts

Allowance

HelperCapRemainingStatusAllowlist

Each click is a template method

The Rust Ootle template in template/ is the on-chain version of the engine this page runs. Engine tests in Node and in tari_template_test_tooling cover the same rules.

UI actionTemplate methodWho can call it
Open purseCapPurse::new(alloc)Signer becomes owner
Depositdeposit(bucket)Anyone, TARI only
Grant Bobgrant(helper, label, cap, period_epochs, expires_at_epoch, allowlist)Owner
Change capset_cap(helper, new_cap)Owner
Change allowed shopsset_allowlist(helper, allowlist)Owner
Bob spendsspend(amount, merchant, memo) → receipt NFTThe helper (checked inside the method)
Revokerevoke(helper)Owner
Undo revokereactivate(helper)Owner, only before expiry
Withdrawwithdraw(amount) → BucketOwner
Read balancevault_balance()Anyone
Read allowanceallowance_of(helper) → AllowanceViewAnyone
Find receiptsreceipt_resource() → ResourceAddressAnyone
Period refillConsensus::current_epoch(), automatic on spend—

Calling it from a transaction

These are the calls the engine tests in template/tests/engine.rs make. Owner opens and funds a purse in one transaction:

test.transaction()
    .allocate_component_address("alloc")
    .call_function(template, "new", args![Workspace("alloc")])
    .put_last_instruction_output_on_workspace("purse")
    .call_method(owner.account, "withdraw", args![TARI_TOKEN, DEPOSIT])
    .put_last_instruction_output_on_workspace("funds")
    .call_method("purse", "deposit", args![Workspace("funds")])
    .build_and_seal(&owner.secret)

The helper spends and keeps the receipt NFT in their own account:

test.transaction()
    .call_method(purse, "spend", args![FORTY, cafe, "lunch".to_string()])
    .put_last_instruction_output_on_workspace("receipt")
    .call_method(bob.account, "deposit", args![Workspace("receipt")])
    .build_and_seal(&bob.secret)

Honest limits