The signatureSubscribe
method in Solana allows developers to receive real-time notifications about the status of a transaction signature. This subscription-based method provides updates when a transaction’s status changes.
string
- Transaction signature to monitor, as base-58 encoded string
<config>
- (optional) Configuration object:
commitment
- The level of commitment desired when querying state:
"processed"
- Most recent block that has reached the node"confirmed"
- Block that has reached 1 confirmation by supermajority of the cluster"finalized"
- Block that has been finalized by supermajority of the clusterenableReceivedNotification
- (optional) Boolean to enable notifications when transaction is received by the node. Default: false
result
- An integer subscription id (needed to unsubscribe)
subscription
- An object containing signature status:
err
- Error if transaction failed, null if transaction succeeded
status
- Transaction status:
"received"
- Transaction received by node (if enableReceivedNotification is enabled)"processed"
- Transaction has been processed"confirmed"
- Transaction has been confirmed"finalized"
- Transaction has been finalizedconfirmations
- Number of blocks since transaction was processed (null if finalized)
confirmationStatus
- The transaction’s cluster confirmation status:
"processed"
- Transaction landed in a block"confirmed"
- Transaction confirmed by supermajority"finalized"
- Transaction finalized by supermajoritysignatureSubscribe
code examplesnpm install -g wscat
signatureSubscribe
method is essential for applications that need to track transaction status. Common use cases include: