Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "swaps/types"

Index

Type aliases

CloseChannelParams

CloseChannelParams: { currency?: undefined | string; destination?: undefined | string; fee?: undefined | number; force?: undefined | false | true; remoteIdentifier?: undefined | string; units?: undefined | number }

Type declaration

  • Optional currency?: undefined | string
  • Optional destination?: undefined | string

    The on-chain address to send funds extracted from the channel. If unspecified the funds return to the default wallet for the client closing the channel.

  • Optional fee?: undefined | number

    The fee in sat per byte.

  • Optional force?: undefined | false | true
  • Optional remoteIdentifier?: undefined | string

    The remote node with which to close channels..

  • Optional units?: undefined | number

    The amount to extract from the channel, if applicable. If 0 or unspecified, the entire off-chain balance for the specified currency will be extracted.

OpenChannelParams

OpenChannelParams: { currency?: undefined | string; fee?: undefined | number; pushUnits?: undefined | number; remoteIdentifier?: undefined | string; units: number; uris?: string[] }

Type declaration

  • Optional currency?: undefined | string
  • Optional fee?: undefined | number

    The fee in sat per byte.

  • Optional pushUnits?: undefined | number

    The balance to assign to the remote node.

  • Optional remoteIdentifier?: undefined | string

    The remote node with which to open the channel.

  • units: number

    The size of the channel.

  • Optional uris?: string[]

    Uris with which to connect to the remote node.

ResolveRequest

ResolveRequest: { amount: number; chain_height: number; expiration: number; rHash: string; tokenAddress: string }

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: { getTotalTimeLock: Function }

Type declaration

  • getTotalTimeLock: Function

SanitySwap

SanitySwap: Pick<SwapDeal, "rHash" | "rPreimage" | "peerPubKey"> & { currency: string }

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

SwapAccepted

SwapAccepted: Pick<SwapDeal, "orderId" | "localId" | "pairId" | "rHash" | "peerPubKey" | "price"> & { amountReceiving: number; amountSending: number; currencyReceiving: string; currencySending: string; quantity: number }

A swap that has been accepted.

SwapCapacities

SwapCapacities: { maxInboundChannelCapacity: number; maxOutboundChannelCapacity: number; totalInboundCapacity: number; totalOutboundCapacity: number }

Type declaration

  • maxInboundChannelCapacity: number

    Max inbound capacity for a distinct channel denominated in satoshis.

  • maxOutboundChannelCapacity: number

    Max outbound capacity for a distinct channel denominated in satoshis.

  • totalInboundCapacity: number

    The total inbound capacity.

  • totalOutboundCapacity: number

    The total outbound capacity.

SwapDeal

SwapDeal: { completeTime?: undefined | number; createTime: number; destination?: undefined | string; errorMessage?: undefined | string; executeTime?: undefined | number; failureReason?: SwapFailureReason; isBuy: boolean; localId: string; makerAmount: number; makerCltvDelta?: undefined | number; makerCurrency: string; makerUnits: number; orderId: string; pairId: string; peerPubKey: string; phase: SwapPhase; price: number; proposedQuantity: number; quantity?: undefined | number; rHash: string; rPreimage?: undefined | string; role: SwapRole; state: SwapState; takerAmount: number; takerCltvDelta: number; takerCurrency: string; takerMaxTimeLock?: undefined | number; takerPubKey?: undefined | string; takerUnits: number }

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 for an accepted deal.

  • 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"> & { failureReason: SwapFailureReason; quantity: number }

SwapSuccess

SwapSuccess: Pick<SwapDeal, "orderId" | "localId" | "pairId" | "rHash" | "peerPubKey" | "price" | "rPreimage" | "role"> & { amountReceived: number; amountSent: number; currencyReceived: string; currencySent: string; quantity: number }

The result of a successful swap.

TradingLimits

TradingLimits: { maxBuy: number; maxSell: number; reservedBuy: number; reservedSell: number }

Type declaration

  • maxBuy: number

    Maximum inbound limit for a buy order denominated in satoshis.

  • maxSell: number

    Maximum outbound limit for a sell order denominated in satoshis.

  • reservedBuy: number

    The inbound amount reserved for open buy orders.

  • reservedSell: number

    The outbound amount reserved for open sell orders.

Generated using TypeDoc