import type { AccountCreateProofErrorKind, AccountRequestCredentialsErrorKind, HostApiOutcome, PaymentBalance, PaymentStatus } from "./types.js"; import type { HostSdkRuntime } from "./sdk-interfaces.js"; export interface HostApiAccount { public_key: Uint8Array; name?: string | null; } export interface HostRuntimeSession { readonly productId: string; handleMessage(raw: Uint8Array): HostApiOutcome; reset(): void; forgetRequest(requestId: string): void; isFollowRequest(requestId: string): boolean; encodeSignResponse(requestId: string, requestTag: number, signature: Uint8Array): Uint8Array; encodeSignError(requestId: string, requestTag: number): Uint8Array; encodeAccountGetResponse(requestId: string, publicKey: Uint8Array, name?: string | null): Uint8Array; encodeAccountGetError(requestId: string, errorKind: AccountRequestCredentialsErrorKind, reason?: string | null): Uint8Array; encodeAccountGetAliasResponse(requestId: string, context: Uint8Array, alias: Uint8Array): Uint8Array; encodeAccountGetAliasError(requestId: string, errorKind: AccountRequestCredentialsErrorKind, reason?: string | null): Uint8Array; encodeAccountCreateProofResponse(requestId: string, proof: Uint8Array): Uint8Array; encodeAccountCreateProofError(requestId: string, errorKind: AccountCreateProofErrorKind, reason?: string | null): Uint8Array; encodeDevicePermissionResponse(requestId: string, granted: boolean): Uint8Array; encodeDevicePermissionError(requestId: string): Uint8Array; encodeRemotePermissionResponse(requestId: string, granted: boolean): Uint8Array; encodeRemotePermissionError(requestId: string): Uint8Array; encodeCreateTransactionResponse(requestId: string, signedTxBytes: Uint8Array): Uint8Array; encodeCreateTransactionError(requestId: string): Uint8Array; encodeCreateTxNonProductResponse(requestId: string, signedTxBytes: Uint8Array): Uint8Array; encodeCreateTxNonProductError(requestId: string): Uint8Array; encodePaymentBalance(requestId: string, balance: PaymentBalance): Uint8Array; encodePaymentBalanceInterrupt(requestId: string): Uint8Array; encodePaymentTopUpResponse(requestId: string): Uint8Array; encodePaymentTopUpError(requestId: string, reason: string): Uint8Array; encodePaymentRequestResponse(requestId: string, receiptId: string): Uint8Array; encodePaymentRequestError(requestId: string, reason: string): Uint8Array; encodePaymentStatus(requestId: string, status: PaymentStatus): Uint8Array; encodePaymentStatusInterrupt(requestId: string): Uint8Array; encodeChainQueryResponse(requestId: string, jsonRpcResult: string): Uint8Array; encodeChainQueryError(requestId: string): Uint8Array; encodeChainRpcResponse(requestId: string, requestTag: number, jsonRpcMessage: string): Uint8Array; encodeChainRpcError(requestId: string, requestTag: number, reason: string): Uint8Array; encodeNavigateResponse(requestId: string): Uint8Array; encodePushNotificationResponse(requestId: string): Uint8Array; encodeChainFollowStop(requestId: string): Uint8Array; encodeChainNotification(requestId: string, jsonRpcMessage: string): Uint8Array | null; encodeStorageReadResponse(requestId: string, value: Uint8Array | null): Uint8Array; encodeStorageWriteResponse(requestId: string): Uint8Array; encodeStorageClearResponse(requestId: string): Uint8Array; } /** * Shared host-side runtime for product integrations. * * One `HostRuntime` can serve many product sessions at once while keeping * per-product follow/subscription bookkeeping isolated in `HostRuntimeSession`. * The current transport remains the SCALE Host API; this class only * centralizes host-owned state and response encoding. */ export declare class HostRuntime { private readonly sdk; private readonly sessions; constructor(sdk: HostSdkRuntime); setAccounts(accounts: readonly HostApiAccount[]): void; clearAccounts(): void; setSupportedChains(chains: readonly Uint8Array[]): void; session(productId: string): HostRuntimeSession; destroySession(productId: string): void; reset(): void; handleMessage(raw: Uint8Array, appId: string): HostApiOutcome; encodeSignResponse(requestId: string, requestTag: number, signature: Uint8Array): Uint8Array; encodeSignError(requestId: string, requestTag: number): Uint8Array; encodeAccountGetResponse(requestId: string, publicKey: Uint8Array, name?: string | null): Uint8Array; encodeAccountGetError(requestId: string, errorKind: AccountRequestCredentialsErrorKind, reason?: string | null): Uint8Array; encodeAccountGetAliasResponse(requestId: string, context: Uint8Array, alias: Uint8Array): Uint8Array; encodeAccountGetAliasError(requestId: string, errorKind: AccountRequestCredentialsErrorKind, reason?: string | null): Uint8Array; encodeAccountCreateProofResponse(requestId: string, proof: Uint8Array): Uint8Array; encodeAccountCreateProofError(requestId: string, errorKind: AccountCreateProofErrorKind, reason?: string | null): Uint8Array; encodeDevicePermissionResponse(requestId: string, granted: boolean): Uint8Array; encodeDevicePermissionError(requestId: string): Uint8Array; encodeRemotePermissionResponse(requestId: string, granted: boolean): Uint8Array; encodeRemotePermissionError(requestId: string): Uint8Array; encodeCreateTransactionResponse(requestId: string, signedTxBytes: Uint8Array): Uint8Array; encodeCreateTransactionError(requestId: string): Uint8Array; encodeCreateTxNonProductResponse(requestId: string, signedTxBytes: Uint8Array): Uint8Array; encodeCreateTxNonProductError(requestId: string): Uint8Array; encodePaymentBalance(requestId: string, balance: PaymentBalance): Uint8Array; encodePaymentBalanceInterrupt(requestId: string): Uint8Array; encodePaymentTopUpResponse(requestId: string): Uint8Array; encodePaymentTopUpError(requestId: string, reason: string): Uint8Array; encodePaymentRequestResponse(requestId: string, receiptId: string): Uint8Array; encodePaymentRequestError(requestId: string, reason: string): Uint8Array; encodePaymentStatus(requestId: string, status: PaymentStatus): Uint8Array; encodePaymentStatusInterrupt(requestId: string): Uint8Array; encodeChainQueryResponse(requestId: string, jsonRpcResult: string): Uint8Array; encodeChainQueryError(requestId: string): Uint8Array; encodeChainSubNotification(requestId: string, jsonRpcMessage: string): Uint8Array; encodeChainFollowEvent(requestId: string, jsonRpcMessage: string): Uint8Array; encodeChainFollowStop(requestId: string): Uint8Array; encodeChainRpcResponse(requestId: string, requestTag: number, jsonRpcMessage: string): Uint8Array; encodeChainRpcError(requestId: string, requestTag: number, reason: string): Uint8Array; encodeNavigateResponse(requestId: string): Uint8Array; encodeStorageReadResponse(requestId: string, value: Uint8Array | null): Uint8Array; encodeStorageWriteResponse(requestId: string): Uint8Array; encodeStorageClearResponse(requestId: string): Uint8Array; encodePushNotificationResponse(requestId: string): Uint8Array; findSessionForFollowRequest(requestId: string): HostRuntimeSession | undefined; } //# sourceMappingURL=host-runtime.d.ts.map