getMarketTrades

Provides the trading history for the designated market through this method:

import { Nectar, KLineInterval } from "@wasd3rplay/nectar-sdk";

const nectar = new Nectar();
const trades = await nectar.getMarketTrades({
    symbol: "ETH_ETH:USDT_ETH",
    page: 1
});

Parameters

  • symbol

    • The market symbol

    • The symbol expression is a combination of base_ticker, a colon (':'), and quote_ticker.

  • page (default: 1)

    • The page number to retrieve, which should be greater than or equal to 1

    • Each page has 20 items

Result

The result of this method is a list of trade histories:

e.g.

{
  previous: "<url>" | null,
  next: "<url>" | null,
  count: 10,
  results: [
    {
      price: '1108000000',
      order_type: 1,
      base_ticker_amount: '500000000000000000',  // 0.5 ETH
      quote_ticker_amount: '554000000',          // 554 USDT
      time: '1691930148'
    },
    ...
  ]
}
  • previous

    • The URL to retrieve the previous page

    • If this value is null, it indicates that there is no previous page to query.

  • next

    • The staring point of the history item as a timestamp

    • If this value is null, it indicates that there is no next page to query.

  • count

    • The total number of trades

  • results

    • The list of trades in the current page

    • price

      • The price at the trade

    • order_type

      • The order type of the trade

    • base_ticker_amount

      • The base token amount of the trade

    • quote_ticker_amount

      • The quote token amount of the trade

    • time

      • The trade date/time as a timestamp