@canton-network/core-wallet-dapp-rpc-client 0.19.1 → 0.20.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 +21 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;AA+fO,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,EA4FA,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 * 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 [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 PrepareExecuteResult {\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 = (\n params: PrepareExecuteParams\n) => Promise<PrepareExecuteResult>\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: '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":";;;;;;;;;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"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -301,6 +301,18 @@ export type ExternalTxId = string;
|
|
|
301
301
|
*
|
|
302
302
|
*/
|
|
303
303
|
export type TopologyTransactions = string;
|
|
304
|
+
/**
|
|
305
|
+
*
|
|
306
|
+
* 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.
|
|
307
|
+
*
|
|
308
|
+
*/
|
|
309
|
+
export type Disabled = boolean;
|
|
310
|
+
/**
|
|
311
|
+
*
|
|
312
|
+
* Reason for the wallet state, e.g., 'no signing provider matched'.
|
|
313
|
+
*
|
|
314
|
+
*/
|
|
315
|
+
export type Reason = string;
|
|
304
316
|
/**
|
|
305
317
|
*
|
|
306
318
|
* Structure representing a wallet
|
|
@@ -317,6 +329,8 @@ export interface Wallet {
|
|
|
317
329
|
signingProviderId: SigningProviderId;
|
|
318
330
|
externalTxId?: ExternalTxId;
|
|
319
331
|
topologyTransactions?: TopologyTransactions;
|
|
332
|
+
disabled?: Disabled;
|
|
333
|
+
reason?: Reason;
|
|
320
334
|
[k: string]: any;
|
|
321
335
|
}
|
|
322
336
|
/**
|
|
@@ -448,7 +462,7 @@ export interface DarsAvailableResult {
|
|
|
448
462
|
[k: string]: any;
|
|
449
463
|
}
|
|
450
464
|
export type PrepareReturnResult = any;
|
|
451
|
-
export interface
|
|
465
|
+
export interface PrepareExecuteAndWaitResult {
|
|
452
466
|
tx: TxChangedExecutedEvent;
|
|
453
467
|
[k: string]: any;
|
|
454
468
|
}
|
|
@@ -489,7 +503,8 @@ export type Connect = () => Promise<StatusEvent>;
|
|
|
489
503
|
export type Disconnect = () => Promise<Null>;
|
|
490
504
|
export type DarsAvailable = () => Promise<DarsAvailableResult>;
|
|
491
505
|
export type PrepareReturn = (params: PrepareReturnParams) => Promise<PrepareReturnResult>;
|
|
492
|
-
export type PrepareExecute = (params: PrepareExecuteParams) => Promise<
|
|
506
|
+
export type PrepareExecute = (params: PrepareExecuteParams) => Promise<Null>;
|
|
507
|
+
export type PrepareExecuteAndWait = (params: PrepareExecuteParams) => Promise<PrepareExecuteAndWaitResult>;
|
|
493
508
|
export type LedgerApi = (params: LedgerApiParams) => Promise<LedgerApiResult>;
|
|
494
509
|
export type OnAccountsChanged = () => Promise<AccountsChangedEvent>;
|
|
495
510
|
export type RequestAccounts = () => Promise<RequestAccountsResult>;
|
|
@@ -521,6 +536,10 @@ export declare class SpliceWalletJSONRPCDAppAPI {
|
|
|
521
536
|
*
|
|
522
537
|
*/
|
|
523
538
|
request(method: 'prepareExecute', ...params: Parameters<PrepareExecute>): ReturnType<PrepareExecute>;
|
|
539
|
+
/**
|
|
540
|
+
*
|
|
541
|
+
*/
|
|
542
|
+
request(method: 'prepareExecuteAndWait', ...params: Parameters<PrepareExecuteAndWait>): ReturnType<PrepareExecuteAndWait>;
|
|
524
543
|
/**
|
|
525
544
|
*
|
|
526
545
|
*/
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":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;OAEG;IAEU,OAAO,CAChB,MAAM,EAAE,aAAa,EACrB,GAAG,MAAM,EAAE,UAAU,CAAC,WAAW,CAAC,GACnC,UAAU,CAAC,WAAW,CAAC;CAmB7B;AACD,eAAe,0BAA0B,CAAA"}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;AA+fO,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,EA4FA,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[]\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 * 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 [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 PrepareExecuteResult {\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 = (\n params: PrepareExecuteParams\n) => Promise<PrepareExecuteResult>\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: '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":";;;;;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.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"]}
|
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.20.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.2.
|
|
33
|
-
"@canton-network/core-types": "^0.16.
|
|
32
|
+
"@canton-network/core-rpc-transport": "^0.2.2",
|
|
33
|
+
"@canton-network/core-types": "^0.16.1",
|
|
34
34
|
"lodash": "^4.17.21"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|