Interface WebSocketRequestSubscribeStrictWithTopLevelMarkets

When providing a top-level markets parameter, we can accept subscriptions using a short-hand of the subscription name only.

  • If a subscription does not provide its own markets parameter, it will inherit the top-level markets array provided.
interface WebSocketRequestSubscribeStrictWithTopLevelMarkets {
    method: "subscribe";
    subscriptions: IDEXSubscribeType[];
    markets: string[];
    cid?: 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
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.
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.