We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
get_token_accounts_by_owner_json_parsed
As mentioned here #48 I'm doing the following the get the token balance of a token account
opts = TokenAccountOpts(program_id=Pubkey.from_string('TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA')) data = http_client.get_token_accounts_by_owner_json_parsed(addr, opts) print(data)
GetTokenAccountsByOwnerJsonParsedResp { │ context: RpcResponseContext { │ │ slot: 266082342, │ │ api_version: Some( │ │ │ "1.17.28", │ │ ), │ }, │ value: [ │ │ RpcKeyedAccountJsonParsed { │ │ │ pubkey: Pubkey( │ │ │ │ DDbasA38QbfNA3newPNSi7ecNSuX2mocuXQBTEb4oPw4, │ │ │ ), │ │ │ account: AccountJSON { │ │ │ │ lamports: 2039280, │ │ │ │ data: ParsedAccount( │ │ │ │ │ ParsedAccount { │ │ │ │ │ │ program: "spl-token", │ │ │ │ │ │ parsed: Object { │ │ │ │ │ │ │ "info": Object { │ │ │ │ │ │ │ │ "isNative": Bool(false), │ │ │ │ │ │ │ │ "mint": String("Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB"), │ │ │ │ │ │ │ │ "owner": String("addr"), │ │ │ │ │ │ │ │ "state": String("initialized"), │ │ │ │ │ │ │ │ "tokenAmount": Object { │ │ │ │ │ │ │ │ │ "amount": String("14322586"), │ │ │ │ │ │ │ │ │ "decimals": Number(6), │ │ │ │ │ │ │ │ │ "uiAmount": Number(14.322586), │ │ │ │ │ │ │ │ │ "uiAmountString": String("14.322586"), │ │ │ │ │ │ │ │ }, │ │ │ │ │ │ │ }, │ │ │ │ │ │ │ "type": String("account"), │ │ │ │ │ │ }, │ │ │ │ │ │ space: 165, │ │ │ │ │ }, │ │ │ │ ), │ │ │ │ owner: Pubkey( │ │ │ │ │ TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA, │ │ │ │ ), │ │ │ │ executable: false, │ │ │ │ rent_epoch: 18446744073709551615, │ │ │ }, │ │ }, │ │ RpcKeyedAccountJsonParsed { │ │ │ pubkey: Pubkey( │ │ │ │ 9S7bZeawU8UM2ez5oZWC5ye2f3xJZNsCKFFEZHa1kPTz, │ │ │ ), │ │ │ account: AccountJSON { │ │ │ │ lamports: 2039280, │ │ │ │ data: ParsedAccount( │ │ │ │ │ ParsedAccount { │ │ │ │ │ │ program: "spl-token", │ │ │ │ │ │ parsed: Object { │ │ │ │ │ │ │ "info": Object { │ │ │ │ │ │ │ │ "isNative": Bool(false), │ │ │ │ │ │ │ │ "mint": String("EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"), │ │ │ │ │ │ │ │ "owner": String("addr"), │ │ │ │ │ │ │ │ "state": String("initialized"), │ │ │ │ │ │ │ │ "tokenAmount": Object { │ │ │ │ │ │ │ │ │ "amount": String("1430977"), │ │ │ │ │ │ │ │ │ "decimals": Number(6), │ │ │ │ │ │ │ │ │ "uiAmount": Number(1.430977), │ │ │ │ │ │ │ │ │ "uiAmountString": String("1.430977"), │ │ │ │ │ │ │ │ }, │ │ │ │ │ │ │ }, │ │ │ │ │ │ │ "type": String("account"), │ │ │ │ │ │ }, │ │ │ │ │ │ space: 165, │ │ │ │ │ }, │ │ │ │ ), │ │ │ │ owner: Pubkey( │ │ │ │ │ TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA, │ │ │ │ ), │ │ │ │ executable: false, │ │ │ │ rent_epoch: 18446744073709551615, │ │ │ }, │ │ }, │ ], }
This is my account that I'm fetching
The text was updated successfully, but these errors were encountered:
No branches or pull requests
As mentioned here #48 I'm doing the following the get the token balance of a token account
This is my account that I'm fetching
The text was updated successfully, but these errors were encountered: