import { VerifyWalletLinkResult, WalletLinkChallengeResult, VerifyWalletLinkSessionResult } from './wallet.js'; declare const HAZBASE_X402_BRIDGE_VERSION = 1; declare const HAZBASE_X402_BRIDGE_REQUEST = "hazbase:x402:request"; declare const HAZBASE_X402_BRIDGE_DETECTED = "hazbase:x402:detected"; declare const HAZBASE_X402_BRIDGE_PAYMENT = "hazbase:x402:payment"; declare const HAZBASE_X402_BRIDGE_ERROR = "hazbase:x402:error"; declare const HAZBASE_WALLET_ADDRESS_REQUEST = "hazbase:wallet:address-request"; declare const HAZBASE_WALLET_ADDRESS_RESPONSE = "hazbase:wallet:address-response"; declare const HAZBASE_WALLET_LINK_REQUEST = "hazbase:wallet:link-request"; declare const HAZBASE_WALLET_LINK_RESPONSE = "hazbase:wallet:link-response"; declare const HAZBASE_WALLET_OPERATION_REQUEST = "hazbase:wallet:operation-request"; declare const HAZBASE_WALLET_OPERATION_ACK = "hazbase:wallet:operation-ack"; declare const HAZBASE_WALLET_OPERATION_RESULT = "hazbase:wallet:operation-result"; declare const HAZBASE_WALLET_OPERATION_ERROR = "hazbase:wallet:operation-error"; type WalletOperationRequest = { chainId: number; account: string; policyKey: string; calls: Array<{ to: string; value: string; data: string; }>; grantToken: string; metadata?: Record; }; type RequestWalletOperationOptions = { request: WalletOperationRequest; id?: string; origin?: string; targetWindow?: Window; ackTimeoutMs?: number; timeoutMs?: number; retryIntervalMs?: number; signal?: AbortSignal; }; type RequestWalletOperationResult = { ok: true; id: string; result: Record; message: Record; } | { ok: false; id: string; reason?: string; timedOut?: boolean; acknowledged?: boolean; message?: Record; }; type RequestWalletAddressOptions = { id?: string; version?: number; purpose?: string; targetWindow?: Window; origin?: string; timeoutMs?: number; retryIntervalMs?: number; signal?: AbortSignal; }; type RequestWalletAddressResult = { ok: true; address: string; id: string; message: Record; } | { ok: false; id: string; reason?: string; timedOut?: boolean; message?: Record; }; type RequestWalletLinkOptions = { id?: string; purpose?: string; origin?: string; apiEndpoint?: string; fetcher?: typeof fetch; targetWindow?: Window; timeoutMs?: number; retryIntervalMs?: number; signal?: AbortSignal; }; type RequestWalletLinkResult = ({ ok: true; id: string; address: string; proof: string; message: Record; } & VerifyWalletLinkResult) | { ok: false; id: string; reason?: string; timedOut?: boolean; message?: Record; challenge?: WalletLinkChallengeResult; }; type WalletLinkHandoff = { challenge: WalletLinkChallengeResult; returnUrl: string; }; type WalletLinkProofFragment = { challengeId: string; nonce: string; proof: string; }; type WalletOperationHandoff = { id: string; request: WalletOperationRequest; origin: string; returnUrl: string; createdAt: string; expiresAt: string; }; type WalletOperationResultFragment = { id: string; ok: boolean; result?: Record; reason?: string; }; type ConsumeWalletOperationResultOptions = { input?: string; replaceState?: boolean; resultParam?: string; expectedId?: string; }; type ConsumeWalletAddressOptions = { input?: string; paramNames?: string[]; replaceState?: boolean; }; type WalletAddressPwaUrlOptions = { returnUrl?: string; returnParam?: string; }; type WalletLinkPwaUrlOptions = { challenge: WalletLinkChallengeResult; returnUrl?: string; requestParam?: string; }; type WalletOperationPwaUrlOptions = { id: string; request: WalletOperationRequest; origin?: string; returnUrl?: string; requestParam?: string; ttlMs?: number; }; type CreateX402WalletUrlOptions = { sourceUrl: string; title?: string; completionMode?: 'fragment'; completionParam?: string; }; type SaveX402HandoffOptions = { storagePrefix?: string; ttlMs?: number; sourceUrl: string; pageTitle?: string; completionMode?: 'fragment'; completionParam?: string; storage?: Storage; }; type PublishX402RequestOptions = SaveX402HandoffOptions & { scriptId?: string; removeUrlParams?: string[]; }; type PostX402BridgeRequestOptions = { id?: string; x402: Record; sourceUrl: string; title?: string; completionMode?: 'fragment'; completionParam?: string; origin?: string; targetWindow?: Window; }; type HazbaseX402ContentEnvelope = { x402: Record; sourceUrl: string; completionMode?: 'fragment'; completionParam?: string; bridgeRequestId?: string; }; type HazbaseRuntimeLike = { id?: string; lastError?: { message?: string; }; sendMessage?: (message: unknown, callback?: (response: unknown) => void) => void; onMessage?: { addListener?: (listener: (message: unknown) => void) => void; removeListener?: (listener: (message: unknown) => void) => void; }; }; type InstallHazbaseWalletContentBridgeOptions = { runtime?: HazbaseRuntimeLike; stateKey?: string; walletLinkSelector?: string; walletName?: string; openX402MessageType: string; receiveAddressMessageType?: string; receiveWalletLinkMessageType?: string; receiveOwnerOperationMessageType?: string; runtimePaymentMessageType: string; runtimeCancelledMessageType: string; runtimeOwnerOperationResultMessageType?: string; runtimeOwnerOperationCancelledMessageType?: string; legacyAddressRequestType?: string; legacyAddressResponseType?: string; unavailableMessage?: string; walletOpenFailedMessage?: string; paymentCancelledMessage?: string; capabilities?: Record; }; declare function installHazbaseWalletContentBridge(options: InstallHazbaseWalletContentBridgeOptions): () => void; declare function readX402EnvelopeFromPage(): HazbaseX402ContentEnvelope | null; declare function createHazbaseRequestId(prefix?: string): string; declare function normalizeEvmAddress(value: unknown): string; declare function requestWalletOperation(options: RequestWalletOperationOptions): Promise; declare function shortenAddress(value: unknown, options?: { head?: number; tail?: number; fallback?: string; }): string; /** @deprecated A fragment address is not proof of identity. Use consumeAndVerifyWalletLinkFromFragment instead. */ declare function consumeWalletAddressFromFragment(options?: ConsumeWalletAddressOptions): string; /** @deprecated Raw address handoff is not proof of identity. Use the wallet-link helpers instead. */ declare function createWalletAddressReturnUrl(input?: string): string; /** @deprecated Raw address handoff is not proof of identity. Use createWalletLinkPwaUrl instead. */ declare function createWalletAddressPwaUrl(walletUrl: string, options?: WalletAddressPwaUrlOptions): string; declare function createWalletLinkPwaUrl(walletUrl: string, options: WalletLinkPwaUrlOptions): string; declare function readWalletLinkHandoffFromUrl(input?: string, requestParam?: string): WalletLinkHandoff | null; declare function createWalletLinkReturnUrl(returnUrl: string, result: WalletLinkProofFragment): string; declare function createWalletOperationPwaUrl(walletUrl: string, options: WalletOperationPwaUrlOptions): string; declare function readWalletOperationHandoffFromUrl(input?: string, requestParam?: string): WalletOperationHandoff | null; declare function createWalletOperationReturnUrl(returnUrl: string, result: WalletOperationResultFragment, resultParam?: string): string; declare function consumeWalletOperationResultFromFragment(inputOrOptions?: string | ConsumeWalletOperationResultOptions, legacyReplaceState?: boolean, legacyResultParam?: string): WalletOperationResultFragment | null; declare function consumeWalletLinkProofFromFragment(input?: string, replaceState?: boolean): WalletLinkProofFragment | null; declare function verifyWalletLinkProof(proof: WalletLinkProofFragment, options?: { origin?: string; apiEndpoint?: string; fetcher?: typeof fetch; }): Promise; declare function verifyWalletLinkSession(linkSessionToken: string, options?: { origin?: string; apiEndpoint?: string; fetcher?: typeof fetch; }): Promise; declare function consumeAndVerifyWalletLinkFromFragment(options?: { input?: string; replaceState?: boolean; origin?: string; apiEndpoint?: string; fetcher?: typeof fetch; }): Promise; declare function requestWalletLink(options?: RequestWalletLinkOptions): Promise; /** @deprecated A raw address is not proof of identity. Use requestWalletLink instead. */ declare function requestWalletAddress(options?: RequestWalletAddressOptions): Promise; declare function createX402WalletUrl(walletUrl: string, x402: Record, options: CreateX402WalletUrlOptions): string; declare function setX402RequestScript(x402: Record, options?: { scriptId?: string; sourceUrl?: string; completionMode?: 'fragment'; completionParam?: string; }): void; declare function saveX402Handoff(paymentRequestId: string, x402: Record, options: SaveX402HandoffOptions): void; declare function removeX402UrlParams(paramNames?: string[]): void; declare function publishX402Request(paymentRequestId: string, x402: Record, options: PublishX402RequestOptions): void; declare function postX402BridgeRequest(options: PostX402BridgeRequestOptions): string; export { type ConsumeWalletAddressOptions, type ConsumeWalletOperationResultOptions, type CreateX402WalletUrlOptions, HAZBASE_WALLET_ADDRESS_REQUEST, HAZBASE_WALLET_ADDRESS_RESPONSE, HAZBASE_WALLET_LINK_REQUEST, HAZBASE_WALLET_LINK_RESPONSE, HAZBASE_WALLET_OPERATION_ACK, HAZBASE_WALLET_OPERATION_ERROR, HAZBASE_WALLET_OPERATION_REQUEST, HAZBASE_WALLET_OPERATION_RESULT, HAZBASE_X402_BRIDGE_DETECTED, HAZBASE_X402_BRIDGE_ERROR, HAZBASE_X402_BRIDGE_PAYMENT, HAZBASE_X402_BRIDGE_REQUEST, HAZBASE_X402_BRIDGE_VERSION, type HazbaseRuntimeLike, type HazbaseX402ContentEnvelope, type InstallHazbaseWalletContentBridgeOptions, type PostX402BridgeRequestOptions, type PublishX402RequestOptions, type RequestWalletAddressOptions, type RequestWalletAddressResult, type RequestWalletLinkOptions, type RequestWalletLinkResult, type RequestWalletOperationOptions, type RequestWalletOperationResult, type SaveX402HandoffOptions, type WalletAddressPwaUrlOptions, type WalletLinkHandoff, type WalletLinkProofFragment, type WalletLinkPwaUrlOptions, type WalletOperationHandoff, type WalletOperationPwaUrlOptions, type WalletOperationRequest, type WalletOperationResultFragment, consumeAndVerifyWalletLinkFromFragment, consumeWalletAddressFromFragment, consumeWalletLinkProofFromFragment, consumeWalletOperationResultFromFragment, createHazbaseRequestId, createWalletAddressPwaUrl, createWalletAddressReturnUrl, createWalletLinkPwaUrl, createWalletLinkReturnUrl, createWalletOperationPwaUrl, createWalletOperationReturnUrl, createX402WalletUrl, installHazbaseWalletContentBridge, normalizeEvmAddress, postX402BridgeRequest, publishX402Request, readWalletLinkHandoffFromUrl, readWalletOperationHandoffFromUrl, readX402EnvelopeFromPage, removeX402UrlParams, requestWalletAddress, requestWalletLink, requestWalletOperation, saveX402Handoff, setX402RequestScript, shortenAddress, verifyWalletLinkProof, verifyWalletLinkSession };