ウォレット
ウォレット残高の取得
Solanaウォレットアドレスのトークン残高とSOL保有を取得します。
GET
/
v1
/
wallet
/
{wallet}
/
balances
ウォレット残高を取得
curl --request GET \
--url 'https://api.helius.xyz/v1/wallet/{wallet}/balances?api-key='import requests
url = "https://api.helius.xyz/v1/wallet/{wallet}/balances?api-key="
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.helius.xyz/v1/wallet/{wallet}/balances?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}/balances?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}/balances?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}/balances?api-key=")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.helius.xyz/v1/wallet/{wallet}/balances?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{
"balances": [
{
"mint": "So11111111111111111111111111111111111111112",
"balance": 1.5,
"decimals": 9,
"tokenProgram": "spl-token",
"symbol": "SOL",
"name": "Solana",
"pricePerToken": 145.32,
"usdValue": 217.98,
"logoUri": "https://example.com/sol-logo.png"
}
],
"totalUsdValue": 217.98,
"pagination": {
"page": 1,
"limit": 100,
"hasMore": true
},
"nfts": [
{
"mint": "7Xq8wXyXVqfBPPqVJjPDwG9zN5wCVxBYZ6z7vPYBzr6F",
"compressed": false,
"name": "Degen Ape",
"imageUri": "https://example.com/nft.png",
"collectionName": "Degen Ape Academy",
"collectionAddress": "DegN1dXmU2uYa4n7U9qTh7YNYpK4u8L9qXx7XqYqJfGH"
}
]
}{
"error": "Invalid wallet address",
"code": 400,
"details": "'invalid-address' is not a valid Solana address"
}{
"error": "API key required. Pass via ?api-key=xxx or X-Api-Key header",
"code": 401
}{
"error": "RATE_LIMIT_EXCEEDED",
"code": 429,
"details": "Too many requests. Retry after 2 seconds."
}{
"error": "INTERNAL_ERROR",
"code": 500,
"details": "An unexpected error occurred. Please retry."
}各リクエストには100クレジットがかかります。
リクエストパラメータ
string
デフォルト:"GQUtvPx89ZNCwmvQqFmH59bJcU8fW8siETpaxod7Aydz"
必須
Solanaウォレットアドレス(base58エンコード)
number
デフォルト:"1"
ページネーションのためのページ番号(1から開始)
number
デフォルト:"100"
ページごとの最大トークン数
boolean
デフォルト:"false"
残高ゼロのトークンを含める
boolean
デフォルト:"true"
結果にネイティブSOLを含める
boolean
デフォルト:"false"
結果にNFTを含める(最大100、最初のページのみ)
承認
ApiKeyQueryApiKeyHeader
クエリパラメータとして渡されるAPIキー
パスパラメータ
Solanaウォレットアドレス(base58エンコードされた)
Pattern:
^[1-9A-HJ-NP-Za-km-z]{32,44}$クエリパラメータ
ページ番号(1から始まる)
必須範囲:
x >= 1ページごとの最大トークン数
必須範囲:
1 <= x <= 100残高がゼロのトークンを含める
結果にネイティブSOLを含める
結果にNFTを含める(最大100、最初のページのみ)
レスポンス
ウォレットの残高を正常に取得しました
現在のページのトークン残高の配列、ネイティブSOLを含みます。 showNative=trueの場合、SOLはミントアドレスSo11111111111111111111111111111111111111112で最初に表示されます。 他のトークンはUSD価値の降順でソートされます。
Show child attributes
Show child attributes
このページの残高の合計USD価値(総ポートフォリオ価値ではありません)
例:
217.98
ページングメタデータ。ユーザーはページパラメータを使用して手動で追加ページをリクエストする必要があります。
Show child attributes
Show child attributes
NFT保有物の配列(showNfts=trueの場合のみ含まれます、最大100、最初のページのみ)
Show child attributes
Show child attributes
このページは役に立ちましたか?
⌘I
ウォレット残高を取得
curl --request GET \
--url 'https://api.helius.xyz/v1/wallet/{wallet}/balances?api-key='import requests
url = "https://api.helius.xyz/v1/wallet/{wallet}/balances?api-key="
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.helius.xyz/v1/wallet/{wallet}/balances?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}/balances?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}/balances?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}/balances?api-key=")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.helius.xyz/v1/wallet/{wallet}/balances?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{
"balances": [
{
"mint": "So11111111111111111111111111111111111111112",
"balance": 1.5,
"decimals": 9,
"tokenProgram": "spl-token",
"symbol": "SOL",
"name": "Solana",
"pricePerToken": 145.32,
"usdValue": 217.98,
"logoUri": "https://example.com/sol-logo.png"
}
],
"totalUsdValue": 217.98,
"pagination": {
"page": 1,
"limit": 100,
"hasMore": true
},
"nfts": [
{
"mint": "7Xq8wXyXVqfBPPqVJjPDwG9zN5wCVxBYZ6z7vPYBzr6F",
"compressed": false,
"name": "Degen Ape",
"imageUri": "https://example.com/nft.png",
"collectionName": "Degen Ape Academy",
"collectionAddress": "DegN1dXmU2uYa4n7U9qTh7YNYpK4u8L9qXx7XqYqJfGH"
}
]
}{
"error": "Invalid wallet address",
"code": 400,
"details": "'invalid-address' is not a valid Solana address"
}{
"error": "API key required. Pass via ?api-key=xxx or X-Api-Key header",
"code": 401
}{
"error": "RATE_LIMIT_EXCEEDED",
"code": 429,
"details": "Too many requests. Retry after 2 seconds."
}{
"error": "INTERNAL_ERROR",
"code": 500,
"details": "An unexpected error occurred. Please retry."
}