Saltar al contenido principal

cfx_getBalance

Returns balance of the given account.

Params

(2)

1. addr (required)

string
Match pattern:
^(NET\d+|CFX|CFXTEST)(:TYPE\..*|):[ABCDEFGHJKMNPRSTUVWXYZ0123456789]{42}$

2. block_hash_or_epoch_number (required)

No schema defined

Result

(cfx_getBalance_result)
string
Match pattern:
^0x([1-9a-f][0-9a-f]{0,63}|0)$

Examples

Request

curl -X POST --data \
'{
"method": "cfx_getBalance",
"params": [
"CFXTEST:TYPE.USER:AATGGCS6J4VMKE5M10WY04SKDZ7D27RDX2CZXKDMY3"
],
"jsonrpc": "2.0",
"id": 1
}' \
-H "Content-Type: application/json" \
localhost:12539

Result

"0x3576f7dd9fa08e0514"

Endpoint

Params

addr

block_hash_or_epoch_number

Unsupported field schema for field root: Unknown field type undefined.

{
  "nullable": true
}

Request

curl -X POST --data \
'{
"method": "cfx_getBalance",
"params": [
null,
null
],
"jsonrpc": "2.0",
"id": 1
}' \
-H "Content-Type: application/json" \
https://test.confluxrpc.com