import { type RelayQuoteResult, type RelayVmType } from '@funkit/fun-relay'; import type { Hex } from 'viem'; import type { WithdrawalClient, WithdrawalTypedData } from '../interfaces/withdrawalClient'; import type { FunLogger } from '../utils/funLogger'; /** * Idempotent, lazy init of the process-global relay client over the funkit * chain list (mirrors web's `FunkitProvider` init). Callers invoke it right * before the first execution so flows that never withdraw don't touch relay. * * `source` MUST be passed on React Native: relay-sdk auto-derives one from * `location.hostname` when omitted, gated only on `typeof window !== 'undefined'` * — and RN's Hermes runtime has a `window` but no `location`, so the auto-derive * throws `Property 'location' doesn't exist`. An explicit source skips it. */ export declare function ensureRelayClientInitialized(logger: FunLogger, source?: string): void; /** Switch the wallet to the source chain if it isn't already there. */ export declare function ensureOnSourceChain(wallet: WithdrawalClient, sourceChainId: number, logger: FunLogger): Promise; /** * Adapt the host {@link WithdrawalClient} into the evm-shaped relay wallet * `executeRelayQuote` drives — i.e. WithdrawalClient-based EVM relay execution. * * Faithful port of ONE branch of web's inline adapter in * `useCheckoutDirectExecution` — the `withdrawalClient ? {...}` EVM branch. It * deliberately does NOT cover web's other two branches (raw-viem checkout * deposits, non-EVM Lighter) nor web-only preWithdrawalAction tx prepending — * none are on the core surface today. */ export declare function toRelayWallet(wallet: WithdrawalClient, logger: FunLogger): { supportsAtomicBatch?: (() => Promise) | undefined; handleBatchTransactionStep?: ((chainId: number, items: { data: { to: string; value: string; data: string; }; }[]) => Promise) | undefined; vmType: "evm"; getChainId: () => Promise; handleSignMessageStep: (stepItem: { data?: { sign?: { signatureKind?: string; message?: string; domain?: WithdrawalTypedData["domain"]; types?: WithdrawalTypedData["types"]; primaryType?: string; value?: WithdrawalTypedData["message"]; }; }; }) => Promise; handleSendTransactionStep: (chainId: number, step: { data: { to: string; value: string; data: string; }; }) => Promise; handleConfirmTransactionStep: (txHash: string, chainId: number) => Promise; switchChain: () => Promise; address: () => Promise; }; /** Log namespace, one per withdrawal rail. */ export type WithdrawalRail = 'crypto-withdrawal' | 'fiat-withdrawal'; /** The id a rail correlates a withdrawal by, across its logs. */ export type WithdrawalLogContext = { submission_id: string; } | { order_id: string; }; /** * Resolve once the user has done everything relay asked of them, with the hash * relay reported — on-chain confirmation is driven separately by the wallet's * own `confirmTransaction` inside the relay steps. * * `undefined` means relay reported neither a hash nor an error; both rails treat * that as unrecoverable, since funds may already have moved. */ export declare function executeWithdrawalRelayQuote({ relayQuote, wallet, logger, rail, context, onStepMessage, }: { relayQuote: RelayQuoteResult; wallet: WithdrawalClient; logger: FunLogger; rail: WithdrawalRail; context: WithdrawalLogContext; /** Relay step progress (raw step action text), for optional host display. */ onStepMessage?: (message: string) => void; }): Promise; //# sourceMappingURL=withdrawal.d.ts.map