Version: 0.15.2

MakerNegotiator

Handles the negotiation on the maker side of a trade. Bundles functionality to create orders for a maker and make them available for the taker.

Hierarchy

  • MakerNegotiator

Index

Constructors

Methods

Constructors

constructor

+ new MakerNegotiator(comitClient: ComitClient, executionParams: ExecutionParams, tryParams: TryParams): MakerNegotiator

Defined in src/negotiation/maker/maker_negotiator.ts:19

Parameters:

NameTypeDescription
comitClientComitClientThe ComitClient of the taker for swap execution.
executionParamsExecutionParamsThe ExecutionParams of the maker for swap execution.
tryParamsTryParamsThe TryParams of the maker for swap execution.

Returns: MakerNegotiator

Methods

addOrder

addOrder(order: Order): boolean

Defined in src/negotiation/maker/maker_negotiator.ts:48

Add an Order to the order book.

Parameters:

NameTypeDescription
orderOrderThe order to add.

Returns: boolean

True if the order parameters are valid and were successfully added to the order book, false otherwise.


getExecutionParams

getExecutionParams(): ExecutionParams

Defined in src/negotiation/maker/maker_negotiator.ts:81

Get the ExecutionParams of the maker.

Returns: ExecutionParams

The ExecutionParams of the maker.


getOrderById

getOrderById(orderId: string): Order | undefined

Defined in src/negotiation/maker/maker_negotiator.ts:73

Get an Order by Order.id.

Parameters:

NameTypeDescription
orderIdstringThe Order.id.

Returns: Order | undefined

An Order or undefined if there is no Order for the given id.


getOrderByTradingPair

getOrderByTradingPair(tradingPair: string): Order | undefined

Defined in src/negotiation/maker/maker_negotiator.ts:64

Get an Order by trading pair (e.g. ethereum-ether-bitcoin-bitcoin).

Parameters:

NameTypeDescription
tradingPairstringA trading pair (e.g. bitcoin-bitcoin-ethereum-erc20).

Returns: Order | undefined

An Order or undefined if there is no Order for the given trading pair.


getUrl

getUrl(): string | undefined

Defined in src/negotiation/maker/maker_negotiator.ts:107

Returns: string | undefined

The maker's HttpService URL.


listen

listen(port: number, hostname?: undefined | string): Promise‹void›

Defined in src/negotiation/maker/maker_negotiator.ts:116

Exposes the maker's HttpService on the given port and hostname.

Parameters:

NameTypeDescription
portnumberThe port where the HttpService should be exposed.
hostname?undefined | stringOptionally a hostname can be provided as well.

Returns: Promise‹void›


takeOrder

takeOrder(swapId: string, order: Order): Promise‹void›

Defined in src/negotiation/maker/maker_negotiator.ts:94

Take an order by accepting the swap request on the maker side.

This function uses the given swapId and order to find a matching Swap using the ComitClient. If a matching Swap can be found {@link Swap#accept} is called.

Parameters:

NameTypeDescription
swapIdstringThe id of a swap.
orderOrderThe order corresponding to the swap.

Returns: Promise‹void›