Skip to main content
POST
/
quai_getBlockByNumber
curl --request POST \
  --url https://rpc.quai.network/cyprus1/ \
  --header 'Content-Type: application/json' \
  --data '
{
  "jsonrpc": "2.0",
  "method": "quai_getBlockByNumber",
  "params": [
    "0x1DF22D",
    false
  ],
  "id": 1
}
'
import requests

url = "https://rpc.quai.network/cyprus1/"

payload = {
    "jsonrpc": "2.0",
    "method": "quai_getBlockByNumber",
    "params": ["0x1DF22D", False],
    "id": 1
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: JSON.stringify({
    jsonrpc: '2.0',
    method: 'quai_getBlockByNumber',
    params: ['0x1DF22D', false],
    id: 1
  })
};

fetch('https://rpc.quai.network/cyprus1/', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://rpc.quai.network/cyprus1/",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => json_encode([
    'jsonrpc' => '2.0',
    'method' => 'quai_getBlockByNumber',
    'params' => [
        '0x1DF22D',
        false
    ],
    'id' => 1
  ]),
  CURLOPT_HTTPHEADER => [
    "Content-Type: application/json"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://rpc.quai.network/cyprus1/"

	payload := strings.NewReader("{\n  \"jsonrpc\": \"2.0\",\n  \"method\": \"quai_getBlockByNumber\",\n  \"params\": [\n    \"0x1DF22D\",\n    false\n  ],\n  \"id\": 1\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://rpc.quai.network/cyprus1/")
  .header("Content-Type", "application/json")
  .body("{\n  \"jsonrpc\": \"2.0\",\n  \"method\": \"quai_getBlockByNumber\",\n  \"params\": [\n    \"0x1DF22D\",\n    false\n  ],\n  \"id\": 1\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://rpc.quai.network/cyprus1/")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n  \"jsonrpc\": \"2.0\",\n  \"method\": \"quai_getBlockByNumber\",\n  \"params\": [\n    \"0x1DF22D\",\n    false\n  ],\n  \"id\": 1\n}"

response = http.request(request)
puts response.read_body
{
  "jsonrpc": "2.0",
  "result": {
    "hash": "0x44d0080caa510ebbfd94a0b5458f55cf3ef1aae1c927a569e3f7b1d62d14050d",
    "header": {
      "baseFeePerGas": "0x0",
      "efficiencyScore": "0x0",
      "etxEligibleSlices": "0x0100000000000000000000000000000000000000000000000000000000000000",
      "etxRollupRoot": "0xefedf4a872a58cf75c151b07c899e1935e715b8e96d1d7a3762098baee6a190c",
      "etxSetRoot": "0x5081c74207b8b250b6b737c59304da6e96bff3e43efe22ec1a371054222d278c",
      "evmRoot": "0xe5a3e7e3027f0a3a476cc34c569743c285333bc3d1af49b0b513e26cbafed117",
      "exchangeRate": "0x38d7ea4c68000",
      "expansionNumber": "0x0",
      "extraData": "0xd78776302e31392e3088676f312e32332e31856c696e7578",
      "gasLimit": "0x2625a00",
      "gasUsed": "0x0",
      "interlinkRootHash": "0x41af39c27ae9ec516256273dac73e49f77e7f73ba2cdf0c4ee430e41949688dc",
      "manifestHash": [
        "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
        "0x1a32d49ac346152143b3c26b75fa1c65307e6cce31a3cb8ef249fbd8b31cca18",
        "0x2318f6ff55c995c83b0ecc2bea5c55bbfca985ca9a11aeaed17dcadcc4816789"
      ],
      "number": [
        "0x4c",
        "0xc4"
      ],
      "outboundEtxsRoot": "0xab8fa086bb1bbd363ffb25d03b3fc1dd7ec367638be6e2d6ff27ddbb8d131fc7",
      "parentDeltaEntropy": [
        "0x0",
        "0x0",
        "0x231a26aae7abbbd2f4"
      ],
      "parentEntropy": [
        "0x323a62e45b6837238b24",
        "0x323a62e45b6837238b24",
        "0x325dd12ce93390b9fdb1"
      ],
      "parentHash": [
        "0x80bb9de7b8d1e21d9afec56855152d00def1cc7c7647083cbbaebad3d51afe53",
        "0x80bb9de7b8d1e21d9afec56855152d00def1cc7c7647083cbbaebad3d51afe53"
      ],
      "parentUncledDeltaEntropy": [
        "0x0",
        "0x0",
        "0x0"
      ],
      "primeTerminusHash": "0x80bb9de7b8d1e21d9afec56855152d00def1cc7c7647083cbbaebad3d51afe53",
      "quaiStateSize": "0xad2d",
      "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
      "secondaryCoinbase": "0x00A3E45AA16163F2663015B6695894D918866d19",
      "size": "0x2a9",
      "stateLimit": "0x2625a00",
      "stateUsed": "0x0",
      "thresholdCount": "0x0",
      "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
      "uncleHash": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
      "uncledEntropy": "0x0",
      "utxoRoot": "0x877d9ced2cc8b0fc3108ec5b5a3f09a49d8a70d190bfeeb6d7b482a4d42fc31c"
    },
    "interlinkHashes": [],
    "outboundEtxs": [
      {
        "blockHash": "0x44d0080caa510ebbfd94a0b5458f55cf3ef1aae1c927a569e3f7b1d62d14050d",
        "blockNumber": "0x15e",
        "from": "0x0003e45Aa16163f2663015B6695894D918866D19",
        "gas": "0x5208",
        "hash": "0xa46b006daf696c20b4cd11232a5dc58a284293d9537357380377dd89141a7ad3",
        "input": "0x01",
        "to": "0x0003e45Aa16163f2663015B6695894D918866D19",
        "transactionIndex": "0x0",
        "value": "0xf4240",
        "type": "0x1",
        "accessList": [],
        "originatingTxHash": "0x0000a437f4296823f1a95d3f380ac388b9795c84d8d9cc85314618cfeff53d66",
        "etxIndex": "0x0",
        "etxType": "0x1"
      }
    ],
    "size": "0x437",
    "subManifest": [],
    "totalEntropy": "0x32844728974bc93b6760",
    "transactions": [],
    "uncles": [],
    "woHeader": {
      "difficulty": "0x520e7944b",
      "headerHash": "0x5de47cfcca055b0a2eea531e7edd14f8b4f8221a7f9b2cc3d80d3b73cfd51a97",
      "location": "0x0000",
      "lock": "0x1",
      "mixHash": "0x4d9e77f36ee76199dee28ee5cebfbd08783a62d1f4c66173212c4b0e7babb6da",
      "nonce": "0xa85880000063d6e1",
      "number": "0x15e",
      "parentHash": "0x9115a437f4296823f1a95d3f380ac388b9795c84d8d9cc85314618cfeff53d66",
      "primaryCoinbase": "0x0003e45Aa16163f2663015B6695894D918866D19",
      "primeTerminusNumber": "0x4b",
      "timestamp": "0x66fd8176",
      "txHash": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"
    },
    "workshares": []
  },
  "id": 1
}

Body

application/json
jsonrpc
enum<string>
required
Available options:
2.0
Example:

"2.0"

method
enum<string>
required

The name of the method to be invoked.

Available options:
quai_getBlockByNumber
Example:

"quai_getBlockByNumber"

params
(string | boolean)[]
required

The block number.

Required array length: 2 elements

The block number.

Example:
["0x1DF22D", false]
id
integer
required

A unique identifier for the request.

Example:

1

Response

200 - application/json

Successful response

jsonrpc
string
Example:

"2.0"

result
object

The block data for the corresponding number.

Example:
{
  "hash": "0x44d0080caa510ebbfd94a0b5458f55cf3ef1aae1c927a569e3f7b1d62d14050d",
  "header": {
    "baseFeePerGas": "0x0",
    "efficiencyScore": "0x0",
    "etxEligibleSlices": "0x0100000000000000000000000000000000000000000000000000000000000000",
    "etxRollupRoot": "0xefedf4a872a58cf75c151b07c899e1935e715b8e96d1d7a3762098baee6a190c",
    "etxSetRoot": "0x5081c74207b8b250b6b737c59304da6e96bff3e43efe22ec1a371054222d278c",
    "evmRoot": "0xe5a3e7e3027f0a3a476cc34c569743c285333bc3d1af49b0b513e26cbafed117",
    "exchangeRate": "0x38d7ea4c68000",
    "expansionNumber": "0x0",
    "extraData": "0xd78776302e31392e3088676f312e32332e31856c696e7578",
    "gasLimit": "0x2625a00",
    "gasUsed": "0x0",
    "interlinkRootHash": "0x41af39c27ae9ec516256273dac73e49f77e7f73ba2cdf0c4ee430e41949688dc",
    "manifestHash": [
      "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
      "0x1a32d49ac346152143b3c26b75fa1c65307e6cce31a3cb8ef249fbd8b31cca18",
      "0x2318f6ff55c995c83b0ecc2bea5c55bbfca985ca9a11aeaed17dcadcc4816789"
    ],
    "number": ["0x4c", "0xc4"],
    "outboundEtxsRoot": "0xab8fa086bb1bbd363ffb25d03b3fc1dd7ec367638be6e2d6ff27ddbb8d131fc7",
    "parentDeltaEntropy": ["0x0", "0x0", "0x231a26aae7abbbd2f4"],
    "parentEntropy": [
      "0x323a62e45b6837238b24",
      "0x323a62e45b6837238b24",
      "0x325dd12ce93390b9fdb1"
    ],
    "parentHash": [
      "0x80bb9de7b8d1e21d9afec56855152d00def1cc7c7647083cbbaebad3d51afe53",
      "0x80bb9de7b8d1e21d9afec56855152d00def1cc7c7647083cbbaebad3d51afe53"
    ],
    "parentUncledDeltaEntropy": ["0x0", "0x0", "0x0"],
    "primeTerminusHash": "0x80bb9de7b8d1e21d9afec56855152d00def1cc7c7647083cbbaebad3d51afe53",
    "quaiStateSize": "0xad2d",
    "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
    "secondaryCoinbase": "0x00A3E45AA16163F2663015B6695894D918866d19",
    "size": "0x2a9",
    "stateLimit": "0x2625a00",
    "stateUsed": "0x0",
    "thresholdCount": "0x0",
    "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
    "uncleHash": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
    "uncledEntropy": "0x0",
    "utxoRoot": "0x877d9ced2cc8b0fc3108ec5b5a3f09a49d8a70d190bfeeb6d7b482a4d42fc31c"
  },
  "interlinkHashes": [],
  "outboundEtxs": [
    {
      "blockHash": "0x44d0080caa510ebbfd94a0b5458f55cf3ef1aae1c927a569e3f7b1d62d14050d",
      "blockNumber": "0x15e",
      "from": "0x0003e45Aa16163f2663015B6695894D918866D19",
      "gas": "0x5208",
      "hash": "0xa46b006daf696c20b4cd11232a5dc58a284293d9537357380377dd89141a7ad3",
      "input": "0x01",
      "to": "0x0003e45Aa16163f2663015B6695894D918866D19",
      "transactionIndex": "0x0",
      "value": "0xf4240",
      "type": "0x1",
      "accessList": [],
      "originatingTxHash": "0x0000a437f4296823f1a95d3f380ac388b9795c84d8d9cc85314618cfeff53d66",
      "etxIndex": "0x0",
      "etxType": "0x1"
    }
  ],
  "size": "0x437",
  "subManifest": [],
  "totalEntropy": "0x32844728974bc93b6760",
  "transactions": [],
  "uncles": [],
  "woHeader": {
    "difficulty": "0x520e7944b",
    "headerHash": "0x5de47cfcca055b0a2eea531e7edd14f8b4f8221a7f9b2cc3d80d3b73cfd51a97",
    "location": "0x0000",
    "lock": "0x1",
    "mixHash": "0x4d9e77f36ee76199dee28ee5cebfbd08783a62d1f4c66173212c4b0e7babb6da",
    "nonce": "0xa85880000063d6e1",
    "number": "0x15e",
    "parentHash": "0x9115a437f4296823f1a95d3f380ac388b9795c84d8d9cc85314618cfeff53d66",
    "primaryCoinbase": "0x0003e45Aa16163f2663015B6695894D918866D19",
    "primeTerminusNumber": "0x4b",
    "timestamp": "0x66fd8176",
    "txHash": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"
  },
  "workshares": []
}
id
integer
Example:

1