Negotiator

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

  • Negotiator

Index

Constructors

Methods

Constructors

constructor

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

Defined in negotiation/taker/negotiator.ts:62

Parameters:

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

Returns: Negotiator

Methods

getOrder

getOrder(criteria: MatchingCriteria): Promise‹TakerOrder

Defined in negotiation/taker/negotiator.ts:80

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