diff --git a/methods/websocket/signatureUnsubscribe.md b/methods/websocket/signatureUnsubscribe.md new file mode 100644 index 0000000..63d0cb3 --- /dev/null +++ b/methods/websocket/signatureUnsubscribe.md @@ -0,0 +1,7 @@ +# signatureUnsubscribe + +Cancels a subscription created by `signatureSubscribe` on the same WebSocket connection and returns `true`. An id that this connection does not hold returns `InvalidParams` (-32602) with the message `Invalid subscription id.` + +## Implementation notes + +[**Agave**](../../implementations/agave.md) implements this method in the [pinned PubSub trait](https://github.com/anza-xyz/agave/blob/6dd9d38771e46103b9680357a855804165612602/rpc/src/rpc_pubsub.rs#L148). diff --git a/methods/websocket/signatureUnsubscribe.yaml b/methods/websocket/signatureUnsubscribe.yaml new file mode 100644 index 0000000..d229a11 --- /dev/null +++ b/methods/websocket/signatureUnsubscribe.yaml @@ -0,0 +1,27 @@ +name: signatureUnsubscribe +status: standard +summary: Cancel a signatureSubscribe subscription. +params: + - name: subscriptionId + required: true + summary: Identifier returned by signatureSubscribe on this connection. + schema: { $ref: '#/components/schemas/U64' } +result: + name: success + summary: True when the subscription is cancelled. + schema: { type: boolean } +errors: + - $ref: '#/components/errors/InvalidParams' +examples: + - name: basic + summary: Cancel a subscription. + params: + - name: subscriptionId + value: 1 + result: + name: success + value: true +implementations: + agave: { status: full } + cloudbreak: { status: none } + superbank: { status: none } diff --git a/proposals/0052-signature-unsubscribe.md b/proposals/0052-signature-unsubscribe.md new file mode 100644 index 0000000..c52d61c --- /dev/null +++ b/proposals/0052-signature-unsubscribe.md @@ -0,0 +1,38 @@ +--- +number: 0052 +title: Add signatureUnsubscribe +authors: [rpcpool] +status: draft +created: 2026-09-14 +reference-implementations: [https://github.com/anza-xyz/agave/blob/6dd9d38771e46103b9680357a855804165612602/rpc/src/rpc_pubsub.rs#L148] +--- + +# Add signatureUnsubscribe + +## Summary + +Add the signatureUnsubscribe WebSocket RPC method. + +## Motivation + +Agave exposes this public PubSub lifecycle method. + +## Specification + +Add the paired WebSocket method page. It defines the connection-scoped cancellation request, true result, and invalid-subscription error. + +## Return-type impact + +The method returns true after cancellation. + +## Compatibility + +This is additive. Agave implements it. Cloudbreak and Superbank do not currently implement WebSocket PubSub. + +## Reference implementation + +[Agave pinned handler](https://github.com/anza-xyz/agave/blob/6dd9d38771e46103b9680357a855804165612602/rpc/src/rpc_pubsub.rs#L148) + +## Security considerations + +Servers release the subscription resources when this call succeeds. diff --git a/spec-info.yaml b/spec-info.yaml index 892ea85..bca4391 100644 --- a/spec-info.yaml +++ b/spec-info.yaml @@ -1,5 +1,5 @@ title: Solana JSON-RPC API -version: 0.1.0 +version: 0.2.0 license: name: MIT url: https://opensource.org/license/mit/