Wallet balances
Canton holdings are private contracts. Read them through your authorized application backend or a wallet that supports ledgerApi, then pass the typed result to the standard account panel. PartyLayer does not invent a public balance endpoint or silently count an unavailable read as a zero balance.
Prerequisites
Connect a wallet on the intended network. The application read must be authorized for the current party/network and return TokenHoldingRef records: a contract id (cid) paired with its Holding view (owner, instrumentId, amount and optional lock). A wallet proxy additionally requires the actual ledgerApi capability. These reads never transfer funds.
How the query works
Use a consistent active-contract snapshot at a valid ledger offset and the Holding interface from your deployed Token Standard. Request interface views, read every page, and map each contract id and view into a typed holding. Inspect the deployed API version; streaming and paginated endpoint request/response shapes differ. A partial page is not a complete balance.
The JSON Ledger API referencedocuments activeAtOffset, eventFormat and interface filters. The updatedwallet holdings exampledemonstrates a read-only v2 wallet proxy: ledger-end followed by active-contracts, exact Holding views, safe offset validation and rejection of unexpected pagination. It uses the public default wallet catalog and requires a compatible wallet/ledger deployment; it is not a claim that every live wallet read has passed.
React
Starting with SDK 0.21.0 / React 3.2.0, useWalletTokenHoldings is the ready alternative for compatible v2 wallet proxies. It scopes the cache and validates complete snapshots; the application-fetcher hook below remains available. See the reader guide.
The same hook also accepts an explicit application endpoint/source configuration when a wallet has no ledger proxy. The server referenceauthorizes those reads with its own app session and rebuilds party-scoped filters; participant credentials stay server-side.
The ready-made account panel displays supplied holdings only when party and CAIP-2 network exactly match its active session. Previous-account data is hidden. Loading/errors are explicit. Custom views can render TokenBalances with owner, holdings, loading and error; formatInstrument receives both instrument admin and id.
Vanilla JavaScript
The existing core package exposes a framework-free decimal helper. Declare core directly in a separate backend/vanilla package rather than relying on a hoisted transitive dependency.
Notes
Reported locks remain locked in the summary, even if their timestamp is in the past. Only an updated ledger view establishes that a lock was removed. These totals cover returned active holdings, not incomplete assignments, pending transfers, a proof of spendability or full historical activity. Backend authorization, complete reads and final live-wallet acceptance remain required.