Wallets API
Which ZK-compressed accounts a wallet or program holds
The Solana ZK-compressed accounts a wallet or program owns (or its compressed token accounts), those a wallet is delegate of, or one account by leaf hash or address.
/api/external/wallet-analysis/compressed-accounts/{chain}What it returns
Reads Solana ZK-compression state: accounts that live as leaves of a state Merkle tree and that the ordinary account reads never see. Name exactly ONE subject: owner lists the compressed accounts whose owner is that wallet or program; with kind=token it lists instead the compressed TOKEN accounts holding that wallet's tokens, with their mint, amount, delegate and state. delegate lists the compressed token accounts that wallet may move. hash (a leaf hash) or address (a compressed address) answers one account; when it is a compressed token account its raw amount is filled in. Rows of kind=all carry token: null even for token accounts: use kind=token for token data. A hash or address nobody holds answers 200 with an empty accounts. Lists page with limit and cursor; pass back cursor until it is null. Lamports and amounts are decimal strings, null when above 2^53.
Chains
- Solana SOL
Request
Send your key in the x-dex-data-key header. Replace each <placeholder> with a real value.
curl -H "x-dex-data-key: $DEXDATA_API_KEY" \ "https://api.dexdata.io/api/external/wallet-analysis/compressed-accounts/SOL"
| Parameter | Description |
|---|---|
ownerquery · string · optional | A wallet or program, base58: list the compressed accounts it owns. |
delegatequery · string · optional | A wallet, base58: list the compressed token accounts it is the delegate of. |
hashquery · string · optional | A compressed account's leaf hash, base58: answer that one account. |
addressquery · string · optional | A compressed address, base58: answer the account at that address. |
kindquery · string · optional | With owner only. all (the default) lists every compressed account it owns, without token data; token lists its compressed token accounts with their token data. With delegate the listing is always token accounts, so only token is accepted; with hash or address it is refused.alltoken |
limitquery · integer · optional | Rows per page, 1-1000; defaults to 100. With owner or delegate only. |
cursorquery · string · optional | The cursor of the previous page, unchanged. With owner or delegate only. |
chainpath · string · required | SOL. Every other chain returns 400: compressed accounts live in Solana ZK-compression state trees. |
Response fields
A JSON response. Every field is always present; null means the value could not be established, never zero.
| Field | Type | Description |
|---|---|---|
slot | integer | The slot the compression state was read at. |
accounts | object[] | The accounts, one per row. A real empty array when there are none. |
accounts[].hash | string | The account's leaf hash, base58 — its identity in the state tree. Every write replaces the leaf, so the hash changes each time the account changes. |
accounts[].address | string | null | The account's persistent compressed address, when it has one (program-derived accounts); else null. |
accounts[].owner | string | The program or wallet that owns the account. Every compressed token account is owned by the compressed-token program; the wallet holding the tokens is token.owner. |
accounts[].lamports | string | null | Lamports held, as a decimal string. null when the true figure exceeds 2^53: the source encodes it as a JSON number and cannot carry it exactly. |
accounts[].tree | string | The state tree holding the leaf. |
accounts[].leafIndex | integer | The leaf's position in the state tree. |
accounts[].seq | integer | null | The tree sequence number when the leaf was written; null when not reported. |
accounts[].slotCreated | integer | The slot the leaf was written in. |
accounts[].dataHash | string | null | The hash of the account data; null for an account with no data. |
accounts[].data | string | null | The account data, base64; null for an account with no data. |
accounts[].token | object | null | Token data when the account is a compressed token account and the query reads it; null otherwise. kind=all never reads it (every row there is null, token accounts included). A lookup by hash or address of a token account fills amountRaw only; its other fields are null because that lookup does not return them. |
accounts[].token.mint | string | null | The token mint. |
accounts[].token.owner | string | null | The wallet that owns the tokens (not the program that owns the account). |
accounts[].token.amountRaw | string | null | Raw base units as a decimal string, no decimals applied. null when unknown, or when the true amount exceeds 2^53: the source encodes it as a JSON number and cannot carry it exactly. |
accounts[].token.delegate | string | null | The wallet allowed to move the tokens, or null when none is set. |
accounts[].token.state | string | null | initialized or frozen. |
cursor | string | null | Pass as cursor for the next page; null on the last page and on a lookup by hash or address. |
Start building with DexData today
Sign in, create a key and make your first call in a minute. Free credits every month, and you only pay for calls that succeed.
Get a free API key