Saltar al contenido principal

cfx_getAccount

Return account related states of the given account

curl --request POST \
--url https://main.confluxrpc.com \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '
{
"id": 1,
"jsonrpc": "2.0",
"params": ["CFXTEST:TYPE.USER:AATGGCS6J4VMKE5M10WY04SKDZ7D27RDX2CZXKDMY3",null],
"method": "cfx_getAccount"
}'

Params

address required

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

epoch_num optional

Represents rpc api epoch number param.
oneOf
type : string
Pattern : ^0x([1-9a-f][0-9a-f]{0,15}|0)$

Result

Schema
type : object
  • accumulatedInterestReturn accumulatedInterestReturn
    type : string
    Pattern : ^0x([1-9a-f][0-9a-f]{0,63}|0)$
  • address address
    type : string
    Pattern : ^(NET\d+|CFX|CFXTEST)(:TYPE\..*|):[ABCDEFGHJKMNPRSTUVWXYZ0123456789]{42}$
  • admin admin
    type : string
    Pattern : ^(NET\d+|CFX|CFXTEST)(:TYPE\..*|):[ABCDEFGHJKMNPRSTUVWXYZ0123456789]{42}$
  • balance balance
    type : string
    Pattern : ^0x([1-9a-f][0-9a-f]{0,63}|0)$
  • codeHash codeHash
    type : string
    Pattern : ^0x[0-9,a-f,A-F]{64}$
  • collateralForStorage collateralForStorage
    type : string
    Pattern : ^0x([1-9a-f][0-9a-f]{0,63}|0)$
  • nonce nonce
    type : string
    Pattern : ^0x([1-9a-f][0-9a-f]{0,63}|0)$
  • stakingBalance stakingBalance
    type : string
    Pattern : ^0x([1-9a-f][0-9a-f]{0,63}|0)$

Examples

Request

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

Response

{
"accumulatedInterestReturn": "0x0",
"address": "CFXTEST:TYPE.USER:AATGGCS6J4VMKE5M10WY04SKDZ7D27RDX2CZXKDMY3",
"admin": "CFXTEST:TYPE.NULL:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA6F0VRCSW",
"balance": "0x3576f7dd9fa08e0514",
"codeHash": "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",
"collateralForStorage": "0xbed1d0263d9f0000",
"nonce": "0xd",
"stakingBalance": "0x0"
}