signatureSubscribe

Subscribe to a transaction signature to receive notification when the transaction is confirmed on signatureNotification, the subscription is automatically cancelled

Parameters


  • <string> - Transaction Signature, as base-58 encoded string
  • <object> - (optional) Commitment, configures the commitment level of the blocks queried
    Accepts one of the following strings: ["finalized", "confirmed", "processed"]
    For more info, refer to this doc.

Results


  • integer - subscription id (needed to unsubscribe)

Notification Format

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


Example


Request


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

Result

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

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