Skip to content
Documentation/canton-network-docs/SDKsdApp SDKAPI ReferenceView on canton-network-docs
canton-network-docs/SDKsdApp SDKAPI Reference

SDK Methods

Lifecycle

init(options?)

Registers wallet adapters and silently restores a previous session without opening the wallet picker. Call once, early in the app lifecycle.
ParameterTypeDescription
options.additionalAdaptersAdapter[]Extra adapters to register alongside the defaults.
options.defaultAdaptersAdapter[]Replaces the default list of remote wallets. Pass [] to register none.

connect()

Opens the wallet picker and establishes a connection, running the authentication flow if needed. Returns a result indicating whether the connection succeeded.

disconnect()

Ends the session between the dApp and the wallet.

Status

status()

Returns network- and session-related information for the current connection.

isConnected()

Returns whether the user is connected without triggering the login flow. Safe to call on page load.

getActiveNetwork()

Returns details about the network the wallet is connected to.

Accounts

listAccounts()

Returns all parties the user has access to.

getPrimaryAccount()

Returns the account the user marked as primary.

Signing & transactions

signMessage(message)

Signs an arbitrary string with the primary account.
ParameterTypeDescription
messagestringThe message to sign.

prepareExecute(commands)

Prepares, requests signature for, and executes a Daml transaction.
ParameterTypeDescription
commands{ commands: Command[] }The Daml commands to execute.

ledgerApi(request)

Proxies an authenticated request to the Canton JSON Ledger API.
ParameterTypeDescription
request.requestMethodstringHTTP method, e.g. 'GET'.
request.resourcestringLedger API path, e.g. '/v2/version'.

Provider access

getConnectedProvider()

Returns the raw CIP-0103 provider for the active discovery session, or null if not connected. Use it for direct provider.request(...) calls or provider-level events.