Read Balance
Query native CFX and ERC-20 token balances using EspaceClient, ERC20_ABI, and EVM_TESTNET from @cfxdevkit/core.
Edit the address constant to check any wallet.
How it works
getBalance(address)callseth_getBalanceand returns an already-formatted CFX string.ERC20_ABIfrom@cfxdevkit/corecovers all standard ERC-20 functions.client.publicClient.readContract(...)is the underlying viem call for any view function.- Batch multiple reads with
Promise.allto cut round-trips.
Last updated on