Skip to content
function getToken(ctx, params): Promise<Token | undefined>;

Fetches the Token uniquely identified by the provided parameters. Reads name, symbol, decimals from any ERC-20 contract and attaches logo metadata when available. Returns undefined when the address does not respond as an ERC-20 (empty symbol). Each call performs a fresh read.

Parameters

ParameterTypeDescription
ctxSDKContextThe SDK context.
paramsGetTokenParamsThe request-specific parameters to uniquely identify the returned data.

Returns

Promise<Token | undefined>

The token, if one is found.