Version: next

TakerNegotiator

Handles the negotiation on the taker side of a trade. Bundles functionality to get orders from a maker, take them and initiate the swap execution.

Hierarchy

  • TakerNegotiator

Index

Constructors

Methods

Constructors

constructor

+ new TakerNegotiator(comitClient: ComitClient, makerUrl: string): TakerNegotiator

Defined in src/negotiation/taker/taker_negotiator.ts:60

Parameters:

NameTypeDescription
comitClientComitClientThe ComitClient of the taker for swap execution
makerUrlstringThe url where the maker provides offers according to the MakerNegotiator

Returns: TakerNegotiator

Methods

getOrder

getOrder(criteria: MatchingCriteria): Promise‹TakerOrder

Defined in src/negotiation/taker/taker_negotiator.ts:78

Get an order from the maker based on specified criteria. Whatever is returned from the maker is returned here, even if it does not match the criteria or is invalid. Not all criteria are passed to the maker. If it is indeed invalid or mismatching it will not be possible to execute the order, however it gives the opportunity to the lib consumer to know that this maker returns invalid orders and the details of such order.

Parameters:

NameTypeDescription
criteriaMatchingCriteriaThe criteria of the order to be requested from the maker.

Returns: Promise‹TakerOrder