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 : objectauthor author
type : stringPattern :^(NET\d+|CFX|CFXTEST)(:TYPE\..*|):[ABCDEFGHJKMNPRSTUVWXYZ0123456789]{42}$
baseReward baseReward
type : stringPattern :^0x([1-9a-f][0-9a-f]{0,63}|0)$
blockHash blockHash
type : stringPattern :^0x[0-9,a-f,A-F]{64}$
totalReward totalReward
type : stringPattern :^0x([1-9a-f][0-9a-f]{0,63}|0)$
txFee txFee
type : 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!\""
}