getTokenAccounts
https://api.triport.ioDigital Asset Standard (DAS) lookup that returns the token accounts associated with a mint or owner in a single call.
getTokenAccounts is part of the Digital Asset Standard (DAS) family of methods.
It is intended to return the SPL token accounts tied to a given mint or owner,
combining the token-account enumeration that would otherwise require multiple
getTokenAccountsByOwner / getTokenAccountsByDelegate calls into a single
DAS-indexed query.
Use it when you need to enumerate token holdings without first knowing the exact program-account filters, or when you want the DAS index's faster, paginated view of large account sets. Because DAS methods are served from an index rather than the validator directly, they require at least the basic tier.
This is a scaffold entry (
summary: "scaffold — described by api.2.2/2.3/2.4"). The parameter list is currently empty in the spec and the result is typed as an open object ({ "type": "object", "additionalProperties": true }). The parameters and response fields documented below reflect the intended DAS contract and the shape used by the relatedgetTokenAccountsByOwner/getTokenAccountsByDelegatemethods. Do not rely on field names until the api.2.2+ schema is finalized.
Parameters
JSON-RPC named/object parameters (intended contract — subject to change at api.2.2+):
mintstring (base-58 pubkey)optionalownerstring (base-58 pubkey)optionalpageintegeroptionallimitintegeroptionalResponse
The finalized result is expected to follow the DAS token-account shape used by
the sibling read methods — a context slot plus a value array of
{ pubkey, account } entries:
result.context.slotintegerresult.valuearrayresult.value[].pubkeystringresult.value[].accountobjectlamports, owner, data, executable, rentEpoch, space).Errors
| Code | Meaning | When it happens |
|---|---|---|
401 | Unauthorized | Missing or invalid Authorization: Bearer API key. |
403 | Forbidden / tier too low | Your plan is below the basic tier required for sol_das methods. |
429 | Rate limited | You exceeded the requests-per-second allowance for your tier (RPS + burst; there is no daily quota). |
-32601 | Method not found | The method is unavailable on the connected spec version. |
-32602 | Invalid params | Parameters did not match the (finalized) schema. |
See the shared errors reference for the full error envelope.
Examples
JavaScript (fetch)
const res = await fetch("https://api.triport.io", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.TRIPORT_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
jsonrpc: "2.0",
id: 1,
method: "getTokenAccounts",
params: {
owner: "4Nd1mYpQ8Z3vR2sK9bXcW7gH5fT6jL1aP0eU8nQ2dVx",
page: 1,
limit: 100,
},
}),
});
const { result } = await res.json();
console.log(result.value);TypeScript SDK (@triport/sdk)
import { TriportClient } from "@triport/sdk";
const client = new TriportClient({ apiKey: process.env.TRIPORT_API_KEY! });
// Scaffold method: pass params as an object; result is typed as `unknown`
// until the api.2.2+ schema is released.
const result = await client.solana.rpc("getTokenAccounts", {
owner: "4Nd1mYpQ8Z3vR2sK9bXcW7gH5fT6jL1aP0eU8nQ2dVx",
page: 1,
limit: 100,
});
console.log(result);Python (triport-sdk)
import os
from triport import TriportClient
client = TriportClient(api_key=os.environ["TRIPORT_API_KEY"])
result = client.solana.rpc(
"getTokenAccounts",
{
"owner": "4Nd1mYpQ8Z3vR2sK9bXcW7gH5fT6jL1aP0eU8nQ2dVx",
"page": 1,
"limit": 100,
},
)
print(result)Notes
- Scaffold status: params and result are deferred to spec api.2.2 / 2.3 / 2.4. Pin your client to a spec version and re-check this page when the finalized schema ships before depending on specific field names.
- Tier:
sol_dasmethods require the basic tier or higher. The free tier cannot call this method (403). - Pagination: DAS lookups are expected to be paginated via
page/limit; iterate pages until the returnedvaluearray is shorter thanlimit. - Related methods: for the validator-direct (non-DAS, free-tier) equivalents
see
getTokenAccountsByOwnerandgetTokenAccountsByDelegate. Other DAS methods in the same category includegetAsset,getAssetProof,getAssetsByGroup, andgetAssetsByOwner.