Solana 隐私环
getUserRecords
查询由 Solana 钱包所有者注册的公共屏蔽地址记录。
POST
/
v1
/
spr
/
getUserRecords
getUserRecords
curl --request POST \
--url 'https://devnet.helius-rpc.com/v1/spr/getUserRecords?api-key=' \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"id": "1",
"method": "getUserRecords",
"params": {
"owners": [
"11111111111111111111111111111111"
]
}
}
'import requests
url = "https://devnet.helius-rpc.com/v1/spr/getUserRecords?api-key="
payload = {
"jsonrpc": "2.0",
"id": "1",
"method": "getUserRecords",
"params": { "owners": ["11111111111111111111111111111111"] }
}
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: 'getUserRecords',
params: {owners: ['11111111111111111111111111111111']}
})
};
fetch('https://devnet.helius-rpc.com/v1/spr/getUserRecords?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/getUserRecords?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' => 'getUserRecords',
'params' => [
'owners' => [
'11111111111111111111111111111111'
]
]
]),
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/getUserRecords?api-key="
payload := strings.NewReader("{\n \"jsonrpc\": \"2.0\",\n \"id\": \"1\",\n \"method\": \"getUserRecords\",\n \"params\": {\n \"owners\": [\n \"11111111111111111111111111111111\"\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/getUserRecords?api-key=")
.header("Content-Type", "application/json")
.body("{\n \"jsonrpc\": \"2.0\",\n \"id\": \"1\",\n \"method\": \"getUserRecords\",\n \"params\": {\n \"owners\": [\n \"11111111111111111111111111111111\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://devnet.helius-rpc.com/v1/spr/getUserRecords?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\": \"getUserRecords\",\n \"params\": {\n \"owners\": [\n \"11111111111111111111111111111111\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"jsonrpc": "2.0",
"id": "1",
"result": {
"context": {
"slot": 4242,
"blockTime": 1730000000
},
"records": [
null
]
}
}{
"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 到 100 个 Solana 所有者公钥。响应会按照请求顺序,在result.records 中为每个所有者包含一个条目。如果在读取记录的时隙中,所有者没有注册表记录,则该条目为 null。
记录包含所有者采用 base58 编码的 nullifier 公钥和采用 base64 编码的查看公钥。查看公钥是一个带标签的 33 字节 X25519 密钥:先是 0x04,后跟一个规范的 32 字节 u 坐标。禁用合并时,mergeEncryption 为 0;对于 PoseidonCtrV1,则为 1。
记录从 Solana 中获取,所在时隙不早于 context.slot。这些是公开的注册密钥;有关钱包密钥处理方式,请参阅屏蔽密钥对和加密。
请求参数
array
必填
要在用户注册表中查询的 Solana 公钥。最多 100 个。
授权
你的 Helius API 密钥。
请求体
application/json
此页面对您有帮助吗?
⌘I
getUserRecords
curl --request POST \
--url 'https://devnet.helius-rpc.com/v1/spr/getUserRecords?api-key=' \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"id": "1",
"method": "getUserRecords",
"params": {
"owners": [
"11111111111111111111111111111111"
]
}
}
'import requests
url = "https://devnet.helius-rpc.com/v1/spr/getUserRecords?api-key="
payload = {
"jsonrpc": "2.0",
"id": "1",
"method": "getUserRecords",
"params": { "owners": ["11111111111111111111111111111111"] }
}
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: 'getUserRecords',
params: {owners: ['11111111111111111111111111111111']}
})
};
fetch('https://devnet.helius-rpc.com/v1/spr/getUserRecords?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/getUserRecords?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' => 'getUserRecords',
'params' => [
'owners' => [
'11111111111111111111111111111111'
]
]
]),
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/getUserRecords?api-key="
payload := strings.NewReader("{\n \"jsonrpc\": \"2.0\",\n \"id\": \"1\",\n \"method\": \"getUserRecords\",\n \"params\": {\n \"owners\": [\n \"11111111111111111111111111111111\"\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/getUserRecords?api-key=")
.header("Content-Type", "application/json")
.body("{\n \"jsonrpc\": \"2.0\",\n \"id\": \"1\",\n \"method\": \"getUserRecords\",\n \"params\": {\n \"owners\": [\n \"11111111111111111111111111111111\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://devnet.helius-rpc.com/v1/spr/getUserRecords?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\": \"getUserRecords\",\n \"params\": {\n \"owners\": [\n \"11111111111111111111111111111111\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"jsonrpc": "2.0",
"id": "1",
"result": {
"context": {
"slot": 4242,
"blockTime": 1730000000
},
"records": [
null
]
}
}{
"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": {}
}
}