signatureSubscribe

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

Parameters

string (required)

The transaction signature, as a base-58 encoded string.

Info:

  • The transaction signature must be the first signature from the transaction.


object (optional)

Configuration object containing the following fields:

  • commitment (string, optional): Specifies the desired level of commitment.

  • enableReceivedNotification (bool, optional): Determines whether to subscribe for notifications when signatures are received by the RPC, in addition to when they are processed.


Result

Returns an <integer> representing the subscription ID. This ID is required for unsubscribing.


Code Sample

Request Example:

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "signatureSubscribe",
  "params": [
    "2EBVM6cB8vAAD93Ktr6Vd8p67XPbQzCJX47MpReuiCXJAtcjaxpvWpcg9Ege1Nr5Tk3a2GFrByT7WPBjdsTycY9b",
    {
      "commitment": "finalized",
      "enableReceivedNotification": false
    }
  ]
}

Response Example:

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

Notification Format

The notification is an RpcResponse JSON object with the following fields in value:

  • slot (u64): The corresponding slot.

  • value (object | string):

    • If enableReceivedNotification is true and the signature is received, the literal string "receivedSignature".

    • When the signature is processed:

      • err (object | null):

        • null if the transaction succeeded at the specified commitment level.

        • A TransactionError object if the transaction failed.


Example Responses

Notification for a Successfully Processed Transaction:

{
  "jsonrpc": "2.0",
  "method": "signatureNotification",
  "params": {
    "result": {
      "context": {
        "slot": 5207624
      },
      "value": {
        "err": null
      }
    },
    "subscription": 24006
  }
}

Notification for a Successfully Received Transaction Signature:

{
  "jsonrpc": "2.0",
  "method": "signatureNotification",
  "params": {
    "result": {
      "context": {
        "slot": 5207624
      },
      "value": "receivedSignature"
    },
    "subscription": 24006
  }
}

Last updated