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.

GET/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"
Parameters
ParameterDescription
owner

query · string · optional

A wallet or program, base58: list the compressed accounts it owns.
delegate

query · string · optional

A wallet, base58: list the compressed token accounts it is the delegate of.
hash

query · string · optional

A compressed account's leaf hash, base58: answer that one account.
address

query · string · optional

A compressed address, base58: answer the account at that address.
kind

query · 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
limit

query · integer · optional

Rows per page, 1-1000; defaults to 100. With owner or delegate only.
cursor

query · string · optional

The cursor of the previous page, unchanged. With owner or delegate only.
chain

path · 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.

Response fields of Which ZK-compressed accounts a wallet or program holds
FieldTypeDescription
slotintegerThe slot the compression state was read at.
accountsobject[]The accounts, one per row. A real empty array when there are none.
accounts[].hashstringThe 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[].addressstring | nullThe account's persistent compressed address, when it has one (program-derived accounts); else null.
accounts[].ownerstringThe 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[].lamportsstring | nullLamports 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[].treestringThe state tree holding the leaf.
accounts[].leafIndexintegerThe leaf's position in the state tree.
accounts[].seqinteger | nullThe tree sequence number when the leaf was written; null when not reported.
accounts[].slotCreatedintegerThe slot the leaf was written in.
accounts[].dataHashstring | nullThe hash of the account data; null for an account with no data.
accounts[].datastring | nullThe account data, base64; null for an account with no data.
accounts[].tokenobject | nullToken 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.mintstring | nullThe token mint.
accounts[].token.ownerstring | nullThe wallet that owns the tokens (not the program that owns the account).
accounts[].token.amountRawstring | nullRaw 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.delegatestring | nullThe wallet allowed to move the tokens, or null when none is set.
accounts[].token.statestring | nullinitialized or frozen.
cursorstring | nullPass 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