import type { LighterRouteType } from '@funkit/connect-core/clients/lighter'; import type { LighterSigner } from '@funkit/connect-core/clients/lighter'; import type { Address } from 'viem'; import type { WithdrawalSourceTokenParams } from '../../src/flow/withdrawalFlowConfig'; /** Stable ids for the two rails — used for row identity, routing and logs. */ export declare const LIGHTER_FAST_METHOD_ID = "lighter-fast"; export declare const LIGHTER_SECURE_METHOD_ID = "lighter-secure"; /** What the host must implement to submit a Secure withdrawal on Lighter's L2. */ export interface LighterSecureWithdrawalParams { /** Withdrawal amount in token units (e.g. "1.5" for 1.5 ETH). */ amountTokenUnits: string; /** The Lighter asset index (e.g. 1 for ETH, 3 for USDC). */ assetIndex: number; /** * 0 = perps / USDC collateral, 1 = spot. USDC shares asset index 3 across * both routes, so the route type is what selects Perps vs Spot. */ routeType: LighterRouteType; } /** * Lighter withdrawal, as the host configures it. Mirrors web's * `LighterWithdrawalConfig` (`@funkit/connect/clients/lighter`) so an * integrator's web and mobile wiring read the same. * * Passed on `WithdrawalFlowConfig.lighter`; its presence is what turns the * withdrawal flow's single crypto row into the Fast / Secure pair. */ export interface LighterWithdrawalFlowConfig { /** * The connected user's L1 address. The SDK resolves the L2 main-account * index from it — Lighter addresses accounts by index, not by address. */ l1Address: Address; /** * Host-built Lighter L2 signer, used by the Fast rail's relay adapter. The * SDK never holds L2 key material. */ signerClient: LighterSigner; /** * Submits the Secure withdrawal on Lighter's L2 and resolves with the L2 tx * hash. Funds bridge directly to Ethereum mainnet — no relay, no swap. */ sendLighterSecureWithdrawal: (params: LighterSecureWithdrawalParams) => Promise; /** * Withdrawable balance for the selected source token, applied to both rails. * Lighter's own accounting — it must account for what the SDK cannot see * (margin requirements, locked collateral), so the integrator owns it. */ withdrawalSourceTokenBalance?: (params: WithdrawalSourceTokenParams) => string | number; /** * Minimum Secure withdrawal in token units. Takes the same * {@link WithdrawalSourceTokenParams} as every other source-token callback, * so the shape carries over to any venue rather than being symbol-only. * Perps and spot USDC stay distinguishable — they are separate source tokens * with their own addresses. Return `undefined` for the default. */ getSecureMinWithdrawalAmount?: (params: WithdrawalSourceTokenParams) => number | undefined; /** * Awaited after the user taps Withdraw but before either rail fetches a * nonce, prompts, or submits. * * Lighter strategies and withdrawals share one L2 signing account, so a * strategy still placing or cancelling orders bumps the nonce out from under * the withdrawal and the signed tx is rejected. Cancel in-flight strategies * here so the withdrawal signs against a stable nonce. Throw to abort — no * nonce is consumed. */ onBeforeSign?: () => Promise | void; } //# sourceMappingURL=lighterWithdrawalConfig.d.ts.map