Closed rehanpunjwani closed 5 months ago
There appears to be a discrepancy in the response received when querying account information using the client method versus a direct RPC call.
Version: 0.34 Request:
Python
client.get_account_info(Pubkey.from_string("BLZEEuZUBVqFhj8adcCFPJvPVCiCyVmh3hkJMrU8KuJA")).to_json()
Response:
JSON
{ "jsonrpc": "2.0", "result": { "context": { "slot": 266143855, "apiVersion": "1.17.28" }, "value": { "lamports": 2558366285, "data": [ "AAAAAAi2aQPmj/kyc1PszrLaqtyAYSpJobj5d6Ix+gjkmqjkxKegvsQjxYoJAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==", "base64" ], "owner": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", "executable": false, "rentEpoch": 18446744073709551615, "space": null } }, "id": 0 }
Request:
curl --location 'https://api.mainnet-beta.solana.com'\ --header 'Content-Type: application/json'\ --data '{ "jsonrpc": "2.0", "id": 1, "method": "getAccountInfo", "params": [ "BLZEEuZUBVqFhj8adcCFPJvPVCiCyVmh3hkJMrU8KuJA", { "encoding": "jsonParsed" } ] }'
{ "jsonrpc": "2.0", "result": { "context": { "apiVersion": "1.17.28", "slot": 266143976 }, "value": { "data": { "parsed": { "info": { "decimals": 9, "freezeAuthority": null, "isInitialized": true, "mintAuthority": null, "supply": "9999437875564816324" }, "type": "mint" }, "program": "spl-token", "space": 82 }, "executable": false, "lamports": 2558366285, "owner": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", "rentEpoch": 18446744073709551615, "space": 82 } }, "id": 1 }
The client method response does not include the parsed data, which contains important information such as decimals, isInitialized, and supply.
parsed
decimals
isInitialized
supply
Both the client method and the direct RPC call should return the same level of detailed information.
curl
You can use https://michaelhly.com/solana-py/rpc/api/#solana.rpc.api.Client.get_account_info_json_parsed
Overview
There appears to be a discrepancy in the response received when querying account information using the client method versus a direct RPC call.
Client Method
Version: 0.34 Request:
Python
Response:
JSON
Direct RPC Method
Request:
Response:
JSON
Issue
The client method response does not include the
parsed
data, which contains important information such asdecimals
,isInitialized
, andsupply
.Expected Behavior
Both the client method and the direct RPC call should return the same level of detailed information.
Steps to Reproduce
curl
.