钱包
获取历史代币余额
获取钱包在过去某个时间戳、日期时间或槽位的特定代币或本地 SOL 余额。
GET
/
v1
/
wallet
/
{wallet}
/
balance-at
获取历史余额
curl --request GET \
--url 'https://api.helius.xyz/v1/wallet/{wallet}/balance-at?api-key='import requests
url = "https://api.helius.xyz/v1/wallet/{wallet}/balance-at?api-key="
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.helius.xyz/v1/wallet/{wallet}/balance-at?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://api.helius.xyz/v1/wallet/{wallet}/balance-at?api-key=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.helius.xyz/v1/wallet/{wallet}/balance-at?api-key="
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.helius.xyz/v1/wallet/{wallet}/balance-at?api-key=")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.helius.xyz/v1/wallet/{wallet}/balance-at?api-key=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"wallet": "5tzFkiKscXHK5ZXCGbXZxdw7gTjjD1mBwuoFbhUvuAi9",
"mint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"isNative": false,
"balance": "284961463.392936",
"balanceRaw": "284961463392936",
"decimals": 6,
"requested": {
"time": 1736536800,
"slot": null,
"datetime": null
},
"asOf": {
"slot": 313000000,
"signature": "5Cyy7Mh9nVgFq3T8wJp2sKxR4dE6bA1uZoNcLrXmYqUpon",
"blockTime": 1736536794
}
}{
"error": "必须提供`time`、`datetime`或`slot`中的一个",
"code": 400
}{
"error": "需要API密钥。通过?api-key=xxx或X-Api-Key头传递",
"code": 401
}{
"error": "无效的钱包地址",
"code": 400,
"details": "'invalid-address' 不是有效的 Solana 地址"
}{
"error": "RATE_LIMIT_EXCEEDED",
"code": 429,
"details": "请求过多。请在 2 秒后重试。"
}{
"error": "INTERNAL_ERROR",
"code": 500,
"details": "发生意外错误。请重试。"
}{
"error": "UPSTREAM_ERROR",
"code": 502,
"details": "上游RPC请求失败。请重试。"
}此页面对您有帮助吗?
⌘I
获取历史余额
curl --request GET \
--url 'https://api.helius.xyz/v1/wallet/{wallet}/balance-at?api-key='import requests
url = "https://api.helius.xyz/v1/wallet/{wallet}/balance-at?api-key="
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.helius.xyz/v1/wallet/{wallet}/balance-at?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://api.helius.xyz/v1/wallet/{wallet}/balance-at?api-key=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.helius.xyz/v1/wallet/{wallet}/balance-at?api-key="
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.helius.xyz/v1/wallet/{wallet}/balance-at?api-key=")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.helius.xyz/v1/wallet/{wallet}/balance-at?api-key=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"wallet": "5tzFkiKscXHK5ZXCGbXZxdw7gTjjD1mBwuoFbhUvuAi9",
"mint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"isNative": false,
"balance": "284961463.392936",
"balanceRaw": "284961463392936",
"decimals": 6,
"requested": {
"time": 1736536800,
"slot": null,
"datetime": null
},
"asOf": {
"slot": 313000000,
"signature": "5Cyy7Mh9nVgFq3T8wJp2sKxR4dE6bA1uZoNcLrXmYqUpon",
"blockTime": 1736536794
}
}{
"error": "必须提供`time`、`datetime`或`slot`中的一个",
"code": 400
}{
"error": "需要API密钥。通过?api-key=xxx或X-Api-Key头传递",
"code": 401
}{
"error": "无效的钱包地址",
"code": 400,
"details": "'invalid-address' 不是有效的 Solana 地址"
}{
"error": "RATE_LIMIT_EXCEEDED",
"code": 429,
"details": "请求过多。请在 2 秒后重试。"
}{
"error": "INTERNAL_ERROR",
"code": 500,
"details": "发生意外错误。请重试。"
}{
"error": "UPSTREAM_ERROR",
"code": 502,
"details": "上游RPC请求失败。请重试。"
}