---
title: signatureSubscribe
description: Subscribe to status notifications for a transaction signature.
url: /docs/rpc/websocket/signaturesubscribe
type: reference
hideTableOfContents: true
---

Subscribe to receive status notifications for the transaction with the given
signature.

<Callout type="info" title="Source">
  [`signature_subscribe`](https://github.com/anza-xyz/agave/blob/v3.1.8/rpc/src/rpc_pubsub.rs#L511)
</Callout>

<Callout type="warn">
  This subscription ends after the terminal confirmation notification. If
  `enableReceivedNotification` is `true`, the RPC node may send an earlier
  `receivedSignature` notification first and keep the subscription active until
  the signature reaches the requested commitment.
</Callout>

<APIMethod>

```jsonc !!request curl
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "signatureSubscribe",
  "params": [
    // !hover signature
    "2EBVM6cB8vAAD93Ktr6Vd8p67XPbQzCJX47MpReuiCXJAtcjaxpvWpcg9Ege1Nr5Tk3a2GFrByT7WPBjdsTycY9b",
    // !hover(1:4) config
    {
      // !hover commitment
      "commitment": "finalized",
      // !hover enableReceivedNotification
      "enableReceivedNotification": false
    }
  ]
}
```

```ts !!request title="Kit"
import { createSolanaRpcSubscriptions, signature } from "@solana/kit";

const rpc = createSolanaRpcSubscriptions("wss://api.devnet.solana.com");

const sig = signature(
  "2EBVM6cB8vAAD93Ktr6Vd8p67XPbQzCJX47MpReuiCXJAtcjaxpvWpcg9Ege1Nr5Tk3a2GFrByT7WPBjdsTycY9b"
);

const subscription = await rpc
  .signatureNotifications(sig, {
    commitment: "finalized",
    enableReceivedNotification: false
  })
  .subscribe({ abortSignal: AbortSignal.timeout(5_000) });

for await (const notification of subscription) {
  console.log(notification);
}
```

```ts !!request title="web3.js"
import { Connection, clusterApiUrl } from "@solana/web3.js";

const connection = new Connection(clusterApiUrl("devnet"), "confirmed");

const signature =
  "2EBVM6cB8vAAD93Ktr6Vd8p67XPbQzCJX47MpReuiCXJAtcjaxpvWpcg9Ege1Nr5Tk3a2GFrByT7WPBjdsTycY9b";

const subscriptionId = connection.onSignature(
  signature,
  (signatureResult, context) => {
    console.log("Signature result:", signatureResult);
    console.log("Context:", context);
  },
  "finalized"
);
```

```rs !!request title="Rust"
use anyhow::Result;
use futures::StreamExt;
use solana_client::{
    nonblocking::pubsub_client::PubsubClient,
    rpc_config::RpcSignatureSubscribeConfig,
};
use solana_commitment_config::CommitmentConfig;
use solana_sdk::signature::Signature;
use std::str::FromStr;

#[tokio::main]
async fn main() -> Result<()> {
    let pubsub_client = PubsubClient::new("wss://api.devnet.solana.com/").await?;

    let signature = Signature::from_str(
        "2EBVM6cB8vAAD93Ktr6Vd8p67XPbQzCJX47MpReuiCXJAtcjaxpvWpcg9Ege1Nr5Tk3a2GFrByT7WPBjdsTycY9b",
    )?;

    let config = RpcSignatureSubscribeConfig {
        commitment: Some(CommitmentConfig::finalized()),
        enable_received_notification: Some(false),
    };

    let (mut notifications, unsubscribe) = pubsub_client
        .signature_subscribe(&signature, Some(config))
        .await?;

    while let Some(notification) = notifications.next().await {
        println!("{:?}", notification);
    }

    unsubscribe().await;

    Ok(())
}
```

### !params

#### !! signature

!type string !required

Transaction signature, as a base-58 encoded string.

<Callout type="info">
  The signature must be the first signature from the transaction.
</Callout>

#### !! config

!type object

Optional configuration object.

##### !! commitment

!type string !values processed confirmed finalized !default finalized

The commitment describes how finalized a block is at that point in time. See
[Configuring State Commitment](/docs/rpc#configuring-state-commitment).

##### !! enableReceivedNotification

!type boolean !values true false !default false

Whether to also notify when the RPC first receives the signature, before it
reaches the requested commitment.

### !!result

```jsonc !response
{
  "jsonrpc": "2.0",
  // !hover result
  "result": 0,
  "id": 1
}
```

!type integer

Subscription id. Pass this to
[signatureUnsubscribe](/docs/rpc/websocket/signatureunsubscribe) if you cancel
the subscription before it fires.

</APIMethod>

### Notification format

Notifications are delivered as `signatureNotification`. The payload includes
`params.result.context` and `params.result.value`, where `value` is either:

- `{ "err": null | <transaction error> }` when the signature reaches the
  requested commitment
- `"receivedSignature"` when `enableReceivedNotification` is `true` and the RPC
  first receives the signature

Terminal confirmation notification:

<CodeReference>

```jsonc !!
{
  // !hover jsonrpc
  "jsonrpc": "2.0",
  // !hover method
  "method": "signatureNotification",
  // !hover(1:11) params
  "params": {
    // !hover(1:8) params.result
    "result": {
      // !hover(1:3) params.result.context
      "context": {
        // !hover params.result.context.slot
        "slot": 306
      },
      // !hover(1:3) params.result.value
      "value": {
        // !hover params.result.value.err
        "err": null
      }
    },
    // !hover params.subscription
    "subscription": 0
  }
}
```

## !reference

### !! jsonrpc

!type string

Always `"2.0"`.

### !! method

!type string

Always `"signatureNotification"`.

### !! params

!type object

Notification wrapper with the signature status payload and the subscription id.

#### !! result

!type object

Notification result object with `context` and `value`. For PubSub notifications,
`context` includes `slot` and omits `apiVersion`.

##### !! context

!type object

Context for the slot that satisfied the subscription.

###### !! slot

!type u64

Slot associated with the notification.

##### !! value

!type object

Terminal status payload emitted when the signature reaches the requested
commitment.

###### !! err

!type object | null

Transaction error for the observed signature, or `null` on success. Uses the
same structure documented in
[Transaction Errors](/docs/rpc/json-structures#transaction-errors).

#### !! subscription

!type integer

Subscription id that produced this notification.

</CodeReference>

This early notification is only emitted when `enableReceivedNotification: true`.

<CodeReference>

```jsonc !!
{
  // !hover jsonrpc
  "jsonrpc": "2.0",
  // !hover method
  "method": "signatureNotification",
  // !hover(1:9) params
  "params": {
    // !hover(1:6) params.result
    "result": {
      // !hover(1:3) params.result.context
      "context": {
        // !hover params.result.context.slot
        "slot": 1
      },
      // !hover params.result.value
      "value": "receivedSignature"
    },
    // !hover params.subscription
    "subscription": 0
  }
}
```

## !reference

### !! jsonrpc

!type string

Always `"2.0"`.

### !! method

!type string

Always `"signatureNotification"`.

### !! params

!type object

Notification wrapper with the early received-signature payload and the
subscription id.

#### !! result

!type object

Notification result object with `context` and `value`. For PubSub notifications,
`context` includes `slot` and omits `apiVersion`.

##### !! context

!type object

Context for the slot that observed the signature.

###### !! slot

!type u64

Slot associated with the notification.

##### !! value

!type "receivedSignature"

Plain JSON string emitted when `enableReceivedNotification` is `true` and the
RPC node first receives the signature.

#### !! subscription

!type integer

Subscription id that produced this notification.

</CodeReference>
