参数
addressstring必填- 20-byte address, hex encoded.
blockstring必填- Block number in hex (e.g. "0x1208a5f") or a tag: "latest", "safe", "finalized", "earliest" or "pending". L0vd endpoints run archive nodes, so any historical block works.
返回值
string Balance in wei, hex encoded.
适用场景
Read how much native token (ETH on Ethereum, BNB on BNB Chain, POL on Polygon, AVAX on Avalanche) an address held at a block.
Pass a historical block number to rebuild balances at a date: end of month for accounting, the block before an exploit for forensics, or a snapshot block for an airdrop.
如何解读结果
The result is wei as a hex string. Divide by 10^18 to get whole tokens: 0x63495bbdb7fa5e302 = 114,469,605,655,173,260,034 wei ≈ 114.47 ETH.
In JavaScript use BigInt(result) or viem's formatEther; in Python int(result, 16) / 10**18. Plain floats lose precision on large balances.
提示
- This is the native balance only. ERC-20 balances live in the token contract: call balanceOf with eth_call.
- To find the block at a date, binary-search eth_getBlockByNumber on the timestamp field.
- Batch many addresses at the same block in one HTTP request (JSON array) to save round trips.