cfx_getBlockRewardInfo
Returns block reward information in an epoch
- CURL
curl --request POST \
     --url https://main.confluxrpc.com \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '
{
  "id": 1,
  "jsonrpc": "2.0",
  "params": ["0x4350b21"],
  "method": "cfx_getBlockRewardInfo"
}'
Params
num required
Represents rpc api epoch number param.
oneOf
- U64
- string
type : string
Pattern : 
^0x([1-9a-f][0-9a-f]{0,15}|0)$type : string
Possible values : 
- earliest
- latest_checkpoint
- latest_finalized
- latest_confirmed
- latest_state
- latest_mined
Result
Schema
type : array
- items[x]objecttype : object- author authortype : stringPattern :- ^(NET\d+|CFX|CFXTEST)(:TYPE\..*|):[ABCDEFGHJKMNPRSTUVWXYZ0123456789]{42}$
- baseReward baseRewardtype : stringPattern :- ^0x([1-9a-f][0-9a-f]{0,63}|0)$
- blockHash blockHashtype : stringPattern :- ^0x[0-9,a-f,A-F]{64}$
- totalReward totalRewardtype : stringPattern :- ^0x([1-9a-f][0-9a-f]{0,63}|0)$
- txFee txFeetype : stringPattern :- ^0x([1-9a-f][0-9a-f]{0,63}|0)$
 
Examples
- cfx_getBlockRewardInfo
- cfx_getBlockRewardInfo
- cfx_getBlockRewardInfo
- cfx_getBlockRewardInfo
- cfx_getBlockRewardInfo
- cfx_getBlockRewardInfo
- cfx_getBlockRewardInfo
Request
curl -X POST --data \
'{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "cfx_getBlockRewardInfo",
    "params": [
        "0x4350b21"
    ]
}' \
-H "Content-Type: application/json" \
localhost:12539
Response
[
  {
    "author": "CFXTEST:TYPE.USER:AAMJXDGZ4M84HJVF2S9RMW5UZD4DKH8AA6KRDSH0EP",
    "baseReward": "0x1bc0b7812dd38000",
    "blockHash": "0x65edf7f1e1ffec4fd0eca4a2a6efb127b11d887dc7ca522ff75e418fda32d160",
    "totalReward": "0x1bc297bf33e95087",
    "txFee": "0x0"
  }
]
Request
curl -X POST --data \
'{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "cfx_getBlockRewardInfo",
    "params": [
        "latest_mined"
    ]
}' \
-H "Content-Type: application/json" \
localhost:12539
Response
{
  "code": -32602,
  "message": "Invalid parameters: epoch",
  "data": "\"Reward not calculated yet!\""
}
Request
curl -X POST --data \
'{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "cfx_getBlockRewardInfo",
    "params": [
        "earliest"
    ]
}' \
-H "Content-Type: application/json" \
localhost:12539
Response
[]
Request
curl -X POST --data \
'{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "cfx_getBlockRewardInfo",
    "params": [
        "latest_state"
    ]
}' \
-H "Content-Type: application/json" \
localhost:12539
Response
{
  "code": -32602,
  "message": "Invalid parameters: epoch",
  "data": "\"Reward not calculated yet!\""
}
Request
curl -X POST --data \
'{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "cfx_getBlockRewardInfo",
    "params": [
        "latest_confirmed"
    ]
}' \
-H "Content-Type: application/json" \
localhost:12539
Response
[
  {
    "author": "CFXTEST:TYPE.USER:AANG4D91REJDBPGMGTMSPDYEFXKUBJ2BBYWRWM9J3Z",
    "baseReward": "0x1bc0b7812dd38000",
    "blockHash": "0x1c79eb4f7189fe55370ff24f8dae0b175a4919581615a0142dfecb65e5320b3a",
    "totalReward": "0x1bc297c037cb1b15",
    "txFee": "0x0"
  }
]
Request
curl -X POST --data \
'{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "cfx_getBlockRewardInfo",
    "params": [
        "latest_finalized"
    ]
}' \
-H "Content-Type: application/json" \
localhost:12539
Response
[
  {
    "author": "CFXTEST:TYPE.USER:AASKVGXCFEJ371G4ECEPX9AN78NGRKE5AY9F8JTBGG",
    "baseReward": "0x1bc16d674ec80000",
    "blockHash": "0x163f896ad555627c591692241570bd5d99290c8a826f409433687e843bd2e021",
    "totalReward": "0x1bc34da62be3b9cd",
    "txFee": "0x7a120"
  }
]
Request
curl -X POST --data \
'{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "cfx_getBlockRewardInfo",
    "params": [
        "latest_checkpoint"
    ]
}' \
-H "Content-Type: application/json" \
localhost:12539
Response
[
  {
    "author": "CFXTEST:TYPE.USER:AASKVGXCFEJ371G4ECEPX9AN78NGRKE5AY9F8JTBGG",
    "baseReward": "0x1bbb0850262f8000",
    "blockHash": "0xec07ad889b4aba91b578a7536aa9c3ddb60fe9cbdfd5e9204fc108b255f08bb7",
    "totalReward": "0x1bbce83f08aa3d51",
    "txFee": "0x0"
  },
  {
    "author": "CFXTEST:TYPE.USER:AAMJXDGZ4M84HJVF2S9RMW5UZD4DKH8AA6KRDSH0EP",
    "baseReward": "0x1bc16d674ec80000",
    "blockHash": "0x3dc71e0aa01c258cc1a2415ba54a4fb36a53ba19be4ea3be6e566e879a42ddd0",
    "totalReward": "0x1bc34dc4de662074",
    "txFee": "0x7a120"
  }
]