Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "orderbook/types"

Index

Type aliases

Currency

Currency: { decimalPlaces: number; id: string; swapClient: SwapClientType; tokenAddress?: undefined | string }

Type declaration

  • decimalPlaces: number

    The number of places to the right of the decimal point of the smallest subunit of the currency, For example, BTC, LTC, and others where the smallest subunits (satoshis) are 0.00000001 full units (bitcoins) have 8 decimal places. ETH has 18. This can be thought of as the base 10 exponent of the smallest subunit expressed as a positive integer.

  • id: string

    The ticker symbol for this currency such as BTC, LTC, ETH, etc...

  • swapClient: SwapClientType

    The payment channel network client to use for executing swaps.

  • Optional tokenAddress?: undefined | string

    The contract address for layered tokens such as ERC20.

IncomingOrder

IncomingOrder: OutgoingOrder & Remote

An incoming peer order which only includes fields that are relevant to us.

LimitOrder

LimitOrder: MarketOrder & { price: number }

A limit order with a specified price that will enter the order book if it is not immediately matched.

Local

Local: { localId: string }

Properties that apply only to orders placed by the local xud.

Type declaration

  • localId: string

    A local identifier for the order.

MarketOrder

MarketOrder: { isBuy: boolean; pairId: string; quantity: number }

An order without a price that is intended to match against any available orders on the opposite side of the book for its trading pair.

Type declaration

  • isBuy: boolean

    Whether the order is a buy (if true) or a sell (if false).

  • pairId: string

    A trading pair symbol with the base currency first followed by a '/' separator and the quote currency

  • quantity: number

    The quantity denominated in satoshis (or equivalent) for the order.

MatchingResult

MatchingResult: { matches: OrderMatch[]; remainingOrder?: OwnOrder }

Type declaration

Order

OrderBookThresholds

OrderBookThresholds: { minQuantity: number }

Type declaration

  • minQuantity: number

OrderIdentifier

OrderIdentifier: Pick<MarketOrder, "pairId"> & { id: string }

Properties that can be used to uniquely identify and fetch an order within an order book.

OrderInvalidation

OrderInvalidation: OrderIdentifier & { quantity?: undefined | number }

OrderMatch

OrderMatch: { maker: Order; taker: OwnOrder }

Type declaration

OrderPortion

OrderPortion: OrderIdentifier & { localId?: undefined | string; quantity: number }

A reference to a portion of an existing order.

OutgoingOrder

OutgoingOrder: Pick<OwnOrder, Exclude<keyof OwnOrder, "localId" | "createdAt" | "hold" | "initialQuantity">> & { replaceOrderId?: undefined | string }

An outgoing local order which only includes fields that are relevant to peers.

OwnLimitOrder

OwnLimitOrder: LimitOrder & Local

OwnMarketOrder

OwnMarketOrder: MarketOrder & Local

OwnOrder

OwnOrder: OwnLimitOrder & Stamp & { hold: number }

A local order that may enter the order book.

Pair

Pair: { baseCurrency: string; quoteCurrency: string }

Type declaration

  • baseCurrency: string
  • quoteCurrency: string

PeerOrder

PeerOrder: LimitOrder & Stamp & Remote

A peer order that may enter the order book.

PlaceOrderEvent

PlaceOrderEvent: { order?: Order; swapFailure?: SwapFailure; swapSuccess?: SwapSuccess; type: PlaceOrderEventType }

Type declaration

PlaceOrderResult

PlaceOrderResult: { internalMatches: OwnOrder[]; remainingOrder?: OwnOrder; swapFailures: SwapFailure[]; swapSuccesses: SwapSuccess[] }

Type declaration

Remote

Remote: { peerPubKey: string }

Properties that apply only to orders placed by remote peers.

Type declaration

  • peerPubKey: string

    The nodePubKey of the node which created this order.

SortableOrder

SortableOrder: { createdAt: number; price: number }

Type declaration

  • createdAt: number
  • price: number

Stamp

Stamp: OrderIdentifier & { createdAt: number; initialQuantity: number }

Properties that uniquely identify an order and make it ready to enter the order book.

Functions

isOwnOrder

  • isOwnOrder(order: Order): order is OwnOrder

isPeerOrder

  • isPeerOrder(order: Order): order is PeerOrder

Generated using TypeDoc