signatureSubscribe
Subscribes to a transaction signature and fires a one-shot notification when the transaction reaches the requested commitment level.
signatureSubscribe watches a single transaction signature and pushes a
signatureNotification the moment the transaction is processed at the
commitment level you asked for. It is the push-based alternative to polling
getSignatureStatuses in a loop after sendTransaction: submit, subscribe,
and wait for one frame instead of hammering the HTTP endpoint.
The notification carries context.slot and a value object whose err field
is null on success or a TransactionError object if the transaction failed
on-chain — a failed transaction still confirms, so always inspect err
rather than treating the notification itself as success. With
enableReceivedNotification: true you additionally get an early frame with
value set to the string "receivedSignature" when the node first sees the
signature, useful for showing a "propagating…" state in a UI before the real
confirmation lands.
The defining quirk: this subscription is one-shot. After the notification
at the requested commitment fires, the server cancels the subscription
automatically — you do not need to call
signatureUnsubscribe afterwards, and attempting
to will fail because the id is already gone. signatureUnsubscribe is only
for abandoning a wait early (for example, when your blockhash expires and you
are about to re-send).
Two gotchas. The signature must be the transaction's first signature (the
fee payer's) as a base-58 string. And the subscription only sees what happens
from now on: if the transaction already reached the requested commitment
before you subscribed, no notification will ever arrive — pair the
subscription with one getSignatureStatuses check to close that race, and put
a deadline on the wait tied to blockhash expiry.
Parameters
Positional params array: [signature, config?].
signaturestring (base-58)requiredsendTransaction.configobjectoptionalcommitmentstringoptionalprocessed, confirmed (default), or finalized — the level at which the final notification fires.enableReceivedNotificationbooleanoptionaltrue, also notify when the node first receives the signature.Response
Subscribe ack:
The confirmation notification (after which the subscription self-cancels):
{
"jsonrpc": "2.0",
"method": "signatureNotification",
"params": {
"subscription": 5207,
"result": {
"context": { "slot": 348392055 },
"value": { "err": null }
}
}
}With enableReceivedNotification: true, an earlier frame may carry
"result": { "context": {...}, "value": "receivedSignature" }.
result (on ack)integerparams.result.context.slotintegerparams.result.value.errobject | nullnull = executed successfully; otherwise the on-chain TransactionError.params.result.valuestring"receivedSignature" on the optional received-notification frame.Errors
| Code | Meaning | When it happens |
|---|---|---|
-32602 | Invalid params | signature is not a valid base-58 transaction signature. |
4001 | unauthorized | Missing or invalid API key on the upgrade / auth frame. |
4029 | rate_limited | Subscribe rate exceeded for your tier. |
Notes
- One-shot: the subscription auto-cancels after the final notification — no unsubscribe needed on the happy path.
- Failed ≠ missing: a transaction that errored on-chain still triggers the
notification, with
value.errpopulated. Check it. - Race on subscribe: confirmations that happened before you subscribed are
not replayed. Combine with a one-shot
getSignatureStatusescall. - Related methods:
signatureUnsubscribeto abandon a wait early,sendTransactionto submit, andlogsSubscribeto stream the transaction's logs instead of just its status.