Solanaプライバシーリング
getMerkleProofs
プライバシー状態ツリー内のコミットメントに対する Merkle 包含証明を取得します。
POST
/
v1
/
spr
/
getMerkleProofs
getMerkleProofs
curl --request POST \
--url 'https://devnet.helius-rpc.com/v1/spr/getMerkleProofs?api-key=' \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"id": "1",
"method": "getMerkleProofs",
"params": {
"treeAccount": "33KVhbT4QtdQDrrrGwwThqD47Dh4Q6tA443t9jMNcWFN",
"leaves": [
"11111111111111111111111111111112"
]
}
}
'import requests
url = "https://devnet.helius-rpc.com/v1/spr/getMerkleProofs?api-key="
payload = {
"jsonrpc": "2.0",
"id": "1",
"method": "getMerkleProofs",
"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: 'getMerkleProofs',
params: {
treeAccount: '33KVhbT4QtdQDrrrGwwThqD47Dh4Q6tA443t9jMNcWFN',
leaves: ['11111111111111111111111111111112']
}
})
};
fetch('https://devnet.helius-rpc.com/v1/spr/getMerkleProofs?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/getMerkleProofs?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' => 'getMerkleProofs',
'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/getMerkleProofs?api-key="
payload := strings.NewReader("{\n \"jsonrpc\": \"2.0\",\n \"id\": \"1\",\n \"method\": \"getMerkleProofs\",\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/getMerkleProofs?api-key=")
.header("Content-Type", "application/json")
.body("{\n \"jsonrpc\": \"2.0\",\n \"id\": \"1\",\n \"method\": \"getMerkleProofs\",\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/getMerkleProofs?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\": \"getMerkleProofs\",\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": [
{
"leaf": "<string>",
"leafIndex": 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、leafIndex、root、rootSeq、および rootIndex が含まれます。状態ツリーの場合、rootSeq は証明の鮮度を確保するために使用される確定済みの Solana スロットです。rootIndex は Solana アカウントのルート履歴内におけるルートの位置であり、スロットから計算することはできません。
インデックス化されたルートがルート履歴から期限切れになっている場合は、インデクサーが追いついてから再試行してください。SDK はウォレット操作のための証明の組み立てを処理します。
リクエストパラメータ
array
必須
base58 形式の 32 バイト BN254 スカラー体要素としてエンコードされた状態ツリーのコミットメントです。
string
必須
コミットメントを含む状態ツリーアカウントです。
承認
Helius API キーです。
ボディ
application/json
リクエストを識別するための ID です。
JSON-RPC プロトコルのバージョンです。
利用可能なオプション:
2.0 呼び出すメソッドです。URL パスの最後のセグメントと一致する必要があります。
利用可能なオプション:
getMerkleProofs Show child attributes
Show child attributes
例:
{
"treeAccount": "33KVhbT4QtdQDrrrGwwThqD47Dh4Q6tA443t9jMNcWFN",
"leaves": ["11111111111111111111111111111112"]
}
このページは役に立ちましたか?
⌘I
getMerkleProofs
curl --request POST \
--url 'https://devnet.helius-rpc.com/v1/spr/getMerkleProofs?api-key=' \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"id": "1",
"method": "getMerkleProofs",
"params": {
"treeAccount": "33KVhbT4QtdQDrrrGwwThqD47Dh4Q6tA443t9jMNcWFN",
"leaves": [
"11111111111111111111111111111112"
]
}
}
'import requests
url = "https://devnet.helius-rpc.com/v1/spr/getMerkleProofs?api-key="
payload = {
"jsonrpc": "2.0",
"id": "1",
"method": "getMerkleProofs",
"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: 'getMerkleProofs',
params: {
treeAccount: '33KVhbT4QtdQDrrrGwwThqD47Dh4Q6tA443t9jMNcWFN',
leaves: ['11111111111111111111111111111112']
}
})
};
fetch('https://devnet.helius-rpc.com/v1/spr/getMerkleProofs?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/getMerkleProofs?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' => 'getMerkleProofs',
'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/getMerkleProofs?api-key="
payload := strings.NewReader("{\n \"jsonrpc\": \"2.0\",\n \"id\": \"1\",\n \"method\": \"getMerkleProofs\",\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/getMerkleProofs?api-key=")
.header("Content-Type", "application/json")
.body("{\n \"jsonrpc\": \"2.0\",\n \"id\": \"1\",\n \"method\": \"getMerkleProofs\",\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/getMerkleProofs?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\": \"getMerkleProofs\",\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": [
{
"leaf": "<string>",
"leafIndex": 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": {}
}
}