Транзакции
getTransactionsForAddress
getTransactionsForAddress возвращает полную историю транзакций Solana для адреса за один вызов — с фильтрами по времени, слоту и статусу, сортировкой и пагинацией по ключу.
POST
/
getTransactionsForAddress
curl --request POST \
--url 'https://mainnet.helius-rpc.com/?api-key=' \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"id": "1",
"method": "getTransactionsForAddress",
"params": [
"Vote111111111111111111111111111111111111111",
{
"transactionDetails": "signatures",
"limit": 50,
"sortOrder": "desc",
"filters": {
"status": "succeeded",
"slot": {
"gte": 1000,
"lt": 2000
},
"tokenTransfer": {
"direction": "in",
"mint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
}
}
}
]
}
'import requests
url = "https://mainnet.helius-rpc.com/?api-key="
payload = {
"jsonrpc": "2.0",
"id": "1",
"method": "getTransactionsForAddress",
"params": [
"Vote111111111111111111111111111111111111111",
{
"transactionDetails": "signatures",
"limit": 50,
"sortOrder": "desc",
"filters": {
"status": "succeeded",
"slot": {
"gte": 1000,
"lt": 2000
},
"tokenTransfer": {
"direction": "in",
"mint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
}
}
}
]
}
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: 'getTransactionsForAddress',
params: [
'Vote111111111111111111111111111111111111111',
{
transactionDetails: 'signatures',
limit: 50,
sortOrder: 'desc',
filters: {
status: 'succeeded',
slot: {gte: 1000, lt: 2000},
tokenTransfer: {direction: 'in', mint: 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v'}
}
}
]
})
};
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' => 'getTransactionsForAddress',
'params' => [
'Vote111111111111111111111111111111111111111',
[
'transactionDetails' => 'signatures',
'limit' => 50,
'sortOrder' => 'desc',
'filters' => [
'status' => 'succeeded',
'slot' => [
'gte' => 1000,
'lt' => 2000
],
'tokenTransfer' => [
'direction' => 'in',
'mint' => 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v'
]
]
]
]
]),
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\": \"getTransactionsForAddress\",\n \"params\": [\n \"Vote111111111111111111111111111111111111111\",\n {\n \"transactionDetails\": \"signatures\",\n \"limit\": 50,\n \"sortOrder\": \"desc\",\n \"filters\": {\n \"status\": \"succeeded\",\n \"slot\": {\n \"gte\": 1000,\n \"lt\": 2000\n },\n \"tokenTransfer\": {\n \"direction\": \"in\",\n \"mint\": \"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\"\n }\n }\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\": \"getTransactionsForAddress\",\n \"params\": [\n \"Vote111111111111111111111111111111111111111\",\n {\n \"transactionDetails\": \"signatures\",\n \"limit\": 50,\n \"sortOrder\": \"desc\",\n \"filters\": {\n \"status\": \"succeeded\",\n \"slot\": {\n \"gte\": 1000,\n \"lt\": 2000\n },\n \"tokenTransfer\": {\n \"direction\": \"in\",\n \"mint\": \"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\"\n }\n }\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\": \"getTransactionsForAddress\",\n \"params\": [\n \"Vote111111111111111111111111111111111111111\",\n {\n \"transactionDetails\": \"signatures\",\n \"limit\": 50,\n \"sortOrder\": \"desc\",\n \"filters\": {\n \"status\": \"succeeded\",\n \"slot\": {\n \"gte\": 1000,\n \"lt\": 2000\n },\n \"tokenTransfer\": {\n \"direction\": \"in\",\n \"mint\": \"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\"\n }\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"jsonrpc": "2.0",
"id": "1",
"result": {
"data": [
{
"signature": "5h6xBEauJ3PK6SWCZ1PGjBvj8vDdWG3KpwATGy1ARAXFSDwt8GFXM7W5Ncn16wmqokgpiKRLuS83KUxyZyv2sUYv",
"slot": 1054,
"transactionIndex": 42,
"err": null,
"memo": null,
"blockTime": 1641038400,
"confirmationStatus": "finalized"
},
{
"signature": "kwjd820slPK6SWCZ1PGjBvj8vDdWG3KpwATGy1ARAXFSDwt8GFXM7W5Ncn16wmqokgpiKRLuS83KUxyZyv2sUYv",
"slot": 1055,
"transactionIndex": 15,
"err": null,
"memo": null,
"blockTime": 1641038460,
"confirmationStatus": "finalized"
}
],
"paginationToken": "1055:5"
}
}Параметры запроса
Адрес аккаунта Solana, для которого нужно получить историю транзакций (кошелек, токен, программа, NFT и т. д.).
Уровень подтверждения для запроса. Уровень подтверждения
processed не поддерживается.confirmedfinalized
Максимальное количество транзакций на запрос. Используйте значения от 1 до 1000 для transactionDetails:“signatures” и от 1 до 1000 для transactionDetails:“full”.
Токен пагинации из предыдущего ответа для получения следующей страницы результатов (формат “slot:position”).
Формат кодирования данных транзакции (применяется только при transactionDetails=full).
jsonjsonParsedbase58base64
Максимальная возвращаемая версия транзакции (применяется только при transactionDetails=full). Укажите 1, чтобы получать устаревшие транзакции, а также транзакции версий v0 и v1.
Фильтр транзакций по связанным токен-аккаунтам. Определяет, следует ли включать транзакции с участием токен-аккаунтов, принадлежащих указанному адресу.
nonebalanceChangedall
Ограничивает результаты транзакциями, в которых запрашиваемый адрес участвовал в переводе токенов, соответствующем заданным критериям. Все поля необязательны и объединяются по логике AND.
Фильтр по диапазону исходных сумм в блокчейне. Все поля необязательны и могут использоваться совместно.
Авторизации
Ваш ключ API Helius. Его можно бесплатно получить на панели управления.
Тело
application/json
Массив, содержащий обязательный адрес аккаунта и необязательный объект конфигурации.
Required array length:
1 - 2 elements- string
- object
Адрес аккаунта Solana, для которого нужно получить историю транзакций (кошелек, токен, программа, NFT и т. д.).
Пример:
"Vote111111111111111111111111111111111111111"
Была ли эта страница полезной?
⌘I
getTransactionsForAddress
curl --request POST \
--url 'https://mainnet.helius-rpc.com/?api-key=' \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"id": "1",
"method": "getTransactionsForAddress",
"params": [
"Vote111111111111111111111111111111111111111",
{
"transactionDetails": "signatures",
"limit": 50,
"sortOrder": "desc",
"filters": {
"status": "succeeded",
"slot": {
"gte": 1000,
"lt": 2000
},
"tokenTransfer": {
"direction": "in",
"mint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
}
}
}
]
}
'import requests
url = "https://mainnet.helius-rpc.com/?api-key="
payload = {
"jsonrpc": "2.0",
"id": "1",
"method": "getTransactionsForAddress",
"params": [
"Vote111111111111111111111111111111111111111",
{
"transactionDetails": "signatures",
"limit": 50,
"sortOrder": "desc",
"filters": {
"status": "succeeded",
"slot": {
"gte": 1000,
"lt": 2000
},
"tokenTransfer": {
"direction": "in",
"mint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
}
}
}
]
}
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: 'getTransactionsForAddress',
params: [
'Vote111111111111111111111111111111111111111',
{
transactionDetails: 'signatures',
limit: 50,
sortOrder: 'desc',
filters: {
status: 'succeeded',
slot: {gte: 1000, lt: 2000},
tokenTransfer: {direction: 'in', mint: 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v'}
}
}
]
})
};
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' => 'getTransactionsForAddress',
'params' => [
'Vote111111111111111111111111111111111111111',
[
'transactionDetails' => 'signatures',
'limit' => 50,
'sortOrder' => 'desc',
'filters' => [
'status' => 'succeeded',
'slot' => [
'gte' => 1000,
'lt' => 2000
],
'tokenTransfer' => [
'direction' => 'in',
'mint' => 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v'
]
]
]
]
]),
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\": \"getTransactionsForAddress\",\n \"params\": [\n \"Vote111111111111111111111111111111111111111\",\n {\n \"transactionDetails\": \"signatures\",\n \"limit\": 50,\n \"sortOrder\": \"desc\",\n \"filters\": {\n \"status\": \"succeeded\",\n \"slot\": {\n \"gte\": 1000,\n \"lt\": 2000\n },\n \"tokenTransfer\": {\n \"direction\": \"in\",\n \"mint\": \"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\"\n }\n }\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\": \"getTransactionsForAddress\",\n \"params\": [\n \"Vote111111111111111111111111111111111111111\",\n {\n \"transactionDetails\": \"signatures\",\n \"limit\": 50,\n \"sortOrder\": \"desc\",\n \"filters\": {\n \"status\": \"succeeded\",\n \"slot\": {\n \"gte\": 1000,\n \"lt\": 2000\n },\n \"tokenTransfer\": {\n \"direction\": \"in\",\n \"mint\": \"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\"\n }\n }\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\": \"getTransactionsForAddress\",\n \"params\": [\n \"Vote111111111111111111111111111111111111111\",\n {\n \"transactionDetails\": \"signatures\",\n \"limit\": 50,\n \"sortOrder\": \"desc\",\n \"filters\": {\n \"status\": \"succeeded\",\n \"slot\": {\n \"gte\": 1000,\n \"lt\": 2000\n },\n \"tokenTransfer\": {\n \"direction\": \"in\",\n \"mint\": \"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\"\n }\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"jsonrpc": "2.0",
"id": "1",
"result": {
"data": [
{
"signature": "5h6xBEauJ3PK6SWCZ1PGjBvj8vDdWG3KpwATGy1ARAXFSDwt8GFXM7W5Ncn16wmqokgpiKRLuS83KUxyZyv2sUYv",
"slot": 1054,
"transactionIndex": 42,
"err": null,
"memo": null,
"blockTime": 1641038400,
"confirmationStatus": "finalized"
},
{
"signature": "kwjd820slPK6SWCZ1PGjBvj8vDdWG3KpwATGy1ARAXFSDwt8GFXM7W5Ncn16wmqokgpiKRLuS83KUxyZyv2sUYv",
"slot": 1055,
"transactionIndex": 15,
"err": null,
"memo": null,
"blockTime": 1641038460,
"confirmationStatus": "finalized"
}
],
"paginationToken": "1055:5"
}
}