capabilities.work

Snapshot a Wallet's SOL and SPL Token Holdings

A 3-step recipe with Solana. We can help you get access.

Recipe · 3 steps

Snapshot a Wallet's SOL and SPL Token Holdings

with Solana

Build a holdings snapshot for a single wallet address.

  1. Read the wallet's native SOL balance in lamports.
  2. Enumerate every SPL Token account owned by the wallet, parsed so mint and amount are readable without decoding account data by hand.
  3. Resolve the balance of the wallet's first token account, returning the raw amount alongside the mint's decimals and a display-ready string.
What you'll need to have ready
  • ownerAddress: Base58-encoded wallet public key that owns the accounts.
  • tokenProgramId: The token program that owns the token accounts.
For your developer

Arazzo workflow solana:wallet-portfolio, 3 operations: getBalance → getTokenAccountsByOwner → getTokenAccountBalance. Specs on APIs.io.