Gdex v0.1.1 Gdex.Websocket.Subscribe View Source

Functions to send subscribe messages to GDAX.

Link to this section Summary

Functions

Subscribe to channels for the given product_ids

Send the request to gdax. Use this if you want more control on channels and products

Link to this section Types

Link to this type product_ids() View Source
product_ids() :: binary | [binary]
Link to this type subscribe_opt() View Source
subscribe_opt() :: {:authenticate, boolean}

Link to this section Functions

Link to this function subscribe(gdax, channels, product_ids, opts \\ []) View Source

Subscribe to channels for the given product_ids.

Options

  • :authenticate - wheter to send an authenticated subscribe message or not.
Link to this function subscribe_raw(gdax, request, opts \\ []) View Source
subscribe_raw(Gdex.Websocket.State.t, Map.t, [subscribe_opt]) :: :ok

Send the request to gdax. Use this if you want more control on channels and products

Options

Same as subscribe/4.

Examples

subscribe_raw(gdax, %{
  type: "subscribe",
  product_ids: ["ETH-USD", "ETH-EUR"],
  channels: [
    "level2",
    "heartbeat",
    %{name: "ticker", product_ids: ["ETH-BTC", "ETH-GBP"]}
  ]
})

See Also

Check the official GDAX API Documentation for the correct request format.