From 63142677a5165e5365cc499ce7f83cf061b577d8 Mon Sep 17 00:00:00 2001 From: Anxo Rodriguez Date: Tue, 3 Dec 2024 21:56:35 +0000 Subject: [PATCH] feat: show id of order and tx hash when posting the discrete order --- src/domain/polling/index.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/domain/polling/index.ts b/src/domain/polling/index.ts index a575019..1453af3 100644 --- a/src/domain/polling/index.ts +++ b/src/domain/polling/index.ts @@ -317,6 +317,7 @@ async function _processConditionalOrder( ): Promise { const { provider, orderBookApi, dryRun, chainId } = context; const { handler } = conditionalOrder.params; + const log = getLogger( "checkForAndPlaceOrder:_processConditionalOrder", orderRef @@ -412,6 +413,7 @@ async function _processConditionalOrder( if (!conditionalOrder.orders.has(orderUid)) { // Place order const placeOrderResult = await _placeOrder({ + conditionalOrder, orderUid, order: { ...orderToSubmit, from: owner, signature }, orderBookApi, @@ -500,6 +502,7 @@ export const _printUnfilledOrders = (orders: Map) => { * @param apiUrl rest api url */ async function _placeOrder(params: { + conditionalOrder: ConditionalOrder; orderUid: string; order: any; orderBookApi: OrderBookApi; @@ -509,6 +512,7 @@ async function _placeOrder(params: { metricLabels: string[]; }): Promise | PollResultErrors> { const { + conditionalOrder, orderUid, order, orderBookApi, @@ -518,7 +522,6 @@ async function _placeOrder(params: { metricLabels, } = params; const log = getLogger("checkForAndPlaceOrder:_placeOrder", orderRef); - const { chainId } = orderBookApi.context; try { const postOrder: OrderCreation = { kind: order.kind, @@ -539,7 +542,9 @@ async function _placeOrder(params: { }; // If the operation is a dry run, don't post to the API - log.info(`Post order ${orderUid} to OrderBook on chain ${chainId}`); + log.info( + `Post order ${orderUid} (ID=${conditionalOrder.id}, TX=${conditionalOrder.tx})` + ); log.debug(`Post order ${orderUid} details`, postOrder); if (!dryRun) { const orderUid = await orderBookApi.sendOrder(postOrder);