Ws subscribe response v1 legacy
All V1 Websocket Responses are housed in this wrapper. It returns a confirmation of the JSON RPC subscribe request.
If a request_id
is supplied in the JSON RPC request, it will be propagated back in this JSON RPC response.
To ensure you always know if you have missed any payloads, GRVT servers apply the following heuristics to sequence numbers:
- All snapshot payloads will have a sequence number of
0
. All delta payloads will have a sequence number of1+
. So its easy to distinguish between snapshots, and deltas - Num snapshots returned in Response (per stream): You can ensure that you received the right number of snapshots
- First sequence number returned in Response (per stream): You can ensure that you received the first stream, without gaps from snapshots
- Sequence numbers should always monotonically increase by
1
. If it decreases, or increases by more than1
. Please reconnect - Duplicate sequence numbers are possible due to network retries. If you receive a duplicate, please ignore it, or idempotently re-update it.
When subscribing to the same primary selector again, the previous secondary selector will be replaced. See
Overview
page for more details.NameLite |
Type | RequiredDefault |
Description |
---|---|---|---|
request_idri |
integer | False0 |
Optional Field which is used to match the response by the client. If not passed, this field will not be returned |
streams |
string | True | The channel to subscribe to (eg: ticker.s / ticker.d) |
subss1 |
[string] | True | The list of feeds subscribed to |
unsubsu |
[string] | True | The list of feeds unsubscribed from |
num_snapshotsns |
[integer] | True | The number of snapshot payloads to expect for each subscribed feed. Returned in same order as subs |
first_sequence_numberfs |
[string] | True | The first sequence number to expect for each subscribed feed. Returned in same order as subs |