import type { Squid } from "@0xsquid/sdk";
import { ChainData, ChainType, Token } from "@0xsquid/squid-types";
import { QueryClient } from "@tanstack/react-query";
import type { AppConfig } from "../../core/types/config";
import { SwapDirection, SwapParams } from "../../core/types/swap";
import type { TokenGroup, TokenWithBalance } from "../../core/types/tokens";
export declare const assetsBaseUrl = "https://raw.githubusercontent.com/0xsquid/assets/main";
export declare const shareSubgraphId: (token1: Token, token2: Token) => boolean;
/**
 * Check if `tokenToCheck` shares any subgraph id with the tokens being compared
 * If any of the tokens being compared shares a subgraph id with `tokenToCheck`, it will be sorted first
 * @param a first token being compared
 * @param b second token being compared
 * @param tokenToCheck the token to check subgraph ids against
 */
export declare const sortTokensBySharedSubgraphIds: ({ a, b, tokenToCheck, }: {
    a: Token;
    b: Token;
    tokenToCheck: Token;
}) => -1 | 0 | 1;
/**
 * Returns an array of supported chain IDs based on the provided config:
 * - If `availableChains` is defined, only chains in `availableChains` will be returned
 * - If `disabledChains` is defined, chains in `disabledChains` will be removed
 * - If none of the above is defined, returns all chains
 */
export declare const getSupportedChainIdsForDirection: (chainIds: string[], config: Pick<AppConfig, "availableChains" | "disabledChains">, direction?: SwapDirection) => string[];
/**
 * Filter available chains based on provided config and direction
 */
export declare const filterChains: ({ chains, config, direction, }: {
    chains: ChainData[];
    config: Pick<AppConfig, "disabledChains" | "availableChains">;
    direction?: SwapDirection | undefined;
}) => ChainData[];
/**
 * Filter tokens based on provided config and direction
 */
export declare const filterTokens: ({ tokens, config, direction, }: {
    tokens: Token[];
    config: Pick<AppConfig, "disabledChains" | "availableChains">;
    direction?: SwapDirection | undefined;
}) => Token[];
export declare function getTokenImage(token?: Pick<Token, "address" | "chainId">): string;
/**
 * When user changes something from the SwapView
 * param changed can be chains, tokens, or destination address
 *
 * If source chain is changed but source token is undefined, need to find a default token
 * If destination chain is changed but destination token is undefined, need to find a default token
 * If only source token is changed, and destination token is not, and they were the same, then destination token becomes undefined
 * If only destination token is changed but source is not, and they were the same, then source token updates to something else
 *
 */
export declare const getNewSwapParamsFromInput: ({ inputParams, initialSwapRoute, tokens, chains, config, queryClient, connectedSourceAddress, }: {
    inputParams: SwapParams;
    initialSwapRoute?: SwapParams | undefined;
    tokens: Token[];
    chains: ChainData[];
    config: Pick<AppConfig, "initialAssets" | "defaultTokensPerChain" | "disabledChains" | "availableChains">;
    queryClient: QueryClient;
    connectedSourceAddress?: string | undefined;
}) => SwapParams;
export declare const sortAllTokens: (tokenA: Pick<Token, "address" | "symbol" | "chainId">, tokenB: Pick<Token, "address" | "symbol" | "chainId">) => number;
export declare const findToken: <T extends Pick<Token, "address" | "chainId">>(tokens: T[], chainId?: string, address?: string) => T | undefined;
export declare const findNativeToken: (tokens: Token[], chain: Pick<ChainData, "chainId"> & {
    nativeCurrency: Pick<ChainData["nativeCurrency"], "symbol">;
}) => Token | undefined;
export declare const normalizeIbcAddress: (address: string) => string;
/**
 * Groups tokens based on their properties (symbol, coingeckoId)
 * Some custom logic to handle native/wrapped pairs
 *
 * @param tokens - Array of TokenWithBalance objects to be grouped
 * @param chainType - Optional parameter to filter tokens by chain type ('evm' or 'cosmos')
 * @returns Object containing grouped tokens and ungrouped tokens
 */
export declare const groupTokensBySymbol: <T extends TokenWithBalance>(tokens: T[], chainType?: ChainType) => {
    grouped: TokenGroup[];
    ungrouped: T[];
};
/**
 * Groups tokens based on their chainId
 *
 * @param tokens - Array of TokenWithBalance objects to be grouped
 * @param chains - Array of ChainData objects to find chain information
 * @returns Array of TokenGroup objects
 */
export declare const groupTokensByChainId: <T extends TokenWithBalance>(tokens: T[], chains: ChainData[]) => TokenGroup[];
/**
 * Removes some tokens based on address and chain ID.
 * Some tokens will be returned by backend but should be hidden.
 *
 * Also filters tokens in `config.availableTokens` if provided.
 *
 * TODO: in the future we might want to have this as a token attribute instead.
 */
export declare const filterViewableTokens: <T extends Token>(tokens: T[], config: Pick<AppConfig, "availableTokens">, direction?: SwapDirection) => T[];
export declare const getSecretNetworkBalances: (chainData: ChainData, cosmosAddress: string, squidTokens: Token[], keplrTypeWallet: any) => Promise<TokenWithBalance[]>;
export declare function getTokenAssetsKey(token?: Pick<Token, "address" | "chainId">): string;
export type AssetsColors = {
    chains: Record<string, {
        bgColor: string;
    }>;
    tokens: Record<string, {
        bgColor: string;
        textColor: string;
    }>;
};
export declare function fetchAssetsColors(): Promise<AssetsColors>;
export declare function initializeSquidWithAssetsColors(squid: Squid, assetsColors: AssetsColors): void;
export declare function isEmptyObject(obj: Record<string, unknown> | undefined): boolean;
export declare const normalizeTokenSymbol: (symbol: string) => string;
export declare const areTokenSymbolsCompatible: (symbol1: string, symbol2: string) => boolean;
export declare function isEvmosChain(chain: ChainData | undefined): boolean;
