Options
All
  • Public
  • Public/Protected
  • All
Menu

Represents a single Bittrex API client.

Hierarchy

  • BittrexApiClient

Index

Constructors

constructor

  • Initializes a new Bittrex API client.

    Parameters

    • Optional apiKey: string

      The personal account API key.

    • Optional apiSecret: string

      The personal account API secret.

    Returns BittrexApiClient

Properties

Private apiKey

apiKey: string

The personal account's API key.

Private apiSecret

apiSecret: string

The personal account's API secret.

Methods

buyWithLimit

  • buyWithLimit(market: string, quantity: number, rate: number): Promise<string>
  • Interface to the "public/buylimit" Bittrex's API operation.

    Parameters

    • market: string

      The market on which we would like to buy.

    • quantity: number

      The quantity that we would like to buy.

    • rate: number

      The price at which we would like to buy.

    Returns Promise<string>

    Either a promise of the placed order's identifier, or the placed order's identifier if using the await construct.

cancelOrder

  • cancelOrder(orderId: string): Promise<boolean>
  • Interface to the "public/cancelorder" Bittrex's API operation.

    Parameters

    • orderId: string

      The ID of the order we would like to cancel.

    Returns Promise<boolean>

    True if the operation resulted in a success, throws otherwise.

getBalance

  • getBalance(currency: string): Promise<Balance>
  • Interface to the "public/getbalance" Bittrex's API operation.

    Parameters

    • currency: string

      The currency of which we would like to retrieve the balance.

    Returns Promise<Balance>

    Either a promise of a balance, or a balance if using the await construct.

getBalances

  • getBalances(): Promise<Balance[]>
  • Interface to the "public/getbalances" Bittrex's API operation.

    Returns Promise<Balance[]>

    Either a promise of a balance array, or a balance array if using the await construct.

getCurrencies

  • Interface to the "public/getcurrencies" Bittrex's API operation.

    Returns Promise<Currency[]>

    Either a promise of a currency array, or a currency array if using the await construct.

getDepositAddress

  • getDepositAddress(currency: string): Promise<string>
  • Interface to the "public/getdepositaddress" Bittrex's API operation.

    Parameters

    • currency: string

      The currency of which we would like to retrieve the deposit address.

    Returns Promise<string>

    Either a promise of a deposit address, or a deposit address if using the await construct.

getExchangeStateUpdatesStream

  • getExchangeStateUpdatesStream(watchableMarkets: string[], callback: function): void
  • Interface to the Bittrex's API websockets system.

    Parameters

    • watchableMarkets: string[]

      The markets of which we would like to receive constant updates.

    • callback: function

      A callback function invoked as soon as new updates about the watched markets are received from Bittrex.

    Returns void

getMarketHistory

  • getMarketHistory(market: string): Promise<Trade[]>
  • Interface to the "public/getmarkethistory" Bittrex's API operation.

    Parameters

    • market: string

      The market of which we would like to retrieve the market history.

    Returns Promise<Trade[]>

    Either a promise of a trade array, or a trade array if using the await construct.

getMarketSummaries

  • Interface to the "public/getmarketsummaries" Bittrex's API operation.

    Returns Promise<MarketSummary[]>

    Either a promise of a market summary array, or a market summary array if using the await construct.

getMarketSummary

  • Interface to the "public/getmarketsummary" Bittrex's API operation.

    Parameters

    • market: string

      The market of which we would like to retrieve the summary.

    Returns Promise<MarketSummary>

    Either a promise of a market summary, or a market summary if using the await construct.

getMarkets

  • getMarkets(): Promise<Market[]>
  • Interface to the "public/getmarkets" Bittrex's API operation.

    Returns Promise<Market[]>

    Either a promise of a market, or a market if using the await construct.

getOpenOrders

  • getOpenOrders(market?: string): Promise<Order[]>
  • Interface to the "public/getopenorders" Bittrex's API operation.

    Parameters

    • Optional market: string

      The market of which we would like to retrieve the open orders.

    Returns Promise<Order[]>

    Either a promise of an open order array, or an open order array if using the await construct.

getOrder

  • getOrder(uuid: string): Promise<Order>
  • Interface to the "public/getorder" Bittrex's API operation.

    Parameters

    • uuid: string

      The uuid of the order of which we would like to get the detail.

    Returns Promise<Order>

    Either a promise of an order, or an order if using the await construct.

getOrderBook

  • getOrderBook(market: string, type: OrderBookType.BUY | OrderBookType.SELL | OrderBookType.BOTH): Promise<OrderBook>
  • Interface to the "public/getorderbook" Bittrex's API operation.

    Parameters

    • market: string

      The market of which we would like to retrieve the order book.

    • type: OrderBookType.BUY | OrderBookType.SELL | OrderBookType.BOTH

      The type of the order book that we want to retrieve, depending on if we want only the buys, sells, or both.

    Returns Promise<OrderBook>

    Either a promise of an order book, or an order book if using the await construct.

getTicker

  • getTicker(market: string): Promise<Ticker>
  • Interface to the "public/getticker" Bittrex's API operation.

    Parameters

    • market: string

      The market of which we would like to retrieve the ticker.

    Returns Promise<Ticker>

    Either a promise of a ticker, or a ticker if using the await construct.

Private makeRequest

  • makeRequest(operation: string, ...parameters: [string, string][]): Promise<any>
  • Utility method that sends a request to the Bittrex's API, handling the authentication through the API key and API secret possibly given when instantiating the client itself.

    Parameters

    • operation: string

      The Bittrex's API operation that we would like to call.

    • Rest ...parameters: [string, string][]

      The parameters which the operation takes in.

    Returns Promise<any>

    Either the promise of the Bittrex's API JSON response, or the JSON response if using the await construct.

sellWithLimit

  • sellWithLimit(market: string, quantity: number, rate: number): Promise<string>
  • Interface to the "public/selllimit" Bittrex's API operation.

    Parameters

    • market: string

      The market on which we would like to sell.

    • quantity: number

      The quantity that we would like to sell.

    • rate: number

      The price at which we would like to sell.

    Returns Promise<string>

    Either a promise of the placed order's identifier, or the placed order's identifier if using the await construct.

withdraw

  • withdraw(currency: string, quantity: number, address: string, paymentId?: string): Promise<string>
  • Interface to the "public/getdepositaddress" Bittrex's API operation.

    Parameters

    • currency: string

      The currency which we would like to withdraw.

    • quantity: number

      The quantity which we would like to withdraw.

    • address: string

      The address to which we would like to withdraw.

    • Optional paymentId: string

      Optional parameter used for CryptoNotes/BitShareX/Nxt.

    Returns Promise<string>

    Either a promise of a withdrawal ID, or a withdrawal ID if using the await construct.

Generated using TypeDoc