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.
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.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Background
SolanaBlockChaincan already retrieve SPL-token holdings throughgetSPLTokenHoldings(...), butSolanaWalletcurrently only exposes the wallet's SOL balance.Add a general wallet method for retrieving the balance of a specific SPL token.
Suggested API
SolanaWalletImplshould 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
SolanaWalletexposes an SPL-token balance method.SolanaWalletImpluses the existing blockchain API.