„KeyexcludedfromsecondideXmexmexesage” after using Get_program_accounts
for token spl at Solane
As the use of a developer on blockchain Solan, it is necessary to understand the smallness of the ecosystem of salt pans. In this article, we will examine the error that occurs when the function Get_program_accounts
from Solan-Pipe ‘library is used to download the 100 best holders of a particular Spl token.
Problem: Keyexcludeddardardaryindexmexmessage
When you call „Get_program_accounts”, Solana returns a list of program accounts that are addresses that have access to the blockchain. In some cases, however, the key from this administration of the secondary index would be excluded for various reasons, such as:
- Account is not eligible for transactions or reading.
- Account is deactivated.
- There is a problem with the configuration of programming accounts.
In our case, there is an error „KeyexcludddardardDexmexmesage” when „Get_program_accounts” returns the list of accounts that have no programs with them. This is often for the following reasons:
- The user has restricted the account access.
- A program that owns an account does not allow it to be included in the secondary index.
Why you find an error
If you come across “Error: KeyexcludedfardDardDexmexmexmesage” When using Get_program_accounts
for your token spl there are a few potential reasons why:
1.
- Limited access : User has limited access to an account or program.
3
How to solve the problem
To solve this problem, you can try the following steps:
- Check the call
Get_program_accounts
: Make sure you have called the correct Get_program_accountsand broadcast in the sought -after arguments.
- Check your account access : Make sure the user has access to the account by checking their licenses using the Solan API documentation.
3
Example code
Here is an example of how you can use "Get_program_accounts" to get the best 100 brackets of a particular spl token on Solane:
Python
Import solan.pubiscy as PK
From Solan Ilana Imports Get_acCount, Get_accoun_info
Def Main ():
Define Account ID and SPL token name
Account_id = „Your_Account_id”
Spl_token_name = „your_spl_oken_name”
Create an instance of the client using the solan Tool CLI
From Solan.Web3 Imports Web3
Web3 = Web3 ()
Get your account information for your SPL token holder
Spl_token_aolders = get_program_accounts (Web3, Accounn_id, Spl_Token_name)
Print („Top 100 Holder”, spl_token_name)
Print (spl_token_holders [: 100])
If __name__ == „__main__”:
Main ()
`
Conclusion
In this article, we examined the error that happens when we useGet_program_accounts’ to find the 100 best holders of a particular spl token on the salt pans. Understanding the potential reasons for this error and the following steps mentioned in the example, you should be able to solve the problem and successfully use „Get_program_accounts” with the SPL token.