eth_getBalance
网络: Arc · 主网 · Chain ID 5042(0x13b2)
数据: 全节点。Arc 不提供旧区块状态,请查询近期区块。
计为 1 个 Request。 计费规则见 Request Counting。
返回指定地址账户余额。
参数
DATA(20 字节)— 要查询余额的地址。QUANTITY|TAG— 区块号,或"latest"、"earliest"、"pending"。
返回
QUANTITY — 当前余额(单位 wei)。
请求
{
"jsonrpc": "2.0",
"method": "eth_getBalance",
"params": ["0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045", "latest"],
"id": 1
}响应
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x6c6b935b8bbd400000"
}返回值单位为 wei。
0x6c6b935b8bbd400000= 2000 × 10^18 wei,即 2,000 个 Arc 原生代币。
代码示例
curl -X POST https://arc-rpc.blockreq.com/v1/rpc/public \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_getBalance","params":["0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045","latest"],"id":1}'