/** * API protocol definition. * * This is the core of the entire project: the definition of what methods * exist in the host-product API and what their argument/return types are. * * `hostApiProtocol` is the registry of all protocol methods with their * versioned SCALE codec pairs. Types are defined as SCALE codecs (not just * TypeScript types) so the wire format is the single source of truth. * TypeScript types are derived from the codecs via `CodecType<>`. * * `MessagePayload` and `Message` define the top-level wire envelope. * * The derived mapped types (`RequestMethod`, `RequestCodecType`, * `RequestParams`, `ResponseOk`, etc.) are used by both * facades and the transport layer for end-to-end type safety. */ import type { Codec, CodecType } from "scale-ts"; /** * All protocol methods with their versioned codec pairs. * * Request methods have `_request` and `_response` keys. * Subscription methods have `_start` and `_receive` keys * (`_stop` and `_interrupt` are inferred as `_void`). * * Each key is a versioned enum: `Enum({ v1: codec })`. * When adding a v2, extend the enum: `Enum({ v1: codec1, v2: codec2 })`. */ export declare const hostApiProtocol: { readonly host_handshake: { readonly _request: Codec<{ tag: "v1"; value: number; }>; readonly _response: Codec<{ tag: "v1"; value: import("scale-ts").ResultPayload; }>; }; readonly host_feature_supported: { readonly _request: Codec<{ tag: "v1"; value: { tag: "Chain"; value: `0x${string}`; }; }>; readonly _response: Codec<{ tag: "v1"; value: import("scale-ts").ResultPayload; }>; }; readonly host_push_notification: { readonly _request: Codec<{ tag: "v1"; value: { text: string; deeplink: string | undefined; }; }>; readonly _response: Codec<{ tag: "v1"; value: import("scale-ts").ResultPayload; }>; }; readonly host_navigate_to: { readonly _request: Codec<{ tag: "v1"; value: string; }>; readonly _response: Codec<{ tag: "v1"; value: import("scale-ts").ResultPayload; }>; }; readonly host_device_permission: { readonly _request: Codec<{ tag: "v1"; value: "Camera" | "Microphone" | "Bluetooth" | "Location"; }>; readonly _response: Codec<{ tag: "v1"; value: import("scale-ts").ResultPayload; }>; }; readonly remote_permission: { readonly _request: Codec<{ tag: "v1"; value: { tag: "ExternalRequest"; value: string; } | { tag: "TransactionSubmit"; value: undefined; }; }>; readonly _response: Codec<{ tag: "v1"; value: import("scale-ts").ResultPayload; }>; }; readonly host_local_storage_read: { readonly _request: Codec<{ tag: "v1"; value: string; }>; readonly _response: Codec<{ tag: "v1"; value: import("scale-ts").ResultPayload | undefined, { tag: "Unknown"; value: { reason: string; }; } | { tag: "Full"; value: undefined; }>; }>; }; readonly host_local_storage_write: { readonly _request: Codec<{ tag: "v1"; value: [string, Uint8Array]; }>; readonly _response: Codec<{ tag: "v1"; value: import("scale-ts").ResultPayload; }>; }; readonly host_local_storage_clear: { readonly _request: Codec<{ tag: "v1"; value: string; }>; readonly _response: Codec<{ tag: "v1"; value: import("scale-ts").ResultPayload; }>; }; readonly host_account_connection_status_subscribe: { readonly _start: Codec<{ tag: "v1"; value: undefined; }>; readonly _receive: Codec<{ tag: "v1"; value: "disconnected" | "connected"; }>; }; readonly host_account_get: { readonly _request: Codec<{ tag: "v1"; value: [string, number]; }>; readonly _response: Codec<{ tag: "v1"; value: import("scale-ts").ResultPayload<{ publicKey: Uint8Array; name: string | undefined; }, { tag: "NotConnected"; value: undefined; } | { tag: "Rejected"; value: undefined; } | { tag: "DomainNotValid"; value: undefined; } | { tag: "Unknown"; value: { reason: string; }; }>; }>; }; readonly host_account_get_alias: { readonly _request: Codec<{ tag: "v1"; value: [string, number]; }>; readonly _response: Codec<{ tag: "v1"; value: import("scale-ts").ResultPayload<{ context: Uint8Array; alias: Uint8Array; }, { tag: "NotConnected"; value: undefined; } | { tag: "Rejected"; value: undefined; } | { tag: "DomainNotValid"; value: undefined; } | { tag: "Unknown"; value: { reason: string; }; }>; }>; }; readonly host_account_create_proof: { readonly _request: Codec<{ tag: "v1"; value: [[string, number], { genesisHash: `0x${string}`; ringRootHash: `0x${string}`; hints: { palletInstance: number | undefined; } | undefined; }, Uint8Array]; }>; readonly _response: Codec<{ tag: "v1"; value: import("scale-ts").ResultPayload, { tag: "Rejected"; value: undefined; } | { tag: "Unknown"; value: { reason: string; }; } | { tag: "RingNotFound"; value: undefined; }>; }>; }; readonly host_get_non_product_accounts: { readonly _request: Codec<{ tag: "v1"; value: undefined; }>; readonly _response: Codec<{ tag: "v1"; value: import("scale-ts").ResultPayload<{ publicKey: Uint8Array; name: string | undefined; }[], { tag: "NotConnected"; value: undefined; } | { tag: "Rejected"; value: undefined; } | { tag: "DomainNotValid"; value: undefined; } | { tag: "Unknown"; value: { reason: string; }; }>; }>; }; readonly host_create_transaction: { readonly _request: Codec<{ tag: "v1"; value: [[string, number], { tag: "v1"; value: { signer: string | undefined; callData: `0x${string}`; extensions: { id: string; extra: `0x${string}`; additionalSigned: `0x${string}`; }[]; txExtVersion: number; context: { metadata: `0x${string}`; tokenSymbol: string; tokenDecimals: number; bestBlockHeight: number; }; }; }]; }>; readonly _response: Codec<{ tag: "v1"; value: import("scale-ts").ResultPayload<`0x${string}`, { tag: "Rejected"; value: undefined; } | { tag: "Unknown"; value: { reason: string; }; } | { tag: "FailedToDecode"; value: undefined; } | { tag: "PermissionDenied"; value: undefined; } | { tag: "NotSupported"; value: string; }>; }>; }; readonly host_create_transaction_with_non_product_account: { readonly _request: Codec<{ tag: "v1"; value: { tag: "v1"; value: { signer: string | undefined; callData: `0x${string}`; extensions: { id: string; extra: `0x${string}`; additionalSigned: `0x${string}`; }[]; txExtVersion: number; context: { metadata: `0x${string}`; tokenSymbol: string; tokenDecimals: number; bestBlockHeight: number; }; }; }; }>; readonly _response: Codec<{ tag: "v1"; value: import("scale-ts").ResultPayload<`0x${string}`, { tag: "Rejected"; value: undefined; } | { tag: "Unknown"; value: { reason: string; }; } | { tag: "FailedToDecode"; value: undefined; } | { tag: "PermissionDenied"; value: undefined; } | { tag: "NotSupported"; value: string; }>; }>; }; readonly host_sign_raw: { readonly _request: Codec<{ tag: "v1"; value: { address: string; data: { tag: "Bytes"; value: Uint8Array; } | { tag: "Payload"; value: string; }; }; }>; readonly _response: Codec<{ tag: "v1"; value: import("scale-ts").ResultPayload<{ signature: `0x${string}`; signedTransaction: `0x${string}` | undefined; }, { tag: "Rejected"; value: undefined; } | { tag: "Unknown"; value: { reason: string; }; } | { tag: "FailedToDecode"; value: undefined; } | { tag: "PermissionDenied"; value: undefined; }>; }>; }; readonly host_sign_payload: { readonly _request: Codec<{ tag: "v1"; value: { address: string; blockHash: `0x${string}`; blockNumber: `0x${string}`; era: `0x${string}`; genesisHash: `0x${string}`; method: `0x${string}`; nonce: `0x${string}`; specVersion: `0x${string}`; tip: `0x${string}`; transactionVersion: `0x${string}`; signedExtensions: string[]; version: number; assetId: `0x${string}` | undefined; metadataHash: `0x${string}` | undefined; mode: number | undefined; withSignedTransaction: boolean | undefined; }; }>; readonly _response: Codec<{ tag: "v1"; value: import("scale-ts").ResultPayload<{ signature: `0x${string}`; signedTransaction: `0x${string}` | undefined; }, { tag: "Rejected"; value: undefined; } | { tag: "Unknown"; value: { reason: string; }; } | { tag: "FailedToDecode"; value: undefined; } | { tag: "PermissionDenied"; value: undefined; }>; }>; }; readonly host_chat_create_room: { readonly _request: Codec<{ tag: "v1"; value: { roomId: string; name: string; icon: string; }; }>; readonly _response: Codec<{ tag: "v1"; value: import("scale-ts").ResultPayload<{ status: "New" | "Exists"; }, { tag: "Unknown"; value: { reason: string; }; } | { tag: "PermissionDenied"; value: undefined; }>; }>; }; readonly host_chat_register_bot: { readonly _request: Codec<{ tag: "v1"; value: { botId: string; name: string; icon: string; }; }>; readonly _response: Codec<{ tag: "v1"; value: import("scale-ts").ResultPayload<{ status: "New" | "Exists"; }, { tag: "Unknown"; value: { reason: string; }; } | { tag: "PermissionDenied"; value: undefined; }>; }>; }; readonly host_chat_list_subscribe: { readonly _start: Codec<{ tag: "v1"; value: undefined; }>; readonly _receive: Codec<{ tag: "v1"; value: { roomId: string; participatingAs: "RoomHost" | "Bot"; }[]; }>; }; readonly host_chat_post_message: { readonly _request: Codec<{ tag: "v1"; value: { roomId: string; payload: { tag: "Text"; value: string; } | { tag: "RichText"; value: { text: string | undefined; media: { url: string; }[]; }; } | { tag: "Actions"; value: { text: string | undefined; actions: { actionId: string; title: string; }[]; layout: "Column" | "Grid"; }; } | { tag: "File"; value: { url: string; fileName: string; mimeType: string; sizeBytes: bigint; text: string | undefined; }; } | { tag: "Reaction"; value: { messageId: string; emoji: string; }; } | { tag: "ReactionRemoved"; value: { messageId: string; emoji: string; }; } | { tag: "Custom"; value: { messageType: string; payload: Uint8Array; }; }; }; }>; readonly _response: Codec<{ tag: "v1"; value: import("scale-ts").ResultPayload<{ messageId: string; }, { tag: "Unknown"; value: { reason: string; }; } | { tag: "MessageTooLarge"; value: undefined; }>; }>; }; readonly host_chat_action_subscribe: { readonly _start: Codec<{ tag: "v1"; value: undefined; }>; readonly _receive: Codec<{ tag: "v1"; value: { roomId: string; peer: string; payload: { tag: "MessagePosted"; value: { tag: "Text"; value: string; } | { tag: "RichText"; value: { text: string | undefined; media: { url: string; }[]; }; } | { tag: "Actions"; value: { text: string | undefined; actions: { actionId: string; title: string; }[]; layout: "Column" | "Grid"; }; } | { tag: "File"; value: { url: string; fileName: string; mimeType: string; sizeBytes: bigint; text: string | undefined; }; } | { tag: "Reaction"; value: { messageId: string; emoji: string; }; } | { tag: "ReactionRemoved"; value: { messageId: string; emoji: string; }; } | { tag: "Custom"; value: { messageType: string; payload: Uint8Array; }; }; } | { tag: "ActionTriggered"; value: { messageId: string; actionId: string; payload: Uint8Array | undefined; }; } | { tag: "Command"; value: { command: string; payload: string; }; }; }; }>; }; readonly product_chat_custom_message_render_subscribe: { readonly _start: Codec<{ tag: "v1"; value: { messageId: string; messageType: string; payload: Uint8Array; }; }>; readonly _receive: Codec<{ tag: "v1"; value: import("./types.js").CustomRendererNode; }>; }; readonly remote_statement_store_subscribe: { readonly _start: Codec<{ tag: "v1"; value: Uint8Array[]; }>; readonly _receive: Codec<{ tag: "v1"; value: { proof: { tag: "Sr25519"; value: { signature: Uint8Array; signer: Uint8Array; }; } | { tag: "Ed25519"; value: { signature: Uint8Array; signer: Uint8Array; }; } | { tag: "Ecdsa"; value: { signature: Uint8Array; signer: Uint8Array; }; } | { tag: "OnChain"; value: { who: Uint8Array; blockHash: Uint8Array; event: bigint; }; }; decryptionKey: Uint8Array | undefined; expiry: bigint | undefined; channel: Uint8Array | undefined; topics: Uint8Array[]; data: Uint8Array | undefined; }[]; }>; }; readonly remote_statement_store_create_proof: { readonly _request: Codec<{ tag: "v1"; value: [[string, number], { proof: { tag: "Sr25519"; value: { signature: Uint8Array; signer: Uint8Array; }; } | { tag: "Ed25519"; value: { signature: Uint8Array; signer: Uint8Array; }; } | { tag: "Ecdsa"; value: { signature: Uint8Array; signer: Uint8Array; }; } | { tag: "OnChain"; value: { who: Uint8Array; blockHash: Uint8Array; event: bigint; }; } | undefined; decryptionKey: Uint8Array | undefined; expiry: bigint | undefined; channel: Uint8Array | undefined; topics: Uint8Array[]; data: Uint8Array | undefined; }]; }>; readonly _response: Codec<{ tag: "v1"; value: import("scale-ts").ResultPayload<{ tag: "Sr25519"; value: { signature: Uint8Array; signer: Uint8Array; }; } | { tag: "Ed25519"; value: { signature: Uint8Array; signer: Uint8Array; }; } | { tag: "Ecdsa"; value: { signature: Uint8Array; signer: Uint8Array; }; } | { tag: "OnChain"; value: { who: Uint8Array; blockHash: Uint8Array; event: bigint; }; }, { tag: "Unknown"; value: { reason: string; }; } | { tag: "UnableToSign"; value: undefined; } | { tag: "UnknownAccount"; value: undefined; }>; }>; }; readonly remote_statement_store_submit: { readonly _request: Codec<{ tag: "v1"; value: { proof: { tag: "Sr25519"; value: { signature: Uint8Array; signer: Uint8Array; }; } | { tag: "Ed25519"; value: { signature: Uint8Array; signer: Uint8Array; }; } | { tag: "Ecdsa"; value: { signature: Uint8Array; signer: Uint8Array; }; } | { tag: "OnChain"; value: { who: Uint8Array; blockHash: Uint8Array; event: bigint; }; }; decryptionKey: Uint8Array | undefined; expiry: bigint | undefined; channel: Uint8Array | undefined; topics: Uint8Array[]; data: Uint8Array | undefined; }; }>; readonly _response: Codec<{ tag: "v1"; value: import("scale-ts").ResultPayload; }>; }; readonly remote_preimage_lookup_subscribe: { readonly _start: Codec<{ tag: "v1"; value: `0x${string}`; }>; readonly _receive: Codec<{ tag: "v1"; value: Uint8Array | undefined; }>; }; readonly remote_preimage_submit: { readonly _request: Codec<{ tag: "v1"; value: Uint8Array; }>; readonly _response: Codec<{ tag: "v1"; value: import("scale-ts").ResultPayload<`0x${string}`, { tag: "Unknown"; value: { reason: string; }; }>; }>; }; readonly host_jsonrpc_message_send: { readonly _request: Codec<{ tag: "v1"; value: [`0x${string}`, string]; }>; readonly _response: Codec<{ tag: "v1"; value: import("scale-ts").ResultPayload; }>; }; readonly host_jsonrpc_message_subscribe: { readonly _start: Codec<{ tag: "v1"; value: `0x${string}`; }>; readonly _receive: Codec<{ tag: "v1"; value: string; }>; }; readonly remote_chain_head_follow: { readonly _start: Codec<{ tag: "v1"; value: { genesisHash: `0x${string}`; withRuntime: boolean; }; }>; readonly _receive: Codec<{ tag: "v1"; value: { tag: "Initialized"; value: { finalizedBlockHashes: `0x${string}`[]; finalizedBlockRuntime: { tag: "Valid"; value: { specName: string; implName: string; specVersion: number; implVersion: number; transactionVersion: number | undefined; apis: [string, number][]; }; } | { tag: "Invalid"; value: { error: string; }; } | undefined; }; } | { tag: "NewBlock"; value: { blockHash: `0x${string}`; parentBlockHash: `0x${string}`; newRuntime: { tag: "Valid"; value: { specName: string; implName: string; specVersion: number; implVersion: number; transactionVersion: number | undefined; apis: [string, number][]; }; } | { tag: "Invalid"; value: { error: string; }; } | undefined; }; } | { tag: "BestBlockChanged"; value: { bestBlockHash: `0x${string}`; }; } | { tag: "Finalized"; value: { finalizedBlockHashes: `0x${string}`[]; prunedBlockHashes: `0x${string}`[]; }; } | { tag: "OperationBodyDone"; value: { operationId: string; value: `0x${string}`[]; }; } | { tag: "OperationCallDone"; value: { operationId: string; output: `0x${string}`; }; } | { tag: "OperationStorageItems"; value: { operationId: string; items: { key: `0x${string}`; value: `0x${string}` | undefined; hash: `0x${string}` | undefined; closestDescendantMerkleValue: `0x${string}` | undefined; }[]; }; } | { tag: "OperationStorageDone"; value: { operationId: string; }; } | { tag: "OperationWaitingForContinue"; value: { operationId: string; }; } | { tag: "OperationInaccessible"; value: { operationId: string; }; } | { tag: "OperationError"; value: { operationId: string; error: string; }; } | { tag: "Stop"; value: undefined; }; }>; }; readonly remote_chain_head_header: { readonly _request: Codec<{ tag: "v1"; value: { genesisHash: `0x${string}`; followSubscriptionId: string; hash: `0x${string}`; }; }>; readonly _response: Codec<{ tag: "v1"; value: import("scale-ts").ResultPayload<`0x${string}` | undefined, { reason: string; }>; }>; }; readonly remote_chain_head_body: { readonly _request: Codec<{ tag: "v1"; value: { genesisHash: `0x${string}`; followSubscriptionId: string; hash: `0x${string}`; }; }>; readonly _response: Codec<{ tag: "v1"; value: import("scale-ts").ResultPayload<{ tag: "Started"; value: { operationId: string; }; } | { tag: "LimitReached"; value: undefined; }, { reason: string; }>; }>; }; readonly remote_chain_head_storage: { readonly _request: Codec<{ tag: "v1"; value: { genesisHash: `0x${string}`; followSubscriptionId: string; hash: `0x${string}`; items: { key: `0x${string}`; type: "Value" | "Hash" | "ClosestDescendantMerkleValue" | "DescendantsValues" | "DescendantsHashes"; }[]; childTrie: `0x${string}` | undefined; }; }>; readonly _response: Codec<{ tag: "v1"; value: import("scale-ts").ResultPayload<{ tag: "Started"; value: { operationId: string; }; } | { tag: "LimitReached"; value: undefined; }, { reason: string; }>; }>; }; readonly remote_chain_head_call: { readonly _request: Codec<{ tag: "v1"; value: { genesisHash: `0x${string}`; followSubscriptionId: string; hash: `0x${string}`; function: string; callParameters: `0x${string}`; }; }>; readonly _response: Codec<{ tag: "v1"; value: import("scale-ts").ResultPayload<{ tag: "Started"; value: { operationId: string; }; } | { tag: "LimitReached"; value: undefined; }, { reason: string; }>; }>; }; readonly remote_chain_head_unpin: { readonly _request: Codec<{ tag: "v1"; value: { genesisHash: `0x${string}`; followSubscriptionId: string; hashes: `0x${string}`[]; }; }>; readonly _response: Codec<{ tag: "v1"; value: import("scale-ts").ResultPayload; }>; }; readonly remote_chain_head_continue: { readonly _request: Codec<{ tag: "v1"; value: { genesisHash: `0x${string}`; followSubscriptionId: string; operationId: string; }; }>; readonly _response: Codec<{ tag: "v1"; value: import("scale-ts").ResultPayload; }>; }; readonly remote_chain_head_stop_operation: { readonly _request: Codec<{ tag: "v1"; value: { genesisHash: `0x${string}`; followSubscriptionId: string; operationId: string; }; }>; readonly _response: Codec<{ tag: "v1"; value: import("scale-ts").ResultPayload; }>; }; readonly remote_chain_spec_genesis_hash: { readonly _request: Codec<{ tag: "v1"; value: `0x${string}`; }>; readonly _response: Codec<{ tag: "v1"; value: import("scale-ts").ResultPayload<`0x${string}`, { reason: string; }>; }>; }; readonly remote_chain_spec_chain_name: { readonly _request: Codec<{ tag: "v1"; value: `0x${string}`; }>; readonly _response: Codec<{ tag: "v1"; value: import("scale-ts").ResultPayload; }>; }; readonly remote_chain_spec_properties: { readonly _request: Codec<{ tag: "v1"; value: `0x${string}`; }>; readonly _response: Codec<{ tag: "v1"; value: import("scale-ts").ResultPayload; }>; }; readonly remote_chain_transaction_broadcast: { readonly _request: Codec<{ tag: "v1"; value: { genesisHash: `0x${string}`; transaction: `0x${string}`; }; }>; readonly _response: Codec<{ tag: "v1"; value: import("scale-ts").ResultPayload; }>; }; readonly remote_chain_transaction_stop: { readonly _request: Codec<{ tag: "v1"; value: { genesisHash: `0x${string}`; operationId: string; }; }>; readonly _response: Codec<{ tag: "v1"; value: import("scale-ts").ResultPayload; }>; }; readonly host_payment_balance_subscribe: { readonly _start: Codec<{ tag: "v1"; value: undefined; }>; readonly _receive: Codec<{ tag: "v1"; value: { available: { currency: string; minorUnits: string; }; pending: { currency: string; minorUnits: string; }; }; }>; }; readonly host_payment_top_up: { readonly _request: Codec<{ tag: "v1"; value: { amount: { currency: string; minorUnits: string; }; source: { tag: "ProductAccount"; value: { account: [string, number]; }; } | { tag: "OneTimePrivateKey"; value: { privateKey: Uint8Array; }; }; }; }>; readonly _response: Codec<{ tag: "v1"; value: import("scale-ts").ResultPayload; }>; }; readonly host_payment_request: { readonly _request: Codec<{ tag: "v1"; value: { amount: { currency: string; minorUnits: string; }; recipient: string; memo: string | undefined; }; }>; readonly _response: Codec<{ tag: "v1"; value: import("scale-ts").ResultPayload<{ id: string; }, { reason: string; }>; }>; }; readonly host_payment_status_subscribe: { readonly _start: Codec<{ tag: "v1"; value: string; }>; readonly _receive: Codec<{ tag: "v1"; value: { tag: "Processing"; value: undefined; } | { tag: "Completed"; value: undefined; } | { tag: "Failed"; value: { reason: string; }; }; }>; }; readonly host_codec_upgrade: { readonly _request: Codec<{ tag: "v1"; value: { supportedFormats: string[]; }; }>; readonly _response: Codec<{ tag: "v1"; value: { selectedFormat: string; }; }>; }; }; type Protocol = typeof hostApiProtocol; /** Union of all request method names (entries with `_request` / `_response`). */ export type RequestMethod = { [K in keyof Protocol]: "_request" extends keyof Protocol[K] ? K : never; }[keyof Protocol]; /** Union of all subscription method names (entries with `_start` / `_receive`). */ export type SubscriptionMethod = { [K in keyof Protocol]: "_start" extends keyof Protocol[K] ? K : never; }[keyof Protocol]; /** Action string suffixes for request methods. */ type RequestSuffix = "request" | "response"; /** Action string suffixes for subscription methods. */ type SubscriptionSuffix = "start" | "receive" | "stop" | "interrupt"; /** Union of all valid action strings on the wire. */ export type ActionString = `${RequestMethod}_${RequestSuffix}` | `${SubscriptionMethod}_${SubscriptionSuffix}`; /** Full decoded type of a request method's _request codec (versioned envelope). */ export type RequestCodecType = CodecType; /** Full decoded type of a request method's _response codec (versioned envelope). */ export type ResponseCodecType = CodecType; /** Full decoded type of a subscription method's _start codec (versioned envelope). */ export type StartCodecType = CodecType; /** Full decoded type of a subscription method's _receive codec (versioned envelope). */ export type ReceiveCodecType = CodecType; /** Available version tags for a request method's _request codec. */ export type RequestVersions = RequestCodecType["tag"]; /** Available version tags for a request method's _response codec. */ export type ResponseVersions = ResponseCodecType["tag"]; /** Available version tags for a subscription method's _start codec. */ export type StartVersions = StartCodecType["tag"]; /** Available version tags for a subscription method's _receive codec. */ export type ReceiveVersions = ReceiveCodecType["tag"]; /** Extract the inner value type for a specific version tag from a versioned enum type. */ type VersionValue = Extract extends { value: infer U; } ? U : never; /** Request params type for method M at version V. */ export type RequestParams = VersionValue, V>; /** The full Result type for method M's response at version V. */ type ResponseResultType = VersionValue, V>; /** Ok type from a request method's response Result at version V. */ export type ResponseOk = Extract, { success: true; }> extends { value: infer U; } ? U : never; /** Err type from a request method's response Result at version V. */ export type ResponseErr = Extract, { success: false; }> extends { value: infer U; } ? U : never; /** Subscription start params type for method M at version V. */ export type SubscriptionParams = VersionValue, V>; /** Subscription receive payload type for method M at version V. */ export type SubscriptionPayload = VersionValue, V>; export declare const MessagePayload: Codec<{ tag: string; value: unknown; }>; export declare const Message: Codec<{ requestId: string; payload: { tag: string; value: unknown; }; }>; export {}; //# sourceMappingURL=protocol.d.ts.map