Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getTokenAccountsByOwner #187

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

wiyarmir
Copy link
Member

@wiyarmir wiyarmir commented Jan 14, 2025

TL;DR

Added support for retrieving SPL Token accounts by owner with optional mint or program ID filtering.

What changed?

  • Created a new PublicKeyBase58Serializer for handling Base58 serialization of public keys
  • Implemented getTokenAccountsByOwner methods with support for filtering by mint or program ID
  • Added data classes to represent token account information including account details, token amounts, and ownership data

How to test?

// Test retrieving token accounts by owner and mint
val tokenAccounts = client.getTokenAccountsByOwnerAndMint(
    account = ownerPublicKey,
    mint = mintPublicKey
)

// Test retrieving token accounts by owner and program ID
val programTokenAccounts = client.getTokenAccountsByOwnerAndProgramId(
    account = ownerPublicKey,
    programId = programPublicKey
)

Why make this change?

This addition enables querying and filtering SPL Token accounts, which is essential for applications that need to track token holdings, manage token accounts, or analyze token-related activities for specific accounts on the Solana blockchain.

Copy link
Contributor

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails

Scanned Files

Copy link
Contributor

🥳 JUnit passed

Passed Failed Skipped
✅ 38 ❌ 0 ⚠️ 4

You can see the report here.

@wiyarmir wiyarmir requested a review from jszmltr January 14, 2025 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant