Nectar SDK & API
StartRelease
v1.6
v1.6
  • Introduction
  • Quick Start
  • Installation
  • Actions
    • getAllMarkets
    • getMarket
    • getMarketByTicker
    • getAllMarket24h
    • getMarket24h
    • getChains
    • getTokens
    • getAllOrders
    • getOpenOrders
    • getChart
    • getTrades
    • getBidAsk
    • transferToTradingWallet
    • transferToFundingWallet
    • buyLimit
    • sellLimit
    • buyMarketTotal
    • sellMarketAmount
    • cancelOrder
  • Types
    • BidAsk
    • Chain
    • Contract
    • Kline
    • Market
    • MarketQuote
    • NectarTransferResult
    • Order
    • Paginated
    • Token
    • Trade
    • Transaction
  • Enums
    • ChainType
    • ContractType
    • KLineInterval
    • OrderStatus
    • OrderType
    • TokenType
    • TransactionStatus
  • API Specifications
    • Header
    • Exchange Info
    • Markets 24hr Summary
    • Market History
    • Market Trades
    • Cancel Order
    • Opened User Orders
    • All User Orders
  • Release Notes
  • License and Copyright
Powered by GitBook
On this page
  • Usage
  • Parameters
  • Options
  • Returns
  1. Actions

getChart

Last updated 1 year ago

The getChart() method of Nectar instances returns a of a market of the given symbol.

Usage

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

const nectar = new Nectar();

const symbol = "WETH_ETHSEPOLIA:USDT_ETHSEPOLIA";

const now = Date.now() / 1000;

const chart = await nectar.getChart(symbol, KLineInterval.DAY_1, {
  startTime: now - 60 * 60 * 24 * 7, // 1 week ago
  endTime: now,
});

Parameters

  • symbol: string

    • A market symbol.

    • It is a combination of a base ticker, a colon, and a quote ticker.

    • E.g., ETH_ETHSEPOLIA:USDT_ETHSEPOLIA

  • interval: KLineInterval

    • A time period of a single bar.

Options

  • startTime?: number

    • Optional

    • Defaults to 0

    • The start timestamp of a chart, expressed in seconds.

  • endTime?: number

    • Optional

    • Defaults to Date.now()

    • The end timestamp of a chart, expressed in seconds.

Returns

  • Kline[]

    • A candlestick chart.

open-high-low-close chart