eth_getBalance

BaseC1

Returns the balance of an account in wei at the requested block. Pass a historic block number to read a past balance — this resolves against our archive nodes, so old heights work, not just the latest state.

Endpoint
POST https://api.1st-node.com/v1/base/rpc

Parameters

NameTypeDescription
addressDATA, 20 bytesAddress to query the balance for.
blockQUANTITY | TAGBlock number, or "latest"/"earliest"/"pending".

Returns

QUANTITY — the current balance in wei, hex-encoded.

Request

curl https://api.1st-node.com/v1/base/rpc \
  -H "Authorization: Bearer $ONE_KEY" \
  -H "content-type: application/json" \
  -d '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "eth_getBalance",
  "params": ["0x3f5ce5fbfe3e9af3971dd833d26ba9b5c936f0be", "latest"]
}'
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "eth_getBalance",
  "params": ["0x3f5ce5fbfe3e9af3971dd833d26ba9b5c936f0be", "latest"]
}

Response

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "0x7c2562030800"
}
More state methods on Base

Base API

Частые вопросы

Can I read a historic balance?

Yes — pass a past block number and our archive nodes resolve the balance at that height.

What unit is the balance in?

Wei, hex-encoded. Divide by 1e18 for the native token amount.

Пополнили, получили ключ, запустили.

Полное самообслуживание. Оплата криптой или картой. Тарификация в кредитах — тяжёлые примитивы дороже, простые дёшевы.

Получить API-ключ