Interface WebSocketRequestSubscribe

The base type which is a superset of all possible parameters and subscriptions that can be made to the WebSocket API.

interface WebSocketRequestSubscribe {
    method: "subscribe";
    subscriptions: IDEXSubscribeType[];
    cid?: string;
    markets?: string[];
}

Hierarchy (view full)

Properties

method: "subscribe"

The subscribe method is used to subscribe to a list of subscriptions based on your provided parameters.

subscriptions: IDEXSubscribeType[]
  • When top-level markets is provided:
    • we can accept string subscription names or full subscriptions and the subscriptions markets parameter is optional.
    • candles may never be provided as a name-string as it has a required interval parameter.
  • when top level markets property is not provided:
    • all unauthenticated subscriptions require the markets array so may not be defined only by their name.
    • authenticated subscriptions may still be defined by name
cid?: string

Requests may optionally provide a cid parameter to identify the request a response should be associated with.

  • When provided, the onResponse callback object will include the provided cid as a property.
markets?: string[]

A top-level markets array can be used to allow multiple subscriptions to inherit this array without having define them themselves.

  • When a subscription does not define the markets parameter, it will inherit the top-level markets array provided here.