Class ProductAPI

Constructors

Properties

URL: {
    PRODUCTS: string;
} = ...

Methods

  • Get historic rates for a product. Rates are returned in grouped buckets (candlesticks) based on requested granularity.

    Note: The maximum number of data points for a single request is 300 candles. If your selection of start/end time and granularity will result in more than 300 data points, your request will be rejected. If you wish to retrieve fine granularity data over a larger time range, you will need to make multiple requests with new start/end ranges.

    Parameters

    • productId: string

      Representation for base and counter

    • Optionalparams: HistoricRateRequest

      Desired timespan

    Returns Promise<Candle[]>

  • Stop watching a specific candle interval.

    Parameters

    • productId: string

      Representation for base and counter

    • granularity: CandleGranularity

      Desired candle size

    Returns void

  • Watch a specific product ID for new candles. Candles will be emitted through the ProductEvent.NEW_CANDLE event.

    Parameters

    • productId: string

      Representation for base and counter

    • granularity: CandleGranularity

      Desired candle size

    • lastCandleTime: string

      Timestamp (ISO 8601) of last candle received

    Returns void

    Handle to stop the watch interval