ℹ Overview
Order Execution for placing an order:
const execute = composePromise(
()=>resOrders,
(txns)=>_sendTransactions(this.algod, txns),
(orders)=>{
resOrders = orders;
return wallet.connector.sign(orders, wallet?.connector?.sk);
},
(o)=>structure(this, o),
);
Order execution for closing an order:
const execute = composePromise(
() => resOrders,
(txns) => _sendTransactions(this.algod, txns),
(orders) => {
resOrders = orders;
return order.wallet.connector.sign(orders, order.wallet?.connector?.sk);
},
(o) => structure(this, o),
);
First thing to note: For placing an order we use the wallet set on the API. For closing an order we use the wallet set on the order. Why can't we use the wallet set on the API for closing an order?
Right now, the process for finding and cancelling an order can be done in many ways. A rough example below:
const openOrders = await api.http.dexd.fetchOrders("wallet", order.address)
const mappedOpenOrders = openOrders.map((order) => {
return { ...order, wallet: api.wallet }
})
await api.closeOrder(mappedOpenOrders[0])
For easier to use canceling we should:
- discuss the composition of the closeOrder promise in respect to
order.wallet
- Expose an easy to use method for finding and cancelling orders.
ℹ Overview
Order Execution for placing an order:
Order execution for closing an order:
First thing to note: For placing an order we use the wallet set on the API. For closing an order we use the wallet set on the order. Why can't we use the wallet set on the API for closing an order?
Right now, the process for finding and cancelling an order can be done in many ways. A rough example below:
For easier to use canceling we should:
order.wallet