Creates an instance of TokenModule.
Configuration object for the token module
API configuration options. Contains settings for connecting to the Conflux eSpace Scanner API.
Target network environment
Optional
apiKey?: stringAPI key for authentication
Optional
host?: stringCustom API host URL
Protected
baseBase URL for the API endpoints
Protected
Optional
apiOptional API key for authenticated requests
Protected
loggerLogger instance for token operations
Protected
fetchProtected
Makes an API request with the given parameters. Handles parameter sanitization, API key inclusion, and error handling.
API endpoint to call
Query parameters
Promise resolving to the API response
Get ERC20 token balance for an address. Retrieves the current balance of a specific ERC20 token for a given address.
Parameters for the token balance query
Parameters for token balance request Gets the current balance of a specific token for an account
TokenBalanceParams
The token balance
Get ERC20 token total supply. Retrieves the current total supply of a specific ERC20 token.
Parameters for the token supply query
Parameters for token supply request Gets the current total supply of a token
TokenSupplyParams
The token total supply
Get historical ERC20 token total supply at a specific block. Retrieves the total supply of a specific ERC20 token at a given block number.
Parameters for the historical token supply query
Parameters for historical token supply data Gets the total supply of a token at a specific block
TokenSupplyHistoryParams
The historical token supply
Get historical ERC20 token balance for an account at a specific block number. Retrieves the balance of a specific ERC20 token for a given address at a specific block.
Parameters for the historical balance query
Parameters for token balance history Gets the balance of a token for an account at a specific block
TokenBalanceHistoryParams
The historical token balance
Module for handling ERC20 token-related operations on Conflux eSpace. Provides methods for querying token balances, supplies, and historical data.
TokenModule