import type { GetSupportedAssetsResponse, SupportedAssetInfo } from '@funkit/api-base'; /** * Pure, platform-agnostic resolution of the token-transfer (UDA deposit) token * list. The displayed tokens are NOT the full `/assets/supported` allow-list — * they're the curated set from the Statsig `tokentransferconfig` (chains + * specific asset addresses), with `/assets/supported` only supplying metadata * (symbol / name / logo / decimals) for those addresses. This is the half of * web's `useTokenTransferConfig` that touches no DOM / providers, lifted here so * `@funkit/connect` (web) and `@funkit/connect-rn` (RN) share it. The React * hooks (Statsig reads + react-query) stay per-platform. */ /** Minimal logger surface used to warn about config/metadata mismatches. */ interface ResolverLogger { warn: (title: string, data?: object) => void; } /** Raw asset entry from the Statsig `tokentransferconfig`. */ export interface TokenTransferAssetConfig { address: string; /** Show a "New" badge. `'primary'` promotes it as the highlighted new token. */ showNewBadge?: 'primary' | true; } /** API metadata merged with the config-driven fields. */ export type ResolvedAssetInfo = SupportedAssetInfo & TokenTransferAssetConfig; /** Raw chain entry from the Statsig `tokentransferconfig`. */ export interface TokenTransferChainConfig { readonly chainId: number; readonly isDefault?: boolean; readonly assets: readonly TokenTransferAssetConfig[]; } /** Resolved token-transfer config (the platform hook adds `isLoading`). */ export interface TokenTransferConfigResult { /** Supported assets filtered to the config, keyed by [chainId][address]. */ supportedAssets: GetSupportedAssetsResponse; /** chainId → display symbols. */ symbolsByChainId: Record; /** Chain ids in config display order. */ chainIdSortOrder: number[]; /** Default chain id (from `isDefault`). */ defaultChainId: number | undefined; /** Symbols to prioritize at the top of the list. */ priorityTokenSymbols: string[]; /** Symbols with a "New" badge; the `'primary'` symbol is first. */ newBadgeSymbols: Set; /** * chainId → (display symbol or alias) → original-case token address. * Lets callers resolve a selected symbol to its on-chain address without a * round-trip. Addresses keep their source casing (checksummed EVM, base58 * Solana/Tron) — unlike `supportedAssets`, which is lowercase-keyed. */ addressBySymbolByChainId: Record>; } /** * Disabled overrides. Keys are chainId strings; values are token addresses, or * `["*"]` to disable the whole chain. */ export type DisabledChainsAndAssets = Record; /** True if an entire chain is disabled (`["*"]`). */ export declare function isChainDisabled(disabledConfig: DisabledChainsAndAssets, chainId: number | string): boolean; /** True if a chain+asset is disabled (chain `["*"]`, or the address). */ export declare function isAssetDisabled(disabledConfig: DisabledChainsAndAssets, chainId: number | string, tokenAddress: string): boolean; /** * Build the token-transfer config by filtering `/assets/supported` through the * Statsig chain config + disabled list. Pure: pass the already-fetched data in. */ export declare function resolveTokenTransferConfig({ chainConfigs, priorityTokens, disabledChainAssets, supportedAssets, logger, }: { chainConfigs: readonly TokenTransferChainConfig[]; priorityTokens: readonly string[]; disabledChainAssets: DisabledChainsAndAssets; supportedAssets: GetSupportedAssetsResponse; logger?: ResolverLogger; }): TokenTransferConfigResult; export {}; //# sourceMappingURL=tokenTransferConfig.d.ts.map