Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "swaps/types"

Index

Type aliases

ResolveRequest

ResolveRequest: object

Type declaration

  • amount: number

    The amount of the incoming payment pending resolution, in the smallest units supported by the token.

  • chain_height: number
  • expiration: number

    The number of blocks before the incoming payment expires.

  • rHash: string
  • tokenAddress: string

Route

Route: object

Type declaration

  • getTotalTimeLock: Function

SanitySwap

SanitySwap: Pick<SwapDeal, "rHash" | "rPreimage" | "peerPubKey"> & object

Tracks the state of a pending swap of 1 satoshi for 1 satoshi of a specified currency.

SwapDeal

SwapDeal: object

Type declaration

  • Optional completeTime?: undefined | number

    The time when the swap either completed successfully or failed.

  • createTime: number

    The time when we created this swap deal locally.

  • Optional destination?: undefined | string

    The identifier for the payment channel network node we should pay to complete the swap.

  • Optional errorMessage?: undefined | string

    The reason for being in the current state.

  • Optional executeTime?: undefined | number

    The time when we began executing the swap by sending payment.

  • Optional failureReason?: SwapFailureReason
  • isBuy: boolean

    Whether the maker order is a buy order.

  • localId: string

    The local id of the own order involved in the swap.

  • makerAmount: number

    The amount the maker is expecting to receive denominated in satoshis.

  • Optional makerCltvDelta?: undefined | number

    The CLTV delta from the current height that should be used to set the timelock for the final hop when sending to maker.

  • makerCurrency: string

    The currency the maker is expecting to receive.

  • makerUnits: number

    The number of the smallest base units of the currency (like satoshis or wei) the maker is expecting to receive.

  • orderId: string

    The global order id in the XU network for the maker order being executed.

  • pairId: string

    The trading pair for the swap. The pairId together with the orderId are needed to find the maker order in the order book.

  • peerPubKey: string

    The xud node pub key of the counterparty to this swap deal.

  • phase: SwapPhase

    The most updated deal phase

  • price: number

    The price of the order that's being executed.

  • proposedQuantity: number

    The quantity of the order to execute as proposed by the taker.

  • Optional quantity?: undefined | number

    The quantity of the order to execute as accepted by the maker.

  • rHash: string

    The hex-encoded hash of the preimage.

  • Optional rPreimage?: undefined | string

    The hex-encoded preimage.

  • role: SwapRole

    Our role in the swap.

  • state: SwapState

    The most updated deal state. State works together with phase to indicate where the deal is in its life cycle and if the deal is active, errored, or completed.

  • takerAmount: number

    The amount the taker is expecting to receive denominated in satoshis.

  • takerCltvDelta: number

    The CLTV delta from the current height that should be used to set the timelock for the final hop when sending to taker.

  • takerCurrency: string

    The currency the taker is expecting to receive.

  • Optional takerMaxTimeLock?: undefined | number

    The maximum time lock from the maker to the taker in blocks.

  • Optional takerPubKey?: undefined | string

    Taker's lnd pubkey on the taker currency's network.

  • takerUnits: number

    The number of the smallest base units of the currency (like satoshis or wei) the maker is expecting to receive.

SwapFailure

SwapFailure: Pick<SwapDeal, "orderId" | "pairId" | "quantity" | "peerPubKey"> & object

SwapSuccess

SwapSuccess: Pick<SwapDeal, "orderId" | "localId" | "pairId" | "rHash" | "peerPubKey" | "price" | "rPreimage" | "role"> & object

The result of a successful swap.

Generated using TypeDoc