signatureSubscribe — Solana WebSocket Method
signatureSubscribe sends a notification when a transaction with the given signature reaches the specified commitment level. The subscription is automatically cancelled after the first notification.
Subscribe request
{
"jsonrpc": "2.0",
"id": 1,
"method": "signatureSubscribe",
"params": [
"5VERvPixYNsarPMsVExFPzcSD3G9qVSX...",
{
"commitment": "confirmed",
"enableReceivedNotification": true
}
]
}
Notification format
Transaction confirmed
{
"jsonrpc": "2.0",
"method": "signatureNotification",
"params": {
"result": {
"context": { "slot": 123456789 },
"value": { "err": null }
},
"subscription": 42
}
}
If the transaction failed, err contains the error object instead of null.
Received notification (optional)
When enableReceivedNotification: true is set, you also receive a notification when the RPC node first sees the transaction:
{
"jsonrpc": "2.0",
"method": "signatureNotification",
"params": {
"result": {
"context": { "slot": 0 },
"value": "receivedSignature"
},
"subscription": 42
}
}
Use cases
- Confirm a transaction after sending. Subscribe immediately after
sendTransaction, then wait for the notification instead of pollinggetSignatureStatuses. - Track another wallet’s transaction. If you know a signature, you can subscribe to watch its confirmation.
FAQ
Does the subscription persist after the notification?
No. signatureSubscribe automatically unsubscribes after delivering the confirmation notification. It is a one-shot subscription.
What if the transaction never confirms?
If the blockhash expires without the transaction being included, no notification is sent. You must implement your own timeout logic (check block height against lastValidBlockHeight).
Should I use signatureSubscribe or poll getSignatureStatuses?
signatureSubscribe is more efficient — one subscription replaces repeated polling. However, it does not tell you when the blockhash expires. Combine it with a block height check for a complete confirmation strategy.
Parameters
| Parameter | Type | Required | Description | Default |
|---|---|---|---|---|
signature | string | Yes | Transaction signature as base-58 encoded string | — |
config | object | No | Configuration object with commitment and enableReceivedNotification | — |
Updated: