From 1f6a65ef1144db08f2ccbb4acffbd233954dfd7a Mon Sep 17 00:00:00 2001
From: Piyush Dixit <79581397+PiyushDixit96@users.noreply.github.com>
Date: Sun, 23 May 2021 01:56:55 +0530
Subject: Update index.js
---
index.js | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/index.js b/index.js
index 55cd0a8..a06b357 100644
--- a/index.js
+++ b/index.js
@@ -79,20 +79,18 @@ 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
- if (orderType !== "LIMIT") {
- total = `${fixFloat(Number(price) * Number(quantity))} ${sy}`
- let {
- L: Last_price
- } = data;
+ let total=``;
+ if (orderType === "MARKET") {
price = Last_price
+ }else{
+ total = `\nTotal: ${fixFloat(Number(price) * Number(quantity))} ${sy}`
}
if (executionType === 'NEW') {
if (orderStatus === 'NEW') {
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}`
+ txt = `✅ ✅ ✅\nSpot ${orderType} ${side} Order CREATED\nSymbol: #${symbol}\nPrice: ${price}\nQuantity: ${fixFloat(quantity)}${total}\nOrder ID: #ID${orderId}`
}
} else if (orderStatus === 'REJECTED') {
if (orderType === "MARKET") {
--
cgit v1.2.3