Account & Program
getAccountInfo
Returns all information associated with an account
Returns all information associated with the account of provided public key.
Parameters
The public key of the account to query (base-58 encoded string)
Configuration object containing the following optional fields:
Response
If the requested account doesn’t exist, returns null
. Otherwise, returns an object containing:
Code Examples
Basic Request
Response
Request with Data Slice
Using web3.js
Notes
-
The
jsonParsed
encoding is only available for certain account types:- Stake account
- Token account
- Token mint
- Token metadata
-
When using
dataSlice
, the data field will be limited to the requested slice only. -
The account data may be encoded differently based on the program that owns the account.
Common Errors
Code | Message | Solution |
---|---|---|
-32602 | Invalid param: WrongSize | Verify the public key is valid |
-32602 | Invalid param: not base58 encoded string | Ensure the public key is base58 encoded |
-32007 | Account not found | The requested account does not exist |