accounts
Version:
Tempo Accounts SDK
48 lines • 1.64 kB
TypeScript
import type { Address } from 'ox';
/** A single tokenlist entry. */
export type Token = {
/** Token contract address. */
address: Address.Address;
/** Token decimals. */
decimals: number;
/** Token logo URI. */
logoUri?: string | undefined;
/** Token name. */
name: string;
/** Token symbol. */
symbol: string;
};
/**
* Fetches the curated tokenlist for a given Tempo chain. Concurrent calls
* for the same chain share a single in-flight request, and successful
* responses are cached for the lifetime of the process.
*
* Returns an empty list on any non-OK response so callers can fall back
* to chain-supplied behavior rather than treating a fetch failure as fatal.
*/
export declare function fetch(options: fetch.Options): Promise<readonly Token[]>;
export declare namespace fetch {
/** Options for {@link fetch}. */
type Options = {
/** Chain id to fetch the tokenlist for. */
chainId: number;
/**
* Base URL of the tokenlist service.
* @default 'https://tokenlist.tempo.xyz'
*/
baseUrl?: string | undefined;
};
}
/**
* Resolves a token symbol (case-insensitive) against the curated tokenlist
* for a given chain. Returns the token entry, or `undefined` if no match.
*/
export declare function resolveSymbol(options: resolveSymbol.Options): Promise<Token | undefined>;
export declare namespace resolveSymbol {
/** Options for {@link resolveSymbol}. */
type Options = fetch.Options & {
/** Symbol to look up (case-insensitive). */
symbol: string;
};
}
//# sourceMappingURL=Tokenlist.d.ts.map