Package-level declarations

Types

Link copied to clipboard
data class ConnectResult(val isConnected: Boolean, val isNetworkConnected: Boolean, val reason: String? = null, val networkReason: String? = null, val userUrl: String? = null)
Link copied to clipboard
class DappClient(transport: DappTransport)

The dApp side of CIP-0103: typed calls onto a DappTransport.

Link copied to clipboard

The error codes CIP-0103 inherits from EIP-1474 / EIP-1193.

Link copied to clipboard
sealed interface DappEvent

An event pushed from wallet to dApp, as a JSON-RPC notification.

Link copied to clipboard
class DappException(val errorCode: DappErrorCode, message: String, val data: JsonElement? = null, cause: Throwable? = null) : RuntimeException

A CIP-0103 error, thrown by DappClient when the wallet returns one and by the wallet-side engine to produce one.

Link copied to clipboard
object DappJson

Wire codec for the CIP-0103 types, written against OpenRPC 0.5.0.

Link copied to clipboard

Every method in OpenRPC 0.5.0, request and event alike.

Link copied to clipboard
data class DappNetwork(val networkId: String, val ledgerApi: String? = null, val accessToken: String? = null)

OpenRPC Network. networkId is a CAIP-2 identifier, e.g. canton:da-mainnet.

Link copied to clipboard
data class DappProvider(val id: String, val version: String? = null, val providerType: DappProviderType? = null, val url: String? = null, val userUrl: String? = null)

The wallet, as advertised to a dApp. OpenRPC Provider.

Link copied to clipboard

Where the wallet kernel runs. OpenRPC Provider.providerType; wire is the JSON spelling.

Link copied to clipboard
data class DappRequestContext(val expiresAt: Instant? = null)

What a transport knows about an inbound request beyond the frame itself.

Link copied to clipboard

The wallet-side counterpart of DappTransport: something that answers JSON-RPC frames and emits events.

Link copied to clipboard
data class DappSessionInfo(val accessToken: String, val userId: String)

OpenRPC Session. Named …Info here because DappSession is the wallet-side engine in :canton-dapp-wallet, and one of the two had to give way.

Link copied to clipboard

The exact bytes a signMessage request signs — and the reason they are not simply the message's bytes.

Link copied to clipboard
data class DappStatus(val provider: DappProvider, val connection: ConnectResult, val network: DappNetwork? = null, val session: DappSessionInfo? = null)

Result of DappMethod.STATUS. OpenRPC StatusEvent.

Link copied to clipboard
interface DappTransport

Moves JSON-RPC frames between a dApp and a wallet.

Link copied to clipboard
data class DappWallet(val primary: Boolean, val partyId: String, val status: DappWalletStatus, val hint: String, val publicKey: String, val namespace: String, val networkId: String, val signingProviderId: String, val externalTxId: String? = null, val topologyTransactions: String? = null, val disabled: Boolean? = null, val reason: String? = null)

One account. OpenRPC calls this Wallet, which is confusing in a codebase where "wallet" is the application — but the wire name is what it is, and renaming the type would not rename the JSON.

Link copied to clipboard

Where an account is in its lifecycle. OpenRPC Wallet.status; wire is the JSON spelling.

Link copied to clipboard
data class JsonRpcErrorBody(val code: Int, val message: String, val data: JsonElement? = null)

The error member of a JSON-RPC response.

Link copied to clipboard
data class JsonRpcRequest(val method: String, val params: JsonElement? = null, val id: JsonElement? = null)

A JSON-RPC 2.0 request or notification.

Link copied to clipboard
data class JsonRpcResponse(val id: JsonElement?, val result: JsonElement? = null, val error: JsonRpcErrorBody? = null)

A JSON-RPC 2.0 response. Exactly one of result and error is set; ok and failed are the honest way to ask which.

Link copied to clipboard

HTTP method of a proxied LedgerApiRequest. wire is the lowercase JSON spelling.

Link copied to clipboard
data class LedgerApiRequest(val requestMethod: LedgerApiMethod, val resource: String, val body: JsonElement? = null, val query: JsonObject? = null, val path: JsonObject? = null)

Params of DappMethod.LEDGER_API — the wallet acting as an authenticating proxy onto the JSON Ledger API.

Link copied to clipboard
sealed interface MessageSignatureEvent

Lifecycle of one signMessage request, as delivered by messageSignature.

Link copied to clipboard
data class PrepareSubmission(val commands: JsonArray, val commandId: String? = null, val actAs: List<String> = emptyList(), val readAs: List<String> = emptyList(), val disclosedContracts: JsonArray? = null, val synchronizerId: String? = null, val packageIdSelectionPreference: List<String> = emptyList())

Params of DappMethod.PREPARE_EXECUTE and DappMethod.PREPARE_EXECUTE_AND_WAIT. OpenRPC JsPrepareSubmissionRequest.

Link copied to clipboard
data class PrepareSubmissionResult(val preparedTransaction: String? = null, val preparedTransactionHash: String? = null)

OpenRPC JsPrepareSubmissionResponse. Both fields are optional in the CIP and both are strings — preparedTransaction is base64 of the serialized PreparedTransaction protobuf, which is what lets a wallet recompute the hash over the exact bytes the participant produced.

Link copied to clipboard
data class SignMessageRequest(val message: String)
Link copied to clipboard
data class SignMessageResult(val signature: String)
Link copied to clipboard
sealed interface TxChangedEvent

Lifecycle of one submission, as delivered by the txChanged event and returned (in its executed form) by prepareExecuteAndWait.

Properties

Link copied to clipboard

The only value of the jsonrpc member this protocol accepts.