AptosAptos Network's breakthrough technology and seamless user experience are now available on QuickNode.

Start building today!     

Contents

accountSubscribe RPC Method

The API credit value for this method is 1 . To learn more about API credits and each method's value, visit the API Credits page.

Parameters:

  1. String - Pubkey of account to query, as base-58 encoded string.
  2. Object - (optional) Configuration object containing the following optional fields:

    Commitment - (optional) All fields are strings.

    Finalized - the node will query the most recent block confirmed by supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized.

    Confirmed - the node will query the most recent block that has been voted on by supermajority of the cluster.

    Processed - the node will query its most recent block. Note that the block may not be complete.

    encoding - encoding for Account data, either "base58" (slow), "base64", "base64+zstd", or "jsonParsed".

Returns:

  1. Result - The result will be an RpcResponse JSON object with id equal to:

    number - Subscription id (needed to unsubscribe)

Notification Format:

  1. Result - The notification format is the same as seen in the getAccountInfo RPC HTTP method.

Code Examples:

wscat -c wss://sample-endpoint-name.network.quiknode.pro/token-goes-here/ \ 
# wait for connection 
{"id":1,"jsonrpc":"2.0","method":"accountSubscribe","params":["E645TckHQnDcavVv92Etc6xSWQaq8zzPtPRGBheviRAk",{"encoding": "jsonParsed"}]}
Ready to get started? Create a free account