/** * Discriminated union for HostApi message processing outcomes. * * Returned by {@link HostSdk.handleMessage}. Use the `type` field to * narrow the variant and access its fields with full type safety. */ export interface OutcomeResponse { type: "Response"; data: Uint8Array; } export interface OutcomeNeedsSign { type: "NeedsSign"; request_id: string; request_tag: number; public_key: Uint8Array; payload: Uint8Array; } export interface OutcomeNeedsChainQuery { type: "NeedsChainQuery"; request_id: string; method: string; params: unknown; } export interface OutcomeNeedsChainSubscription { type: "NeedsChainSubscription"; request_id: string; method: string; params: unknown; } export interface OutcomeNeedsNavigate { type: "NeedsNavigate"; request_id: string; url: string; } export interface OutcomeNeedsPushNotification { type: "NeedsPushNotification"; request_id: string; text: string; deeplink: string | null; } export interface OutcomeNeedsChainFollow { type: "NeedsChainFollow"; request_id: string; genesis_hash: Uint8Array; with_runtime: boolean; } export interface OutcomeNeedsChainRpc { type: "NeedsChainRpc"; request_id: string; request_tag: number; genesis_hash: Uint8Array; json_rpc_method: string; json_rpc_params: unknown; follow_sub_id: string | null; } export interface OutcomeNeedsStorageRead { type: "NeedsStorageRead"; request_id: string; key: string; } export interface OutcomeNeedsStorageWrite { type: "NeedsStorageWrite"; request_id: string; key: string; value: Uint8Array; } export interface OutcomeNeedsStorageClear { type: "NeedsStorageClear"; request_id: string; key: string; } export interface PaymentAmount { currency: string; minor_units: string; } export interface PaymentBalance { available: PaymentAmount; pending: PaymentAmount; } export type PaymentTopUpSource = { type: "ProductAccount"; account: ProductAccountId; } | { type: "OneTimePrivateKey"; private_key: Uint8Array; }; export interface PaymentTopUpRequest { amount: PaymentAmount; source: PaymentTopUpSource; } export interface PaymentRequest { amount: PaymentAmount; recipient: string; memo: string | null; } export interface PaymentReceipt { id: string; } export type PaymentStatus = { type: "Processing"; } | { type: "Completed"; } | { type: "Failed"; reason: string; }; export interface ProductAccountId { dotns_id: string; derivation_index: number; } export interface RingLocation { genesis_hash: Uint8Array; ring_root_hash: Uint8Array; pallet_instance: number | null; } export type DevicePermissionKind = "Camera" | "Microphone" | "Bluetooth" | "Location"; export type RemotePermissionRequest = { type: "ExternalRequest"; url: string; } | { type: "TransactionSubmit"; }; export type AccountRequestCredentialsErrorKind = "NotConnected" | "Rejected" | "DomainNotValid" | "Unknown"; export type AccountCreateProofErrorKind = "RingNotFound" | "Rejected" | "Unknown"; export interface OutcomeNeedsAccountGet { type: "NeedsAccountGet"; request_id: string; account: ProductAccountId; } export interface OutcomeNeedsPaymentBalanceSubscription { type: "NeedsPaymentBalanceSubscription"; request_id: string; } export interface OutcomeNeedsPaymentTopUp { type: "NeedsPaymentTopUp"; request_id: string; request: PaymentTopUpRequest; } export interface OutcomeNeedsPaymentRequest { type: "NeedsPaymentRequest"; request_id: string; request: PaymentRequest; } export interface OutcomeNeedsPaymentStatusSubscription { type: "NeedsPaymentStatusSubscription"; request_id: string; receipt_id: string; } export interface OutcomeNeedsAccountGetAlias { type: "NeedsAccountGetAlias"; request_id: string; account: ProductAccountId; } export interface OutcomeNeedsAccountCreateProof { type: "NeedsAccountCreateProof"; request_id: string; account: ProductAccountId; ring_location: RingLocation; message: Uint8Array; } export interface OutcomeNeedsDevicePermission { type: "NeedsDevicePermission"; request_id: string; kind: DevicePermissionKind; } export interface OutcomeNeedsRemotePermission { type: "NeedsRemotePermission"; request_id: string; request: RemotePermissionRequest; } export interface OutcomeNeedsCreateTransaction { type: "NeedsCreateTransaction"; request_id: string; account: ProductAccountId; versioned_payload: Uint8Array; } export interface OutcomeNeedsCreateTransactionNonProduct { type: "NeedsCreateTransactionNonProduct"; request_id: string; versioned_payload: Uint8Array; } export interface OutcomeSilent { type: "Silent"; } export type HostApiOutcome = OutcomeResponse | OutcomeNeedsSign | OutcomeNeedsChainQuery | OutcomeNeedsChainSubscription | OutcomeNeedsNavigate | OutcomeNeedsPushNotification | OutcomeNeedsChainFollow | OutcomeNeedsChainRpc | OutcomeNeedsStorageRead | OutcomeNeedsStorageWrite | OutcomeNeedsStorageClear | OutcomeNeedsAccountGet | OutcomeNeedsPaymentBalanceSubscription | OutcomeNeedsPaymentTopUp | OutcomeNeedsPaymentRequest | OutcomeNeedsPaymentStatusSubscription | OutcomeNeedsAccountGetAlias | OutcomeNeedsAccountCreateProof | OutcomeNeedsDevicePermission | OutcomeNeedsRemotePermission | OutcomeNeedsCreateTransaction | OutcomeNeedsCreateTransactionNonProduct | OutcomeSilent; export declare function isResponse(o: HostApiOutcome): o is OutcomeResponse; export declare function isNeedsSign(o: HostApiOutcome): o is OutcomeNeedsSign; export declare function isNeedsChainQuery(o: HostApiOutcome): o is OutcomeNeedsChainQuery; export declare function isNeedsChainSubscription(o: HostApiOutcome): o is OutcomeNeedsChainSubscription; export declare function isNeedsNavigate(o: HostApiOutcome): o is OutcomeNeedsNavigate; export declare function isNeedsPushNotification(o: HostApiOutcome): o is OutcomeNeedsPushNotification; export declare function isNeedsChainFollow(o: HostApiOutcome): o is OutcomeNeedsChainFollow; export declare function isNeedsChainRpc(o: HostApiOutcome): o is OutcomeNeedsChainRpc; export declare function isNeedsStorageRead(o: HostApiOutcome): o is OutcomeNeedsStorageRead; export declare function isNeedsStorageWrite(o: HostApiOutcome): o is OutcomeNeedsStorageWrite; export declare function isNeedsStorageClear(o: HostApiOutcome): o is OutcomeNeedsStorageClear; export declare function isNeedsAccountGet(o: HostApiOutcome): o is OutcomeNeedsAccountGet; export declare function isNeedsPaymentBalanceSubscription(o: HostApiOutcome): o is OutcomeNeedsPaymentBalanceSubscription; export declare function isNeedsPaymentTopUp(o: HostApiOutcome): o is OutcomeNeedsPaymentTopUp; export declare function isNeedsPaymentRequest(o: HostApiOutcome): o is OutcomeNeedsPaymentRequest; export declare function isNeedsPaymentStatusSubscription(o: HostApiOutcome): o is OutcomeNeedsPaymentStatusSubscription; export declare function isNeedsAccountGetAlias(o: HostApiOutcome): o is OutcomeNeedsAccountGetAlias; export declare function isNeedsAccountCreateProof(o: HostApiOutcome): o is OutcomeNeedsAccountCreateProof; export declare function isNeedsDevicePermission(o: HostApiOutcome): o is OutcomeNeedsDevicePermission; export declare function isNeedsRemotePermission(o: HostApiOutcome): o is OutcomeNeedsRemotePermission; export declare function isNeedsCreateTransaction(o: HostApiOutcome): o is OutcomeNeedsCreateTransaction; export declare function isNeedsCreateTransactionNonProduct(o: HostApiOutcome): o is OutcomeNeedsCreateTransactionNonProduct; export declare function isSilent(o: HostApiOutcome): o is OutcomeSilent; /** * Decoded Substrate extrinsic signing payload fields. * * Returned by {@link HostSdk.decodeSignPayload}. Use this to inspect the * payload from a `NeedsSign` outcome for display in signing confirmation UI. * * **Heuristic decoder**: decoded fields are for display purposes only and * should not be trusted as a security boundary. See the Rust module docs * for full limitations. */ export interface DecodedSignPayload { /** Genesis hash of the target chain (32 bytes). */ genesisHash: Uint8Array; /** Block hash for the mortality window (32 bytes). */ blockHash: Uint8Array; /** Runtime spec version. */ specVersion: number; /** Transaction format version. */ txVersion: number; /** Metadata hash (32 bytes) if CheckMetadataHash is active, or null. */ metadataHash: Uint8Array | null; /** Raw bytes: call data concatenated with signed-extension extra data. */ callDataAndExtra: Uint8Array; } /** Decoded statement from the statement store. */ export interface DecodedStatement { proofPubkey?: Uint8Array; decryptionKey?: Uint8Array; channel?: Uint8Array; priority: number; topics: Uint8Array[]; data: Uint8Array; } /** Health status of the statement store connection. */ export interface HostStoreStatus { storeRunning: boolean; storeHealth: "healthy" | "unreachable" | "checking"; subscribers: number; pendingEvents: number; lastError: string; msSinceHealthy: number; } /** Wallet state as reported by WalletHandle. */ export type WalletState = "NoWallet" | "Locked" | "Unlocked"; /** Callback invoked when the wallet auto-locks. */ export type AutoLockCallback = () => void; //# sourceMappingURL=types.d.ts.map