0

I am trying to find all the token accounts that belong to a specific wallet address however i keep getting this error: Error: failed to get accounts owned by program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA: TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA excluded from account secondary indexes; this RPC method unavailable for key

my code:

const filters:solanaWeb3.GetProgramAccountsFilter[] = [
                    {
                        dataSize:156
                    },
                    {
                        memcmp:{
                            offset:32,
                            bytes:newPub.toString()
                        }
                    }
                ]
                const tA = await connection.getParsedProgramAccounts(TOKEN_PROGRAM_ID,{filters})

1 Answer 1

1

Token program has one of the largest sets of accounts on Solana and is usually excluded by many RPC nodes for performance reasons. If you are using any publicly available (and free to use) RPC nodes, the chances are that it's excluded.

You can use quicknode or other hosted/paid RPC nodes - it should work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.