import type { EVMReadRequest, EVMReadResult } from "../types"; /** * Cached, immutable metadata for an ERC-20 contract. The fields are * derived from the standard ERC-20 view functions (`name`, `symbol`, * `decimals`) and never change for a given (chain, address) pair, which * is why agentic-cli's `TokenRegistry` can hydrate this from disk * without any RPC round-trip on subsequent boots. */ export type TokenMetadata = { address: `0x${string}`; name: string; symbol: string; decimals: number; }; /** * Anything that can answer an `EVMReadRequest` — the abstract method on * `EVMWalletClient`, a thin adapter over viem's `PublicClient`, a mock * in tests. Keeps {@link getErc20Metadata} agnostic to the underlying * RPC client. */ export type Erc20Reader = { read(request: EVMReadRequest): Promise; }; /** * Fetch ERC-20 metadata (`name`, `symbol`, `decimals`) for `address` in * a single parallel RPC round-trip. * * Intended as the single source of truth for ERC-20 metadata reads in * fox-sdk and its consumers — agentic-cli's `TokenRegistry` wraps this * with on-disk caching at `~/.config/agentic-cli/tokens.json`, since * the data is immutable and re-fetching it on every CLI invocation is * pointless overhead. Inside fox-sdk, {@link EVMWalletClient.balanceOf} * uses it for the metadata half of an ERC-20 balance read. * * Throws if any of the three responses are missing — this is a hard * failure: a contract that doesn't expose all three is not a usable * ERC-20 from this SDK's point of view. */ export declare function getErc20Metadata(reader: Erc20Reader, address: `0x${string}`): Promise;