과거 계정
getHistoricalAccountInfo
과거 슬롯 또는 특정 트랜잭션 직후의 Solana 계정을 getAccountInfo 인코딩 및 마지막 쓰기 위치와 함께 읽습니다.
POST
/
getHistoricalAccountInfo
curl --request POST \
--url 'https://mainnet.helius-rpc.com/?api-key=' \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"id": "1",
"method": "getHistoricalAccountInfo",
"params": [
"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
{
"slot": 445000000
},
{
"encoding": "jsonParsed"
}
]
}
'import requests
url = "https://mainnet.helius-rpc.com/?api-key="
payload = {
"jsonrpc": "2.0",
"id": "1",
"method": "getHistoricalAccountInfo",
"params": ["EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", { "slot": 445000000 }, { "encoding": "jsonParsed" }]
}
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: 'getHistoricalAccountInfo',
params: [
'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
{slot: 445000000},
{encoding: 'jsonParsed'}
]
})
};
fetch('https://mainnet.helius-rpc.com/?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://mainnet.helius-rpc.com/?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' => 'getHistoricalAccountInfo',
'params' => [
'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
[
'slot' => 445000000
],
[
'encoding' => 'jsonParsed'
]
]
]),
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://mainnet.helius-rpc.com/?api-key="
payload := strings.NewReader("{\n \"jsonrpc\": \"2.0\",\n \"id\": \"1\",\n \"method\": \"getHistoricalAccountInfo\",\n \"params\": [\n \"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\",\n {\n \"slot\": 445000000\n },\n {\n \"encoding\": \"jsonParsed\"\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://mainnet.helius-rpc.com/?api-key=")
.header("Content-Type", "application/json")
.body("{\n \"jsonrpc\": \"2.0\",\n \"id\": \"1\",\n \"method\": \"getHistoricalAccountInfo\",\n \"params\": [\n \"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\",\n {\n \"slot\": 445000000\n },\n {\n \"encoding\": \"jsonParsed\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://mainnet.helius-rpc.com/?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\": \"getHistoricalAccountInfo\",\n \"params\": [\n \"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\",\n {\n \"slot\": 445000000\n },\n {\n \"encoding\": \"jsonParsed\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"jsonrpc": "2.0",
"id": "1",
"result": {
"context": {
"slot": 468129571
},
"value": {
"lamports": 531589475273,
"owner": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
"data": [
"<string>"
],
"executable": false,
"rentEpoch": 123,
"space": 82,
"lastUpdatedAt": {
"slot": 444999837,
"transactionIndex": 700
}
}
}
}{
"jsonrpc": "2.0",
"error": {
"code": -32602,
"message": "유효하지 않은 매개변수"
},
"id": "1"
}{
"jsonrpc": "2.0",
"error": {
"code": -32001,
"message": "인증되지 않음"
},
"id": "1"
}{
"jsonrpc": "2.0",
"error": {
"code": -32005,
"message": "요청이 너무 많음"
},
"id": "1"
}{
"jsonrpc": "2.0",
"error": {
"code": -32603,
"message": "내부 오류"
},
"id": "1"
}{
"jsonrpc": "2.0",
"error": {
"code": -32002,
"message": "서비스를 사용할 수 없음"
},
"id": "1"
}{
"jsonrpc": "2.0",
"error": {
"code": -32003,
"message": "게이트웨이 시간 초과"
},
"id": "1"
}getHistoricalAccountInfo은 베타 버전입니다. 매개변수, 가격, 응답 형식 및 데이터 제공 범위는 변경될 수 있습니다.개요
getHistoricalAccountInfo은 과거 슬롯 또는 해당 슬롯의 특정 트랜잭션 직후 시점의 Solana 계정을 반환합니다. Helius 전용 RPC 메서드입니다. 표준 getAccountInfo은 현재 상태만 반환합니다.
응답에는 getAccountInfo과 동일한 계정 필드와 함께 lastUpdatedAt이 포함됩니다. 이는 반환된 상태를 마지막으로 기록한 슬롯과 트랜잭션입니다.
기록은 에포크 1030이 시작될 때의 상태인 슬롯 444,959,999(2026년 9월 7일)부터 제공됩니다. 이보다 이전 슬롯을 요청하면 오류 -32018이 반환됩니다.
getHistoricalAccountInfo은 Business 이상의 요금제에서 메인넷을 통해 사용할 수 있으며, 베타 기간에는 호출당 0크레딧이 부과됩니다. 가격은 변경될 수 있습니다.
기록에서 위치 선택
두 번째 매개변수는 기록에서 읽을 시점을 선택하는 쿼리 객체입니다.| 쿼리 | 반환되는 계정 시점 |
|---|---|
생략 또는 {} | 요청한 커밋먼트로 제한된 최신 인덱싱 슬롯 |
{ "slot": 445000000 } | 슬롯 445,000,000의 끝 |
{ "slot": 445000000, "transactionIndex": 10 } | 슬롯 445,000,000의 인덱스 10에 있는 트랜잭션이 실행된 직후 |
transactionIndex을 사용하려면 slot이 필요합니다. 인덱스 N의 트랜잭션 직전 계정을 읽으려면 transactionIndex: N - 1을 쿼리하세요. 슬롯의 첫 번째 트랜잭션 직전 상태를 확인하려면 transactionIndex 없이 이전 슬롯을 쿼리하세요.
에포크 보상과 같이 트랜잭션을 통하지 않는 쓰기는 슬롯 끝에 적용됩니다. transactionIndex을 사용한 쿼리에는 이러한 쓰기가 포함되지 않습니다.
요청 예시
curl https://mainnet.helius-rpc.com/?api-key=YOUR_API_KEY \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": "1",
"method": "getHistoricalAccountInfo",
"params": [
"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
{ "slot": 445000000 },
{ "encoding": "jsonParsed" }
]
}'
응답 읽기
- **
value**은 요청한 위치의 계정입니다. 당시 계정이 아직 생성되지 않았거나 이미 폐쇄되어 존재하지 않았다면null입니다.null응답에는lastUpdatedAt이 없습니다. - **
lastUpdatedAt.slot**과 **lastUpdatedAt.transactionIndex**은 이 상태를 만든 쓰기를 식별합니다. 해당 쓰기는 요청한 위치 또는 그 이전에 있습니다. - 에포크 보상처럼 트랜잭션 외부에서 쓰기가 발생한 경우
lastUpdatedAt.transactionIndex은null입니다. - **
nulltransactionIndex을 포함하는 444,959,999의lastUpdatedAt.slot**은 기록 제공이 시작된 이후 계정이 변경되지 않았음을 의미합니다. 해당 슬롯에서 계정에 쓰기가 발생했다는 의미는 아닙니다. - **
context.slot**은 쿼리한 슬롯이 아니라 Helius가 요청을 처리할 당시 인덱싱한 최신 슬롯입니다. jsonParsed토큰 계정은 요청한 위치를 기준으로 민트의 소수 자릿수를 사용합니다. 해당 위치에서 민트를 읽을 수 없으면 계정은 base64를 대신 사용합니다.
lastUpdatedAt을 커서로 사용하세요. 계정 기록을 역순으로 탐색하기를 참조하세요.
오류
| 코드 | 의미 |
|---|---|
-32018 | 슬롯이 기록 제공 시작 지점(슬롯 444,959,999)보다 이전입니다 |
-32004 | 슬롯이 요청한 커밋먼트에서 허용하는 범위보다 최신입니다. confirmed을 사용하거나 더 오래된 슬롯을 쿼리하세요 |
-32602 | slot 없는 transactionIndex, base58 인코딩 또는 알 수 없는 구성 필드와 같은 잘못된 매개변수입니다 |
-32601 | 메서드를 찾을 수 없습니다. Helius 메인넷 또는 Gatekeeper 엔드포인트를 호출하세요. 이 메서드는 devnet에서 사용할 수 없습니다 |
관련 메서드
Historical Accounts Guide
과거 계정 메서드에서 위치, 제공 범위 및 lastUpdatedAt이 작동하는 방식
getHistoricalTokenAccountsByOwner
과거 슬롯에서 지갑의 토큰 계정 나열하기
getTransactionsForAddress
검사하려는 트랜잭션의 슬롯과 transactionIndex 찾기
getAccountInfo
계정의 현재 상태 읽기
요청 매개변수
상태를 읽을 슬롯입니다. 이 슬롯이 끝난 시점의 계정을 반환합니다. 지원되는 가장 이른 슬롯은 에포크 1030이 시작될 때의 상태인 444959999입니다. 생략하면 요청한 커밋먼트로 제한된 최신 인덱싱 슬롯을 읽습니다.
인증
Helius API 키입니다. 대시보드에서 무료로 발급받을 수 있습니다.
본문
application/json
이 페이지가 도움이 되었나요?
⌘I
getHistoricalAccountInfo
curl --request POST \
--url 'https://mainnet.helius-rpc.com/?api-key=' \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"id": "1",
"method": "getHistoricalAccountInfo",
"params": [
"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
{
"slot": 445000000
},
{
"encoding": "jsonParsed"
}
]
}
'import requests
url = "https://mainnet.helius-rpc.com/?api-key="
payload = {
"jsonrpc": "2.0",
"id": "1",
"method": "getHistoricalAccountInfo",
"params": ["EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", { "slot": 445000000 }, { "encoding": "jsonParsed" }]
}
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: 'getHistoricalAccountInfo',
params: [
'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
{slot: 445000000},
{encoding: 'jsonParsed'}
]
})
};
fetch('https://mainnet.helius-rpc.com/?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://mainnet.helius-rpc.com/?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' => 'getHistoricalAccountInfo',
'params' => [
'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
[
'slot' => 445000000
],
[
'encoding' => 'jsonParsed'
]
]
]),
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://mainnet.helius-rpc.com/?api-key="
payload := strings.NewReader("{\n \"jsonrpc\": \"2.0\",\n \"id\": \"1\",\n \"method\": \"getHistoricalAccountInfo\",\n \"params\": [\n \"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\",\n {\n \"slot\": 445000000\n },\n {\n \"encoding\": \"jsonParsed\"\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://mainnet.helius-rpc.com/?api-key=")
.header("Content-Type", "application/json")
.body("{\n \"jsonrpc\": \"2.0\",\n \"id\": \"1\",\n \"method\": \"getHistoricalAccountInfo\",\n \"params\": [\n \"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\",\n {\n \"slot\": 445000000\n },\n {\n \"encoding\": \"jsonParsed\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://mainnet.helius-rpc.com/?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\": \"getHistoricalAccountInfo\",\n \"params\": [\n \"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\",\n {\n \"slot\": 445000000\n },\n {\n \"encoding\": \"jsonParsed\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"jsonrpc": "2.0",
"id": "1",
"result": {
"context": {
"slot": 468129571
},
"value": {
"lamports": 531589475273,
"owner": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
"data": [
"<string>"
],
"executable": false,
"rentEpoch": 123,
"space": 82,
"lastUpdatedAt": {
"slot": 444999837,
"transactionIndex": 700
}
}
}
}{
"jsonrpc": "2.0",
"error": {
"code": -32602,
"message": "유효하지 않은 매개변수"
},
"id": "1"
}{
"jsonrpc": "2.0",
"error": {
"code": -32001,
"message": "인증되지 않음"
},
"id": "1"
}{
"jsonrpc": "2.0",
"error": {
"code": -32005,
"message": "요청이 너무 많음"
},
"id": "1"
}{
"jsonrpc": "2.0",
"error": {
"code": -32603,
"message": "내부 오류"
},
"id": "1"
}{
"jsonrpc": "2.0",
"error": {
"code": -32002,
"message": "서비스를 사용할 수 없음"
},
"id": "1"
}{
"jsonrpc": "2.0",
"error": {
"code": -32003,
"message": "게이트웨이 시간 초과"
},
"id": "1"
}