TriportRPC

List SPL tokens on a wallet

GEThttps://api.triport.io/v1/sol/wallet/tokens/So11111111111111111111111111111111111111112?include_zero=false

Returns every SPL token account held by a Solana address, with balances, mint decimals, and (when cached) token metadata.

Solanasol_read_rpcfree — RPS-per-tier with a burst multiplier of 2×

Lists the token accounts owned by a single Solana wallet. For each holding you get the SPL mint, the raw amount (a u64 rendered as a string to avoid precision loss), the mint's decimals, and a convenience ui_amount (amount scaled by decimals). When token metadata has been cached, the response also carries the human-readable name, symbol, and logo_uri.

Use this to render a wallet's portfolio or to check a specific token balance. By default, accounts with a zero balance are omitted; pass include_zero=true to include closed-out or empty token accounts as well.

Gotchas:

  • amount is a string, not a number. Parse it as a big integer and divide by 10 ** decimals yourself if you need exact arithmetic — ui_amount is a double and is lossy for large balances.
  • name, symbol, and logo_uri are optional and only present for mints whose metadata is cached. Treat them as best-effort, not guaranteed.
  • This endpoint covers SPL tokens only. For native SOL use wallet balance; for NFTs use wallet NFTs.

Parameters

Path parameters

addressstringrequired
Solana base58 pubkey (32 bytes), length 32–44, matching ^[1-9A-HJ-NP-Za-km-z]+$.
Query parametersobject
include_zerobooleanoptional
Include token accounts with a zero balance. Default false.

Response

Response fields

FieldTypeDescription
addressstringThe wallet address that was queried (echoes the path param).
tokensarrayList of SolTokenBalance objects, one per token account.
tokens[].mintstringSPL token mint address. Required.
tokens[].amountstringRaw balance as a u64 rendered as a decimal string. Required.
tokens[].decimalsintegerMint decimals (0–18). Required.
tokens[].ui_amountnumber (double)amount scaled by decimals. Convenience only; lossy for large values.
tokens[].owner_programstringToken program that owns the account (e.g. SPL Token or Token-2022).
tokens[].namestringToken name, when metadata is cached.
tokens[].symbolstringToken symbol, when metadata is cached.
tokens[].logo_uristring (uri)Token logo URL, when metadata is cached.

Errors

CodeMeaningWhen it happens
401unauthorized / trial_expired / subscription_expiredMissing or invalid credentials, or the API key's trial/subscription has lapsed.
403tier_insufficient / method_unknownThe key's tier is below what this method requires, or the method isn't part of the key's product.
429rate_limitedSustained RPS for the sol_read_rpc category exceeded. Honor the Retry-After header.

On a 429, the response carries Retry-After, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, and X-RateLimit-Category headers. There is no daily quota — limiting is RPS-per-tier with burst only. See the shared errors reference for the full error envelope.

Examples

JavaScript (fetch)

const address = "So11111111111111111111111111111111111111112";
const res = await fetch(
  `https://api.triport.io/v1/sol/wallet/tokens/${address}?include_zero=false`,
  {
    headers: {
      Authorization: `Bearer ${process.env.TRIPORT_API_KEY}`,
      "Content-Type": "application/json",
    },
  }
);
if (!res.ok) throw new Error(`triport: ${res.status}`);
const { tokens } = await res.json();
for (const t of tokens) {
  console.log(`${t.symbol ?? t.mint}: ${t.ui_amount}`);
}

TypeScript SDK (@triport/sdk)

import { TriportClient } from "@triport/sdk";


const client = new TriportClient({ apiKey: process.env.TRIPORT_API_KEY! });


const { tokens } = await client.sol.wallet.tokens(
  "So11111111111111111111111111111111111111112",
  { includeZero: false }
);


tokens.forEach((t) => console.log(t.symbol ?? t.mint, t.uiAmount));

Python (triport-sdk)

import os
from triport import TriportClient


client = TriportClient(api_key=os.environ["TRIPORT_API_KEY"])


result = client.sol.wallet.tokens(
    "So11111111111111111111111111111111111111112",
    include_zero=False,
)
for t in result.tokens:
    print(t.symbol or t.mint, t.ui_amount)

Notes

  • Zero balances: omitted by default. Set include_zero=true to surface empty token accounts (useful when you need to detect and close rent-bearing accounts).
  • Precision: always read amount + decimals for exact math; ui_amount is for display only.
  • Related endpoints: wallet balance (native SOL), wallet history (transactions), wallet NFTs (DAS-backed NFT holdings).