Solana 隐私环
getNonInclusionProofs
检索无效化器不在隐私无效化器树中的证明。
POST
/
v1
/
spr
/
getNonInclusionProofs
getNonInclusionProofs
curl --request POST \
--url 'https://devnet.helius-rpc.com/v1/spr/getNonInclusionProofs?api-key=' \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"id": "1",
"method": "getNonInclusionProofs",
"params": {
"treeAccount": "33KVhbT4QtdQDrrrGwwThqD47Dh4Q6tA443t9jMNcWFN",
"leaves": [
"11111111111111111111111111111112"
]
}
}
'import requests
url = "https://devnet.helius-rpc.com/v1/spr/getNonInclusionProofs?api-key="
payload = {
"jsonrpc": "2.0",
"id": "1",
"method": "getNonInclusionProofs",
"params": {
"treeAccount": "33KVhbT4QtdQDrrrGwwThqD47Dh4Q6tA443t9jMNcWFN",
"leaves": ["11111111111111111111111111111112"]
}
}
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',
id: '1',
method: 'getNonInclusionProofs',
params: {
treeAccount: '33KVhbT4QtdQDrrrGwwThqD47Dh4Q6tA443t9jMNcWFN',
leaves: ['11111111111111111111111111111112']
}
})
};
fetch('https://devnet.helius-rpc.com/v1/spr/getNonInclusionProofs?api-key=', 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://devnet.helius-rpc.com/v1/spr/getNonInclusionProofs?api-key=",
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',
'id' => '1',
'method' => 'getNonInclusionProofs',
'params' => [
'treeAccount' => '33KVhbT4QtdQDrrrGwwThqD47Dh4Q6tA443t9jMNcWFN',
'leaves' => [
'11111111111111111111111111111112'
]
]
]),
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://devnet.helius-rpc.com/v1/spr/getNonInclusionProofs?api-key="
payload := strings.NewReader("{\n \"jsonrpc\": \"2.0\",\n \"id\": \"1\",\n \"method\": \"getNonInclusionProofs\",\n \"params\": {\n \"treeAccount\": \"33KVhbT4QtdQDrrrGwwThqD47Dh4Q6tA443t9jMNcWFN\",\n \"leaves\": [\n \"11111111111111111111111111111112\"\n ]\n }\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://devnet.helius-rpc.com/v1/spr/getNonInclusionProofs?api-key=")
.header("Content-Type", "application/json")
.body("{\n \"jsonrpc\": \"2.0\",\n \"id\": \"1\",\n \"method\": \"getNonInclusionProofs\",\n \"params\": {\n \"treeAccount\": \"33KVhbT4QtdQDrrrGwwThqD47Dh4Q6tA443t9jMNcWFN\",\n \"leaves\": [\n \"11111111111111111111111111111112\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://devnet.helius-rpc.com/v1/spr/getNonInclusionProofs?api-key=")
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 \"id\": \"1\",\n \"method\": \"getNonInclusionProofs\",\n \"params\": {\n \"treeAccount\": \"33KVhbT4QtdQDrrrGwwThqD47Dh4Q6tA443t9jMNcWFN\",\n \"leaves\": [\n \"11111111111111111111111111111112\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"jsonrpc": "2.0",
"error": {
"code": 123,
"message": "<string>",
"data": {}
},
"result": {
"context": {
"blockTime": 123,
"slot": 1
},
"proofs": [
{
"highElement": "<string>",
"highElementIndex": 1,
"leaf": "<string>",
"lowElement": "<string>",
"lowElementIndex": 1,
"merkleContext": {
"tree": "<string>",
"treeType": 1
},
"path": [
"<string>"
],
"root": "<string>",
"rootIndex": 1,
"rootSeq": 1
}
]
}
}{
"jsonrpc": "2.0",
"id": "<string>",
"error": {
"code": 123,
"message": "<string>",
"data": {}
}
}{
"jsonrpc": "2.0",
"id": "<string>",
"error": {
"code": 123,
"message": "<string>",
"data": {}
}
}{
"jsonrpc": "2.0",
"id": "<string>",
"error": {
"code": 123,
"message": "<string>",
"data": {}
}
}非包含证明
提供 1 到 1,000 个无效化器值以及无效化器树账户。每个叶子节点都必须编码一个 BN254 标量域元素。如果无效化器已被使用或已进入该树的队列,请求将失败。证明顺序与请求的叶子节点顺序一致。 每个证明都包含同级path、作为边界的 lowElement 和 highElement 值及其索引,以及根。对于无效化器树,rootSeq 是树的更新序列,rootIndex 是根在 Solana 账户根历史记录中的位置。
请求参数
array
必填
编码为 base58 格式 32 字节 BN254 标量域元素的无效化器值。
string
必填
要查询的树账户。状态树和无效化器树共用一个账户。
授权
你的 Helius API 密钥。
请求体
application/json
用于标识请求的 ID。
JSON-RPC 协议版本。
可用选项:
2.0 要调用的方法。必须与 URL 的最后一个路径段匹配。
可用选项:
getNonInclusionProofs Show child attributes
Show child attributes
示例:
{
"treeAccount": "33KVhbT4QtdQDrrrGwwThqD47Dh4Q6tA443t9jMNcWFN",
"leaves": ["11111111111111111111111111111112"]
}
此页面对您有帮助吗?
⌘I
getNonInclusionProofs
curl --request POST \
--url 'https://devnet.helius-rpc.com/v1/spr/getNonInclusionProofs?api-key=' \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"id": "1",
"method": "getNonInclusionProofs",
"params": {
"treeAccount": "33KVhbT4QtdQDrrrGwwThqD47Dh4Q6tA443t9jMNcWFN",
"leaves": [
"11111111111111111111111111111112"
]
}
}
'import requests
url = "https://devnet.helius-rpc.com/v1/spr/getNonInclusionProofs?api-key="
payload = {
"jsonrpc": "2.0",
"id": "1",
"method": "getNonInclusionProofs",
"params": {
"treeAccount": "33KVhbT4QtdQDrrrGwwThqD47Dh4Q6tA443t9jMNcWFN",
"leaves": ["11111111111111111111111111111112"]
}
}
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',
id: '1',
method: 'getNonInclusionProofs',
params: {
treeAccount: '33KVhbT4QtdQDrrrGwwThqD47Dh4Q6tA443t9jMNcWFN',
leaves: ['11111111111111111111111111111112']
}
})
};
fetch('https://devnet.helius-rpc.com/v1/spr/getNonInclusionProofs?api-key=', 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://devnet.helius-rpc.com/v1/spr/getNonInclusionProofs?api-key=",
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',
'id' => '1',
'method' => 'getNonInclusionProofs',
'params' => [
'treeAccount' => '33KVhbT4QtdQDrrrGwwThqD47Dh4Q6tA443t9jMNcWFN',
'leaves' => [
'11111111111111111111111111111112'
]
]
]),
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://devnet.helius-rpc.com/v1/spr/getNonInclusionProofs?api-key="
payload := strings.NewReader("{\n \"jsonrpc\": \"2.0\",\n \"id\": \"1\",\n \"method\": \"getNonInclusionProofs\",\n \"params\": {\n \"treeAccount\": \"33KVhbT4QtdQDrrrGwwThqD47Dh4Q6tA443t9jMNcWFN\",\n \"leaves\": [\n \"11111111111111111111111111111112\"\n ]\n }\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://devnet.helius-rpc.com/v1/spr/getNonInclusionProofs?api-key=")
.header("Content-Type", "application/json")
.body("{\n \"jsonrpc\": \"2.0\",\n \"id\": \"1\",\n \"method\": \"getNonInclusionProofs\",\n \"params\": {\n \"treeAccount\": \"33KVhbT4QtdQDrrrGwwThqD47Dh4Q6tA443t9jMNcWFN\",\n \"leaves\": [\n \"11111111111111111111111111111112\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://devnet.helius-rpc.com/v1/spr/getNonInclusionProofs?api-key=")
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 \"id\": \"1\",\n \"method\": \"getNonInclusionProofs\",\n \"params\": {\n \"treeAccount\": \"33KVhbT4QtdQDrrrGwwThqD47Dh4Q6tA443t9jMNcWFN\",\n \"leaves\": [\n \"11111111111111111111111111111112\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"jsonrpc": "2.0",
"error": {
"code": 123,
"message": "<string>",
"data": {}
},
"result": {
"context": {
"blockTime": 123,
"slot": 1
},
"proofs": [
{
"highElement": "<string>",
"highElementIndex": 1,
"leaf": "<string>",
"lowElement": "<string>",
"lowElementIndex": 1,
"merkleContext": {
"tree": "<string>",
"treeType": 1
},
"path": [
"<string>"
],
"root": "<string>",
"rootIndex": 1,
"rootSeq": 1
}
]
}
}{
"jsonrpc": "2.0",
"id": "<string>",
"error": {
"code": 123,
"message": "<string>",
"data": {}
}
}{
"jsonrpc": "2.0",
"id": "<string>",
"error": {
"code": 123,
"message": "<string>",
"data": {}
}
}{
"jsonrpc": "2.0",
"id": "<string>",
"error": {
"code": 123,
"message": "<string>",
"data": {}
}
}