MakerClient
A client for the HttpService exposed by the maker. This client is used by the taker to request and take orders from a maker.
Hierarchy
- MakerClient
Index
Constructors
Methods
Constructors
constructor
+ new MakerClient(makerUrl
: string): MakerClient
Defined in src/negotiation/taker/maker_client.ts:9
Parameters:
Name | Type | Description |
---|---|---|
makerUrl | string | The URL to reach the maker's HttpService, see getUrl |
Returns: MakerClient
Methods
getExecutionParams
▸ getExecutionParams(orderId
: string): Promise‹ExecutionParams›
Defined in src/negotiation/taker/maker_client.ts:28
Get the execution parameters of the maker for a certain Order.
Parameters:
Name | Type | Description |
---|---|---|
orderId | string | The id of an Order as received by the maker. |
Returns: Promise‹ExecutionParams›
getOrderByTradingPair
▸ getOrderByTradingPair(tradingPair
: string): Promise‹Order›
Defined in src/negotiation/taker/maker_client.ts:19
Get an Order from the maker for a given trading pair (e.g. ethereum-ether-bitcoin-bitcoin).
Parameters:
Name | Type | Description |
---|---|---|
tradingPair | string | A trading pair (e.g. ETH-BTC). |
Returns: Promise‹Order›
takeOrder
▸ takeOrder(orderId
: string, swapId
: string): Promise‹void›
Defined in src/negotiation/taker/maker_client.ts:44
Tells the maker that we are taking this order and what is the swap id of the swap request sent for this order from taker cnd to maker cnd.
Parameters:
Name | Type | Description |
---|---|---|
orderId | string | The id of the order that is taken. |
swapId | string | To facilitate matching between swap requests and orders, the taker first tells their cnd to send a swap request to the maker's cnd, then use the unique swap id, known by both cnds, to tell the maker that it is taking the order and what swap request is being use for this order. While this facilitates the order-to-swap matching logic on the maker's side, the maker still needs to double check the parameters of the swap. |
Returns: Promise‹void›