diff --git a/src/main/tjava/com/r35157/libs/solana/SolanaBlockChain.tjava b/src/main/tjava/com/r35157/libs/solana/SolanaBlockChain.tjava index e118147..982aea0 100644 --- a/src/main/tjava/com/r35157/libs/solana/SolanaBlockChain.tjava +++ b/src/main/tjava/com/r35157/libs/solana/SolanaBlockChain.tjava @@ -144,6 +144,22 @@ public interface SolanaBlockChain { SolanaSPLTokenProgram splProgram ) throws IOException, InterruptedException; + /** + * Fetches accounts owned by a Solana program using server-side account data filters. + * + *

This method uses Solana's {@code getProgramAccounts} RPC call. The supplied filters + * are sent to the RPC node, so matching is performed server-side instead of fetching all + * accounts owned by the program and filtering them locally.

+ * + *

The initial supported filter type is {@link SolanaProgramAccountMemcmpFilter}, which + * matches bytes at a specific offset in the account data.

+ * + * @param programId the Solana program id that owns the accounts to search + * @param filters the memcmp filters to apply when searching program accounts + * @return the matching program accounts + * @throws IOException if the program accounts could not be fetched or parsed + * @throws InterruptedException if the calling thread is interrupted while fetching program accounts + */ Set getProgramAccounts( ΩSolanaProgramIdΩ programId, Set filters