signatureSubscribe
(Subscription Websocket) Subscribe to a transaction signature to receive notification when the transaction is confirmed. Note: On signatureNotification, the subscription is automatically cancelled.
This method will use 20 Compute Units.
Parameters
tx_sigThe transaction signature as base-58 encoded string.objectoptional. Configuration object containing the following fields:commitmentstring. The level of commitment required for the query. The options include:finalizedstring. The node will query the most recent block confirmed by the supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized.confirmedstring. The node will query the most recent block that has been voted on by the supermajority of the cluster.processedstring. The node will query its most recent block. Note that the block may not be complete.
Returns
result The result will be an RpcResponse JSON object with id equal to the subscription id (needed to unsubscribe).
Notification Format:
resultError if the transaction failed and null if the transaction succeeded.
// Result
{ "jsonrpc": "2.0", "result": 0, "id": 1 }wscat -c wss://mainnet.solana.validationcloud.io/v1/<YOUR_API_KEY_HERE>
# wait for connection
{"id":1,"jsonrpc":"2.0","method":"signatureSubscribe","params":["51y9Hf2cFzrUPDH24qvL6b6PtPMDGQSX3WwiHsSvkdfGiFTKdoJwGkvqS3gny6XNPLtUtRwGERAs45639EfR5XfT"]}
wscat -c wss://devnet.solana.validationcloud.io/v1/<YOUR_API_KEY_HERE>
# wait for connection
{"id":1,"jsonrpc":"2.0","method":"signatureSubscribe","params":["51y9Hf2cFzrUPDH24qvL6b6PtPMDGQSX3WwiHsSvkdfGiFTKdoJwGkvqS3gny6XNPLtUtRwGERAs45639EfR5XfT"]}
Last updated
Was this helpful?