getTokenAccounts
Last updated:
`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 related `getTokenAccountsByOwner` / > `getTokenAccountsByDelegate` methods. Do not rely on field names until the > api.2.2+ schema is finalized.
Parameters
This method takes no parameters.
Returns
| Field | Type |
|---|---|
| result | object |
Examples
curl https://<your-endpoint>/ \
-X POST -H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"getTokenAccounts","params":[]}'const res = await fetch("https://<your-endpoint>/", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"id": 1,
"method": "getTokenAccounts",
"params": [],
"jsonrpc": "2.0"
}),
});
const data = await res.json();import requests
resp = requests.post("https://<your-endpoint>/", json={"id":1,"method":"getTokenAccounts","params":[],"jsonrpc":"2.0"})
print(resp.json())Usage
- Transport: HTTP (JSON-RPC).
- Networks: mainnet.
- Credit cost: 10 per call.
FAQ
- What does getTokenAccounts do?
- Digital Asset Standard (DAS) lookup that returns the token accounts associated with a mint or owner in a single call.
- How many credits does getTokenAccounts cost?
- getTokenAccounts costs 10 credit(s) per call on Triport by default.
- Is getTokenAccounts available over WebSocket?
- getTokenAccounts is an HTTP JSON-RPC method.