import type { GetSupportedAssetsResponse, SupportedAssetInfo } from '@funkit/api-base'; import type { Config } from '../../wagmi/hooks'; import { type ConvertBalanceState, type ConvertBalances } from './balances'; import type { ConvertAsset, ConvertResolvedAsset } from './types'; /** Where the host's asset list and balances stand: still loading, failed, or readable. */ export type ConvertAssetListStatus = 'loading' | 'error' | 'ready'; /** * Looks a host-listed token up in the supported-assets list. Hosts key every * native asset by the `NATIVE_TOKEN` placeholder, but the list keys Hypercore's * under Relay's id, so a placeholder miss retries with the Relay key. */ export declare function findSupportedAsset(supportedAssets: GetSupportedAssetsResponse, chainId: string, address: string): SupportedAssetInfo | undefined; /** * Host icon, then the SDK's own logo for the symbol, then the asset list's, * then a CDN guess. The SDK logo outranks the list because list logos come * from mixed third parties, and some are wrong (HYPE shows HyperEVM's). */ export declare function resolveConvertAssetIcon(asset: ConvertAsset, supportedAssetLogo: string | undefined): string; /** * Resolves decimals and an icon for every host-listed asset. The supported * list answers synchronously; a token it lacks falls back to the SDK's usual * decimals lookup (on-chain, then Relay), in parallel across misses. A token * neither can resolve is left out, never given guessed decimals. */ export declare function resolveConvertAssets({ assets, supportedAssets, wagmiConfig, }: { assets: ConvertAsset[]; supportedAssets: GetSupportedAssetsResponse; wagmiConfig: Config; }): Promise; /** The listed asset with this {@link convertAssetKey}, if any. */ export declare function findConvertAsset(assets: ConvertResolvedAsset[] | undefined, assetKey: string | undefined): ConvertResolvedAsset | undefined; /** * Whether a token answers a search: its symbol contains the query in any case, * or the query is its address as {@link normalizeTokenAddress} spells it, so * a Solana mint must match exactly. An empty query matches everything. */ export declare function matchesConvertAssetQuery(asset: ConvertAsset, query: string): boolean; /** One row on a Convert token screen. */ export interface ConvertAssetOption { asset: ConvertResolvedAsset; key: string; /** `undefined` until the first balance read lands. */ balance: ConvertBalanceState | undefined; /** The balance in USD; `undefined` when the balance is unknown. */ usdAmount: number | undefined; isDisabled: boolean; /** Worth less than the minimum Convert quotes, so it can't be a source. */ isBelowMinimum?: boolean; } /** * Pickable rows first, then by USD value. An unknown value sorts last, and the * stable sort keeps the host's order among equal values. */ export declare function compareConvertAssetOptions(a: ConvertAssetOption, b: ConvertAssetOption): number; /** * The source screen's rows: held tokens by USD value, disabled ones last. * - Under the $1 minimum is disabled ("Low Balance"): Relay won't quote it. * - An unreadable balance stays listed but disabled, so funds never look gone. */ export declare function getConvertSourceOptions({ assets, balances, }: { assets: ConvertResolvedAsset[]; balances: ConvertBalances; }): ConvertAssetOption[]; /** * The source Convert opens on: the most valuable token the user can convert * from, i.e. the source screen's top row. `undefined` when no row is pickable. */ export declare function getConvertPreselectedSource(options: ConvertAssetOption[]): ConvertAssetOption | undefined;