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.
Methods
Section titled “Methods”connect()
Section titled “connect()”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
Returns
Section titled “Returns”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()
Section titled “disconnect()”disconnect():
Promise<null>
Defined in: packages/dapp/src/rpc/client.ts:28
Disconnect wallet session
Returns
Section titled “Returns”Promise<null>
getActiveNetwork()
Section titled “getActiveNetwork()”getActiveNetwork():
Promise<{ledgerApi?: {baseUrl:string; };networkId:string; }>
Defined in: packages/dapp/src/rpc/client.ts:31
Get the active network
Returns
Section titled “Returns”Promise<{ ledgerApi?: { baseUrl: string; }; networkId: string; }>
getPrimaryAccount()
Section titled “getPrimaryAccount()”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
Returns
Section titled “Returns”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()
Section titled “ledgerApi()”ledgerApi(
params):Promise<{response:string; }>
Defined in: packages/dapp/src/rpc/client.ts:55
Proxy call to Ledger API
Parameters
Section titled “Parameters”params
Section titled “params”string = ...
requestMethod
Section titled “requestMethod”"GET" | "POST" | "PUT" | "DELETE" = ...
resource
Section titled “resource”string = ...
Returns
Section titled “Returns”Promise<{ response: string; }>
listAccounts()
Section titled “listAccounts()”listAccounts():
Promise<object[]>
Defined in: packages/dapp/src/rpc/client.ts:34
List accounts authorized for the dApp
Returns
Section titled “Returns”Promise<object[]>
prepareExecute()
Section titled “prepareExecute()”prepareExecute(
params):Promise<null>
Defined in: packages/dapp/src/rpc/client.ts:40
Prepare, sign, and execute a transaction
Parameters
Section titled “Parameters”params
Section titled “params”actAs?
Section titled “actAs?”string[] = ...
commandId?
Section titled “commandId?”string = ...
commands
Section titled “commands”Record<string, any> = ...
disclosedContracts?
Section titled “disclosedContracts?”object[] = ...
packageIdSelectionPreference?
Section titled “packageIdSelectionPreference?”string[] = ...
readAs?
Section titled “readAs?”string[] = ...
synchronizerId?
Section titled “synchronizerId?”string = ...
Returns
Section titled “Returns”Promise<null>
prepareExecuteAndWait()
Section titled “prepareExecuteAndWait()”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
Parameters
Section titled “Parameters”params
Section titled “params”actAs?
Section titled “actAs?”string[] = ...
commandId?
Section titled “commandId?”string = ...
commands
Section titled “commands”Record<string, any> = ...
disclosedContracts?
Section titled “disclosedContracts?”object[] = ...
packageIdSelectionPreference?
Section titled “packageIdSelectionPreference?”string[] = ...
readAs?
Section titled “readAs?”string[] = ...
synchronizerId?
Section titled “synchronizerId?”string = ...
Returns
Section titled “Returns”Promise<{ tx: { commandId: string; payload: { completionOffset: number; updateId: string; }; status: "executed"; }; }>
signMessage()
Section titled “signMessage()”signMessage(
params):Promise<{signature:string; }>
Defined in: packages/dapp/src/rpc/client.ts:50
Sign an arbitrary message
Parameters
Section titled “Parameters”params
Section titled “params”message
Section titled “message”string = ...
Returns
Section titled “Returns”Promise<{ signature: string; }>
status()
Section titled “status()”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
Returns
Section titled “Returns”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; }; }>