Skip to main content

signatureUnsubscribe

Unsubscribe from signature confirmation notification

Common use cases
Cancel monitoring before confirmationUnsubscribe when abandoning transaction monitoring before notification arrives, such as user-initiated cancellation or application timeout. Frees server resources and prevents orphaned subscriptions.
Clean up on application shutdownCall signatureUnsubscribe in cleanup handlers when closing WebSocket connection or unmounting components. Ensures proper resource cleanup even though signatureSubscribe auto-cancels after notification.

Parameters

subscriptionId (number, required)

subscription id to cancel

Request

wscat -c wss://solana-mainnet.api.syndica.io -x '{
"jsonrpc": "2.0",
"id": 1,
"method": "signatureUnsubscribe",
"params": [
0
]
}'
Network Selection

Replace mainnet with devnet in the URL to query devnet instead.

Response

{
"jsonrpc": "2.0",
"result": true,
"id": 1
}

Response Fields

Return value: boolean

unsubscribe success message

FAQ and Troubleshooting

Do I need to call signatureUnsubscribe after receiving a notification?

No. signatureSubscribe automatically cancels after sending signatureNotification. Explicit unsubscribe only needed if cancelling before notification arrives.

What happens if I call signatureUnsubscribe with an invalid subscription ID?

Returns JSON-RPC error -32602 with message "Invalid subscription id." Subscription ID may be invalid if already auto-cancelled after notification or never existed.

Should I unsubscribe on WebSocket disconnect?

Not necessary - server automatically cleans up all subscriptions when WebSocket connection closes. Explicit unsubscribe only needed for graceful cleanup before disconnect.

signatureSubscribe
Creates signature subscription that signatureUnsubscribe cancels. Auto-expires after notification, so explicit unsubscribe rarely needed. Every signatureSubscribe can have optional signatureUnsubscribe for early cancellation.

accountUnsubscribe
Cancels accountSubscribe subscriptions. Unlike signatureSubscribe which auto-cancels, accountSubscribe requires explicit unsubscribe for cleanup. Similar error handling: invalid ID returns -32602.

slotUnsubscribe
Cancels slotSubscribe subscriptions. Follows identical unsubscribe pattern: single subscription ID parameter, returns boolean. More commonly used than signatureUnsubscribe since slot subscriptions don't auto-expire.

getSignatureStatuses
HTTP alternative for checking transaction status. Use instead of signatureSubscribe/signatureUnsubscribe cycle when only single status check needed, avoiding WebSocket subscription overhead.

External Resources