import { QueryClient } from "@tanstack/react-query"; import type { AppConfig, NamedTokenConfig, TokenConfig } from "../../core/types/config"; import { SwapDirection } from "../../core/types/swap"; import { Chain, Token } from "../../core/types/tokens"; export declare const resolveChainIdFromAsset: (asset: TokenConfig | NamedTokenConfig, chains: Chain[]) => string | undefined; export declare const getConfigWithDefaults: (config: AppConfig | undefined) => AppConfig; export declare const randomIntFromInterval: (min: number, max: number) => number; export declare const getTokensForChain: (tokens: Token[], chainId: number | string | undefined) => Token[]; /** * Returns the first available chain ID for a specific direction based on config. * If no initial chains are found in config, returns the first available chain ID. * @returns The first available chain ID. */ export declare const getFirstAvailableChainId: (config: Pick, direction: SwapDirection, chains?: Chain[] | undefined) => string | undefined; export declare const fetchHighestBalanceToken: (fetchCachedBalance?: { address?: string; queryClient?: QueryClient; }, chainId?: string) => string | undefined; /** * Returns the default token address for a specific chain and direction based on config. * If no default tokens are set in config, returns the native token for the specified chain * * @param tokens The list of tokens. * @param config App config * @param chainId The chain ID of the token * @param direction The direction of the swap * @param unavailableTokenAddress The token that is unavailable. Can be useful when we don't want to show the same token in the opposite direction * @returns */ export declare const getInitialOrDefaultTokenAddressForChain: ({ tokens, config, chainId, direction, excludeToken, fetchCachedBalance, }: { tokens: Token[]; config: Pick; chainId: string | undefined; direction: SwapDirection; excludeToken?: { address?: string | undefined; chainId?: string | undefined; } | undefined; fetchCachedBalance?: { address?: string | undefined; queryClient?: QueryClient | undefined; } | undefined; }) => string | undefined; /** * Retrieves the initial token address for a specific chain and direction. * If no initial assets are set in config, returns undefined. * * @param tokens - The list of tokens. * @param config - The application configuration. * @param chainId - The ID of the chain. * @param direction - The direction ("from" or "to"). * @returns The initial token address if found; otherwise, the default token address. */ export declare const getInitialTokenAddressForChain: ({ chainId, config, direction, tokens, unavailableTokenAddress, }: { tokens: Token[]; config: Pick; chainId: string | undefined; direction: SwapDirection; unavailableTokenAddress?: string | undefined; }) => string | undefined; /** * Filter tokens for destination chain * * Case 1: fromToken.bridgeOnly = true * Destination token list shows only tokens with the same commonKey as fromToken * * Case 2: fromToken.bridgeOnly = false * Destination token list shows all tokens with bridgeOnly = false * OR Destination token list shows all tokens with the same commonKey as fromToken * @param tokens * @param selectedDestinationChain * @param selectedSourceToken * @param removeSourceToken * @returns */ export declare const filterTokensForDestination: ({ tokens, selectedDestinationChain, selectedSourceToken, removeSourceToken, }: { tokens: T[]; selectedDestinationChain: Chain | undefined; selectedSourceToken: Token | undefined; removeSourceToken?: boolean | undefined; }) => T[]; /** * Returns the initial chain ID for a specific direction based on the provided chains and config. * @returns The initial chain ID if found in config; otherwise, undefined. */ export declare const getInitialChainIdFromConfig: ({ config, direction, chains, }: { config: Pick; direction: SwapDirection; chains: Chain[] | undefined; }) => string | undefined;