跳转到主要内容
POST
/
quai_getUncleByBlockHashAndIndex
curl --request POST \
  --url https://rpc.quai.network/cyprus1/ \
  --header 'Content-Type: application/json' \
  --data '
{
  "jsonrpc": "2.0",
  "method": "quai_getUncleByBlockHashAndIndex",
  "params": [
    "0x000000ceb1b398df1e8026b2a426b411f6cc9041f2f4356211a3c723a2f797d2",
    "0x1"
  ],
  "id": 1
}
'
import requests

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

payload = {
    "jsonrpc": "2.0",
    "method": "quai_getUncleByBlockHashAndIndex",
    "params": ["0x000000ceb1b398df1e8026b2a426b411f6cc9041f2f4356211a3c723a2f797d2", "0x1"],
    "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_getUncleByBlockHashAndIndex',
    params: ['0x000000ceb1b398df1e8026b2a426b411f6cc9041f2f4356211a3c723a2f797d2', '0x1'],
    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_getUncleByBlockHashAndIndex',
    'params' => [
        '0x000000ceb1b398df1e8026b2a426b411f6cc9041f2f4356211a3c723a2f797d2',
        '0x1'
    ],
    '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_getUncleByBlockHashAndIndex\",\n  \"params\": [\n    \"0x000000ceb1b398df1e8026b2a426b411f6cc9041f2f4356211a3c723a2f797d2\",\n    \"0x1\"\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_getUncleByBlockHashAndIndex\",\n  \"params\": [\n    \"0x000000ceb1b398df1e8026b2a426b411f6cc9041f2f4356211a3c723a2f797d2\",\n    \"0x1\"\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_getUncleByBlockHashAndIndex\",\n  \"params\": [\n    \"0x000000ceb1b398df1e8026b2a426b411f6cc9041f2f4356211a3c723a2f797d2\",\n    \"0x1\"\n  ],\n  \"id\": 1\n}"

response = http.request(request)
puts response.read_body
{
  "jsonrpc": "2.0",
  "result": {
    "difficulty": "0x4830bb629",
    "headerHash": "0x668637e998e3d18e5f529c3dbfe084f57a4ca853812aa136e57153d5d81287ac",
    "location": "0x0000",
    "lock": "0x1",
    "mixHash": "0x81c2449a5024c5ba098610f4de40390f87a36df9d92fd5568ef69291aa7b02dc",
    "nonce": "0x36d54000031850e1",
    "number": "0x2ed",
    "parentHash": "0xfeee321190b340d980aa0c6a6216a396c9d0b387c69dd5e1385c3293b61b3386",
    "primaryCoinbase": "0x0003e45Aa16163f2663015B6695894D918866D19",
    "primeTerminusNumber": "0xa5",
    "timestamp": "0x66fd8a4d",
    "txHash": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"
  },
  "id": 1
}

请求体

application/json
jsonrpc
enum<string>
必填
可用选项:
2.0
示例:

"2.0"

method
enum<string>
必填

The name of the method to be invoked.

可用选项:
quai_getUncleByBlockHashAndIndex
示例:

"quai_getUncleByBlockHashAndIndex"

params
string[]
必填

The block hash and uncle index.

Required array length: 2 elements
示例:
[
  "0x000000ceb1b398df1e8026b2a426b411f6cc9041f2f4356211a3c723a2f797d2",
  "0x1"
]
id
integer
必填

A unique identifier for the request.

示例:

1

响应

200 - application/json

Successful response

jsonrpc
string
示例:

"2.0"

result
object

The uncle data for the corresponding block number and index.

示例:
{
  "difficulty": "0x4830bb629",
  "headerHash": "0x668637e998e3d18e5f529c3dbfe084f57a4ca853812aa136e57153d5d81287ac",
  "location": "0x0000",
  "lock": "0x1",
  "mixHash": "0x81c2449a5024c5ba098610f4de40390f87a36df9d92fd5568ef69291aa7b02dc",
  "nonce": "0x36d54000031850e1",
  "number": "0x2ed",
  "parentHash": "0xfeee321190b340d980aa0c6a6216a396c9d0b387c69dd5e1385c3293b61b3386",
  "primaryCoinbase": "0x0003e45Aa16163f2663015B6695894D918866D19",
  "primeTerminusNumber": "0xa5",
  "timestamp": "0x66fd8a4d",
  "txHash": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"
}
id
integer
示例:

1