import { type Address, type Hex } from 'viem'; export declare const LIGHTER_DEPOSIT_ADDRESS: Address; export declare const LIGHTER_SLOW_DEPOSIT_TIME_ESTIMATE_SECONDS: number; export declare const LIGHTER_DELAYED_AUTO_TRIGGER_CUTOFF: number; /** * zkLighter L1 `withdraw` ABI — selector `0xd20191bd`, non-payable, on the same * contract as deposits. `amount` is in Lighter base units (see * {@link lighterWithdrawBaseUnits}). */ export declare const LIGHTER_WITHDRAW_ABI: readonly [{ readonly type: "function"; readonly name: "withdraw"; readonly stateMutability: "nonpayable"; readonly inputs: readonly [{ readonly name: "accountIndex"; readonly type: "uint48"; }, { readonly name: "assetIndex"; readonly type: "uint16"; }, { readonly name: "routeType"; readonly type: "uint8"; }, { readonly name: "amount"; readonly type: "uint64"; }]; readonly outputs: readonly []; }]; /** Strips fractional digits beyond `decimals` (string-based, no float math). */ export declare function truncateToDecimals(amount: string, decimals: number): string; /** * Converts a token-unit amount to Lighter L1 `withdraw` / L2 transfer base * units using {@link lighterL2Decimals} — NOT the mainnet ERC-20 decimals. */ export declare function lighterWithdrawBaseUnits(assetIndex: number, amountTokenUnits: string): bigint; /** * Builds the on-chain `withdraw` transaction for the L1 fallback. `value` is 0 * (no protocol fee — the user pays gas only). */ export declare function buildLighterL1WithdrawTransaction(params: { accountIndex: number; assetIndex: number; routeType: number; amountBaseUnit: bigint; }): { to: Address; data: Hex; value: bigint; }; /** * Explorer link for a Lighter Secure withdrawal tx. The L1 on-chain fallback * produces a canonical 32-byte mainnet tx hash → Etherscan; L2 Secure hashes * are Lighter's own (non-EVM) format → Lighter explorer. Detecting the EVM hash * keeps L1-vs-L2 routing self-contained (no extra state threaded through the * modal step machine). */ export declare function resolveLighterWithdrawalExplorerUrl(txHash: string): string; /** * True when an error is Lighter's **L2 (Secure) withdrawal** rate limit — * codes 23004 / 23005, e.g. "Too Many L2 Withdrawal Requests!: L2 withdrawal * rate limit exceeded. Only 3 withdrawals allowed per 2 hours". Used to offer * the on-chain L1 fallback (Secure withdrawals only). * * The L2 SDK usually surfaces this as a plain string (the numeric code isn't * always preserved), so we match message content — plus the structured `code` * field when the error carries one. */ export declare function isLighterWithdrawalRateLimitError(error: unknown): boolean; /** Lighter L2 route type: 0 = perps (USDC collateral), 1 = spot. */ export type LighterRouteType = 0 | 1; /** Lighter L2 route types (`RouteType` in the withdraw/transfer tx payload). */ export declare const LIGHTER_ROUTE_TYPE: { readonly PERPS: 0; readonly SPOT: 1; }; /** * USDC exists twice on a Lighter account: as perps collateral * (`total_asset_value`, withdrawn via route 0) and as a spot asset balance * (asset entry 3, withdrawn via route 1). The Secure dropdown keys selection * by `symbol`, so the spot variant gets a pseudo-symbol to stay selectable * alongside the plain `USDC` (perps) entry. */ export declare const LIGHTER_USDC_SPOT_SYMBOL = "USDC (Spot)"; /** * Strips the ` (Spot)` / ` (Perps)` variant suffix off a Lighter source-token * selection, returning the real token symbol (e.g. `USDC (Spot)` → `USDC`). * Symbol-keyed lookups (icons, prices, asset indices, min amounts) operate on * the base symbol; only selection identity and route resolution keep the suffix. */ export declare function getLighterBaseSymbol(symbol: string): string; /** * Resolves the Lighter L2 route type for a Secure source-token selection. * Plain `USDC` withdraws perps collateral (route 0); everything else — * including the `USDC (Spot)` pseudo-symbol — is a spot asset (route 1). */ export declare function resolveLighterSecureRouteType(selectedSourceToken: string): LighterRouteType; /** * Resolves the Lighter `asset_id` for a selected source token symbol. Returns * `undefined` when the token isn't in the fetched assets list (e.g. timing * race before balances load, or an invalid selection) — callers should treat * that as "not ready to submit" rather than falling back to `0`, which would * silently target the wrong Lighter asset. */ export declare function resolveLighterAssetIndex(lighterAssets: { symbol: string; asset_id: number; }[], selectedSourceToken: string): number | undefined; /** * Lighter Secure withdrawal assets, keyed by Lighter L2 `asset_index`. * * `symbol`, the mainnet ERC-20's `decimals`, and Lighter's L2 `l2Decimals` * (the `decimals` field of Lighter's `/api/v1/assetDetails`) live here — the mainnet * ERC-20 destination address is provided per-call via * `WithdrawalParam.targetAssetAddress` (resolved by the modal via * `useAssetSymbolPrice`). Indices match Lighter's * `packages/fun-relay/src/dynamicRoutes/lighter.ts:AssetIndex` enum and the * spot-asset list in `apps/with-next/consts/lighterAssets.ts`. Adding a new * Lighter asset requires extending this table. */ export declare const LIGHTER_SECURE_ASSETS_BY_INDEX: Record; /** * Mainnet ERC-20 address for a Lighter Secure source token symbol, or undefined * if the symbol isn't a known Secure asset. */ export declare function getLighterSecureMainnetAddress(symbol: string): Address | undefined; /** * Mainnet ERC-20 decimals for a Lighter Secure source token symbol, from * `LIGHTER_SECURE_ASSETS_BY_INDEX`. Falls back to 18 for unknown symbols. */ export declare function getLighterSecureMainnetDecimals(symbol: string): number; /** * Default minimum Secure-withdrawal amounts (token units) for known Lighter * assets. Used as a fallback when `LighterWithdrawalConfig.getSecureMinWithdrawalAmount` * is omitted or returns `undefined` for a symbol. */ export declare const LIGHTER_DEFAULT_SECURE_MIN_WITHDRAWAL_AMOUNTS: Record; /** * Upper bound on a single Lighter Fast withdrawal, in USD. Amounts above this * block the CTA and surface the "submit a Secure withdrawal" footer. Fast is * USDC Perps only (price = 1), so this is also the token-unit cap. */ export declare const LIGHTER_FAST_MAX_WITHDRAWAL_USD = 3000000; export declare const LIGHTER_STAKING_POOL_INDEX = 281474976624800; export declare const LIGHTER_UNSTAKED_FEE_TOKENS = 3; export declare const LIGHTER_STAKING_THRESHOLD_LIT = 100; export declare const LIGHTER_DYNAMIC_ROUTING_ID: { ETH_SPOT: string; USDC_PERPS: string; ETH_SPOT_NEW_USER: string; USDC_PERPS_NEW_USER: string; LINK_SPOT_NEW_USER: string; UNI_SPOT_NEW_USER: string; AAVE_SPOT_NEW_USER: string; SKY_SPOT_NEW_USER: string; LDO_SPOT_NEW_USER: string; LIT_SPOT_NEW_USER: string; }; //# sourceMappingURL=lighter.d.ts.map