get_block_median_time - Nervos

Returns the past median time by block hash.

Parameters

  • block_hash - A median time is calculated for a consecutive block sequence. block_hash indicates the highest block of the sequence.

Returns

When the given block hash is not on the current canonical chain, this RPC returns null; otherwise returns the median time of the consecutive 37 blocks where the given block_hash has the highest height.

Note that the given block is included in the median time. The included block number range is [MAX(block - 36, 0), block].

Example

Request

curl --location --request POST 'https://ckb-mirana.unifra.io/v1/4fb36720a57340d39aee4cf68511064a' \
--header 'Content-Type: application/json' \
--data-raw '{
  "id": 42,
  "jsonrpc": "2.0",
  "method": "get_block_median_time",
  "params": [
    "0xb3c5b9789dff3821e298a62e6cc4060accb19ed2558f988a8826573252b9ae20"
  ]
}'

Result

{
    "jsonrpc": "2.0",
    "result": "0x18433092b85",
    "id": 42
}
Language
Click Try It! to start a request and see the response here!