WSS

accountSubscribe

Subscribe to an account to receive notifications when the lamports or data for a given account public key changes

wss://sol.nownodes.io/wss/{{api_key}}

Body

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "accountSubscribe",
  "params": [
    "CM78CPUeXjn8o3yroDHxUtKsZZgoy4GPkPPXfouKNH12",
    {
      "encoding": "jsonParsed",
      "commitment": "finalized"
    }
  ]
}

Response: 200

{ "jsonrpc": "2.0", "result": 23784, "id": 1 }

Notification Format:

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

Base58 encoding:

Parsed-JSON encoding:

accountUnsubscribe

Subscribe to an account to receive notifications when the lamports or data for a given account public key changes

Body

Response: 200

blockSubscribe

Subscribe to receive notification anytime a new block is confirmed or finalized.

Body

Response: 200

Notification Format:

The notification will be an object with the following fields:

  • slot: <u64> - The corresponding slot.

  • err: <object|null> - Error if something went wrong publishing the notification otherwise null.

  • block: <object|null> - A block object as seen in the getBlock RPC HTTP method.

blockUnsubscribe

Unsubscribe from block notifications

Body

Response: 200

logsSubscribe

Subscribe to transaction logging

Body

Response: 200

Notification Format:

The notification will be an RpcResponse JSON object with value equal to:

  • signature: <string> - The transaction signature base58 encoded.

  • err: <object|null> - Error if transaction failed, null if transaction succeeded. TransactionError definitions

  • logs: <array|null> - Array of log messages the transaction instructions output during execution, null if simulation failed before the transaction was able to execute (for example due to an invalid blockhash or signature verification failure)

Example:

logsUnsubscribe

Unsubscribe from transaction logging

Body

Response: 200

programSubscribe

Subscribe to a program to receive notifications when the lamports or data for an account owned by the given program changes

Body

Response: 200

Notification format

The notification format is a single program account object as seen in the getProgramAccounts RPC HTTP method.

Base58 encoding:

Parsed-JSON encoding:

programUnsubscribe

Unsubscribe from program-owned account change notifications

Body

Response: 200

rootSubscribe

Subscribe to receive notification anytime a new root is set by the validator.

Body

Response: 200

Notification Format:

The result is the latest root slot number.

rootUnsubscribe

Unsubscribe from root notifications

Body

Response: 200

signatureSubscribe

Subscribe to receive a notification when the transaction with the given signature reaches the specified commitment level.

Body

Response: 200

Notification Format:

The notification will be an RpcResponse JSON object with value containing an object with:

Example responses:

The following is an example response of a notification from a successfully processed transactions:

The following is an example response of a notification from a successfully recieved transaction signature:

signatureUnsubscribe

Unsubscribe from signature confirmation notification

Body

Response: 200

slotSubscribe

Subscribe to receive notification anytime a slot is processed by the validator

Body

Response: 200

Notification Format:

The notification will be an object with the following fields:

  • parent: <u64> - The parent slot

  • root: <u64> - The current root slot

  • slot: <u64> - The newly set slot value

Example:

slotUnsubscribe

Unsubscribe from slot notifications

Body

Response: 200

slotsUpdatesSubscribe

Subscribe to receive a notification from the validator on a variety of updates on every slot

Body

Response: 200

Notification Format

The notification will be an object with the following fields:

  • err: <string|undefined> - The error message. Only present if the update is of type "dead".

  • parent: <u64|undefined> - The parent slot. Only present if the update is of type "createdBank".

  • slot: <u64> - The newly updated slot

  • stats: <object|undefined> - The error message. Only present if the update is of type "frozen". An object with the following fields:

    • maxTransactionsPerEntry: <u64>,

    • numFailedTransactions: <u64>,

    • numSuccessfulTransactions: <u64>,

    • numTransactionEntries: <u64>,

  • timestamp: <i64> - The Unix timestamp of the update

  • type: <string> - The update type, one of:

    • "firstShredReceived"

    • "completed"

    • "createdBank"

    • "frozen"

    • "dead"

    • "optimisticConfirmation"

    • "root"

slotsUpdatesUnsubscribe

Unsubscribe from slot-update notifications

Body

Response: 200

voteSubscribe

Subscribe to receive notification anytime a new vote is observed in gossip. These votes are pre-consensus therefore there is no guarantee these votes will enter the ledger.

Body

Response: 200

Notification Format:

The notification will be an object with the following fields:

  • hash: <string> - The vote hash

  • slots: <array> - The slots covered by the vote, as an array of u64 integers

  • timestamp: <i64|null> - The timestamp of the vote

  • signature: <string> - The signature of the transaction that contained this vote

  • votePubkey: <string> - The public key of the vote account, as base-58 encoded string

voteUnsubscribe

Unsubscribe from vote notifications

Body

Response: 200

Last updated