cfx_getAccumulateInterestRate
Returns accumulate interest rate of the given 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_getAccumulateInterestRate"
}'
Params
epoch_number optional
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 : string
Pattern :
^0x([1-9a-f][0-9a-f]{0,63}|0)$
Examples
- cfx_getAccumulateInterestRate
- cfx_getAccumulateInterestRate
- cfx_getAccumulateInterestRate
- cfx_getAccumulateInterestRate
- cfx_getAccumulateInterestRate
- cfx_getAccumulateInterestRate
- cfx_getAccumulateInterestRate
Request
curl -X POST --data \
'{
"jsonrpc": "2.0",
"id": 1,
"method": "cfx_getAccumulateInterestRate",
"params": [
"0x4350b21"
]
}' \
-H "Content-Type: application/json" \
localhost:12539
Response
"0x3ed5a51a4d43a6b052b5d04f93a"
Request
curl -X POST --data \
'{
"jsonrpc": "2.0",
"id": 1,
"method": "cfx_getAccumulateInterestRate",
"params": [
"latest_mined"
]
}' \
-H "Content-Type: application/json" \
localhost:12539
Response
{
"code": -32602,
"message": "Invalid parameters: epoch_num",
"data": "\"Latest mined epoch is not executed\""
}
Request
curl -X POST --data \
'{
"jsonrpc": "2.0",
"id": 1,
"method": "cfx_getAccumulateInterestRate",
"params": [
"earliest"
]
}' \
-H "Content-Type: application/json" \
localhost:12539
Response
{
"code": -32016,
"message": "Error processing request: State for epoch (number=0 hash=0x3fb9d350f95424c3c27fcf248d9a6f633a83c2a75c11ef887ea41540c85e7804) does not exist: out-of-bound StateAvailabilityBoundary { synced_state_height: 0, lower_bound: 70580001, upper_bound: 70587171, optimistic_executed_height: Some(70587171) }"
}
Request
curl -X POST --data \
'{
"jsonrpc": "2.0",
"id": 1,
"method": "cfx_getAccumulateInterestRate",
"params": [
"latest_state"
]
}' \
-H "Content-Type: application/json" \
localhost:12539
Response
"0x3ed5a51a4d43a6b052b5d04f93a"
Request
curl -X POST --data \
'{
"jsonrpc": "2.0",
"id": 1,
"method": "cfx_getAccumulateInterestRate",
"params": [
"latest_confirmed"
]
}' \
-H "Content-Type: application/json" \
localhost:12539
Response
"0x3ed5a51a4d43a6b052b5d04f93a"
Request
curl -X POST --data \
'{
"jsonrpc": "2.0",
"id": 1,
"method": "cfx_getAccumulateInterestRate",
"params": [
"latest_finalized"
]
}' \
-H "Content-Type: application/json" \
localhost:12539
Response
"0x3ed5a51a4d43a6b052b5d04f93a"
Request
curl -X POST --data \
'{
"jsonrpc": "2.0",
"id": 1,
"method": "cfx_getAccumulateInterestRate",
"params": [
"latest_checkpoint"
]
}' \
-H "Content-Type: application/json" \
localhost:12539
Response
{
"code": -32016,
"message": "Error processing request: State for epoch (number=70500000 hash=0x3dc71e0aa01c258cc1a2415ba54a4fb36a53ba19be4ea3be6e566e879a42ddd0) does not exist: out-of-bound StateAvailabilityBoundary { synced_state_height: 0, lower_bound: 70580001, upper_bound: 70587175, optimistic_executed_height: None }"
}