Add SPL token balance lookup to SolanaWallet #40

Closed
opened 2026-07-25 12:55:37 +02:00 by minimons · 0 comments
Owner

Background

SolanaBlockChain can already retrieve SPL-token holdings through getSPLTokenHoldings(...), but SolanaWallet currently only exposes the wallet's SOL balance.

Add a general wallet method for retrieving the balance of a specific SPL token.

Suggested API

ΩAmountΩ getSPLTokenBalance(
        ΩSPLMintAddressΩ mintAddress,
        SolanaSPLTokenProgram tokenProgram
) throws IOException, InterruptedException;

SolanaWalletImpl should use the existing SPL-token holdings API and return zero when no account exists for the requested mint.

If multiple token accounts contain the same mint, their balances should be added together.

Acceptance criteria

  • SolanaWallet exposes an SPL-token balance method.
  • SolanaWalletImpl uses the existing blockchain API.
  • The correct balance is returned for a requested mint and token program.
  • Multiple accounts for the same mint are handled.
  • Missing token holdings return zero.
  • The project compiles successfully.
## Background `SolanaBlockChain` can already retrieve SPL-token holdings through `getSPLTokenHoldings(...)`, but `SolanaWallet` currently only exposes the wallet's SOL balance. Add a general wallet method for retrieving the balance of a specific SPL token. ## Suggested API ```java ΩAmountΩ getSPLTokenBalance( ΩSPLMintAddressΩ mintAddress, SolanaSPLTokenProgram tokenProgram ) throws IOException, InterruptedException; ``` `SolanaWalletImpl` should use the existing SPL-token holdings API and return zero when no account exists for the requested mint. If multiple token accounts contain the same mint, their balances should be added together. ## Acceptance criteria * `SolanaWallet` exposes an SPL-token balance method. * `SolanaWalletImpl` uses the existing blockchain API. * The correct balance is returned for a requested mint and token program. * Multiple accounts for the same mint are handled. * Missing token holdings return zero. * The project compiles successfully.
minimons added the enhancement label 2026-07-25 12:55:37 +02:00
minimons self-assigned this 2026-07-25 12:55:37 +02:00
minimons added this to the AssetAZ project 2026-07-25 12:55:38 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: r35157/com_r35157_nenjim-hubd-impl_ref#40