accountSubscribe
Subscribe to an account to receive notifications when the lamports or data for a given account public key changes
Parameters
string
(required)
string
(required)Description: Account Pubkey, as a base-58 encoded string.
object
(optional)
object
(optional)Description: Configuration object containing the following fields:
commitment
(string, optional): Specifies the desired level of commitment.encoding
(string, optional): Specifies the encoding format for Account data. Values:base58
base64
base64+zstd
jsonParsed
Details
Result
The result of the subscription will return a <number>
which serves as the subscription ID. This ID is required for unsubscribing from the account notifications.
Code Sample
Request Example:
Response Example:
Notification Format
The notification format follows the same structure as the getAccountInfo
RPC HTTP method.
Base58 Encoding Example:
Parsed-JSON Encoding Example:
Notes
The
base58
encoding format represents raw account data as a string.The
jsonParsed
encoding format provides structured information, parsed into JSON.
Last updated