# signatureSubscribe

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

{% hint style="danger" %}
This is a subscription to a single notification. It is automatically cancelled by the server once the notification, `signatureNotification`, is sent by the RPC.
{% endhint %}

#### Parameters required for this RPC call

* The transaction signature, as base-58 encoded string. The transaction signature must be the first signature from the transaction (see [transaction id](https://solana.com/docs/references/terminology#transaction-id) for more details).
* **configuration object**: This contains the following parameters, all are optional fields.
  * **commitment**: The commitment describes how finalized a block is at that point in time. Commitment levels <mark style="color:yellow;">processed</mark>, <mark style="color:yellow;">confirmed</mark> and <mark style="color:yellow;">finalized</mark> are supported, defaults to <mark style="color:yellow;">finalized</mark>.
  * **enableReceivedNotification**: Whether or not to subscribe for notifications when signatures are received by the RPC, in addition to when they are processed.

{% tabs %}
{% tab title="Websocket" %}

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

{% endtab %}

{% tab title="Response" %}

```json
{
  "jsonrpc": "2.0",
  "result": 0, //required to unsubscribe
  "id": 1
}
```

{% endtab %}
{% endtabs %}

**Notification Format:**

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

* `slot: <u64>` - The corresponding slot.
* `value: <object|string>` - a notification value of [`RpcSignatureResult`](https://github.com/solana-labs/solana/blob/6d28fd455b07e3557fc6c0c3ddf3ba03e3fe8482/rpc-client-api/src/response.rs#L265-L268), resulting in either:
  * when `enableReceivedNotification` is `true` and the signature is received: the literal string [`"receivedSignature"`](https://github.com/solana-labs/solana/blob/6d28fd455b07e3557fc6c0c3ddf3ba03e3fe8482/rpc-client-api/src/response.rs#L286-L288), or
  * when the signature is processed: `err: <object|null>`:
    * `null` if the transaction succeeded in being processed at the specified commitment level, or
    * a [`TransactionError`](https://github.com/solana-labs/solana/blob/6d28fd455b07e3557fc6c0c3ddf3ba03e3fe8482/sdk/src/transaction/error.rs#L15-L164), if the transaction failed

**Examples Responses:**&#x20;

{% tabs %}
{% tab title="Successfully Processed Transaction" %}

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

{% endtab %}

{% tab title="Successfully received transaction Signature" %}

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

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.shyft.to/solana/rpc-calls/solana-websockets/signaturesubscribe.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
