import type { RelayWallet } from '@funkit/fun-relay'; import type { TransactionReceipt, TypedDataDomain } from 'viem'; export type WithdrawalTransaction = { to: string; data: string; value: string; }; /** EIP-712 payload a gasless relay route asks the wallet to sign. */ export type WithdrawalTypedData = { domain: TypedDataDomain; types: Record; primaryType: string; message: Record; }; export interface WithdrawalClient { /** * Pre-built relay wallet for a non-EVM source chain (e.g. Lighter L2, * `vmType: 'lvm'`). * - When set, relay drives it verbatim: the EVM adapter below and the * ERC-20 approval reset are both skipped, having no meaning off-EVM. * - Every other member stays required — the same client signs the EVM legs * (Lighter's L1 withdrawal fallback runs on mainnet). */ adaptedWallet?: RelayWallet; getChainId: () => Promise; switchChain: (chainId: number) => Promise; sendTransaction: (chainId: number, transaction: WithdrawalTransaction) => Promise; /** * Optional batched submitter. When provided, the SDK collapses approve + * swap/deposit steps into a single user signature via this method (e.g. * EIP-5792 `wallet_sendCalls` with `forceAtomic`). * * Must return a tx hash that {@link confirmTransaction} can wait on. * Implementations using `wallet_sendCalls` should map the calls-id back to * the underlying tx hash via `waitForCallsStatus` → * `receipts[0].transactionHash`. */ sendTransactions?: (chainId: number, transactions: WithdrawalTransaction[]) => Promise; confirmTransaction: (txHash: string, chainId: number) => Promise; address: () => string; /** * Optional. Gasless routes (EIP-3009 / permit) return a signature step in * place of the approve + transfer transactions; without this the withdrawal * cannot proceed down that path. */ signTypedData?: (typedData: WithdrawalTypedData) => Promise; /** 32-byte hashes arrive as `{ raw }` — sign those as raw bytes, not text. */ signMessage?: (message: string | { raw: string; }) => Promise; } //# sourceMappingURL=withdrawalClient.d.ts.map