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; networkReason?: string; reason?: string; userUrl?: string; }>

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

Connect to wallet and get session token

Promise<{ isConnected: boolean; isNetworkConnected: boolean; networkReason?: string; reason?: string; userUrl?: string; }>


disconnect(): Promise<null>

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

Disconnect wallet session

Promise<null>


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

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

Get the active network

Promise<{ accessToken?: string; ledgerApi?: 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" | "removed"; topologyTransactions?: string; }>

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

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" | "removed"; topologyTransactions?: string; }>


isConnected(): Promise<{ isConnected: boolean; isNetworkConnected: boolean; networkReason?: string; reason?: string; userUrl?: string; }>

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

Check whether the wallet session is connected

Promise<{ isConnected: boolean; isNetworkConnected: boolean; networkReason?: string; reason?: string; userUrl?: string; }>


ledgerApi(params): Promise<Record<string, unknown> | unknown[]>

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

Proxy call to Ledger API

Record<string, any> = ...

Record<string, any> = ...

Record<string, any> = ...

Record<string, any> = ...

"get" | "post" | "patch" | "put" | "delete" = ...

string = ...

Promise<Record<string, unknown> | unknown[]>


listAccounts(): Promise<object[]>

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

List accounts authorized for the dApp

Promise<object[]>


prepareExecute(params): Promise<null>

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

Prepare, sign, and execute a transaction

string[] = ...

string = ...

({ CreateAndExerciseCommand: Record<string, any>; } | { CreateCommand: { createArguments: Record<string, any>; templateId: string; }; } | { ExerciseByKeyCommand: Record<string, any>; } | { ExerciseCommand: { choice: string; choiceArgument: Record<string, any>; contractId: string; templateId: string; }; })[] = JsCommandsSchema

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:48

Prepare, sign, execute, and wait for transaction completion

string[] = ...

string = ...

({ CreateAndExerciseCommand: Record<string, any>; } | { CreateCommand: { createArguments: Record<string, any>; templateId: string; }; } | { ExerciseByKeyCommand: Record<string, any>; } | { ExerciseCommand: { choice: string; choiceArgument: Record<string, any>; contractId: string; templateId: string; }; })[] = JsCommandsSchema

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:53

Sign an arbitrary message

string = ...

Promise<{ signature: string; }>


status(): Promise<{ connection: { isConnected: boolean; isNetworkConnected: boolean; networkReason?: string; reason?: string; userUrl?: string; }; network?: { accessToken?: string; ledgerApi?: string; networkId: string; }; provider: { id: string; providerType: "browser" | "desktop" | "mobile" | "remote"; url?: string; userUrl?: string; version?: string; }; session?: { accessToken: string; userId: string; }; }>

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

Get current wallet status

Promise<{ connection: { isConnected: boolean; isNetworkConnected: boolean; networkReason?: string; reason?: string; userUrl?: string; }; network?: { accessToken?: string; ledgerApi?: string; networkId: string; }; provider: { id: string; providerType: "browser" | "desktop" | "mobile" | "remote"; url?: string; userUrl?: string; version?: string; }; session?: { accessToken: string; userId: string; }; }>