diff --git a/index.js b/index.js index fc94a9f..55cd0a8 100644 --- a/index.js +++ b/index.js @@ -79,18 +79,27 @@ function process_data(data) { if (["BNB", "BTC", "XRP", "TRX", "ETH", "AUD", "BRL", "EUR", "GBP", "RUB", "TRY", "PAX", "DAI", "UAH", "NGN", "VAI"].includes(str3)) { sy = str3 } - let total = `${fixFloat(Number(price) * Number(quantity))} ${sy}` + let total if (orderType !== "LIMIT") { + total = `${fixFloat(Number(price) * Number(quantity))} ${sy}` let { - L: Lprice + L: Last_price } = data; - price = Lprice + price = Last_price } if (executionType === 'NEW') { if (orderStatus === 'NEW') { - txt = `✅ ✅ ✅\nSpot ${side} Order CREATED\nSymbol: #${symbol}\nPrice: ${price}\nQuantity: ${fixFloat(quantity)}\nTotal: ${total}\nOrder ID: #ID${orderId}` + if (orderType === "MARKET") { + txt = `✅ ✅ ✅\nSpot ${orderType} ${side} Order CREATED\nSymbol: #${symbol}\nQuantity: ${fixFloat(quantity)}\nOrder ID: #ID${orderId}` + }else { + txt = `✅ ✅ ✅\nSpot ${orderType} ${side} Order CREATED\nSymbol: #${symbol}\nPrice: ${price}\nQuantity: ${fixFloat(quantity)}\nTotal: ${total}\nOrder ID: #ID${orderId}` + } } else if (orderStatus === 'REJECTED') { - txt = `🚫 🚫 🚫\nSpot ${side} Order REJECTED\nSymbol: #${symbol}\nPrice: ${price}\nQuantity: ${fixFloat(quantity)}\nTotal: ${total}\nOrder ID: #ID${orderId}` + if (orderType === "MARKET") { + txt = txt = `🚫 🚫 🚫\nSpot ${orderType} ${side} Order CREATED\nSymbol: #${symbol}\nQuantity: ${fixFloat(quantity)}\nOrder ID: #ID${orderId}\nOrder reject reason: #ID${Order_reject_reason}` + }else { + txt = `🚫 🚫 🚫\nSpot ${orderType} ${side} Order REJECTED\nSymbol: #${symbol}\nPrice: ${price}\nQuantity: ${fixFloat(quantity)}\nTotal: ${total}\nOrder ID: #ID${orderId}\nOrder reject reason: #ID${Order_reject_reason}` + } } } else if (executionType === 'CANCELED') { if (orderStatus === 'CANCELED') {