Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Atomex

Hierarchy

  • Atomex

Index

Constructors

constructor

  • new Atomex(network: "mainnet" | "testnet", baseUrl: string, authToken?: undefined | string): Atomex
  • Parameters

    • network: "mainnet" | "testnet"
    • baseUrl: string
    • Optional authToken: undefined | string

    Returns Atomex

Methods

addOrder

  • Create a new Order in Atomex

    Parameters

    Returns Promise<number>

    order id

addSwapRequisites

  • addSwapRequisites(swapID: string, swapRequisites: AddSwapRequisites): Promise<boolean>
  • Add Requisites to a Swap in Atomex

    Parameters

    • swapID: string

      id of swap

    • swapRequisites: AddSwapRequisites

      swap requisites being updated

    Returns Promise<boolean>

    true/false depending on operation success

cancelOrder

  • cancelOrder(orderID: string, symbol: string, side: Side): Promise<boolean>
  • Cancel an order request in Atomex

    Parameters

    • orderID: string

      id of order to cancel

    • symbol: string

      symbol used in the order. A list of all symbols can be found using getSymbols

    • side: Side

      side of the order Buy or Sell

    Returns Promise<boolean>

    true/false value depending on operation success

formatAmount

  • formatAmount(amount: number | string, currency: string): number
  • Formatting an amount based on currency

    Parameters

    • amount: number | string

      Amount received / sent

    • currency: string

      L1/L2 token symbol (uppercase)

    Returns number

getAuthToken

  • Get Atomex authorization token

    remarks

    the message details can be generated using getAuthMessage

    Parameters

    • authRequest: AuthTokenRequest

      details of the message, timeStamp and signed message with the algorithm used

    Returns Promise<AuthTokenResponse>

    atomex authorization token with expiration time

getCurrencyConfig

  • Get currency & network specific configuration

    Parameters

    • currency: string

      L1/L2 token symbol (uppercase)

    Returns CurrencyConfig

getMaxOrderSize

getOrder

  • getOrder(orderID: string): Promise<Order>
  • Query specific Order using Order ID

    Parameters

    • orderID: string

      order id to query

    Returns Promise<Order>

    details of requested order

getOrderBook

  • getOrderBook(symbol: string): Promise<OrderBook>
  • Get the Order Book for a particular Symbol

    Parameters

    • symbol: string

      a symbol eg. ETH/BTC. A list of all symbols can be found using getSymbols

    Returns Promise<OrderBook>

    an order book containing all orders for the particular symbol

getOrderPreview

  • Returns an approximate preview of the requested amount and expected receive amount

    Parameters

    • orderBook: OrderBook

      order-book received from getOrderBook

    • side: Side

      side for the transaction Buy/Sell

    • amount: number

      amount received/sent

    • direction: "Send" | "Receive"

      direction for the order - Send/Receive

    Returns OrderPreview

getOrderSide

  • getOrderSide(symbol: string, srcBlockchain: string, dstBlockchain: string): Side
  • Get order side for a particular trading pair given the bridge direction

    Parameters

    • symbol: string

      Atomex trading pair {baseCurrency}/{quoteCurrency}

    • srcBlockchain: string

      Left bridge leg

    • dstBlockchain: string

      Right bridge leg

    Returns Side

getOrders

  • Query and filter all available orders in Atomex

    Parameters

    • Optional getOrdersRequest: GetOrdersRequest

      optional filters for querying all orders

    Returns Promise<Order[]>

    list of orders

getQuotes

  • getQuotes(symbolList?: string[]): Promise<BookQuote[]>
  • Get Top of Book Quotes for all or specific Symbols

    Parameters

    • Optional symbolList: string[]

      an array of Symbols eg. ETH/BTC , XTZ/ETH. A list of all symbols can be found using getSymbols

    Returns Promise<BookQuote[]>

    a list of Book Quotes

getSwap

  • getSwap(swapID: string): Promise<Swap>
  • Query specific Swap using Swap ID

    Parameters

    • swapID: string

      Atomex internal swap id

    Returns Promise<Swap>

    details of swap requested

getSwaps

  • Query and filter all available swaps in Atomex

    Parameters

    Returns Promise<Swap[]>

    a list of swaps

getSymbols

  • Get list of all available symbols in Atomex

    Returns Promise<SymbolData[]>

    list of all the symbols and their minimum qty.

setAuthToken

  • setAuthToken(authToken: string): void
  • Initialize Atomex authorization token

    remarks

    the token can be generated using getAuthToken

    Parameters

    • authToken: string

      Atomex authorization token with expiration time

    Returns void

splitSymbol

  • splitSymbol(symbol: string): [string, string]
  • Split Atomex trading pair to base and quote currencies

    Parameters

    • symbol: string

      Atomex trading pair {baseCurrency}/{quoteCurrency}

    Returns [string, string]

Static create

  • create(network: "mainnet" | "testnet" | "localhost"): Atomex
  • Parameters

    • network: "mainnet" | "testnet" | "localhost"

    Returns Atomex

Generated using TypeDoc