From ac491dc579322bfcf08ce4002fb3832bc330ddd0 Mon Sep 17 00:00:00 2001 From: Piyush Dixit <79581397+PiyushDixit96@users.noreply.github.com> Date: Mon, 10 May 2021 23:43:21 +0530 Subject: fix Price --- index.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/index.js b/index.js index 378cb8b..b085ef2 100644 --- a/index.js +++ b/index.js @@ -62,23 +62,23 @@ function process_data(data) { if (data.eventType === 'executionReport') { if (data.executionType === 'NEW') { if (data.orderStatus === 'NEW') { - txt = `💸 💸 💸\nSpot Order CREATED\nSide: ${data.side}\nSymbol: #${data.symbol}\nPrice: ${fixFloat(data.price)}\nQuantity: ${fixFloat(data.quantity)}\nOrder ID: #ID${data.orderId}` + txt = `💸 💸 💸\nSpot Order CREATED\nSide: ${data.side}\nSymbol: #${data.symbol}\nPrice: ${data.price}\nQuantity: ${fixFloat(data.quantity)}\nOrder ID: #ID${data.orderId}` } else if (data.orderStatus === 'REJECTED') { - txt = `🚫 🚫 🚫\nSpot Order REJECTED\nSide: ${data.side}\nSymbol: #${data.symbol}\nPrice: ${fixFloat(data.price)}\nQuantity: ${fixFloat(data.quantity)}\nOrder ID: #ID${data.orderId}` + txt = `🚫 🚫 🚫\nSpot Order REJECTED\nSide: ${data.side}\nSymbol: #${data.symbol}\nPrice: ${data.price}\nQuantity: ${fixFloat(data.quantity)}\nOrder ID: #ID${data.orderId}` } } else if (data.executionType === 'CANCELED') { if (data.orderStatus === 'CANCELED') { - txt = `🛑 🛑 🛑\nSpot Order CANCELED\nSide: ${data.side}\nSymbol: #${data.symbol}\nPrice: ${fixFloat(data.price)}\nQuantity: ${fixFloat(data.quantity)}\nOrder ID: #ID${data.orderId}` + txt = `🛑 🛑 🛑\nSpot Order CANCELED\nSide: ${data.side}\nSymbol: #${data.symbol}\nPrice: ${data.price}\nQuantity: ${fixFloat(data.quantity)}\nOrder ID: #ID${data.orderId}` } } else if (data.executionType === 'TRADE') { if (data.orderStatus === 'PARTIALLY_FILLED') { - txt = `💰 💰 💰\nSpot Order PARTIALLY FILLED\nSide: ${data.side}\nSymbol: #${data.symbol}\nPrice: ${fixFloat(data.price)}\nLast Filled: ${fixFloat(data.lastTradeQuantity)}\nRemaining: ${fixFloat(Number(data.quantity) - Number(data.accumulatedQuantity))}\nOrder ID: #ID${data.orderId}` + txt = `💰 💰 💰\nSpot Order PARTIALLY FILLED\nSide: ${data.side}\nSymbol: #${data.symbol}\nPrice: ${data.price}\nLast Filled: ${fixFloat(data.lastTradeQuantity)}\nRemaining: ${fixFloat(Number(data.quantity) - Number(data.accumulatedQuantity))}\nOrder ID: #ID${data.orderId}` } else if (data.orderStatus === 'FILLED') { - txt = `✅ ✅ ✅\nSpot Order FULLY FILLED\nSide: ${data.side}\nSymbol: #${data.symbol}\nPrice: ${fixFloat(data.price)}\nFilled: ${fixFloat(data.accumulatedQuantity)}\nOrder ID: #ID${data.orderId}` + txt = `✅ ✅ ✅\nSpot Order FULLY FILLED\nSide: ${data.side}\nSymbol: #${data.symbol}\nPrice: ${data.price}\nFilled: ${fixFloat(data.accumulatedQuantity)}\nOrder ID: #ID${data.orderId}` } } else if (['REPLACED', 'EXPIRED', 'PENDING_CANCEL'].includes(data.orderStatus)) { - txt = `🔴 🟡 🔵\nSpot Order ${data.orderStatus}\nSide: ${data.side}\nSymbol: #${data.symbol}\nPrice: ${fixFloat(data.price)}\nQuantity: ${fixFloat(data.quantity)}\nOrder ID: #ID${data.orderId}` + txt = `🔴 🟡 🔵\nSpot Order ${data.orderStatus}\nSide: ${data.side}\nSymbol: #${data.symbol}\nPrice: ${data.price}\nQuantity: ${fixFloat(data.quantity)}\nOrder ID: #ID${data.orderId}` } else { txt = `⚠️ ⚠️ ⚠️\nUndefined\nExecution Type: ${data.executionType}\nOrder Status ${data.orderStatus}\nFull Details:\n${msg}` } -- cgit v1.2.3