Update index.js

This commit is contained in:
Piyush Dixit 2021-05-23 02:01:10 +05:30 committed by GitHub
parent 1f6a65ef11
commit f56baee034
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -96,21 +96,21 @@ function process_data(data) {
if (orderType === "MARKET") { if (orderType === "MARKET") {
txt = txt = `🚫 🚫 🚫\n<b>Spot ${orderType} ${side} Order CREATED</b>\n<b>Symbol:</b> #${symbol}\n<b>Quantity:</b> ${fixFloat(quantity)}\n<b>Order ID:</b> #ID${orderId}\n<b>Order reject reason:</b> #ID${Order_reject_reason}` txt = txt = `🚫 🚫 🚫\n<b>Spot ${orderType} ${side} Order CREATED</b>\n<b>Symbol:</b> #${symbol}\n<b>Quantity:</b> ${fixFloat(quantity)}\n<b>Order ID:</b> #ID${orderId}\n<b>Order reject reason:</b> #ID${Order_reject_reason}`
}else { }else {
txt = `🚫 🚫 🚫\n<b>Spot ${orderType} ${side} Order REJECTED</b>\n<b>Symbol:</b> #${symbol}\n<b>Price:</b> ${price}\n<b>Quantity:</b> ${fixFloat(quantity)}\n<b>Total:</b> ${total}\n<b>Order ID:</b> #ID${orderId}\n<b>Order reject reason:</b> #ID${Order_reject_reason}` txt = `🚫 🚫 🚫\n<b>Spot ${orderType} ${side} Order REJECTED</b>\n<b>Symbol:</b> #${symbol}\n<b>Price:</b> ${price}\n<b>Quantity:</b> ${fixFloat(quantity)}${total}\n<b>Order ID:</b> #ID${orderId}\n<b>Order reject reason:</b> #ID${Order_reject_reason}`
} }
} }
} else if (executionType === 'CANCELED') { } else if (executionType === 'CANCELED') {
if (orderStatus === 'CANCELED') { if (orderStatus === 'CANCELED') {
txt = `❎ ❎ ❎\n<b>Spot ${side} Order CANCELED</b>\n<b>Symbol:</b> #${symbol}\n<b>Price:</b> ${price}\n<b>Quantity:</b> ${fixFloat(quantity)}\n<b>Total:</b> ${total}\n<b>Order ID:</b> #ID${orderId}` txt = `❎ ❎ ❎\n<b>Spot ${orderType} ${side} Order CANCELED</b>\n<b>Symbol:</b> #${symbol}\n<b>Price:</b> ${price}\n<b>Quantity:</b> ${fixFloat(quantity)}${total}\n<b>Order ID:</b> #ID${orderId}`
} }
} else if (executionType === 'TRADE') { } else if (executionType === 'TRADE') {
if (orderStatus === 'PARTIALLY_FILLED') { if (orderStatus === 'PARTIALLY_FILLED') {
txt = `⌛ ⌛ ⌛\n<b>Spot ${side} Order PARTIALLY FILLED</b>\n<b>Symbol:</b> #${symbol}\n<b>Price:</b> ${price}\n<b>Last Filled:</b> ${fixFloat(lastTradeQuantity)}\n<b>Remaining:</b> ${fixFloat(Number(quantity) - Number(Cumulative_filled_quantity))}\n<b>Total:</b> ${total}\n<b>Order ID:</b> #ID${orderId}` txt = `⌛ ⌛ ⌛\n<b>Spot ${orderType} ${side} Order PARTIALLY FILLED</b>\n<b>Symbol:</b> #${symbol}\n<b>Price:</b> ${price}\n<b>Last Filled:</b> ${fixFloat(lastTradeQuantity)}\n<b>Total Filled:</b> ${fixFloat(Cumulative_filled_quantity)}\n<b>Remaining:</b> ${fixFloat(Number(quantity) - Number(Cumulative_filled_quantity))}\n<b>Order ID:</b> #ID${orderId}`
} else if (orderStatus === 'FILLED') { } else if (orderStatus === 'FILLED') {
txt = `💰 💰 💰\n<b>Spot ${side} Order FULLY FILLED</b>\n<b>Symbol:</b> #${symbol}\n<b>Price:</b> ${price}\n<b>Filled:</b> ${fixFloat(Cumulative_filled_quantity)}\n<b>Total:</b> ${total}\n<b>Order ID:</b> #ID${orderId}` txt = `💰 💰 💰\n<b>Spot ${orderType} ${side} Order FULLY FILLED</b>\n<b>Symbol:</b> #${symbol}\n<b>Price:</b> ${price}\n<b>Filled:</b> ${fixFloat(Cumulative_filled_quantity)}${total}\n<b>Order ID:</b> #ID${orderId}`
} }
} else if (['REPLACED', 'EXPIRED', 'PENDING_CANCEL'].includes(orderStatus)) { } else if (['REPLACED', 'EXPIRED', 'PENDING_CANCEL'].includes(orderStatus)) {
txt = `🔴 🟡 🔵\n<b>Spot ${side} Order ${orderStatus}</b>\n<b>Symbol:</b> #${symbol}\n<b>Price:</b> ${price}\n<b>Quantity:</b> ${fixFloat(quantity)}\n<b>Total:</b> ${total}\n<b>Order ID:</b> #ID${orderId}` txt = `🔴 🟡 🔵\n<b>Spot ${orderType} ${side} Order ${orderStatus}</b>\n<b>Symbol:</b> #${symbol}\n<b>Price:</b> ${price}\n<b>Quantity:</b> ${fixFloat(quantity)}${total}\n<b>Order ID:</b> #ID${orderId}`
} else { } else {
txt = `⚠️ ⚠️⚠️\n<b>Undefined</b>\nExecution Type: ${executionType}\nOrder Status ${orderStatus}\nFull Details:\n${data}` txt = `⚠️ ⚠️⚠️\n<b>Undefined</b>\nExecution Type: ${executionType}\nOrder Status ${orderStatus}\nFull Details:\n${data}`
} }