Skip to content

CantonClient

Defined in: packages/dapp/src/rpc/client.ts:20

Canton dApp client interface.

All methods return promises that resolve with validated responses or reject with RPC errors.

connect(): Promise<{ isConnected: boolean; isNetworkConnected: boolean; kernel: { clientType: "browser" | "desktop" | "mobile" | "remote"; id: string; url?: string; userUrl?: string; }; network?: { ledgerApi?: { baseUrl: string; }; networkId: string; }; networkReason?: string; session?: { accessToken: string; userId: string; }; }>

Defined in: packages/dapp/src/rpc/client.ts:25

Connect to wallet and get session token

Promise<{ isConnected: boolean; isNetworkConnected: boolean; kernel: { clientType: "browser" | "desktop" | "mobile" | "remote"; id: string; url?: string; userUrl?: string; }; network?: { ledgerApi?: { baseUrl: string; }; networkId: string; }; networkReason?: string; session?: { accessToken: string; userId: string; }; }>


disconnect(): Promise<null>

Defined in: packages/dapp/src/rpc/client.ts:28

Disconnect wallet session

Promise<null>


getActiveNetwork(): Promise<{ ledgerApi?: { baseUrl: string; }; networkId: string; }>

Defined in: packages/dapp/src/rpc/client.ts:31

Get the active network

Promise<{ ledgerApi?: { baseUrl: string; }; networkId: string; }>


getPrimaryAccount(): Promise<{ disabled?: boolean; externalTxId?: string; hint: string; namespace: string; networkId: string; partyId: string; primary: boolean; publicKey: string; reason?: string; signingProviderId: string; status: "initialized" | "allocated"; topologyTransactions?: string; }>

Defined in: packages/dapp/src/rpc/client.ts:37

Get the primary account

Promise<{ disabled?: boolean; externalTxId?: string; hint: string; namespace: string; networkId: string; partyId: string; primary: boolean; publicKey: string; reason?: string; signingProviderId: string; status: "initialized" | "allocated"; topologyTransactions?: string; }>


ledgerApi(params): Promise<{ response: string; }>

Defined in: packages/dapp/src/rpc/client.ts:55

Proxy call to Ledger API

string = ...

"GET" | "POST" | "PUT" | "DELETE" = ...

string = ...

Promise<{ response: string; }>


listAccounts(): Promise<object[]>

Defined in: packages/dapp/src/rpc/client.ts:34

List accounts authorized for the dApp

Promise<object[]>


prepareExecute(params): Promise<null>

Defined in: packages/dapp/src/rpc/client.ts:40

Prepare, sign, and execute a transaction

string[] = ...

string = ...

Record<string, any> = ...

object[] = ...

string[] = ...

string[] = ...

string = ...

Promise<null>


prepareExecuteAndWait(params): Promise<{ tx: { commandId: string; payload: { completionOffset: number; updateId: string; }; status: "executed"; }; }>

Defined in: packages/dapp/src/rpc/client.ts:45

Prepare, sign, execute, and wait for transaction completion

string[] = ...

string = ...

Record<string, any> = ...

object[] = ...

string[] = ...

string[] = ...

string = ...

Promise<{ tx: { commandId: string; payload: { completionOffset: number; updateId: string; }; status: "executed"; }; }>


signMessage(params): Promise<{ signature: string; }>

Defined in: packages/dapp/src/rpc/client.ts:50

Sign an arbitrary message

string = ...

Promise<{ signature: string; }>


status(): Promise<{ isConnected: boolean; isNetworkConnected: boolean; kernel: { clientType: "browser" | "desktop" | "mobile" | "remote"; id: string; url?: string; userUrl?: string; }; network?: { ledgerApi?: { baseUrl: string; }; networkId: string; }; networkReason?: string; session?: { accessToken: string; userId: string; }; }>

Defined in: packages/dapp/src/rpc/client.ts:22

Get current wallet status

Promise<{ isConnected: boolean; isNetworkConnected: boolean; kernel: { clientType: "browser" | "desktop" | "mobile" | "remote"; id: string; url?: string; userUrl?: string; }; network?: { ledgerApi?: { baseUrl: string; }; networkId: string; }; networkReason?: string; session?: { accessToken: string; userId: string; }; }>