import type { DynamicTargetAssetCandidate, LighterAccountSelector } from '@funkit/connect-core'; import { type LighterChainId } from '@funkit/chains'; import type { Address } from 'viem'; export { LIGHTER_TRADING_MODE, getLighterAccount, getLighterAccountsByL1Address, useInvalidateLighterAccount, useLighterAccountQuery, useLighterAccountsQuery, } from '@funkit/connect-core'; export type { LighterAccount, LighterAccountLookup, LighterAccountResponse, LighterAccountSelector, LighterAccountsByL1AddressResponse, LighterAsset, LighterPoolInfo, LighterShare, LighterSubAccount, } from '@funkit/connect-core'; /** RH routes: every `LIGHTER_RH_*` routing id, new-user ones included. */ export declare function isLighterRhRoutingId(dynamicRoutingId: string | undefined): boolean; /** * The Lighter instance to look the wallet's account up on: an RH route is * always RH, so its recipient index never comes from the config's free-form * target chain. Otherwise a Lighter target chain names it; mainnet new-user * routes target an L1, so their `LIGHTER_*` routing id names mainnet. * Anything else has no instance and no lookup. */ export declare function resolveLighterLookupChainId({ dynamicRoutingId, targetChain, }: { dynamicRoutingId: string | undefined; targetChain: string | number | undefined; }): LighterChainId | undefined; /** * A wallet checkout on the RH route waits while the RH account lookup is in * flight: quoting before it resolves would save no RH recipient. A lookup that * never runs (no resolvable wallet) doesn't hold the checkout. */ export declare function isLighterRhAccountPending({ dynamicRoutingId, isLookupLoading, }: { dynamicRoutingId: string | undefined; isLookupLoading: boolean; }): boolean; /** * Strips the ` (Perps)` variant suffix off a Lighter ticker (e.g. * `USDC (Perps)` → `USDC`). Non-perps tickers pass through unchanged. */ export declare function stripLighterPerpsSuffix(symbol: string): string; export declare function stripLighterPerpsSuffix(symbol: string | undefined): string | undefined; /** * Rewrites the deposit target-asset candidates for a Unified Trading account: * drops the spot-USDC candidates and relabels `USDC (Perps)` as `USDC`. The * underlying routing is unchanged — unified deposits still ride the perps * routes (`LIGHTER_USDC_PERPS*`), only the presentation differs. */ export declare function adaptLighterTargetAssetsForUnifiedAccount(candidates: DynamicTargetAssetCandidate[]): DynamicTargetAssetCandidate[]; export declare function useLighterAccount(lookup: LighterAccountSelector | null, options?: { activeOnly?: boolean; }): { dataUpdatedAt: number; errorUpdatedAt: number; failureCount: number; failureReason: Error | null; errorUpdateCount: number; isFetched: boolean; isFetchedAfterMount: boolean; isFetching: boolean; isInitialLoading: boolean; isPaused: boolean; isRefetching: boolean; isStale: boolean; refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise>; fetchStatus: import("@tanstack/react-query").FetchStatus; promise: Promise; data: undefined; error: Error; isError: true; isPending: false; isLoading: false; isLoadingError: true; isRefetchError: false; isSuccess: false; isPlaceholderData: false; status: 'error'; account: import("@funkit/connect-core").LighterAccount | undefined; } | { dataUpdatedAt: number; errorUpdatedAt: number; failureCount: number; failureReason: Error | null; errorUpdateCount: number; isFetched: boolean; isFetchedAfterMount: boolean; isFetching: boolean; isInitialLoading: boolean; isPaused: boolean; isRefetching: boolean; isStale: boolean; refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise>; fetchStatus: import("@tanstack/react-query").FetchStatus; promise: Promise; data: undefined; error: null; isError: false; isPending: true; isLoading: true; isLoadingError: false; isRefetchError: false; isSuccess: false; isPlaceholderData: false; status: 'pending'; account: import("@funkit/connect-core").LighterAccount | undefined; } | { dataUpdatedAt: number; errorUpdatedAt: number; failureCount: number; failureReason: Error | null; errorUpdateCount: number; isFetched: boolean; isFetchedAfterMount: boolean; isFetching: boolean; isLoading: boolean; isInitialLoading: boolean; isPaused: boolean; isRefetching: boolean; isStale: boolean; refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise>; fetchStatus: import("@tanstack/react-query").FetchStatus; promise: Promise; data: undefined; error: null; isError: false; isPending: true; isLoadingError: false; isRefetchError: false; isSuccess: false; isPlaceholderData: false; status: 'pending'; account: import("@funkit/connect-core").LighterAccount | undefined; } | { dataUpdatedAt: number; errorUpdatedAt: number; failureCount: number; failureReason: Error | null; errorUpdateCount: number; isFetched: boolean; isFetchedAfterMount: boolean; isFetching: boolean; isInitialLoading: boolean; isPaused: boolean; isRefetching: boolean; isStale: boolean; refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise>; fetchStatus: import("@tanstack/react-query").FetchStatus; promise: Promise; data: import("@funkit/connect-core").LighterAccountResponse; isError: false; error: null; isPending: false; isLoading: false; isLoadingError: false; isRefetchError: false; isSuccess: true; isPlaceholderData: true; status: 'success'; account: import("@funkit/connect-core").LighterAccount | undefined; } | { dataUpdatedAt: number; errorUpdatedAt: number; failureCount: number; failureReason: Error | null; errorUpdateCount: number; isFetched: boolean; isFetchedAfterMount: boolean; isFetching: boolean; isInitialLoading: boolean; isPaused: boolean; isRefetching: boolean; isStale: boolean; refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise>; fetchStatus: import("@tanstack/react-query").FetchStatus; promise: Promise; data: import("@funkit/connect-core").LighterAccountResponse; error: Error; isError: true; isPending: false; isLoading: false; isLoadingError: false; isRefetchError: true; isSuccess: false; isPlaceholderData: false; status: 'error'; account: import("@funkit/connect-core").LighterAccount | undefined; } | { dataUpdatedAt: number; errorUpdatedAt: number; failureCount: number; failureReason: Error | null; errorUpdateCount: number; isFetched: boolean; isFetchedAfterMount: boolean; isFetching: boolean; isInitialLoading: boolean; isPaused: boolean; isRefetching: boolean; isStale: boolean; refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise>; fetchStatus: import("@tanstack/react-query").FetchStatus; promise: Promise; data: import("@funkit/connect-core").LighterAccountResponse; error: null; isError: false; isPending: false; isLoading: false; isLoadingError: false; isRefetchError: false; isSuccess: true; isPlaceholderData: false; status: 'success'; account: import("@funkit/connect-core").LighterAccount | undefined; }; /** * `chainId` names the Lighter instance the caller is about to use; undefined * skips the lookup. Only the key's own instance is looked up: a mismatch skips * the lookup rather than redirecting it, so no caller can pair one instance's * account index with the other's route. */ export declare function useLighterAccounts({ address, chainId, }: { address: Address | '' | undefined; chainId: LighterChainId | undefined; }): { dataUpdatedAt: number; errorUpdatedAt: number; failureCount: number; failureReason: Error | null; errorUpdateCount: number; isFetched: boolean; isFetchedAfterMount: boolean; isFetching: boolean; isInitialLoading: boolean; isPaused: boolean; isRefetching: boolean; isStale: boolean; refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise>; fetchStatus: import("@tanstack/react-query").FetchStatus; promise: Promise; data: undefined; error: Error; isError: true; isPending: false; isLoading: false; isLoadingError: true; isRefetchError: false; isSuccess: false; isPlaceholderData: false; status: 'error'; mainAccountIndex: string | undefined; isUnifiedTradingMode: boolean; subAccounts: import("@funkit/connect-core").LighterSubAccount[] | undefined; } | { dataUpdatedAt: number; errorUpdatedAt: number; failureCount: number; failureReason: Error | null; errorUpdateCount: number; isFetched: boolean; isFetchedAfterMount: boolean; isFetching: boolean; isInitialLoading: boolean; isPaused: boolean; isRefetching: boolean; isStale: boolean; refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise>; fetchStatus: import("@tanstack/react-query").FetchStatus; promise: Promise; data: undefined; error: null; isError: false; isPending: true; isLoading: true; isLoadingError: false; isRefetchError: false; isSuccess: false; isPlaceholderData: false; status: 'pending'; mainAccountIndex: string | undefined; isUnifiedTradingMode: boolean; subAccounts: import("@funkit/connect-core").LighterSubAccount[] | undefined; } | { dataUpdatedAt: number; errorUpdatedAt: number; failureCount: number; failureReason: Error | null; errorUpdateCount: number; isFetched: boolean; isFetchedAfterMount: boolean; isFetching: boolean; isLoading: boolean; isInitialLoading: boolean; isPaused: boolean; isRefetching: boolean; isStale: boolean; refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise>; fetchStatus: import("@tanstack/react-query").FetchStatus; promise: Promise; data: undefined; error: null; isError: false; isPending: true; isLoadingError: false; isRefetchError: false; isSuccess: false; isPlaceholderData: false; status: 'pending'; mainAccountIndex: string | undefined; isUnifiedTradingMode: boolean; subAccounts: import("@funkit/connect-core").LighterSubAccount[] | undefined; } | { dataUpdatedAt: number; errorUpdatedAt: number; failureCount: number; failureReason: Error | null; errorUpdateCount: number; isFetched: boolean; isFetchedAfterMount: boolean; isFetching: boolean; isInitialLoading: boolean; isPaused: boolean; isRefetching: boolean; isStale: boolean; refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise>; fetchStatus: import("@tanstack/react-query").FetchStatus; promise: Promise; data: import("@funkit/connect-core").LighterAccountsByL1AddressResponse; isError: false; error: null; isPending: false; isLoading: false; isLoadingError: false; isRefetchError: false; isSuccess: true; isPlaceholderData: true; status: 'success'; mainAccountIndex: string | undefined; isUnifiedTradingMode: boolean; subAccounts: import("@funkit/connect-core").LighterSubAccount[] | undefined; } | { dataUpdatedAt: number; errorUpdatedAt: number; failureCount: number; failureReason: Error | null; errorUpdateCount: number; isFetched: boolean; isFetchedAfterMount: boolean; isFetching: boolean; isInitialLoading: boolean; isPaused: boolean; isRefetching: boolean; isStale: boolean; refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise>; fetchStatus: import("@tanstack/react-query").FetchStatus; promise: Promise; data: import("@funkit/connect-core").LighterAccountsByL1AddressResponse; error: Error; isError: true; isPending: false; isLoading: false; isLoadingError: false; isRefetchError: true; isSuccess: false; isPlaceholderData: false; status: 'error'; mainAccountIndex: string | undefined; isUnifiedTradingMode: boolean; subAccounts: import("@funkit/connect-core").LighterSubAccount[] | undefined; } | { dataUpdatedAt: number; errorUpdatedAt: number; failureCount: number; failureReason: Error | null; errorUpdateCount: number; isFetched: boolean; isFetchedAfterMount: boolean; isFetching: boolean; isInitialLoading: boolean; isPaused: boolean; isRefetching: boolean; isStale: boolean; refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise>; fetchStatus: import("@tanstack/react-query").FetchStatus; promise: Promise; data: import("@funkit/connect-core").LighterAccountsByL1AddressResponse; error: null; isError: false; isPending: false; isLoading: false; isLoadingError: false; isRefetchError: false; isSuccess: true; isPlaceholderData: false; status: 'success'; mainAccountIndex: string | undefined; isUnifiedTradingMode: boolean; subAccounts: import("@funkit/connect-core").LighterSubAccount[] | undefined; };