@canton-network/core-wallet-dapp-rpc-client 0.20.2 → 0.22.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.
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +43 -58
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;AA8gBO,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,EAqGA,MAAa,OAAA,CACT,MAAA,EACA,MAAA,EACgB;AAChB,IAAA,MAAM,QAAA,GAAW,MAAM,IAAA,CAAK,SAAA,CAAU,OAAO,EAAE,MAAA,EAAQ,QAAQ,CAAA;AAE/D,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 { RequestPayload } from '@canton-network/core-types'\nimport { RpcTransport } from '@canton-network/core-rpc-transport'\n\n/**\n *\n * The unique identifier of the command associated with the transaction.\n *\n */\nexport type CommandId = string\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 [k: string]: any\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[]\nexport type RequestMethod = 'GET' | 'POST' | 'PUT' | 'DELETE'\nexport type Resource = string\nexport type Body = string\n/**\n *\n * The unique identifier of the Wallet Gateway.\n *\n */\nexport type Id = string\n/**\n *\n * The type of client that implements the Wallet Gateway.\n *\n */\nexport type ClientType = 'browser' | 'desktop' | 'mobile' | 'remote'\n/**\n *\n * The URL of the Wallet Gateway.\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 Wallet Gateway.\n *\n */\nexport interface KernelInfo {\n id: Id\n clientType: ClientType\n url?: Url\n userUrl?: UserUrl\n [k: string]: any\n}\n/**\n *\n * Whether or not the user is authenticated with the Wallet.\n *\n */\nexport type IsConnected = boolean\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\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 BaseUrl = string\n/**\n *\n * Ledger API configuration.\n *\n */\nexport interface LedgerApiConfig {\n baseUrl: BaseUrl\n [k: string]: any\n}\n/**\n *\n * Network information, if connected to a network.\n *\n */\nexport interface Network {\n networkId: NetworkId\n ledgerApi?: LedgerApiConfig\n [k: string]: any\n}\n/**\n *\n * JWT authentication token.\n *\n */\nexport type AccessToken = string\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 [k: string]: any\n}\nexport type Dar = string\nexport type Dars = Dar[]\n/**\n *\n * The prepared transaction data.\n *\n */\nexport type PreparedTransaction = string\n/**\n *\n * The hash of the prepared transaction.\n *\n */\nexport type PreparedTransactionHash = string\n/**\n *\n * Structure representing the result of a prepareReturn call\n *\n */\nexport interface JsPrepareSubmissionResponse {\n preparedTransaction?: PreparedTransaction\n preparedTransactionHash?: PreparedTransactionHash\n [k: string]: any\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}\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'\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 * Reason for the wallet state, e.g., 'no signing provider matched'.\n *\n */\nexport type Reason = string\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 [k: string]: any\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 signature of the transaction.\n *\n */\nexport type Signature = string\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 PrepareReturnParams {\n commandId?: CommandId\n commands: JsCommands\n actAs?: ActAs\n readAs?: ReadAs\n disclosedContracts?: DisclosedContracts\n synchronizerId?: SynchronizerId\n packageIdSelectionPreference?: PackageIdSelectionPreference\n [k: string]: any\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 [k: string]: any\n}\n/**\n *\n * Ledger API request structure\n *\n */\nexport interface LedgerApiParams {\n requestMethod: RequestMethod\n resource: Resource\n body?: Body\n [k: string]: any\n}\nexport interface StatusEvent {\n kernel: KernelInfo\n isConnected: IsConnected\n isNetworkConnected: IsNetworkConnected\n networkReason?: NetworkReason\n network?: Network\n session?: Session\n [k: string]: any\n}\n/**\n *\n * Represents a null value, used in responses where no data is returned.\n *\n */\nexport type Null = null\nexport interface DarsAvailableResult {\n dars: Dars\n [k: string]: any\n}\nexport type PrepareReturnResult = any\nexport interface PrepareExecuteAndWaitResult {\n tx: TxChangedExecutedEvent\n [k: string]: any\n}\n/**\n *\n * Ledger Api configuration options\n *\n */\nexport interface LedgerApiResult {\n response: Response\n [k: 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 RequestAccountsResult = 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<StatusEvent>\nexport type Disconnect = () => Promise<Null>\nexport type DarsAvailable = () => Promise<DarsAvailableResult>\nexport type PrepareReturn = (\n params: PrepareReturnParams\n) => Promise<PrepareReturnResult>\nexport type PrepareExecute = (params: PrepareExecuteParams) => Promise<Null>\nexport type PrepareExecuteAndWait = (\n params: PrepareExecuteParams\n) => Promise<PrepareExecuteAndWaitResult>\nexport type LedgerApi = (params: LedgerApiParams) => Promise<LedgerApiResult>\nexport type OnAccountsChanged = () => Promise<AccountsChangedEvent>\nexport type RequestAccounts = () => Promise<RequestAccountsResult>\nexport type OnTxChanged = () => Promise<TxChangedEvent>\n\nexport class SpliceWalletJSONRPCDAppAPI {\n public transport: RpcTransport\n\n constructor(transport: RpcTransport) {\n this.transport = transport\n }\n\n /**\n *\n */\n // tslint:disable-next-line:max-line-length\n public async request(\n method: 'status',\n ...params: Parameters<Status>\n ): ReturnType<Status>\n\n /**\n *\n */\n // tslint:disable-next-line:max-line-length\n public async request(\n method: 'connect',\n ...params: Parameters<Connect>\n ): ReturnType<Connect>\n\n /**\n *\n */\n // tslint:disable-next-line:max-line-length\n public async request(\n method: 'disconnect',\n ...params: Parameters<Disconnect>\n ): ReturnType<Disconnect>\n\n /**\n *\n */\n // tslint:disable-next-line:max-line-length\n public async request(\n method: 'darsAvailable',\n ...params: Parameters<DarsAvailable>\n ): ReturnType<DarsAvailable>\n\n /**\n *\n */\n // tslint:disable-next-line:max-line-length\n public async request(\n method: 'prepareReturn',\n ...params: Parameters<PrepareReturn>\n ): ReturnType<PrepareReturn>\n\n /**\n *\n */\n // tslint:disable-next-line:max-line-length\n public async request(\n method: 'prepareExecute',\n ...params: Parameters<PrepareExecute>\n ): ReturnType<PrepareExecute>\n\n /**\n *\n */\n // tslint:disable-next-line:max-line-length\n public async request(\n method: 'prepareExecuteAndWait',\n ...params: Parameters<PrepareExecuteAndWait>\n ): ReturnType<PrepareExecuteAndWait>\n\n /**\n *\n */\n // tslint:disable-next-line:max-line-length\n public async request(\n method: 'ledgerApi',\n ...params: Parameters<LedgerApi>\n ): ReturnType<LedgerApi>\n\n /**\n *\n */\n // tslint:disable-next-line:max-line-length\n public async request(\n method: 'onAccountsChanged',\n ...params: Parameters<OnAccountsChanged>\n ): ReturnType<OnAccountsChanged>\n\n /**\n *\n */\n // tslint:disable-next-line:max-line-length\n public async request(\n method: 'requestAccounts',\n ...params: Parameters<RequestAccounts>\n ): ReturnType<RequestAccounts>\n\n /**\n *\n */\n // tslint:disable-next-line:max-line-length\n public async request(\n method: 'onTxChanged',\n ...params: Parameters<OnTxChanged>\n ): ReturnType<OnTxChanged>\n\n public async request(\n method: string,\n params?: RequestPayload['params']\n ): Promise<unknown> {\n const response = await this.transport.submit({ method, params })\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\n }\n }\n}\nexport default SpliceWalletJSONRPCDAppAPI\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;AA2fO,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,EA8GA,MAAa,OAAA,CACT,MAAA,EACA,MAAA,EACgB;AAChB,IAAA,MAAM,QAAA,GAAW,MAAM,IAAA,CAAK,SAAA,CAAU,OAAO,EAAE,MAAA,EAAQ,QAAQ,CAAA;AAE/D,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 { RequestPayload } from '@canton-network/core-types'\nimport { RpcTransport } from '@canton-network/core-rpc-transport'\n\n/**\n *\n * The unique identifier of the command associated with the transaction.\n *\n */\nexport type CommandId = string\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 [k: string]: any\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 Wallet Gateway.\n *\n */\nexport type Id = string\n/**\n *\n * The type of client that implements the Wallet Gateway.\n *\n */\nexport type ClientType = 'browser' | 'desktop' | 'mobile' | 'remote'\n/**\n *\n * The URL of the Wallet Gateway.\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 Wallet Gateway.\n *\n */\nexport interface KernelInfo {\n id: Id\n clientType: ClientType\n url?: Url\n userUrl?: UserUrl\n [k: string]: any\n}\n/**\n *\n * Whether or not the user is authenticated with the Wallet.\n *\n */\nexport type IsConnected = boolean\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\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 BaseUrl = string\n/**\n *\n * Ledger API configuration.\n *\n */\nexport interface LedgerApiConfig {\n baseUrl: BaseUrl\n [k: string]: any\n}\n/**\n *\n * Network information, if connected to a network.\n *\n */\nexport interface Network {\n networkId: NetworkId\n ledgerApi?: LedgerApiConfig\n [k: string]: any\n}\n/**\n *\n * JWT authentication token.\n *\n */\nexport type AccessToken = string\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 [k: string]: any\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'\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 * Reason for the wallet state, e.g., 'no signing provider matched'.\n *\n */\nexport type Reason = string\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 [k: string]: any\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 [k: string]: any\n}\n/**\n *\n * Request to sign a message.\n *\n */\nexport interface SignMessageParams {\n message: Message\n [k: string]: any\n}\n/**\n *\n * Ledger API request structure\n *\n */\nexport interface LedgerApiParams {\n requestMethod: RequestMethod\n resource: Resource\n body?: Body\n [k: string]: any\n}\nexport interface StatusEvent {\n kernel: KernelInfo\n isConnected: IsConnected\n isNetworkConnected: IsNetworkConnected\n networkReason?: NetworkReason\n network?: Network\n session?: Session\n [k: string]: any\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 [k: string]: any\n}\n/**\n *\n * Result of signing a message.\n *\n */\nexport interface SignMessageResult {\n signature: Signature\n [k: string]: any\n}\n/**\n *\n * Ledger Api configuration options\n *\n */\nexport interface LedgerApiResult {\n response: Response\n [k: 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<StatusEvent>\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\nexport class SpliceWalletJSONRPCDAppAPI {\n public transport: RpcTransport\n\n constructor(transport: RpcTransport) {\n this.transport = transport\n }\n\n /**\n *\n */\n // tslint:disable-next-line:max-line-length\n public async request(\n method: 'status',\n ...params: Parameters<Status>\n ): ReturnType<Status>\n\n /**\n *\n */\n // tslint:disable-next-line:max-line-length\n public async request(\n method: 'connect',\n ...params: Parameters<Connect>\n ): ReturnType<Connect>\n\n /**\n *\n */\n // tslint:disable-next-line:max-line-length\n public async request(\n method: 'disconnect',\n ...params: Parameters<Disconnect>\n ): ReturnType<Disconnect>\n\n /**\n *\n */\n // tslint:disable-next-line:max-line-length\n public async request(\n method: 'getActiveNetwork',\n ...params: Parameters<GetActiveNetwork>\n ): ReturnType<GetActiveNetwork>\n\n /**\n *\n */\n // tslint:disable-next-line:max-line-length\n public async request(\n method: 'prepareExecute',\n ...params: Parameters<PrepareExecute>\n ): ReturnType<PrepareExecute>\n\n /**\n *\n */\n // tslint:disable-next-line:max-line-length\n public async request(\n method: 'prepareExecuteAndWait',\n ...params: Parameters<PrepareExecuteAndWait>\n ): ReturnType<PrepareExecuteAndWait>\n\n /**\n *\n */\n // tslint:disable-next-line:max-line-length\n public async request(\n method: 'signMessage',\n ...params: Parameters<SignMessage>\n ): ReturnType<SignMessage>\n\n /**\n *\n */\n // tslint:disable-next-line:max-line-length\n public async request(\n method: 'ledgerApi',\n ...params: Parameters<LedgerApi>\n ): ReturnType<LedgerApi>\n\n /**\n *\n */\n // tslint:disable-next-line:max-line-length\n public async request(\n method: 'accountsChanged',\n ...params: Parameters<AccountsChanged>\n ): ReturnType<AccountsChanged>\n\n /**\n *\n */\n // tslint:disable-next-line:max-line-length\n public async request(\n method: 'getPrimaryAccount',\n ...params: Parameters<GetPrimaryAccount>\n ): ReturnType<GetPrimaryAccount>\n\n /**\n *\n */\n // tslint:disable-next-line:max-line-length\n public async request(\n method: 'listAccounts',\n ...params: Parameters<ListAccounts>\n ): ReturnType<ListAccounts>\n\n /**\n *\n */\n // tslint:disable-next-line:max-line-length\n public async request(\n method: 'txChanged',\n ...params: Parameters<TxChanged>\n ): ReturnType<TxChanged>\n\n public async request(\n method: string,\n params?: RequestPayload['params']\n ): Promise<unknown> {\n const response = await this.transport.submit({ method, params })\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\n }\n }\n}\nexport default SpliceWalletJSONRPCDAppAPI\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -80,6 +80,12 @@ export type PackageId = string;
|
|
|
80
80
|
*
|
|
81
81
|
*/
|
|
82
82
|
export type PackageIdSelectionPreference = PackageId[];
|
|
83
|
+
/**
|
|
84
|
+
*
|
|
85
|
+
* The message to sign.
|
|
86
|
+
*
|
|
87
|
+
*/
|
|
88
|
+
export type Message = string;
|
|
83
89
|
export type RequestMethod = 'GET' | 'POST' | 'PUT' | 'DELETE';
|
|
84
90
|
export type Resource = string;
|
|
85
91
|
export type Body = string;
|
|
@@ -190,30 +196,6 @@ export interface Session {
|
|
|
190
196
|
userId: UserId;
|
|
191
197
|
[k: string]: any;
|
|
192
198
|
}
|
|
193
|
-
export type Dar = string;
|
|
194
|
-
export type Dars = Dar[];
|
|
195
|
-
/**
|
|
196
|
-
*
|
|
197
|
-
* The prepared transaction data.
|
|
198
|
-
*
|
|
199
|
-
*/
|
|
200
|
-
export type PreparedTransaction = string;
|
|
201
|
-
/**
|
|
202
|
-
*
|
|
203
|
-
* The hash of the prepared transaction.
|
|
204
|
-
*
|
|
205
|
-
*/
|
|
206
|
-
export type PreparedTransactionHash = string;
|
|
207
|
-
/**
|
|
208
|
-
*
|
|
209
|
-
* Structure representing the result of a prepareReturn call
|
|
210
|
-
*
|
|
211
|
-
*/
|
|
212
|
-
export interface JsPrepareSubmissionResponse {
|
|
213
|
-
preparedTransaction?: PreparedTransaction;
|
|
214
|
-
preparedTransactionHash?: PreparedTransactionHash;
|
|
215
|
-
[k: string]: any;
|
|
216
|
-
}
|
|
217
199
|
/**
|
|
218
200
|
*
|
|
219
201
|
* The status of the transaction.
|
|
@@ -246,6 +228,12 @@ export interface TxChangedExecutedEvent {
|
|
|
246
228
|
commandId: CommandId;
|
|
247
229
|
payload: TxChangedExecutedPayload;
|
|
248
230
|
}
|
|
231
|
+
/**
|
|
232
|
+
*
|
|
233
|
+
* The signature of the transaction.
|
|
234
|
+
*
|
|
235
|
+
*/
|
|
236
|
+
export type Signature = string;
|
|
249
237
|
export type Response = string;
|
|
250
238
|
/**
|
|
251
239
|
*
|
|
@@ -354,12 +342,6 @@ export interface TxChangedPendingEvent {
|
|
|
354
342
|
*
|
|
355
343
|
*/
|
|
356
344
|
export type StatusSigned = 'signed';
|
|
357
|
-
/**
|
|
358
|
-
*
|
|
359
|
-
* The signature of the transaction.
|
|
360
|
-
*
|
|
361
|
-
*/
|
|
362
|
-
export type Signature = string;
|
|
363
345
|
/**
|
|
364
346
|
*
|
|
365
347
|
* The identifier of the provider that signed the transaction.
|
|
@@ -406,7 +388,7 @@ export interface TxChangedFailedEvent {
|
|
|
406
388
|
* Structure representing the request for prepare and execute calls
|
|
407
389
|
*
|
|
408
390
|
*/
|
|
409
|
-
export interface
|
|
391
|
+
export interface PrepareExecuteParams {
|
|
410
392
|
commandId?: CommandId;
|
|
411
393
|
commands: JsCommands;
|
|
412
394
|
actAs?: ActAs;
|
|
@@ -418,17 +400,11 @@ export interface PrepareReturnParams {
|
|
|
418
400
|
}
|
|
419
401
|
/**
|
|
420
402
|
*
|
|
421
|
-
*
|
|
403
|
+
* Request to sign a message.
|
|
422
404
|
*
|
|
423
405
|
*/
|
|
424
|
-
export interface
|
|
425
|
-
|
|
426
|
-
commands: JsCommands;
|
|
427
|
-
actAs?: ActAs;
|
|
428
|
-
readAs?: ReadAs;
|
|
429
|
-
disclosedContracts?: DisclosedContracts;
|
|
430
|
-
synchronizerId?: SynchronizerId;
|
|
431
|
-
packageIdSelectionPreference?: PackageIdSelectionPreference;
|
|
406
|
+
export interface SignMessageParams {
|
|
407
|
+
message: Message;
|
|
432
408
|
[k: string]: any;
|
|
433
409
|
}
|
|
434
410
|
/**
|
|
@@ -457,15 +433,19 @@ export interface StatusEvent {
|
|
|
457
433
|
*
|
|
458
434
|
*/
|
|
459
435
|
export type Null = null;
|
|
460
|
-
export interface DarsAvailableResult {
|
|
461
|
-
dars: Dars;
|
|
462
|
-
[k: string]: any;
|
|
463
|
-
}
|
|
464
|
-
export type PrepareReturnResult = any;
|
|
465
436
|
export interface PrepareExecuteAndWaitResult {
|
|
466
437
|
tx: TxChangedExecutedEvent;
|
|
467
438
|
[k: string]: any;
|
|
468
439
|
}
|
|
440
|
+
/**
|
|
441
|
+
*
|
|
442
|
+
* Result of signing a message.
|
|
443
|
+
*
|
|
444
|
+
*/
|
|
445
|
+
export interface SignMessageResult {
|
|
446
|
+
signature: Signature;
|
|
447
|
+
[k: string]: any;
|
|
448
|
+
}
|
|
469
449
|
/**
|
|
470
450
|
*
|
|
471
451
|
* Ledger Api configuration options
|
|
@@ -486,7 +466,7 @@ export type AccountsChangedEvent = Wallet[];
|
|
|
486
466
|
* An array of accounts that the user has authorized the dapp to access..
|
|
487
467
|
*
|
|
488
468
|
*/
|
|
489
|
-
export type
|
|
469
|
+
export type ListAccountsResult = Wallet[];
|
|
490
470
|
/**
|
|
491
471
|
*
|
|
492
472
|
* Event emitted when a transaction changes.
|
|
@@ -501,14 +481,15 @@ export type TxChangedEvent = TxChangedPendingEvent | TxChangedSignedEvent | TxCh
|
|
|
501
481
|
export type Status = () => Promise<StatusEvent>;
|
|
502
482
|
export type Connect = () => Promise<StatusEvent>;
|
|
503
483
|
export type Disconnect = () => Promise<Null>;
|
|
504
|
-
export type
|
|
505
|
-
export type PrepareReturn = (params: PrepareReturnParams) => Promise<PrepareReturnResult>;
|
|
484
|
+
export type GetActiveNetwork = () => Promise<Network>;
|
|
506
485
|
export type PrepareExecute = (params: PrepareExecuteParams) => Promise<Null>;
|
|
507
486
|
export type PrepareExecuteAndWait = (params: PrepareExecuteParams) => Promise<PrepareExecuteAndWaitResult>;
|
|
487
|
+
export type SignMessage = (params: SignMessageParams) => Promise<SignMessageResult>;
|
|
508
488
|
export type LedgerApi = (params: LedgerApiParams) => Promise<LedgerApiResult>;
|
|
509
|
-
export type
|
|
510
|
-
export type
|
|
511
|
-
export type
|
|
489
|
+
export type AccountsChanged = () => Promise<AccountsChangedEvent>;
|
|
490
|
+
export type GetPrimaryAccount = () => Promise<Wallet>;
|
|
491
|
+
export type ListAccounts = () => Promise<ListAccountsResult>;
|
|
492
|
+
export type TxChanged = () => Promise<TxChangedEvent>;
|
|
512
493
|
export declare class SpliceWalletJSONRPCDAppAPI {
|
|
513
494
|
transport: RpcTransport;
|
|
514
495
|
constructor(transport: RpcTransport);
|
|
@@ -527,19 +508,19 @@ export declare class SpliceWalletJSONRPCDAppAPI {
|
|
|
527
508
|
/**
|
|
528
509
|
*
|
|
529
510
|
*/
|
|
530
|
-
request(method: '
|
|
511
|
+
request(method: 'getActiveNetwork', ...params: Parameters<GetActiveNetwork>): ReturnType<GetActiveNetwork>;
|
|
531
512
|
/**
|
|
532
513
|
*
|
|
533
514
|
*/
|
|
534
|
-
request(method: '
|
|
515
|
+
request(method: 'prepareExecute', ...params: Parameters<PrepareExecute>): ReturnType<PrepareExecute>;
|
|
535
516
|
/**
|
|
536
517
|
*
|
|
537
518
|
*/
|
|
538
|
-
request(method: '
|
|
519
|
+
request(method: 'prepareExecuteAndWait', ...params: Parameters<PrepareExecuteAndWait>): ReturnType<PrepareExecuteAndWait>;
|
|
539
520
|
/**
|
|
540
521
|
*
|
|
541
522
|
*/
|
|
542
|
-
request(method: '
|
|
523
|
+
request(method: 'signMessage', ...params: Parameters<SignMessage>): ReturnType<SignMessage>;
|
|
543
524
|
/**
|
|
544
525
|
*
|
|
545
526
|
*/
|
|
@@ -547,15 +528,19 @@ export declare class SpliceWalletJSONRPCDAppAPI {
|
|
|
547
528
|
/**
|
|
548
529
|
*
|
|
549
530
|
*/
|
|
550
|
-
request(method: '
|
|
531
|
+
request(method: 'accountsChanged', ...params: Parameters<AccountsChanged>): ReturnType<AccountsChanged>;
|
|
532
|
+
/**
|
|
533
|
+
*
|
|
534
|
+
*/
|
|
535
|
+
request(method: 'getPrimaryAccount', ...params: Parameters<GetPrimaryAccount>): ReturnType<GetPrimaryAccount>;
|
|
551
536
|
/**
|
|
552
537
|
*
|
|
553
538
|
*/
|
|
554
|
-
request(method: '
|
|
539
|
+
request(method: 'listAccounts', ...params: Parameters<ListAccounts>): ReturnType<ListAccounts>;
|
|
555
540
|
/**
|
|
556
541
|
*
|
|
557
542
|
*/
|
|
558
|
-
request(method: '
|
|
543
|
+
request(method: 'txChanged', ...params: Parameters<TxChanged>): ReturnType<TxChanged>;
|
|
559
544
|
}
|
|
560
545
|
export default SpliceWalletJSONRPCDAppAPI;
|
|
561
546
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAA;AAEjE;;;;GAIG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,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AAA,EACJ;AACJ;AACA,IAAO,aAAA,GAAQ","file":"index.js","sourcesContent":["// Code generated by @open-rpc/generator DO NOT EDIT.\nimport _ from 'lodash'\n\nimport { RequestPayload } from '@canton-network/core-types'\nimport { RpcTransport } from '@canton-network/core-rpc-transport'\n\n/**\n *\n * The unique identifier of the command associated with the transaction.\n *\n */\nexport type CommandId = string\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 [k: string]: any\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[]\nexport type RequestMethod = 'GET' | 'POST' | 'PUT' | 'DELETE'\nexport type Resource = string\nexport type Body = string\n/**\n *\n * The unique identifier of the Wallet Gateway.\n *\n */\nexport type Id = string\n/**\n *\n * The type of client that implements the Wallet Gateway.\n *\n */\nexport type ClientType = 'browser' | 'desktop' | 'mobile' | 'remote'\n/**\n *\n * The URL of the Wallet Gateway.\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 Wallet Gateway.\n *\n */\nexport interface KernelInfo {\n id: Id\n clientType: ClientType\n url?: Url\n userUrl?: UserUrl\n [k: string]: any\n}\n/**\n *\n * Whether or not the user is authenticated with the Wallet.\n *\n */\nexport type IsConnected = boolean\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\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 BaseUrl = string\n/**\n *\n * Ledger API configuration.\n *\n */\nexport interface LedgerApiConfig {\n baseUrl: BaseUrl\n [k: string]: any\n}\n/**\n *\n * Network information, if connected to a network.\n *\n */\nexport interface Network {\n networkId: NetworkId\n ledgerApi?: LedgerApiConfig\n [k: string]: any\n}\n/**\n *\n * JWT authentication token.\n *\n */\nexport type AccessToken = string\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 [k: string]: any\n}\nexport type Dar = string\nexport type Dars = Dar[]\n/**\n *\n * The prepared transaction data.\n *\n */\nexport type PreparedTransaction = string\n/**\n *\n * The hash of the prepared transaction.\n *\n */\nexport type PreparedTransactionHash = string\n/**\n *\n * Structure representing the result of a prepareReturn call\n *\n */\nexport interface JsPrepareSubmissionResponse {\n preparedTransaction?: PreparedTransaction\n preparedTransactionHash?: PreparedTransactionHash\n [k: string]: any\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}\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'\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 * Reason for the wallet state, e.g., 'no signing provider matched'.\n *\n */\nexport type Reason = string\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 [k: string]: any\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 signature of the transaction.\n *\n */\nexport type Signature = string\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 PrepareReturnParams {\n commandId?: CommandId\n commands: JsCommands\n actAs?: ActAs\n readAs?: ReadAs\n disclosedContracts?: DisclosedContracts\n synchronizerId?: SynchronizerId\n packageIdSelectionPreference?: PackageIdSelectionPreference\n [k: string]: any\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 [k: string]: any\n}\n/**\n *\n * Ledger API request structure\n *\n */\nexport interface LedgerApiParams {\n requestMethod: RequestMethod\n resource: Resource\n body?: Body\n [k: string]: any\n}\nexport interface StatusEvent {\n kernel: KernelInfo\n isConnected: IsConnected\n isNetworkConnected: IsNetworkConnected\n networkReason?: NetworkReason\n network?: Network\n session?: Session\n [k: string]: any\n}\n/**\n *\n * Represents a null value, used in responses where no data is returned.\n *\n */\nexport type Null = null\nexport interface DarsAvailableResult {\n dars: Dars\n [k: string]: any\n}\nexport type PrepareReturnResult = any\nexport interface PrepareExecuteAndWaitResult {\n tx: TxChangedExecutedEvent\n [k: string]: any\n}\n/**\n *\n * Ledger Api configuration options\n *\n */\nexport interface LedgerApiResult {\n response: Response\n [k: 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 RequestAccountsResult = 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<StatusEvent>\nexport type Disconnect = () => Promise<Null>\nexport type DarsAvailable = () => Promise<DarsAvailableResult>\nexport type PrepareReturn = (\n params: PrepareReturnParams\n) => Promise<PrepareReturnResult>\nexport type PrepareExecute = (params: PrepareExecuteParams) => Promise<Null>\nexport type PrepareExecuteAndWait = (\n params: PrepareExecuteParams\n) => Promise<PrepareExecuteAndWaitResult>\nexport type LedgerApi = (params: LedgerApiParams) => Promise<LedgerApiResult>\nexport type OnAccountsChanged = () => Promise<AccountsChangedEvent>\nexport type RequestAccounts = () => Promise<RequestAccountsResult>\nexport type OnTxChanged = () => Promise<TxChangedEvent>\n\nexport class SpliceWalletJSONRPCDAppAPI {\n public transport: RpcTransport\n\n constructor(transport: RpcTransport) {\n this.transport = transport\n }\n\n /**\n *\n */\n // tslint:disable-next-line:max-line-length\n public async request(\n method: 'status',\n ...params: Parameters<Status>\n ): ReturnType<Status>\n\n /**\n *\n */\n // tslint:disable-next-line:max-line-length\n public async request(\n method: 'connect',\n ...params: Parameters<Connect>\n ): ReturnType<Connect>\n\n /**\n *\n */\n // tslint:disable-next-line:max-line-length\n public async request(\n method: 'disconnect',\n ...params: Parameters<Disconnect>\n ): ReturnType<Disconnect>\n\n /**\n *\n */\n // tslint:disable-next-line:max-line-length\n public async request(\n method: 'darsAvailable',\n ...params: Parameters<DarsAvailable>\n ): ReturnType<DarsAvailable>\n\n /**\n *\n */\n // tslint:disable-next-line:max-line-length\n public async request(\n method: 'prepareReturn',\n ...params: Parameters<PrepareReturn>\n ): ReturnType<PrepareReturn>\n\n /**\n *\n */\n // tslint:disable-next-line:max-line-length\n public async request(\n method: 'prepareExecute',\n ...params: Parameters<PrepareExecute>\n ): ReturnType<PrepareExecute>\n\n /**\n *\n */\n // tslint:disable-next-line:max-line-length\n public async request(\n method: 'prepareExecuteAndWait',\n ...params: Parameters<PrepareExecuteAndWait>\n ): ReturnType<PrepareExecuteAndWait>\n\n /**\n *\n */\n // tslint:disable-next-line:max-line-length\n public async request(\n method: 'ledgerApi',\n ...params: Parameters<LedgerApi>\n ): ReturnType<LedgerApi>\n\n /**\n *\n */\n // tslint:disable-next-line:max-line-length\n public async request(\n method: 'onAccountsChanged',\n ...params: Parameters<OnAccountsChanged>\n ): ReturnType<OnAccountsChanged>\n\n /**\n *\n */\n // tslint:disable-next-line:max-line-length\n public async request(\n method: 'requestAccounts',\n ...params: Parameters<RequestAccounts>\n ): ReturnType<RequestAccounts>\n\n /**\n *\n */\n // tslint:disable-next-line:max-line-length\n public async request(\n method: 'onTxChanged',\n ...params: Parameters<OnTxChanged>\n ): ReturnType<OnTxChanged>\n\n public async request(\n method: string,\n params?: RequestPayload['params']\n ): Promise<unknown> {\n const response = await this.transport.submit({ method, params })\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\n }\n }\n}\nexport default SpliceWalletJSONRPCDAppAPI\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;AA2fO,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,EA8GA,MAAa,OAAA,CACT,MAAA,EACA,MAAA,EACgB;AAChB,IAAA,MAAM,QAAA,GAAW,MAAM,IAAA,CAAK,SAAA,CAAU,OAAO,EAAE,MAAA,EAAQ,QAAQ,CAAA;AAE/D,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 { RequestPayload } from '@canton-network/core-types'\nimport { RpcTransport } from '@canton-network/core-rpc-transport'\n\n/**\n *\n * The unique identifier of the command associated with the transaction.\n *\n */\nexport type CommandId = string\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 [k: string]: any\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 Wallet Gateway.\n *\n */\nexport type Id = string\n/**\n *\n * The type of client that implements the Wallet Gateway.\n *\n */\nexport type ClientType = 'browser' | 'desktop' | 'mobile' | 'remote'\n/**\n *\n * The URL of the Wallet Gateway.\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 Wallet Gateway.\n *\n */\nexport interface KernelInfo {\n id: Id\n clientType: ClientType\n url?: Url\n userUrl?: UserUrl\n [k: string]: any\n}\n/**\n *\n * Whether or not the user is authenticated with the Wallet.\n *\n */\nexport type IsConnected = boolean\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\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 BaseUrl = string\n/**\n *\n * Ledger API configuration.\n *\n */\nexport interface LedgerApiConfig {\n baseUrl: BaseUrl\n [k: string]: any\n}\n/**\n *\n * Network information, if connected to a network.\n *\n */\nexport interface Network {\n networkId: NetworkId\n ledgerApi?: LedgerApiConfig\n [k: string]: any\n}\n/**\n *\n * JWT authentication token.\n *\n */\nexport type AccessToken = string\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 [k: string]: any\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'\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 * Reason for the wallet state, e.g., 'no signing provider matched'.\n *\n */\nexport type Reason = string\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 [k: string]: any\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 [k: string]: any\n}\n/**\n *\n * Request to sign a message.\n *\n */\nexport interface SignMessageParams {\n message: Message\n [k: string]: any\n}\n/**\n *\n * Ledger API request structure\n *\n */\nexport interface LedgerApiParams {\n requestMethod: RequestMethod\n resource: Resource\n body?: Body\n [k: string]: any\n}\nexport interface StatusEvent {\n kernel: KernelInfo\n isConnected: IsConnected\n isNetworkConnected: IsNetworkConnected\n networkReason?: NetworkReason\n network?: Network\n session?: Session\n [k: string]: any\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 [k: string]: any\n}\n/**\n *\n * Result of signing a message.\n *\n */\nexport interface SignMessageResult {\n signature: Signature\n [k: string]: any\n}\n/**\n *\n * Ledger Api configuration options\n *\n */\nexport interface LedgerApiResult {\n response: Response\n [k: 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<StatusEvent>\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\nexport class SpliceWalletJSONRPCDAppAPI {\n public transport: RpcTransport\n\n constructor(transport: RpcTransport) {\n this.transport = transport\n }\n\n /**\n *\n */\n // tslint:disable-next-line:max-line-length\n public async request(\n method: 'status',\n ...params: Parameters<Status>\n ): ReturnType<Status>\n\n /**\n *\n */\n // tslint:disable-next-line:max-line-length\n public async request(\n method: 'connect',\n ...params: Parameters<Connect>\n ): ReturnType<Connect>\n\n /**\n *\n */\n // tslint:disable-next-line:max-line-length\n public async request(\n method: 'disconnect',\n ...params: Parameters<Disconnect>\n ): ReturnType<Disconnect>\n\n /**\n *\n */\n // tslint:disable-next-line:max-line-length\n public async request(\n method: 'getActiveNetwork',\n ...params: Parameters<GetActiveNetwork>\n ): ReturnType<GetActiveNetwork>\n\n /**\n *\n */\n // tslint:disable-next-line:max-line-length\n public async request(\n method: 'prepareExecute',\n ...params: Parameters<PrepareExecute>\n ): ReturnType<PrepareExecute>\n\n /**\n *\n */\n // tslint:disable-next-line:max-line-length\n public async request(\n method: 'prepareExecuteAndWait',\n ...params: Parameters<PrepareExecuteAndWait>\n ): ReturnType<PrepareExecuteAndWait>\n\n /**\n *\n */\n // tslint:disable-next-line:max-line-length\n public async request(\n method: 'signMessage',\n ...params: Parameters<SignMessage>\n ): ReturnType<SignMessage>\n\n /**\n *\n */\n // tslint:disable-next-line:max-line-length\n public async request(\n method: 'ledgerApi',\n ...params: Parameters<LedgerApi>\n ): ReturnType<LedgerApi>\n\n /**\n *\n */\n // tslint:disable-next-line:max-line-length\n public async request(\n method: 'accountsChanged',\n ...params: Parameters<AccountsChanged>\n ): ReturnType<AccountsChanged>\n\n /**\n *\n */\n // tslint:disable-next-line:max-line-length\n public async request(\n method: 'getPrimaryAccount',\n ...params: Parameters<GetPrimaryAccount>\n ): ReturnType<GetPrimaryAccount>\n\n /**\n *\n */\n // tslint:disable-next-line:max-line-length\n public async request(\n method: 'listAccounts',\n ...params: Parameters<ListAccounts>\n ): ReturnType<ListAccounts>\n\n /**\n *\n */\n // tslint:disable-next-line:max-line-length\n public async request(\n method: 'txChanged',\n ...params: Parameters<TxChanged>\n ): ReturnType<TxChanged>\n\n public async request(\n method: string,\n params?: RequestPayload['params']\n ): Promise<unknown> {\n const response = await this.transport.submit({ method, params })\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\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.
|
|
3
|
+
"version": "0.22.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "TypeScript client generated by OpenRPC",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -29,20 +29,20 @@
|
|
|
29
29
|
"access": "public"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@canton-network/core-rpc-transport": "^0.
|
|
33
|
-
"@canton-network/core-types": "^0.
|
|
34
|
-
"lodash": "^4.17.
|
|
32
|
+
"@canton-network/core-rpc-transport": "^0.4.0",
|
|
33
|
+
"@canton-network/core-types": "^0.18.0",
|
|
34
|
+
"lodash": "^4.17.23"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@types/isomorphic-fetch": "^0.0.39",
|
|
38
38
|
"@types/jest": "^30.0.0",
|
|
39
39
|
"@types/json-schema": "7.0.15",
|
|
40
|
-
"@types/lodash": "^4.17.
|
|
40
|
+
"@types/lodash": "^4.17.23",
|
|
41
41
|
"@types/ws": "^8.18.1",
|
|
42
42
|
"globals": "^16.5.0",
|
|
43
|
-
"prettier": "^3.
|
|
43
|
+
"prettier": "^3.8.1",
|
|
44
44
|
"tsup": "^8.5.1",
|
|
45
|
-
"typedoc": "^0.28.
|
|
45
|
+
"typedoc": "^0.28.16",
|
|
46
46
|
"typescript": "^5.9.3"
|
|
47
47
|
},
|
|
48
48
|
"repository": {
|