Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions docs-main/reference/typescript.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ Interface for objects representing Daml choices.
| Member | Type | Description |
| --- | --- | --- |
| `choiceName` | `string` | The choice name. |
| `template` | `() => TemplateOrInterface` | Returns the template to which this choice belongs. |
| `template` | `() => TemplateOrInterface` | Returns the template to which this choice belongs. |

<span id="interface-choicefrom"></span>

Expand Down Expand Up @@ -121,7 +121,7 @@ The origin companion that contained a [[Choice]].

| Member | Type | Description |
| --- | --- | --- |
| `template` | `() =&gt; O` | Returns the template to which this choice belongs. |
| `template` | `() => O` | Returns the template to which this choice belongs. |

<span id="interface-contracttypecompanion"></span>

Expand Down Expand Up @@ -226,15 +226,15 @@ iteration is unspecified; the only guarantee is that the order in ``keys`` and

| Member | Type | Description |
| --- | --- | --- |
| `delete` | `(k: K) =&gt; Map&lt;K, V&gt;` | - |
| `entries` | `() =&gt; Iterator&lt;[K, V], undefined, undefined&gt;` | - |
| `entriesArray` | `() =&gt; [K, V][]` | - |
| `forEach` | `(f: (value: V, key: K, map: Map&lt;K, V&gt;) =&gt; T, u?: U) =&gt; void` | - |
| `get` | `(k: K) =&gt; undefined \| V` | - |
| `has` | `(k: K) =&gt; boolean` | - |
| `keys` | `() =&gt; Iterator&lt;K, undefined, undefined&gt;` | - |
| `set` | `(k: K, v: V) =&gt; Map&lt;K, V&gt;` | - |
| `values` | `() =&gt; Iterator&lt;V, undefined, undefined&gt;` | - |
| `delete` | `(k: K) => Map<K, V>` | - |
| `entries` | `() => Iterator<[K, V], undefined, undefined>` | - |
| `entriesArray` | `() => [K, V][]` | - |
| `forEach` | `(f: (value: V, key: K, map: Map<K, V>) => T, u?: U) => void` | - |
| `get` | `(k: K) => undefined \| V` | - |
| `has` | `(k: K) => boolean` | - |
| `keys` | `() => Iterator<K, undefined, undefined>` | - |
| `set` | `(k: K, v: V) => Map<K, V>` | - |
| `values` | `() => Iterator<V, undefined, undefined>` | - |

<span id="interface-serializable"></span>

Expand Down Expand Up @@ -295,7 +295,7 @@ Interface for objects representing Daml templates. It is similar to the

| Member | Type | Description |
| --- | --- | --- |
| `Archive` | `Choice&lt;T, {}, {}, K&gt; &amp; ChoiceFrom&lt;Template&lt;T, K, I&gt;&gt;` | - |
| `Archive` | `Choice<T, {}, {}, K> & ChoiceFrom<Template<T, K, I>>` | - |
| `templateId` | `I` | - |
| `templateIdWithPackageId` | `string` | - |

Expand Down Expand Up @@ -844,7 +844,7 @@ ContractId<T extends void = void>(_t: Serializable<T> | TemplateOrInterface<T &

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `_t` | `Serializable&lt;T&gt; \| TemplateOrInterface&lt;T &amp; object, unknown, string&gt;` | yes | - |
| `_t` | `Serializable<T> \| TemplateOrInterface<T & object, unknown, string>` | yes | - |

Returns: `Serializable<ContractId<T>>`

Expand Down Expand Up @@ -903,7 +903,7 @@ List<T extends void = void>(t: Serializable<T>): Serializable<T[]>

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `t` | `Serializable&lt;T&gt;` | yes | - |
| `t` | `Serializable<T>` | yes | - |

Returns: `Serializable<T[]>`

Expand Down Expand Up @@ -936,8 +936,8 @@ Map<K extends void = void, V extends void = void>(kd: Serializable<K>, vd: Seria

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `kd` | `Serializable&lt;K&gt;` | yes | - |
| `vd` | `Serializable&lt;V&gt;` | yes | - |
| `kd` | `Serializable<K>` | yes | - |
| `vd` | `Serializable<V>` | yes | - |

Returns: `Serializable<Map<K, V>>`

Expand Down Expand Up @@ -997,7 +997,7 @@ Optional<T extends void = void>(t: Serializable<T>): Serializable<Optional<T>>

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `t` | `Serializable&lt;T&gt;` | yes | - |
| `t` | `Serializable<T>` | yes | - |

Returns: `Serializable<Optional<T>>`

Expand Down Expand Up @@ -1029,6 +1029,6 @@ TextMap<T extends void = void>(t: Serializable<T>): Serializable<TextMap<T>>

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `t` | `Serializable&lt;T&gt;` | yes | - |
| `t` | `Serializable<T>` | yes | - |

Returns: `Serializable<TextMap<T>>`
52 changes: 26 additions & 26 deletions docs-main/reference/typescript/dapp-sdk.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: "@canton-network/dapp-sdk"
title: "dApp SDK"
description: "TypeScript client library reference for dApp integrations."
---

Expand Down Expand Up @@ -134,31 +134,31 @@ Generated from published `@canton-network/dapp-sdk` TypeDoc snapshots.
| `TxChangedSignedPayload` | `void` | Payload for the TxChangedSignedEvent. |
| `Wallet` | `void` | Structure representing a wallet |
| `AccessToken` | `string` | JWT authentication token. |
| `AccountsChanged` | `() =&gt; Promise&lt;AccountsChangedEvent&gt;` | - |
| `AccountsChanged` | `() => Promise<AccountsChangedEvent>` | - |
| `AccountsChangedEvent` | `Wallet[]` | Event emitted when the user's accounts change. |
| `ActAs` | `Party[]` | Set of parties on whose behalf the command should be executed, if submitted. If not set, the primary wallet's party is used. |
| `CommandId` | `string` | The unique identifier of the command associated with the transaction. |
| `CompletionOffset` | `number` | - |
| `Connect` | `() =&gt; Promise&lt;ConnectResult&gt;` | - |
| `Connect` | `() => Promise<ConnectResult>` | - |
| `ContractId` | `string` | The unique identifier of the disclosed contract. |
| `CreatedEventBlob` | `string` | The blob data of the created event for the disclosed contract. |
| `Disabled` | `boolean` | Whether the wallet is disabled. Wallets are disabled when no signing provider matches the party's namespace during sync. Disabled wallets use participant as the default signing provider. |
| `DisclosedContracts` | `DisclosedContract[]` | List of contract IDs to be disclosed with the command. |
| `Disconnect` | `() =&gt; Promise&lt;Null&gt;` | - |
| `Disconnect` | `() => Promise<Null>` | - |
| `ExternalTxId` | `string` | Unique identifier of the signed transaction given by the Signing Provider. This may not be the same as the internal txId given by the Wallet Gateway. |
| `GetActiveNetwork` | `() =&gt; Promise&lt;Network&gt;` | - |
| `GetPrimaryAccount` | `() =&gt; Promise&lt;Wallet&gt;` | - |
| `GetActiveNetwork` | `() => Promise<Network>` | - |
| `GetPrimaryAccount` | `() => Promise<Wallet>` | - |
| `Hint` | `string` | The party hint and name of the wallet. |
| `IsConnected` | `() =&gt; Promise&lt;ConnectResult&gt;` | - |
| `IsConnected` | `() => Promise<ConnectResult>` | - |
| `IsConnectedValue` | `boolean` | Whether or not the user is authenticated with the Wallet. |
| `IsNetworkConnected` | `boolean` | Whether or not a connection to a network is established. |
| `LedgerApi` | `(params: LedgerApiParams) =&gt; Promise&lt;LedgerApiResult&gt;` | - |
| `LedgerApi` | `(params: LedgerApiParams) => Promise<LedgerApiResult>` | - |
| `LedgerApiUrl` | `string` | The base URL of the ledger API. |
| `ListAccounts` | `() =&gt; Promise&lt;ListAccountsResult&gt;` | - |
| `ListAccounts` | `() => Promise<ListAccountsResult>` | - |
| `ListAccountsResult` | `Wallet[]` | An array of accounts that the user has authorized the dapp to access.. |
| `Message` | `string` | The message to sign. |
| `MessageId` | `string` | The unique identifier of the message associated with the message to be signed. |
| `MessageSignature` | `() =&gt; Promise&lt;MessageSignatureEvent&gt;` | - |
| `MessageSignature` | `() => Promise<MessageSignatureEvent>` | - |
| `MessageSignatureEvent` | `MessageSignaturePendingEvent \| MessageSignatureSignedEvent \| MessageSignatureFailedEvent` | Event emitted when a message signature is requested or completed. |
| `Namespace` | `string` | The namespace of the party. |
| `NetworkId` | `string` | The network ID the wallet corresponds to. |
Expand All @@ -168,8 +168,8 @@ Generated from published `@canton-network/dapp-sdk` TypeDoc snapshots.
| `PackageIdSelectionPreference` | `PackageId[]` | The package-id selection preference of the client for resolving package names and interface instances in command submission and interpretation |
| `Party` | `string` | The party that signed the transaction. |
| `PartyId` | `string` | The party ID corresponding to the wallet. |
| `PrepareExecute` | `(params: PrepareExecuteParams) =&gt; Promise&lt;Null&gt;` | - |
| `PrepareExecuteAndWait` | `(params: PrepareExecuteParams) =&gt; Promise&lt;PrepareExecuteAndWaitResult&gt;` | - |
| `PrepareExecute` | `(params: PrepareExecuteParams) => Promise<Null>` | - |
| `PrepareExecuteAndWait` | `(params: PrepareExecuteParams) => Promise<PrepareExecuteAndWaitResult>` | - |
| `Primary` | `boolean` | Set as primary wallet for dApp usage. |
| `ProviderId` | `string` | The unique identifier of the Provider. |
| `ProviderType` | `"browser" \| "desktop" \| "mobile" \| "remote"` | The type of client that implements the Provider. |
Expand All @@ -178,20 +178,20 @@ Generated from published `@canton-network/dapp-sdk` TypeDoc snapshots.
| `Reason` | `string` | Reason for the wallet state, e.g., 'no signing provider matched'. |
| `RequestMethod` | `"get" \| "post" \| "patch" \| "put" \| "delete"` | - |
| `Resource` | `string` | - |
| `RpcTypes` | `{ accountsChanged: { params: Params&lt;AccountsChanged&gt;; result: Result&lt;AccountsChanged&gt; }; connect: { params: Params&lt;Connect&gt;; result: Result&lt;Connect&gt; }; disconnect: { params: Params&lt;Disconnect&gt;; result: Result&lt;Disconnect&gt; }; getActiveNetwork: { params: Params&lt;GetActiveNetwork&gt;; result: Result&lt;GetActiveNetwork&gt; }; getPrimaryAccount: { params: Params&lt;GetPrimaryAccount&gt;; result: Result&lt;GetPrimaryAccount&gt; }; isConnected: { params: Params&lt;IsConnected&gt;; result: Result&lt;IsConnected&gt; }; ledgerApi: { params: Params&lt;LedgerApi&gt;; result: Result&lt;LedgerApi&gt; }; listAccounts: { params: Params&lt;ListAccounts&gt;; result: Result&lt;ListAccounts&gt; }; messageSignature: { params: Params&lt;MessageSignature&gt;; result: Result&lt;MessageSignature&gt; }; prepareExecute: { params: Params&lt;PrepareExecute&gt;; result: Result&lt;PrepareExecute&gt; }; prepareExecuteAndWait: { params: Params&lt;PrepareExecuteAndWait&gt;; result: Result&lt;PrepareExecuteAndWait&gt; }; signMessage: { params: Params&lt;SignMessage&gt;; result: Result&lt;SignMessage&gt; }; status: { params: Params&lt;Status&gt;; result: Result&lt;Status&gt; }; txChanged: { params: Params&lt;TxChanged&gt;; result: Result&lt;TxChanged&gt; } }` | - |
| `RpcTypes` | `{ accountsChanged: { params: Params<AccountsChanged>; result: Result<AccountsChanged> }; connect: { params: Params<Connect>; result: Result<Connect> }; disconnect: { params: Params<Disconnect>; result: Result<Disconnect> }; getActiveNetwork: { params: Params<GetActiveNetwork>; result: Result<GetActiveNetwork> }; getPrimaryAccount: { params: Params<GetPrimaryAccount>; result: Result<GetPrimaryAccount> }; isConnected: { params: Params<IsConnected>; result: Result<IsConnected> }; ledgerApi: { params: Params<LedgerApi>; result: Result<LedgerApi> }; listAccounts: { params: Params<ListAccounts>; result: Result<ListAccounts> }; messageSignature: { params: Params<MessageSignature>; result: Result<MessageSignature> }; prepareExecute: { params: Params<PrepareExecute>; result: Result<PrepareExecute> }; prepareExecuteAndWait: { params: Params<PrepareExecuteAndWait>; result: Result<PrepareExecuteAndWait> }; signMessage: { params: Params<SignMessage>; result: Result<SignMessage> }; status: { params: Params<Status>; result: Result<Status> }; txChanged: { params: Params<TxChanged>; result: Result<TxChanged> } }` | - |
| `Signature` | `string` | The signature of the message. |
| `SignedBy` | `string` | The identifier of the provider that signed the transaction. |
| `SigningProviderId` | `string` | The signing provider ID the wallet corresponds to. |
| `SignMessage` | `(params: SignMessageParams) =&gt; Promise&lt;SignMessageResult&gt;` | - |
| `Status` | `() =&gt; Promise&lt;StatusEvent&gt;` | Generated! Represents an alias to any of the provided schemas |
| `SignMessage` | `(params: SignMessageParams) => Promise<SignMessageResult>` | - |
| `Status` | `() => Promise<StatusEvent>` | Generated! Represents an alias to any of the provided schemas |
| `StatusExecuted` | `"executed"` | The status of the transaction. |
| `StatusFailed` | `"failed"` | The status of the message signature. |
| `StatusPending` | `"pending"` | The status of the message signature. |
| `StatusSigned` | `"signed"` | The status of the message signature. |
| `SynchronizerId` | `string` | If not set, a suitable synchronizer that this node is connected to will be chosen. |
| `TemplateId` | `string` | The template identifier of the disclosed contract. |
| `TopologyTransactions` | `string` | The topology transactions |
| `TxChanged` | `() =&gt; Promise&lt;TxChangedEvent&gt;` | - |
| `TxChanged` | `() => Promise<TxChangedEvent>` | - |
| `TxChangedEvent` | `TxChangedPendingEvent \| TxChangedSignedEvent \| TxChangedExecutedEvent \| TxChangedFailedEvent` | Event emitted when a transaction changes. |
| `UpdateId` | `string` | The update ID corresponding to the transaction. |
| `Url` | `string` | The URL of the Wallet Provider. |
Expand Down Expand Up @@ -650,7 +650,7 @@ interface ActiveSession
| Member | Type | Description |
| --- | --- | --- |
| `adapter` | `ProviderAdapter` | - |
| `provider` | `Provider&lt;RpcTypes&gt;` | - |
| `provider` | `Provider<RpcTypes>` | - |
| `providerId` | `string` | - |

<span id="interface-dappclientoptions"></span>
Expand Down Expand Up @@ -837,7 +837,7 @@ interface WalletConnectAdapterConfig
| --- | --- | --- |
| `chainId` | `string` | - |
| `metadata` | `{ description: string; icons: string[]; name: string; url: string }` | - |
| `onUri` | `(uri: string) =&gt; void` | Called with the pairing URI so the dApp can display or forward it. |
| `onUri` | `(uri: string) => void` | Called with the pairing URI so the dApp can display or forward it. |
| `projectId` | `string` | - |

<span id="interface-walletinfo"></span>
Expand Down Expand Up @@ -1283,7 +1283,7 @@ onAccountsChanged(listener: EventListener<AccountsChangedEvent>): Promise<void>

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `listener` | `EventListener&lt;AccountsChangedEvent&gt;` | yes | - |
| `listener` | `EventListener<AccountsChangedEvent>` | yes | - |

Returns: `Promise<void>`

Expand All @@ -1309,7 +1309,7 @@ onConnected(listener: EventListener<StatusEvent>): Promise<void>

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `listener` | `EventListener&lt;StatusEvent&gt;` | yes | - |
| `listener` | `EventListener<StatusEvent>` | yes | - |

Returns: `Promise<void>`

Expand All @@ -1335,7 +1335,7 @@ onStatusChanged(listener: EventListener<StatusEvent>): Promise<void>

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `listener` | `EventListener&lt;StatusEvent&gt;` | yes | - |
| `listener` | `EventListener<StatusEvent>` | yes | - |

Returns: `Promise<void>`

Expand All @@ -1361,7 +1361,7 @@ onTxChanged(listener: EventListener<TxChangedEvent>): Promise<void>

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `listener` | `EventListener&lt;TxChangedEvent&gt;` | yes | - |
| `listener` | `EventListener<TxChangedEvent>` | yes | - |

Returns: `Promise<void>`

Expand Down Expand Up @@ -1461,7 +1461,7 @@ removeOnAccountsChanged(listener: EventListener<AccountsChangedEvent>): Promise<

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `listener` | `EventListener&lt;AccountsChangedEvent&gt;` | yes | - |
| `listener` | `EventListener<AccountsChangedEvent>` | yes | - |

Returns: `Promise<void>`

Expand All @@ -1487,7 +1487,7 @@ removeOnConnected(listener: EventListener<StatusEvent>): Promise<void>

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `listener` | `EventListener&lt;StatusEvent&gt;` | yes | - |
| `listener` | `EventListener<StatusEvent>` | yes | - |

Returns: `Promise<void>`

Expand All @@ -1513,7 +1513,7 @@ removeOnStatusChanged(listener: EventListener<StatusEvent>): Promise<void>

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `listener` | `EventListener&lt;StatusEvent&gt;` | yes | - |
| `listener` | `EventListener<StatusEvent>` | yes | - |

Returns: `Promise<void>`

Expand All @@ -1539,7 +1539,7 @@ removeOnTxChanged(listener: EventListener<TxChangedEvent>): Promise<void>

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `listener` | `EventListener&lt;TxChangedEvent&gt;` | yes | - |
| `listener` | `EventListener<TxChangedEvent>` | yes | - |

Returns: `Promise<void>`

Expand Down
Loading