Creates an instance of AccountModule.
Configuration object for the account module
Protected
baseBase URL for the API endpoints
Protected
Optional
apiOptional API key for authenticated requests
Protected
loggerLogger instance for account 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 CFX balance for a single address. Retrieves the current CFX balance for a specific address.
Parameters for the balance query
Parameters for fetching account balance. Used to query the CFX balance of a specific address at a given block.
Account address to check balance for (in hex format)
Optional
tag?: BlockTagBlock tag to query balance at (e.g. 'latest_state', 'latest_confirmed')
The account balance
Get CFX balance for multiple addresses in a single call. Retrieves current CFX balances for multiple addresses efficiently.
Parameters for the multi-balance query
Parameters for fetching multiple account balances. Allows querying CFX balances for multiple addresses in a single call.
Array of account addresses to check balances for (in hex format)
Optional
tag?: BlockTagBlock tag to query balances at (e.g. 'latest_state', 'latest_confirmed')
The account balances
Get a list of normal transactions by address. Retrieves all normal (non-internal) transactions for a specific address.
Parameters for the transaction list query
Parameters for getting transaction list. Used to query normal (non-internal) transactions for an address.
Optional
page?: numberPage number (1-based)
Optional
offset?: numberPage offset.
Optional
skip?: numberNumber of records to skip (pageSize * (pageNumber - 1)). Maximum 10000.
Optional
limit?: numberNumber of records per page. Maximum 100.
Optional
sort?: "asc" | "desc"Sort order by timestamp (ASC for ascending, DESC for descending)
Optional
minTimestamp?: numberMinimum timestamp in seconds
Optional
maxTimestamp?: numberMaximum timestamp in seconds
Optional
startBlock?: numberStarting block number
Optional
endBlock?: numberEnding block number
Account address to get transactions for (in hex format)
Optional
startblock?: numberStart block number
Optional
endblock?: numberEnd block number
Optional
txhash?: stringTransaction hash to filter by
List of transactions
Get a list of internal transactions. Retrieves all internal transactions (contract-to-contract transfers) for a specific address.
Parameters for the internal transaction list query
Parameters for getting internal transaction list
TxlistinternalParams
Optional
page?: numberPage number (1-based)
Optional
offset?: numberPage offset.
Optional
skip?: numberNumber of records to skip (pageSize * (pageNumber - 1)). Maximum 10000.
Optional
limit?: numberNumber of records per page. Maximum 100.
Optional
sort?: "asc" | "desc"Sort order by timestamp (ASC for ascending, DESC for descending)
Optional
minTimestamp?: numberMinimum timestamp in seconds
Optional
maxTimestamp?: numberMaximum timestamp in seconds
Optional
startBlock?: numberStarting block number
Optional
endBlock?: numberEnding block number
Account address to get internal transactions for
Optional
startblock?: numberStart block number
Optional
endblock?: numberEnd block number
Optional
txhash?: stringTransaction hash
List of internal transactions
Get a list of token transfers. Retrieves all token transfer events for a specific address or contract.
Parameters for the token transfer list query
Parameters for getting token transaction list
TokentxParams
Optional
page?: numberPage number (1-based)
Optional
offset?: numberPage offset.
Optional
skip?: numberNumber of records to skip (pageSize * (pageNumber - 1)). Maximum 10000.
Optional
limit?: numberNumber of records per page. Maximum 100.
Optional
sort?: "asc" | "desc"Sort order by timestamp (ASC for ascending, DESC for descending)
Optional
minTimestamp?: numberMinimum timestamp in seconds
Optional
maxTimestamp?: numberMaximum timestamp in seconds
Optional
startBlock?: numberStarting block number
Optional
endBlock?: numberEnding block number
Account address to get token transactions for
Optional
contractaddress?: stringContract address to filter transactions by
Optional
startblock?: numberStart block number
Optional
endblock?: numberEnd block number
List of token transfers
Get a list of NFT token transfers. Retrieves all NFT transfer events for a specific address or contract.
Parameters for the NFT transfer list query
Parameters for getting token transaction list
TokentxParams
Optional
page?: numberPage number (1-based)
Optional
offset?: numberPage offset.
Optional
skip?: numberNumber of records to skip (pageSize * (pageNumber - 1)). Maximum 10000.
Optional
limit?: numberNumber of records per page. Maximum 100.
Optional
sort?: "asc" | "desc"Sort order by timestamp (ASC for ascending, DESC for descending)
Optional
minTimestamp?: numberMinimum timestamp in seconds
Optional
maxTimestamp?: numberMaximum timestamp in seconds
Optional
startBlock?: numberStarting block number
Optional
endBlock?: numberEnding block number
Account address to get token transactions for
Optional
contractaddress?: stringContract address to filter transactions by
Optional
startblock?: numberStart block number
Optional
endblock?: numberEnd block number
List of NFT transfers
Get a list of blocks mined by an address. Retrieves all blocks that were mined by a specific address.
Parameters for the mined blocks query
Parameters for getting mined blocks
GetminedblocksParams
Optional
page?: numberPage number (1-based)
Optional
offset?: numberPage offset.
Optional
skip?: numberNumber of records to skip (pageSize * (pageNumber - 1)). Maximum 10000.
Optional
limit?: numberNumber of records per page. Maximum 100.
Optional
sort?: "asc" | "desc"Sort order by timestamp (ASC for ascending, DESC for descending)
Miner address to get blocks for
List of mined blocks
Get balance history for an address. Retrieves the historical balance of an address at a specific block number.
Parameters for the balance history query
Parameters for getting balance history
BalancehistoryParams
Historical balance information
Module for handling account-related operations on Conflux eSpace. Provides methods for querying account balances, transactions, token transfers, and other account data.
AccountModule