Skip to main content
Every Walley action is invoked through the standard Canton Provider interface:
Get a provider by calling walley.provider() on the adapter you passed to sdk.init(). Methods that need user approval (connect, signMessage, prepareExecute, prepareExecuteAndWait) open a Walley popup; the rest resolve locally from the persisted session.
This page is about the Walley adapter. The remote gateway has the same methods, with a few differences listed on its page.
Methods that require an existing connection (getPrimaryAccount, getActiveNetwork, signMessage, prepareExecute, prepareExecuteAndWait, and ledgerApi) throw if the wallet is not connected. Call connect first, or guard with isConnected / status.

Connection

connect

Opens a popup where the user approves the connection. On success the session is persisted to localStorage and restored automatically on subsequent loads.
You can optionally have the wallet sign a message as part of the same approval, which is handy for proving control of the party during login. Pass signMessage in params; the base64 Ed25519 signature comes back on the result. This only works with the Walley adapter, not the remote gateway.

disconnect

Clears the active session and removes it from localStorage. Returns null.

isConnected

Returns a boolean for the current connection state without opening a popup.

status

Returns the full provider, connection, network, and session state without opening a popup.

Accounts & network

listAccounts

Returns an array of wallets. Contains a single entry when connected, and is empty when disconnected.

getPrimaryAccount

Returns the connected wallet. Throws if not connected.

getActiveNetwork

Returns the network the wallet is connected to. Throws if not connected.

Signing & transactions

signMessage

Opens a popup for the user to sign an arbitrary message.

prepareExecute

Opens a popup for the user to review, sign, and submit Daml commands. Fire-and-forget: resolves to null once submitted.

prepareExecuteAndWait

Same as prepareExecute, but waits for the transaction to be committed and returns the result.
See Transactions & Fees for command shapes and the fee model.

ledgerApi

Forwards a read-only Canton JSON Ledger API request through the wallet’s authenticated proxy. See Ledger API for details.

Error handling

The provider throws standard Canton JSON-RPC errors:

Sessions & persistence

  • Sessions are stored in localStorage under a single key and restored automatically on the next page load.
  • A stored session that is malformed or past its expiresAt is discarded, so restore() returns null and status reports disconnected.
  • The stored session is scoped to your dApp’s origin by the browser.
  • Call disconnect to clear it. There is no server-side session to revoke from the dApp side; the user manages wallet-side access from within Walley.
  • With the remote gateway, Walley stores the session and it lasts one hour. See Sessions.