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
  • Start Nectar SDK
  • Parameters
  • Environment Variables

Actions

Start Nectar SDK

Through Nectar SDK, all data, such as market pairs, price data, creating buy/sell order, order history, and so on, could be retrieved and/or created.

First of all, a Nectar instance should be initialized:

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

const nectar = new Nectar(
    // 1. privateKey
    // 2. nectarUrl
    // 3. nectarAPIKey
);

When creating a Nectar instance, Numerous parameters can be provided, or alternatively, environment variables can be used in place of constructor parameters.

Parameters

  1. privateKey (optional)

    • The private key of user wallet

  2. nectarUrl (optional)

    • The Nectar API server URL

  3. nectarAPIKey (optional)

    • Issued API key via Nectar service

Environment Variables

  • NODE_USER_WALLET_SECRET

    • The private key of user wallet

    • If this exists, theprivateKey parameter of the constructor will be ignored.

  • NODE_NECTAR_URL

    • The Nectar API server URL

    • If this exists, the nectarUrl parameter of the constructor will be ignored.

  • NODE_NECTAR_API_KEY

    • Issued API key via Nectar service

    • If this exists, the nectarAPIKey parameter of the constructor will be ignored.

Last updated 1 year ago