@canton-network/core-wallet-dapp-rpc-client 0.27.1 → 0.29.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;AA2jBO,IAAM,6BAAN,MAAiC;AAAA,EAGpC,YAAY,SAAA,EAAyB;AAFrC,IAAA,aAAA,CAAA,IAAA,EAAO,WAAA,CAAA;AAGH,IAAA,IAAA,CAAK,SAAA,GAAY,SAAA;AAAA,EACrB;AAAA,EAEA,MAAa,QACT,IAAA,EAC8B;AAC9B,IAAA,MAAM,QAAA,GAAW,MAAM,IAAA,CAAK,SAAA,CAAU,OAAO,IAAsB,CAAA;AAEnE,IAAA,IAAI,WAAW,QAAA,EAAU;AACrB,MAAA,MAAM,IAAI,KAAA;AAAA,QACN,gBACI,QAAA,CAAS,KAAA,CAAM,IAAA,GACf,KAAA,GACA,SAAS,KAAA,CAAM;AAAA,OACvB;AAAA,IACJ,CAAA,MAAO;AACH,MAAA,OAAO,QAAA,CAAS,MAAA;AAAA,IACpB;AAAA,EACJ;AACJ;AACA,IAAO,aAAA,GAAQ","file":"index.cjs","sourcesContent":["// Code generated by @open-rpc/generator DO NOT EDIT.\nimport _ from 'lodash'\n\nimport { RequestArgs, RequestPayload } from '@canton-network/core-types'\nimport { RpcTransport } from '@canton-network/core-rpc-transport'\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n/**\n *\n * The unique identifier of the command associated with the transaction.\n *\n */\nexport type CommandId = string\ntype AlwaysTrue = any\n/**\n *\n * Structure representing JS commands for transaction execution\n *\n */\nexport interface JsCommands {\n [key: string]: any\n}\n/**\n *\n * The party that signed the transaction.\n *\n */\nexport type Party = string\n/**\n *\n * Set of parties on whose behalf the command should be executed, if submitted. If not set, the primary wallet's party is used.\n *\n */\nexport type ActAs = Party[]\n/**\n *\n * Set of parties that should be granted read access to the command, if submitted. If not set, no additional read parties are granted.\n *\n */\nexport type ReadAs = Party[]\n/**\n *\n * The template identifier of the disclosed contract.\n *\n */\nexport type TemplateId = string\n/**\n *\n * The unique identifier of the disclosed contract.\n *\n */\nexport type ContractId = string\n/**\n *\n * The blob data of the created event for the disclosed contract.\n *\n */\nexport type CreatedEventBlob = string\n/**\n *\n * If not set, a suitable synchronizer that this node is connected to will be chosen.\n *\n */\nexport type SynchronizerId = string\n/**\n *\n * Structure representing a disclosed contract for transaction execution\n *\n */\nexport interface DisclosedContract {\n templateId?: TemplateId\n contractId?: ContractId\n createdEventBlob: CreatedEventBlob\n synchronizerId?: SynchronizerId\n}\n/**\n *\n * List of contract IDs to be disclosed with the command.\n *\n */\nexport type DisclosedContracts = DisclosedContract[]\nexport type PackageId = string\n/**\n *\n * The package-id selection preference of the client for resolving package names and interface instances in command submission and interpretation\n *\n */\nexport type PackageIdSelectionPreference = PackageId[]\n/**\n *\n * The message to sign.\n *\n */\nexport type Message = string\nexport type RequestMethod = 'GET' | 'POST' | 'PUT' | 'DELETE'\nexport type Resource = string\nexport type Body = string\n/**\n *\n * The unique identifier of the Provider.\n *\n */\nexport type ProviderId = string\n/**\n *\n * The version of the Provider.\n *\n */\nexport type Version = string\n/**\n *\n * The type of client that implements the Provider.\n *\n */\nexport type ProviderType = 'browser' | 'desktop' | 'mobile' | 'remote'\n/**\n *\n * The URL of the Wallet Provider.\n *\n */\nexport type Url = string\n/**\n *\n * A URL that points to a user interface.\n *\n */\nexport type UserUrl = string\n/**\n *\n * Represents a Provider.\n *\n */\nexport interface Provider {\n id: ProviderId\n version?: Version\n providerType?: ProviderType\n url?: Url\n userUrl?: UserUrl\n}\n/**\n *\n * Whether or not the user is authenticated with the Wallet.\n *\n */\nexport type IsConnected = boolean\n/**\n *\n * Reason for the wallet state, e.g., 'no signing provider matched'.\n *\n */\nexport type Reason = string\n/**\n *\n * Whether or not a connection to a network is established.\n *\n */\nexport type IsNetworkConnected = boolean\n/**\n *\n * If not connected to a network, the reason why.\n *\n */\nexport type NetworkReason = string\nexport interface ConnectResult {\n isConnected: IsConnected\n reason?: Reason\n isNetworkConnected: IsNetworkConnected\n networkReason?: NetworkReason\n userUrl?: UserUrl\n}\n/**\n *\n * The network ID the wallet corresponds to.\n *\n */\nexport type NetworkId = string\n/**\n *\n * The base URL of the ledger API.\n *\n */\nexport type LedgerApiUrl = string\n/**\n *\n * JWT authentication token.\n *\n */\nexport type AccessToken = string\n/**\n *\n * Network information, if connected to a network.\n *\n */\nexport interface Network {\n networkId: NetworkId\n ledgerApi?: LedgerApiUrl\n accessToken?: AccessToken\n}\n/**\n *\n * The user identifier.\n *\n */\nexport type UserId = string\n/**\n *\n * Session information, if authenticated.\n *\n */\nexport interface Session {\n accessToken: AccessToken\n userId: UserId\n}\n/**\n *\n * The status of the transaction.\n *\n */\nexport type StatusExecuted = 'executed'\n/**\n *\n * The update ID corresponding to the transaction.\n *\n */\nexport type UpdateId = string\nexport type CompletionOffset = number\n/**\n *\n * Payload for the TxChangedExecutedEvent.\n *\n */\nexport interface TxChangedExecutedPayload {\n updateId: UpdateId\n completionOffset: CompletionOffset\n}\n/**\n *\n * Event emitted when a transaction is executed against the participant.\n *\n */\nexport interface TxChangedExecutedEvent {\n status: StatusExecuted\n commandId: CommandId\n payload: TxChangedExecutedPayload\n}\n/**\n *\n * The signature of the transaction.\n *\n */\nexport type Signature = string\nexport type Response = string\n/**\n *\n * Set as primary wallet for dApp usage.\n *\n */\nexport type Primary = boolean\n/**\n *\n * The party ID corresponding to the wallet.\n *\n */\nexport type PartyId = string\n/**\n *\n * The status of the wallet.\n *\n */\nexport type WalletStatus = 'initialized' | 'allocated' | 'removed'\n/**\n *\n * The party hint and name of the wallet.\n *\n */\nexport type Hint = string\n/**\n *\n * The public key of the party.\n *\n */\nexport type PublicKey = string\n/**\n *\n * The namespace of the party.\n *\n */\nexport type Namespace = string\n/**\n *\n * The signing provider ID the wallet corresponds to.\n *\n */\nexport type SigningProviderId = string\n/**\n *\n * 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.\n *\n */\nexport type ExternalTxId = string\n/**\n *\n * The topology transactions\n *\n */\nexport type TopologyTransactions = string\n/**\n *\n * 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.\n *\n */\nexport type Disabled = boolean\n/**\n *\n * Structure representing a wallet\n *\n */\nexport interface Wallet {\n primary: Primary\n partyId: PartyId\n status: WalletStatus\n hint: Hint\n publicKey: PublicKey\n namespace: Namespace\n networkId: NetworkId\n signingProviderId: SigningProviderId\n externalTxId?: ExternalTxId\n topologyTransactions?: TopologyTransactions\n disabled?: Disabled\n reason?: Reason\n}\n/**\n *\n * The status of the transaction.\n *\n */\nexport type StatusPending = 'pending'\n/**\n *\n * Event emitted when a transaction is pending.\n *\n */\nexport interface TxChangedPendingEvent {\n status: StatusPending\n commandId: CommandId\n}\n/**\n *\n * The status of the transaction.\n *\n */\nexport type StatusSigned = 'signed'\n/**\n *\n * The identifier of the provider that signed the transaction.\n *\n */\nexport type SignedBy = string\n/**\n *\n * Payload for the TxChangedSignedEvent.\n *\n */\nexport interface TxChangedSignedPayload {\n signature: Signature\n signedBy: SignedBy\n party: Party\n}\n/**\n *\n * Event emitted when a transaction has been signed.\n *\n */\nexport interface TxChangedSignedEvent {\n status: StatusSigned\n commandId: CommandId\n payload: TxChangedSignedPayload\n}\n/**\n *\n * The status of the transaction.\n *\n */\nexport type StatusFailed = 'failed'\n/**\n *\n * Event emitted when a transaction has failed.\n *\n */\nexport interface TxChangedFailedEvent {\n status: StatusFailed\n commandId: CommandId\n}\n/**\n *\n * Structure representing the request for prepare and execute calls\n *\n */\nexport interface PrepareExecuteParams {\n commandId?: CommandId\n commands: JsCommands\n actAs?: ActAs\n readAs?: ReadAs\n disclosedContracts?: DisclosedContracts\n synchronizerId?: SynchronizerId\n packageIdSelectionPreference?: PackageIdSelectionPreference\n}\n/**\n *\n * Request to sign a message.\n *\n */\nexport interface SignMessageParams {\n message: Message\n}\n/**\n *\n * Ledger API request structure\n *\n */\nexport interface LedgerApiParams {\n requestMethod: RequestMethod\n resource: Resource\n body?: Body\n}\nexport interface StatusEvent {\n provider: Provider\n connection: ConnectResult\n network?: Network\n session?: Session\n}\n/**\n *\n * Represents a null value, used in responses where no data is returned.\n *\n */\nexport type Null = null\nexport interface PrepareExecuteAndWaitResult {\n tx: TxChangedExecutedEvent\n}\n/**\n *\n * Result of signing a message.\n *\n */\nexport interface SignMessageResult {\n signature: Signature\n}\n/**\n *\n * Ledger Api configuration options\n *\n */\nexport interface LedgerApiResult {\n response: Response\n}\n/**\n *\n * Event emitted when the user's accounts change.\n *\n */\nexport type AccountsChangedEvent = Wallet[]\n/**\n *\n * An array of accounts that the user has authorized the dapp to access..\n *\n */\nexport type ListAccountsResult = Wallet[]\n/**\n *\n * Event emitted when a transaction changes.\n *\n */\nexport type TxChangedEvent =\n | TxChangedPendingEvent\n | TxChangedSignedEvent\n | TxChangedExecutedEvent\n | TxChangedFailedEvent\n/**\n *\n * Generated! Represents an alias to any of the provided schemas\n *\n */\n\nexport type Status = () => Promise<StatusEvent>\nexport type Connect = () => Promise<ConnectResult>\nexport type Disconnect = () => Promise<Null>\nexport type GetActiveNetwork = () => Promise<Network>\nexport type PrepareExecute = (params: PrepareExecuteParams) => Promise<Null>\nexport type PrepareExecuteAndWait = (\n params: PrepareExecuteParams\n) => Promise<PrepareExecuteAndWaitResult>\nexport type SignMessage = (\n params: SignMessageParams\n) => Promise<SignMessageResult>\nexport type LedgerApi = (params: LedgerApiParams) => Promise<LedgerApiResult>\nexport type AccountsChanged = () => Promise<AccountsChangedEvent>\nexport type GetPrimaryAccount = () => Promise<Wallet>\nexport type ListAccounts = () => Promise<ListAccountsResult>\nexport type TxChanged = () => Promise<TxChangedEvent>\n/* eslint-enable @typescript-eslint/no-unused-vars */\n\ntype Params<T> = T extends (...args: infer A) => any\n ? A extends []\n ? never\n : A[0]\n : never\ntype Result<T> = T extends (...args: any[]) => Promise<infer R> ? R : never\n\nexport type RpcTypes = {\n status: {\n params: Params<Status>\n result: Result<Status>\n }\n\n connect: {\n params: Params<Connect>\n result: Result<Connect>\n }\n\n disconnect: {\n params: Params<Disconnect>\n result: Result<Disconnect>\n }\n\n getActiveNetwork: {\n params: Params<GetActiveNetwork>\n result: Result<GetActiveNetwork>\n }\n\n prepareExecute: {\n params: Params<PrepareExecute>\n result: Result<PrepareExecute>\n }\n\n prepareExecuteAndWait: {\n params: Params<PrepareExecuteAndWait>\n result: Result<PrepareExecuteAndWait>\n }\n\n signMessage: {\n params: Params<SignMessage>\n result: Result<SignMessage>\n }\n\n ledgerApi: {\n params: Params<LedgerApi>\n result: Result<LedgerApi>\n }\n\n accountsChanged: {\n params: Params<AccountsChanged>\n result: Result<AccountsChanged>\n }\n\n getPrimaryAccount: {\n params: Params<GetPrimaryAccount>\n result: Result<GetPrimaryAccount>\n }\n\n listAccounts: {\n params: Params<ListAccounts>\n result: Result<ListAccounts>\n }\n\n txChanged: {\n params: Params<TxChanged>\n result: Result<TxChanged>\n }\n}\n\nexport class SpliceWalletJSONRPCDAppAPI {\n public transport: RpcTransport\n\n constructor(transport: RpcTransport) {\n this.transport = transport\n }\n\n public async request<M extends keyof RpcTypes>(\n args: RequestArgs<RpcTypes, M>\n ): Promise<RpcTypes[M]['result']> {\n const response = await this.transport.submit(args as RequestPayload)\n\n if ('error' in response) {\n throw new Error(\n 'RPC error: ' +\n response.error.code +\n ' - ' +\n response.error.message\n )\n } else {\n return response.result as RpcTypes[M]['result']\n }\n }\n}\nexport default SpliceWalletJSONRPCDAppAPI\n"]}
1
+ {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;AA8kBO,IAAM,6BAAN,MAAiC;AAAA,EAGpC,YAAY,SAAA,EAAyB;AAFrC,IAAA,aAAA,CAAA,IAAA,EAAO,WAAA,CAAA;AAGH,IAAA,IAAA,CAAK,SAAA,GAAY,SAAA;AAAA,EACrB;AAAA,EAEA,MAAa,QACT,IAAA,EAC8B;AAC9B,IAAA,MAAM,QAAA,GAAW,MAAM,IAAA,CAAK,SAAA,CAAU,OAAO,IAAsB,CAAA;AAEnE,IAAA,IAAI,WAAW,QAAA,EAAU;AACrB,MAAA,MAAM,IAAI,KAAA;AAAA,QACN,gBACI,QAAA,CAAS,KAAA,CAAM,IAAA,GACf,KAAA,GACA,SAAS,KAAA,CAAM;AAAA,OACvB;AAAA,IACJ,CAAA,MAAO;AACH,MAAA,OAAO,QAAA,CAAS,MAAA;AAAA,IACpB;AAAA,EACJ;AACJ;AACA,IAAO,aAAA,GAAQ","file":"index.cjs","sourcesContent":["// Code generated by @open-rpc/generator DO NOT EDIT.\nimport _ from 'lodash'\n\nimport { RequestArgs, RequestPayload } from '@canton-network/core-types'\nimport { RpcTransport } from '@canton-network/core-rpc-transport'\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n/**\n *\n * The unique identifier of the command associated with the transaction.\n *\n */\nexport type CommandId = string\ntype AlwaysTrue = any\n/**\n *\n * Structure representing JS commands for transaction execution\n *\n */\nexport interface JsCommands {\n [key: string]: any\n}\n/**\n *\n * The party that signed the transaction.\n *\n */\nexport type Party = string\n/**\n *\n * Set of parties on whose behalf the command should be executed, if submitted. If not set, the primary wallet's party is used.\n *\n */\nexport type ActAs = Party[]\n/**\n *\n * Set of parties that should be granted read access to the command, if submitted. If not set, no additional read parties are granted.\n *\n */\nexport type ReadAs = Party[]\n/**\n *\n * The template identifier of the disclosed contract.\n *\n */\nexport type TemplateId = string\n/**\n *\n * The unique identifier of the disclosed contract.\n *\n */\nexport type ContractId = string\n/**\n *\n * The blob data of the created event for the disclosed contract.\n *\n */\nexport type CreatedEventBlob = string\n/**\n *\n * If not set, a suitable synchronizer that this node is connected to will be chosen.\n *\n */\nexport type SynchronizerId = string\n/**\n *\n * Structure representing a disclosed contract for transaction execution\n *\n */\nexport interface DisclosedContract {\n templateId?: TemplateId\n contractId?: ContractId\n createdEventBlob: CreatedEventBlob\n synchronizerId?: SynchronizerId\n}\n/**\n *\n * List of contract IDs to be disclosed with the command.\n *\n */\nexport type DisclosedContracts = DisclosedContract[]\nexport type PackageId = string\n/**\n *\n * The package-id selection preference of the client for resolving package names and interface instances in command submission and interpretation\n *\n */\nexport type PackageIdSelectionPreference = PackageId[]\n/**\n *\n * The message to sign.\n *\n */\nexport type Message = string\nexport type RequestMethod = 'get' | 'post' | 'patch' | 'put' | 'delete'\nexport type Resource = string\nexport interface Body {\n [key: string]: any\n}\n/**\n *\n * Query parameters as key-value pairs.\n *\n */\nexport interface Query {\n [key: string]: any\n}\n/**\n *\n * Path parameters as key-value pairs.\n *\n */\nexport interface Path {\n [key: string]: any\n}\n/**\n *\n * The unique identifier of the Provider.\n *\n */\nexport type ProviderId = string\n/**\n *\n * The version of the Provider.\n *\n */\nexport type Version = string\n/**\n *\n * The type of client that implements the Provider.\n *\n */\nexport type ProviderType = 'browser' | 'desktop' | 'mobile' | 'remote'\n/**\n *\n * The URL of the Wallet Provider.\n *\n */\nexport type Url = string\n/**\n *\n * A URL that points to a user interface.\n *\n */\nexport type UserUrl = string\n/**\n *\n * Represents a Provider.\n *\n */\nexport interface Provider {\n id: ProviderId\n version?: Version\n providerType?: ProviderType\n url?: Url\n userUrl?: UserUrl\n}\n/**\n *\n * Whether or not the user is authenticated with the Wallet.\n *\n */\nexport type IsConnected = boolean\n/**\n *\n * Reason for the wallet state, e.g., 'no signing provider matched'.\n *\n */\nexport type Reason = string\n/**\n *\n * Whether or not a connection to a network is established.\n *\n */\nexport type IsNetworkConnected = boolean\n/**\n *\n * If not connected to a network, the reason why.\n *\n */\nexport type NetworkReason = string\nexport interface ConnectResult {\n isConnected: IsConnected\n reason?: Reason\n isNetworkConnected: IsNetworkConnected\n networkReason?: NetworkReason\n userUrl?: UserUrl\n}\n/**\n *\n * The network ID the wallet corresponds to.\n *\n */\nexport type NetworkId = string\n/**\n *\n * The base URL of the ledger API.\n *\n */\nexport type LedgerApiUrl = string\n/**\n *\n * JWT authentication token.\n *\n */\nexport type AccessToken = string\n/**\n *\n * Network information, if connected to a network.\n *\n */\nexport interface Network {\n networkId: NetworkId\n ledgerApi?: LedgerApiUrl\n accessToken?: AccessToken\n}\n/**\n *\n * The user identifier.\n *\n */\nexport type UserId = string\n/**\n *\n * Session information, if authenticated.\n *\n */\nexport interface Session {\n accessToken: AccessToken\n userId: UserId\n}\n/**\n *\n * The status of the transaction.\n *\n */\nexport type StatusExecuted = 'executed'\n/**\n *\n * The update ID corresponding to the transaction.\n *\n */\nexport type UpdateId = string\nexport type CompletionOffset = number\n/**\n *\n * Payload for the TxChangedExecutedEvent.\n *\n */\nexport interface TxChangedExecutedPayload {\n updateId: UpdateId\n completionOffset: CompletionOffset\n}\n/**\n *\n * Event emitted when a transaction is executed against the participant.\n *\n */\nexport interface TxChangedExecutedEvent {\n status: StatusExecuted\n commandId: CommandId\n payload: TxChangedExecutedPayload\n}\n/**\n *\n * The signature of the transaction.\n *\n */\nexport type Signature = string\n/**\n *\n * Set as primary wallet for dApp usage.\n *\n */\nexport type Primary = boolean\n/**\n *\n * The party ID corresponding to the wallet.\n *\n */\nexport type PartyId = string\n/**\n *\n * The status of the wallet.\n *\n */\nexport type WalletStatus = 'initialized' | 'allocated' | 'removed'\n/**\n *\n * The party hint and name of the wallet.\n *\n */\nexport type Hint = string\n/**\n *\n * The public key of the party.\n *\n */\nexport type PublicKey = string\n/**\n *\n * The namespace of the party.\n *\n */\nexport type Namespace = string\n/**\n *\n * The signing provider ID the wallet corresponds to.\n *\n */\nexport type SigningProviderId = string\n/**\n *\n * 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.\n *\n */\nexport type ExternalTxId = string\n/**\n *\n * The topology transactions\n *\n */\nexport type TopologyTransactions = string\n/**\n *\n * 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.\n *\n */\nexport type Disabled = boolean\n/**\n *\n * Structure representing a wallet\n *\n */\nexport interface Wallet {\n primary: Primary\n partyId: PartyId\n status: WalletStatus\n hint: Hint\n publicKey: PublicKey\n namespace: Namespace\n networkId: NetworkId\n signingProviderId: SigningProviderId\n externalTxId?: ExternalTxId\n topologyTransactions?: TopologyTransactions\n disabled?: Disabled\n reason?: Reason\n}\n/**\n *\n * The status of the transaction.\n *\n */\nexport type StatusPending = 'pending'\n/**\n *\n * Event emitted when a transaction is pending.\n *\n */\nexport interface TxChangedPendingEvent {\n status: StatusPending\n commandId: CommandId\n}\n/**\n *\n * The status of the transaction.\n *\n */\nexport type StatusSigned = 'signed'\n/**\n *\n * The identifier of the provider that signed the transaction.\n *\n */\nexport type SignedBy = string\n/**\n *\n * Payload for the TxChangedSignedEvent.\n *\n */\nexport interface TxChangedSignedPayload {\n signature: Signature\n signedBy: SignedBy\n party: Party\n}\n/**\n *\n * Event emitted when a transaction has been signed.\n *\n */\nexport interface TxChangedSignedEvent {\n status: StatusSigned\n commandId: CommandId\n payload: TxChangedSignedPayload\n}\n/**\n *\n * The status of the transaction.\n *\n */\nexport type StatusFailed = 'failed'\n/**\n *\n * Event emitted when a transaction has failed.\n *\n */\nexport interface TxChangedFailedEvent {\n status: StatusFailed\n commandId: CommandId\n}\n/**\n *\n * Structure representing the request for prepare and execute calls\n *\n */\nexport interface PrepareExecuteParams {\n commandId?: CommandId\n commands: JsCommands\n actAs?: ActAs\n readAs?: ReadAs\n disclosedContracts?: DisclosedContracts\n synchronizerId?: SynchronizerId\n packageIdSelectionPreference?: PackageIdSelectionPreference\n}\n/**\n *\n * Request to sign a message.\n *\n */\nexport interface SignMessageParams {\n message: Message\n}\n/**\n *\n * Ledger API request structure\n *\n */\nexport interface LedgerApiParams {\n requestMethod: RequestMethod\n resource: Resource\n body?: Body\n query?: Query\n path?: Path\n}\nexport interface StatusEvent {\n provider: Provider\n connection: ConnectResult\n network?: Network\n session?: Session\n}\n/**\n *\n * Represents a null value, used in responses where no data is returned.\n *\n */\nexport type Null = null\nexport interface PrepareExecuteAndWaitResult {\n tx: TxChangedExecutedEvent\n}\n/**\n *\n * Result of signing a message.\n *\n */\nexport interface SignMessageResult {\n signature: Signature\n}\n/**\n *\n * Ledger Api response\n *\n */\nexport interface LedgerApiResult {\n [key: string]: any\n}\n/**\n *\n * Event emitted when the user's accounts change.\n *\n */\nexport type AccountsChangedEvent = Wallet[]\n/**\n *\n * An array of accounts that the user has authorized the dapp to access..\n *\n */\nexport type ListAccountsResult = Wallet[]\n/**\n *\n * Event emitted when a transaction changes.\n *\n */\nexport type TxChangedEvent =\n | TxChangedPendingEvent\n | TxChangedSignedEvent\n | TxChangedExecutedEvent\n | TxChangedFailedEvent\n/**\n *\n * Generated! Represents an alias to any of the provided schemas\n *\n */\n\nexport type Status = () => Promise<StatusEvent>\nexport type Connect = () => Promise<ConnectResult>\nexport type Disconnect = () => Promise<Null>\nexport type GetActiveNetwork = () => Promise<Network>\nexport type PrepareExecute = (params: PrepareExecuteParams) => Promise<Null>\nexport type PrepareExecuteAndWait = (\n params: PrepareExecuteParams\n) => Promise<PrepareExecuteAndWaitResult>\nexport type SignMessage = (\n params: SignMessageParams\n) => Promise<SignMessageResult>\nexport type LedgerApi = (params: LedgerApiParams) => Promise<LedgerApiResult>\nexport type AccountsChanged = () => Promise<AccountsChangedEvent>\nexport type GetPrimaryAccount = () => Promise<Wallet>\nexport type ListAccounts = () => Promise<ListAccountsResult>\nexport type TxChanged = () => Promise<TxChangedEvent>\n/* eslint-enable @typescript-eslint/no-unused-vars */\n\ntype Params<T> = T extends (...args: infer A) => any\n ? A extends []\n ? never\n : A[0]\n : never\ntype Result<T> = T extends (...args: any[]) => Promise<infer R> ? R : never\n\nexport type RpcTypes = {\n status: {\n params: Params<Status>\n result: Result<Status>\n }\n\n connect: {\n params: Params<Connect>\n result: Result<Connect>\n }\n\n disconnect: {\n params: Params<Disconnect>\n result: Result<Disconnect>\n }\n\n getActiveNetwork: {\n params: Params<GetActiveNetwork>\n result: Result<GetActiveNetwork>\n }\n\n prepareExecute: {\n params: Params<PrepareExecute>\n result: Result<PrepareExecute>\n }\n\n prepareExecuteAndWait: {\n params: Params<PrepareExecuteAndWait>\n result: Result<PrepareExecuteAndWait>\n }\n\n signMessage: {\n params: Params<SignMessage>\n result: Result<SignMessage>\n }\n\n ledgerApi: {\n params: Params<LedgerApi>\n result: Result<LedgerApi>\n }\n\n accountsChanged: {\n params: Params<AccountsChanged>\n result: Result<AccountsChanged>\n }\n\n getPrimaryAccount: {\n params: Params<GetPrimaryAccount>\n result: Result<GetPrimaryAccount>\n }\n\n listAccounts: {\n params: Params<ListAccounts>\n result: Result<ListAccounts>\n }\n\n txChanged: {\n params: Params<TxChanged>\n result: Result<TxChanged>\n }\n}\n\nexport class SpliceWalletJSONRPCDAppAPI {\n public transport: RpcTransport\n\n constructor(transport: RpcTransport) {\n this.transport = transport\n }\n\n public async request<M extends keyof RpcTypes>(\n args: RequestArgs<RpcTypes, M>\n ): Promise<RpcTypes[M]['result']> {\n const response = await this.transport.submit(args as RequestPayload)\n\n if ('error' in response) {\n throw new Error(\n 'RPC error: ' +\n response.error.code +\n ' - ' +\n response.error.message\n )\n } else {\n return response.result as RpcTypes[M]['result']\n }\n }\n}\nexport default SpliceWalletJSONRPCDAppAPI\n"]}
package/dist/index.d.ts CHANGED
@@ -86,9 +86,27 @@ export type PackageIdSelectionPreference = PackageId[];
86
86
  *
87
87
  */
88
88
  export type Message = string;
89
- export type RequestMethod = 'GET' | 'POST' | 'PUT' | 'DELETE';
89
+ export type RequestMethod = 'get' | 'post' | 'patch' | 'put' | 'delete';
90
90
  export type Resource = string;
91
- export type Body = string;
91
+ export interface Body {
92
+ [key: string]: any;
93
+ }
94
+ /**
95
+ *
96
+ * Query parameters as key-value pairs.
97
+ *
98
+ */
99
+ export interface Query {
100
+ [key: string]: any;
101
+ }
102
+ /**
103
+ *
104
+ * Path parameters as key-value pairs.
105
+ *
106
+ */
107
+ export interface Path {
108
+ [key: string]: any;
109
+ }
92
110
  /**
93
111
  *
94
112
  * The unique identifier of the Provider.
@@ -243,7 +261,6 @@ export interface TxChangedExecutedEvent {
243
261
  *
244
262
  */
245
263
  export type Signature = string;
246
- export type Response = string;
247
264
  /**
248
265
  *
249
266
  * Set as primary wallet for dApp usage.
@@ -416,6 +433,8 @@ export interface LedgerApiParams {
416
433
  requestMethod: RequestMethod;
417
434
  resource: Resource;
418
435
  body?: Body;
436
+ query?: Query;
437
+ path?: Path;
419
438
  }
420
439
  export interface StatusEvent {
421
440
  provider: Provider;
@@ -442,11 +461,11 @@ export interface SignMessageResult {
442
461
  }
443
462
  /**
444
463
  *
445
- * Ledger Api configuration options
464
+ * Ledger Api response
446
465
  *
447
466
  */
448
467
  export interface LedgerApiResult {
449
- response: Response;
468
+ [key: string]: any;
450
469
  }
451
470
  /**
452
471
  *
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAkB,MAAM,4BAA4B,CAAA;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAA;AAGjE;;;;GAIG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,CAAA;AAE9B;;;;GAIG;AACH,MAAM,WAAW,UAAU;IACvB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CACrB;AACD;;;;GAIG;AACH,MAAM,MAAM,KAAK,GAAG,MAAM,CAAA;AAC1B;;;;GAIG;AACH,MAAM,MAAM,KAAK,GAAG,KAAK,EAAE,CAAA;AAC3B;;;;GAIG;AACH,MAAM,MAAM,MAAM,GAAG,KAAK,EAAE,CAAA;AAC5B;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,CAAA;AAC/B;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,CAAA;AAC/B;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAA;AACrC;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,C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A,IAAA,CAAK,SAAA,GAAY,SAAA;AAAA,EACrB;AAAA,EAEA,MAAa,QACT,IAAA,EAC8B;AAC9B,IAAA,MAAM,QAAA,GAAW,MAAM,IAAA,CAAK,SAAA,CAAU,OAAO,IAAsB,CAAA;AAEnE,IAAA,IAAI,WAAW,QAAA,EAAU;AACrB,MAAA,MAAM,IAAI,KAAA;AAAA,QACN,gBACI,QAAA,CAAS,KAAA,CAAM,IAAA,GACf,KAAA,GACA,SAAS,KAAA,CAAM;AAAA,OACvB;AAAA,IACJ,CAAA,MAAO;AACH,MAAA,OAAO,QAAA,CAAS,MAAA;AAAA,IACpB;AAAA,EACJ;AACJ;AACA,IAAO,aAAA,GAAQ","file":"index.js","sourcesContent":["// Code generated by @open-rpc/generator DO NOT EDIT.\nimport _ from 'lodash'\n\nimport { RequestArgs, RequestPayload } from '@canton-network/core-types'\nimport { RpcTransport } from '@canton-network/core-rpc-transport'\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n/**\n *\n * The unique identifier of the command associated with the transaction.\n *\n */\nexport type CommandId = string\ntype AlwaysTrue = any\n/**\n *\n * Structure representing JS commands for transaction execution\n *\n */\nexport interface JsCommands {\n [key: string]: any\n}\n/**\n *\n * The party that signed the transaction.\n *\n */\nexport type Party = string\n/**\n *\n * Set of parties on whose behalf the command should be executed, if submitted. If not set, the primary wallet's party is used.\n *\n */\nexport type ActAs = Party[]\n/**\n *\n * Set of parties that should be granted read access to the command, if submitted. If not set, no additional read parties are granted.\n *\n */\nexport type ReadAs = Party[]\n/**\n *\n * The template identifier of the disclosed contract.\n *\n */\nexport type TemplateId = string\n/**\n *\n * The unique identifier of the disclosed contract.\n *\n */\nexport type ContractId = string\n/**\n *\n * The blob data of the created event for the disclosed contract.\n *\n */\nexport type CreatedEventBlob = string\n/**\n *\n * If not set, a suitable synchronizer that this node is connected to will be chosen.\n *\n */\nexport type SynchronizerId = string\n/**\n *\n * Structure representing a disclosed contract for transaction execution\n *\n */\nexport interface DisclosedContract {\n templateId?: TemplateId\n contractId?: ContractId\n createdEventBlob: CreatedEventBlob\n synchronizerId?: SynchronizerId\n}\n/**\n *\n * List of contract IDs to be disclosed with the command.\n *\n */\nexport type DisclosedContracts = DisclosedContract[]\nexport type PackageId = string\n/**\n *\n * The package-id selection preference of the client for resolving package names and interface instances in command submission and interpretation\n *\n */\nexport type PackageIdSelectionPreference = PackageId[]\n/**\n *\n * The message to sign.\n *\n */\nexport type Message = string\nexport type RequestMethod = 'GET' | 'POST' | 'PUT' | 'DELETE'\nexport type Resource = string\nexport type Body = string\n/**\n *\n * The unique identifier of the Provider.\n *\n */\nexport type ProviderId = string\n/**\n *\n * The version of the Provider.\n *\n */\nexport type Version = string\n/**\n *\n * The type of client that implements the Provider.\n *\n */\nexport type ProviderType = 'browser' | 'desktop' | 'mobile' | 'remote'\n/**\n *\n * The URL of the Wallet Provider.\n *\n */\nexport type Url = string\n/**\n *\n * A URL that points to a user interface.\n *\n */\nexport type UserUrl = string\n/**\n *\n * Represents a Provider.\n *\n */\nexport interface Provider {\n id: ProviderId\n version?: Version\n providerType?: ProviderType\n url?: Url\n userUrl?: UserUrl\n}\n/**\n *\n * Whether or not the user is authenticated with the Wallet.\n *\n */\nexport type IsConnected = boolean\n/**\n *\n * Reason for the wallet state, e.g., 'no signing provider matched'.\n *\n */\nexport type Reason = string\n/**\n *\n * Whether or not a connection to a network is established.\n *\n */\nexport type IsNetworkConnected = boolean\n/**\n *\n * If not connected to a network, the reason why.\n *\n */\nexport type NetworkReason = string\nexport interface ConnectResult {\n isConnected: IsConnected\n reason?: Reason\n isNetworkConnected: IsNetworkConnected\n networkReason?: NetworkReason\n userUrl?: UserUrl\n}\n/**\n *\n * The network ID the wallet corresponds to.\n *\n */\nexport type NetworkId = string\n/**\n *\n * The base URL of the ledger API.\n *\n */\nexport type LedgerApiUrl = string\n/**\n *\n * JWT authentication token.\n *\n */\nexport type AccessToken = string\n/**\n *\n * Network information, if connected to a network.\n *\n */\nexport interface Network {\n networkId: NetworkId\n ledgerApi?: LedgerApiUrl\n accessToken?: AccessToken\n}\n/**\n *\n * The user identifier.\n *\n */\nexport type UserId = string\n/**\n *\n * Session information, if authenticated.\n *\n */\nexport interface Session {\n accessToken: AccessToken\n userId: UserId\n}\n/**\n *\n * The status of the transaction.\n *\n */\nexport type StatusExecuted = 'executed'\n/**\n *\n * The update ID corresponding to the transaction.\n *\n */\nexport type UpdateId = string\nexport type CompletionOffset = number\n/**\n *\n * Payload for the TxChangedExecutedEvent.\n *\n */\nexport interface TxChangedExecutedPayload {\n updateId: UpdateId\n completionOffset: CompletionOffset\n}\n/**\n *\n * Event emitted when a transaction is executed against the participant.\n *\n */\nexport interface TxChangedExecutedEvent {\n status: StatusExecuted\n commandId: CommandId\n payload: TxChangedExecutedPayload\n}\n/**\n *\n * The signature of the transaction.\n *\n */\nexport type Signature = string\nexport type Response = string\n/**\n *\n * Set as primary wallet for dApp usage.\n *\n */\nexport type Primary = boolean\n/**\n *\n * The party ID corresponding to the wallet.\n *\n */\nexport type PartyId = string\n/**\n *\n * The status of the wallet.\n *\n */\nexport type WalletStatus = 'initialized' | 'allocated' | 'removed'\n/**\n *\n * The party hint and name of the wallet.\n *\n */\nexport type Hint = string\n/**\n *\n * The public key of the party.\n *\n */\nexport type PublicKey = string\n/**\n *\n * The namespace of the party.\n *\n */\nexport type Namespace = string\n/**\n *\n * The signing provider ID the wallet corresponds to.\n *\n */\nexport type SigningProviderId = string\n/**\n *\n * 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.\n *\n */\nexport type ExternalTxId = string\n/**\n *\n * The topology transactions\n *\n */\nexport type TopologyTransactions = string\n/**\n *\n * 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.\n *\n */\nexport type Disabled = boolean\n/**\n *\n * Structure representing a wallet\n *\n */\nexport interface Wallet {\n primary: Primary\n partyId: PartyId\n status: WalletStatus\n hint: Hint\n publicKey: PublicKey\n namespace: Namespace\n networkId: NetworkId\n signingProviderId: SigningProviderId\n externalTxId?: ExternalTxId\n topologyTransactions?: TopologyTransactions\n disabled?: Disabled\n reason?: Reason\n}\n/**\n *\n * The status of the transaction.\n *\n */\nexport type StatusPending = 'pending'\n/**\n *\n * Event emitted when a transaction is pending.\n *\n */\nexport interface TxChangedPendingEvent {\n status: StatusPending\n commandId: CommandId\n}\n/**\n *\n * The status of the transaction.\n *\n */\nexport type StatusSigned = 'signed'\n/**\n *\n * The identifier of the provider that signed the transaction.\n *\n */\nexport type SignedBy = string\n/**\n *\n * Payload for the TxChangedSignedEvent.\n *\n */\nexport interface TxChangedSignedPayload {\n signature: Signature\n signedBy: SignedBy\n party: Party\n}\n/**\n *\n * Event emitted when a transaction has been signed.\n *\n */\nexport interface TxChangedSignedEvent {\n status: StatusSigned\n commandId: CommandId\n payload: TxChangedSignedPayload\n}\n/**\n *\n * The status of the transaction.\n *\n */\nexport type StatusFailed = 'failed'\n/**\n *\n * Event emitted when a transaction has failed.\n *\n */\nexport interface TxChangedFailedEvent {\n status: StatusFailed\n commandId: CommandId\n}\n/**\n *\n * Structure representing the request for prepare and execute calls\n *\n */\nexport interface PrepareExecuteParams {\n commandId?: CommandId\n commands: JsCommands\n actAs?: ActAs\n readAs?: ReadAs\n disclosedContracts?: DisclosedContracts\n synchronizerId?: SynchronizerId\n packageIdSelectionPreference?: PackageIdSelectionPreference\n}\n/**\n *\n * Request to sign a message.\n *\n */\nexport interface SignMessageParams {\n message: Message\n}\n/**\n *\n * Ledger API request structure\n *\n */\nexport interface LedgerApiParams {\n requestMethod: RequestMethod\n resource: Resource\n body?: Body\n}\nexport interface StatusEvent {\n provider: Provider\n connection: ConnectResult\n network?: Network\n session?: Session\n}\n/**\n *\n * Represents a null value, used in responses where no data is returned.\n *\n */\nexport type Null = null\nexport interface PrepareExecuteAndWaitResult {\n tx: TxChangedExecutedEvent\n}\n/**\n *\n * Result of signing a message.\n *\n */\nexport interface SignMessageResult {\n signature: Signature\n}\n/**\n *\n * Ledger Api configuration options\n *\n */\nexport interface LedgerApiResult {\n response: Response\n}\n/**\n *\n * Event emitted when the user's accounts change.\n *\n */\nexport type AccountsChangedEvent = Wallet[]\n/**\n *\n * An array of accounts that the user has authorized the dapp to access..\n *\n */\nexport type ListAccountsResult = Wallet[]\n/**\n *\n * Event emitted when a transaction changes.\n *\n */\nexport type TxChangedEvent =\n | TxChangedPendingEvent\n | TxChangedSignedEvent\n | TxChangedExecutedEvent\n | TxChangedFailedEvent\n/**\n *\n * Generated! Represents an alias to any of the provided schemas\n *\n */\n\nexport type Status = () => Promise<StatusEvent>\nexport type Connect = () => Promise<ConnectResult>\nexport type Disconnect = () => Promise<Null>\nexport type GetActiveNetwork = () => Promise<Network>\nexport type PrepareExecute = (params: PrepareExecuteParams) => Promise<Null>\nexport type PrepareExecuteAndWait = (\n params: PrepareExecuteParams\n) => Promise<PrepareExecuteAndWaitResult>\nexport type SignMessage = (\n params: SignMessageParams\n) => Promise<SignMessageResult>\nexport type LedgerApi = (params: LedgerApiParams) => Promise<LedgerApiResult>\nexport type AccountsChanged = () => Promise<AccountsChangedEvent>\nexport type GetPrimaryAccount = () => Promise<Wallet>\nexport type ListAccounts = () => Promise<ListAccountsResult>\nexport type TxChanged = () => Promise<TxChangedEvent>\n/* eslint-enable @typescript-eslint/no-unused-vars */\n\ntype Params<T> = T extends (...args: infer A) => any\n ? A extends []\n ? never\n : A[0]\n : never\ntype Result<T> = T extends (...args: any[]) => Promise<infer R> ? R : never\n\nexport type RpcTypes = {\n status: {\n params: Params<Status>\n result: Result<Status>\n }\n\n connect: {\n params: Params<Connect>\n result: Result<Connect>\n }\n\n disconnect: {\n params: Params<Disconnect>\n result: Result<Disconnect>\n }\n\n getActiveNetwork: {\n params: Params<GetActiveNetwork>\n result: Result<GetActiveNetwork>\n }\n\n prepareExecute: {\n params: Params<PrepareExecute>\n result: Result<PrepareExecute>\n }\n\n prepareExecuteAndWait: {\n params: Params<PrepareExecuteAndWait>\n result: Result<PrepareExecuteAndWait>\n }\n\n signMessage: {\n params: Params<SignMessage>\n result: Result<SignMessage>\n }\n\n ledgerApi: {\n params: Params<LedgerApi>\n result: Result<LedgerApi>\n }\n\n accountsChanged: {\n params: Params<AccountsChanged>\n result: Result<AccountsChanged>\n }\n\n getPrimaryAccount: {\n params: Params<GetPrimaryAccount>\n result: Result<GetPrimaryAccount>\n }\n\n listAccounts: {\n params: Params<ListAccounts>\n result: Result<ListAccounts>\n }\n\n txChanged: {\n params: Params<TxChanged>\n result: Result<TxChanged>\n }\n}\n\nexport class SpliceWalletJSONRPCDAppAPI {\n public transport: RpcTransport\n\n constructor(transport: RpcTransport) {\n this.transport = transport\n }\n\n public async request<M extends keyof RpcTypes>(\n args: RequestArgs<RpcTypes, M>\n ): Promise<RpcTypes[M]['result']> {\n const response = await this.transport.submit(args as RequestPayload)\n\n if ('error' in response) {\n throw new Error(\n 'RPC error: ' +\n response.error.code +\n ' - ' +\n response.error.message\n )\n } else {\n return response.result as RpcTypes[M]['result']\n }\n }\n}\nexport default SpliceWalletJSONRPCDAppAPI\n"]}
1
+ {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;AA8kBO,IAAM,6BAAN,MAAiC;AAAA,EAGpC,YAAY,SAAA,EAAyB;AAFrC,IAAA,aAAA,CAAA,IAAA,EAAO,WAAA,CAAA;AAGH,IAAA,IAAA,CAAK,SAAA,GAAY,SAAA;AAAA,EACrB;AAAA,EAEA,MAAa,QACT,IAAA,EAC8B;AAC9B,IAAA,MAAM,QAAA,GAAW,MAAM,IAAA,CAAK,SAAA,CAAU,OAAO,IAAsB,CAAA;AAEnE,IAAA,IAAI,WAAW,QAAA,EAAU;AACrB,MAAA,MAAM,IAAI,KAAA;AAAA,QACN,gBACI,QAAA,CAAS,KAAA,CAAM,IAAA,GACf,KAAA,GACA,SAAS,KAAA,CAAM;AAAA,OACvB;AAAA,IACJ,CAAA,MAAO;AACH,MAAA,OAAO,QAAA,CAAS,MAAA;AAAA,IACpB;AAAA,EACJ;AACJ;AACA,IAAO,aAAA,GAAQ","file":"index.js","sourcesContent":["// Code generated by @open-rpc/generator DO NOT EDIT.\nimport _ from 'lodash'\n\nimport { RequestArgs, RequestPayload } from '@canton-network/core-types'\nimport { RpcTransport } from '@canton-network/core-rpc-transport'\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n/**\n *\n * The unique identifier of the command associated with the transaction.\n *\n */\nexport type CommandId = string\ntype AlwaysTrue = any\n/**\n *\n * Structure representing JS commands for transaction execution\n *\n */\nexport interface JsCommands {\n [key: string]: any\n}\n/**\n *\n * The party that signed the transaction.\n *\n */\nexport type Party = string\n/**\n *\n * Set of parties on whose behalf the command should be executed, if submitted. If not set, the primary wallet's party is used.\n *\n */\nexport type ActAs = Party[]\n/**\n *\n * Set of parties that should be granted read access to the command, if submitted. If not set, no additional read parties are granted.\n *\n */\nexport type ReadAs = Party[]\n/**\n *\n * The template identifier of the disclosed contract.\n *\n */\nexport type TemplateId = string\n/**\n *\n * The unique identifier of the disclosed contract.\n *\n */\nexport type ContractId = string\n/**\n *\n * The blob data of the created event for the disclosed contract.\n *\n */\nexport type CreatedEventBlob = string\n/**\n *\n * If not set, a suitable synchronizer that this node is connected to will be chosen.\n *\n */\nexport type SynchronizerId = string\n/**\n *\n * Structure representing a disclosed contract for transaction execution\n *\n */\nexport interface DisclosedContract {\n templateId?: TemplateId\n contractId?: ContractId\n createdEventBlob: CreatedEventBlob\n synchronizerId?: SynchronizerId\n}\n/**\n *\n * List of contract IDs to be disclosed with the command.\n *\n */\nexport type DisclosedContracts = DisclosedContract[]\nexport type PackageId = string\n/**\n *\n * The package-id selection preference of the client for resolving package names and interface instances in command submission and interpretation\n *\n */\nexport type PackageIdSelectionPreference = PackageId[]\n/**\n *\n * The message to sign.\n *\n */\nexport type Message = string\nexport type RequestMethod = 'get' | 'post' | 'patch' | 'put' | 'delete'\nexport type Resource = string\nexport interface Body {\n [key: string]: any\n}\n/**\n *\n * Query parameters as key-value pairs.\n *\n */\nexport interface Query {\n [key: string]: any\n}\n/**\n *\n * Path parameters as key-value pairs.\n *\n */\nexport interface Path {\n [key: string]: any\n}\n/**\n *\n * The unique identifier of the Provider.\n *\n */\nexport type ProviderId = string\n/**\n *\n * The version of the Provider.\n *\n */\nexport type Version = string\n/**\n *\n * The type of client that implements the Provider.\n *\n */\nexport type ProviderType = 'browser' | 'desktop' | 'mobile' | 'remote'\n/**\n *\n * The URL of the Wallet Provider.\n *\n */\nexport type Url = string\n/**\n *\n * A URL that points to a user interface.\n *\n */\nexport type UserUrl = string\n/**\n *\n * Represents a Provider.\n *\n */\nexport interface Provider {\n id: ProviderId\n version?: Version\n providerType?: ProviderType\n url?: Url\n userUrl?: UserUrl\n}\n/**\n *\n * Whether or not the user is authenticated with the Wallet.\n *\n */\nexport type IsConnected = boolean\n/**\n *\n * Reason for the wallet state, e.g., 'no signing provider matched'.\n *\n */\nexport type Reason = string\n/**\n *\n * Whether or not a connection to a network is established.\n *\n */\nexport type IsNetworkConnected = boolean\n/**\n *\n * If not connected to a network, the reason why.\n *\n */\nexport type NetworkReason = string\nexport interface ConnectResult {\n isConnected: IsConnected\n reason?: Reason\n isNetworkConnected: IsNetworkConnected\n networkReason?: NetworkReason\n userUrl?: UserUrl\n}\n/**\n *\n * The network ID the wallet corresponds to.\n *\n */\nexport type NetworkId = string\n/**\n *\n * The base URL of the ledger API.\n *\n */\nexport type LedgerApiUrl = string\n/**\n *\n * JWT authentication token.\n *\n */\nexport type AccessToken = string\n/**\n *\n * Network information, if connected to a network.\n *\n */\nexport interface Network {\n networkId: NetworkId\n ledgerApi?: LedgerApiUrl\n accessToken?: AccessToken\n}\n/**\n *\n * The user identifier.\n *\n */\nexport type UserId = string\n/**\n *\n * Session information, if authenticated.\n *\n */\nexport interface Session {\n accessToken: AccessToken\n userId: UserId\n}\n/**\n *\n * The status of the transaction.\n *\n */\nexport type StatusExecuted = 'executed'\n/**\n *\n * The update ID corresponding to the transaction.\n *\n */\nexport type UpdateId = string\nexport type CompletionOffset = number\n/**\n *\n * Payload for the TxChangedExecutedEvent.\n *\n */\nexport interface TxChangedExecutedPayload {\n updateId: UpdateId\n completionOffset: CompletionOffset\n}\n/**\n *\n * Event emitted when a transaction is executed against the participant.\n *\n */\nexport interface TxChangedExecutedEvent {\n status: StatusExecuted\n commandId: CommandId\n payload: TxChangedExecutedPayload\n}\n/**\n *\n * The signature of the transaction.\n *\n */\nexport type Signature = string\n/**\n *\n * Set as primary wallet for dApp usage.\n *\n */\nexport type Primary = boolean\n/**\n *\n * The party ID corresponding to the wallet.\n *\n */\nexport type PartyId = string\n/**\n *\n * The status of the wallet.\n *\n */\nexport type WalletStatus = 'initialized' | 'allocated' | 'removed'\n/**\n *\n * The party hint and name of the wallet.\n *\n */\nexport type Hint = string\n/**\n *\n * The public key of the party.\n *\n */\nexport type PublicKey = string\n/**\n *\n * The namespace of the party.\n *\n */\nexport type Namespace = string\n/**\n *\n * The signing provider ID the wallet corresponds to.\n *\n */\nexport type SigningProviderId = string\n/**\n *\n * 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.\n *\n */\nexport type ExternalTxId = string\n/**\n *\n * The topology transactions\n *\n */\nexport type TopologyTransactions = string\n/**\n *\n * 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.\n *\n */\nexport type Disabled = boolean\n/**\n *\n * Structure representing a wallet\n *\n */\nexport interface Wallet {\n primary: Primary\n partyId: PartyId\n status: WalletStatus\n hint: Hint\n publicKey: PublicKey\n namespace: Namespace\n networkId: NetworkId\n signingProviderId: SigningProviderId\n externalTxId?: ExternalTxId\n topologyTransactions?: TopologyTransactions\n disabled?: Disabled\n reason?: Reason\n}\n/**\n *\n * The status of the transaction.\n *\n */\nexport type StatusPending = 'pending'\n/**\n *\n * Event emitted when a transaction is pending.\n *\n */\nexport interface TxChangedPendingEvent {\n status: StatusPending\n commandId: CommandId\n}\n/**\n *\n * The status of the transaction.\n *\n */\nexport type StatusSigned = 'signed'\n/**\n *\n * The identifier of the provider that signed the transaction.\n *\n */\nexport type SignedBy = string\n/**\n *\n * Payload for the TxChangedSignedEvent.\n *\n */\nexport interface TxChangedSignedPayload {\n signature: Signature\n signedBy: SignedBy\n party: Party\n}\n/**\n *\n * Event emitted when a transaction has been signed.\n *\n */\nexport interface TxChangedSignedEvent {\n status: StatusSigned\n commandId: CommandId\n payload: TxChangedSignedPayload\n}\n/**\n *\n * The status of the transaction.\n *\n */\nexport type StatusFailed = 'failed'\n/**\n *\n * Event emitted when a transaction has failed.\n *\n */\nexport interface TxChangedFailedEvent {\n status: StatusFailed\n commandId: CommandId\n}\n/**\n *\n * Structure representing the request for prepare and execute calls\n *\n */\nexport interface PrepareExecuteParams {\n commandId?: CommandId\n commands: JsCommands\n actAs?: ActAs\n readAs?: ReadAs\n disclosedContracts?: DisclosedContracts\n synchronizerId?: SynchronizerId\n packageIdSelectionPreference?: PackageIdSelectionPreference\n}\n/**\n *\n * Request to sign a message.\n *\n */\nexport interface SignMessageParams {\n message: Message\n}\n/**\n *\n * Ledger API request structure\n *\n */\nexport interface LedgerApiParams {\n requestMethod: RequestMethod\n resource: Resource\n body?: Body\n query?: Query\n path?: Path\n}\nexport interface StatusEvent {\n provider: Provider\n connection: ConnectResult\n network?: Network\n session?: Session\n}\n/**\n *\n * Represents a null value, used in responses where no data is returned.\n *\n */\nexport type Null = null\nexport interface PrepareExecuteAndWaitResult {\n tx: TxChangedExecutedEvent\n}\n/**\n *\n * Result of signing a message.\n *\n */\nexport interface SignMessageResult {\n signature: Signature\n}\n/**\n *\n * Ledger Api response\n *\n */\nexport interface LedgerApiResult {\n [key: string]: any\n}\n/**\n *\n * Event emitted when the user's accounts change.\n *\n */\nexport type AccountsChangedEvent = Wallet[]\n/**\n *\n * An array of accounts that the user has authorized the dapp to access..\n *\n */\nexport type ListAccountsResult = Wallet[]\n/**\n *\n * Event emitted when a transaction changes.\n *\n */\nexport type TxChangedEvent =\n | TxChangedPendingEvent\n | TxChangedSignedEvent\n | TxChangedExecutedEvent\n | TxChangedFailedEvent\n/**\n *\n * Generated! Represents an alias to any of the provided schemas\n *\n */\n\nexport type Status = () => Promise<StatusEvent>\nexport type Connect = () => Promise<ConnectResult>\nexport type Disconnect = () => Promise<Null>\nexport type GetActiveNetwork = () => Promise<Network>\nexport type PrepareExecute = (params: PrepareExecuteParams) => Promise<Null>\nexport type PrepareExecuteAndWait = (\n params: PrepareExecuteParams\n) => Promise<PrepareExecuteAndWaitResult>\nexport type SignMessage = (\n params: SignMessageParams\n) => Promise<SignMessageResult>\nexport type LedgerApi = (params: LedgerApiParams) => Promise<LedgerApiResult>\nexport type AccountsChanged = () => Promise<AccountsChangedEvent>\nexport type GetPrimaryAccount = () => Promise<Wallet>\nexport type ListAccounts = () => Promise<ListAccountsResult>\nexport type TxChanged = () => Promise<TxChangedEvent>\n/* eslint-enable @typescript-eslint/no-unused-vars */\n\ntype Params<T> = T extends (...args: infer A) => any\n ? A extends []\n ? never\n : A[0]\n : never\ntype Result<T> = T extends (...args: any[]) => Promise<infer R> ? R : never\n\nexport type RpcTypes = {\n status: {\n params: Params<Status>\n result: Result<Status>\n }\n\n connect: {\n params: Params<Connect>\n result: Result<Connect>\n }\n\n disconnect: {\n params: Params<Disconnect>\n result: Result<Disconnect>\n }\n\n getActiveNetwork: {\n params: Params<GetActiveNetwork>\n result: Result<GetActiveNetwork>\n }\n\n prepareExecute: {\n params: Params<PrepareExecute>\n result: Result<PrepareExecute>\n }\n\n prepareExecuteAndWait: {\n params: Params<PrepareExecuteAndWait>\n result: Result<PrepareExecuteAndWait>\n }\n\n signMessage: {\n params: Params<SignMessage>\n result: Result<SignMessage>\n }\n\n ledgerApi: {\n params: Params<LedgerApi>\n result: Result<LedgerApi>\n }\n\n accountsChanged: {\n params: Params<AccountsChanged>\n result: Result<AccountsChanged>\n }\n\n getPrimaryAccount: {\n params: Params<GetPrimaryAccount>\n result: Result<GetPrimaryAccount>\n }\n\n listAccounts: {\n params: Params<ListAccounts>\n result: Result<ListAccounts>\n }\n\n txChanged: {\n params: Params<TxChanged>\n result: Result<TxChanged>\n }\n}\n\nexport class SpliceWalletJSONRPCDAppAPI {\n public transport: RpcTransport\n\n constructor(transport: RpcTransport) {\n this.transport = transport\n }\n\n public async request<M extends keyof RpcTypes>(\n args: RequestArgs<RpcTypes, M>\n ): Promise<RpcTypes[M]['result']> {\n const response = await this.transport.submit(args as RequestPayload)\n\n if ('error' in response) {\n throw new Error(\n 'RPC error: ' +\n response.error.code +\n ' - ' +\n response.error.message\n )\n } else {\n return response.result as RpcTypes[M]['result']\n }\n }\n}\nexport default SpliceWalletJSONRPCDAppAPI\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@canton-network/core-wallet-dapp-rpc-client",
3
- "version": "0.27.1",
3
+ "version": "0.29.0",
4
4
  "type": "module",
5
5
  "description": "TypeScript client generated by OpenRPC",
6
6
  "license": "Apache-2.0",
@@ -29,8 +29,8 @@
29
29
  "access": "public"
30
30
  },
31
31
  "dependencies": {
32
- "@canton-network/core-rpc-transport": "^0.8.1",
33
- "@canton-network/core-types": "^0.22.1",
32
+ "@canton-network/core-rpc-transport": "^0.9.1",
33
+ "@canton-network/core-types": "^0.23.1",
34
34
  "lodash": "^4.17.23"
35
35
  },
36
36
  "devDependencies": {