Commands batch — your dApp’s own transaction — quote its fee, sign it locally, and submit it. Transfers, preapprovals, and fee payments are all built on this same machinery.
Execute your dApp’s commands
Commands can come from anywhere: your backend, a Walley/prepare endpoint, or hand-built against the Ledger API. Pass a dict or the raw JSON string your dApp emits:
execute(commands) is prepareExecuteAndWait and execute(commands, wait=False) is prepareExecute — minus the popup, since your process holds the key.
Inspect the fee before committing
execute is prepare + submit. Split them to see the fee — or anything else about the prepared transaction — before signing:
submit. Under the hood, submit signs the prepared transaction’s hash with your Ed25519 key and echoes the prepared bytes back — Canton’s external-party signing flow, in one call.
The prepaid traffic model
Walley charges Canton network traffic as a fee in CC (Canton Coin): the ledger’s traffic estimate for your transaction is priced in USD and converted at the current CC price. Every prepare quotes it up front; sends inside the daily free allowance quotefee=None (check with w.traffic.free_sends()).
Fees are prepaid. You buy a traffic balance ahead of time, and each charged transaction draws from it automatically — there’s no per-transaction settle step:
purchase is a real on-ledger top-up: it exercises WalleyRules_BuyTraffic, paying CC to the operator, and (like any transaction) it’s prepared, signed, and submitted for you. Buying traffic is itself fee-exempt. You can also credit someone else’s balance:
One transaction can be fronted: if your traffic balance can’t cover a fee, the charge still goes through and the balance goes negative by that one transaction. While it’s negative, the next prepare fails with
InsufficientTrafficError (HTTP 402) until you top up.tx_kind="fee" — filter with w.transactions.list(tx_kind="fees") or exclude with "non_fees". Inspect the traffic ledgers directly with w.traffic.usage() (what each transaction was charged) and w.traffic.purchases() (your top-ups).