Modify Error where the coin name doesn't come out when user get a notification
Showing
1 changed file
with
3 additions
and
6 deletions
... | @@ -129,14 +129,13 @@ async function get_marketName() { | ... | @@ -129,14 +129,13 @@ async function get_marketName() { |
129 | } | 129 | } |
130 | async function transaction_coin(coin_name, side, volume, price, ord_type, first = true) { | 130 | async function transaction_coin(coin_name, side, volume, price, ord_type, first = true) { |
131 | var volume = volume; | 131 | var volume = volume; |
132 | - var avg_buy_price=0,market=""; | 132 | + var avg_buy_price=0; |
133 | if (side == "ask") { | 133 | if (side == "ask") { |
134 | await User.findOne({ market: coin_name }).then((result) => { | 134 | await User.findOne({ market: coin_name }).then((result) => { |
135 | if(volume == ""){ | 135 | if(volume == ""){ |
136 | volume = String(result.volume); | 136 | volume = String(result.volume); |
137 | } | 137 | } |
138 | avg_buy_price=result.avg_buy_price; | 138 | avg_buy_price=result.avg_buy_price; |
139 | - market=result.market.split('-')[1]; | ||
140 | }).catch(err => { console.log(err.error) }); | 139 | }).catch(err => { console.log(err.error) }); |
141 | } | 140 | } |
142 | const body = { | 141 | const body = { |
... | @@ -171,10 +170,9 @@ async function transaction_coin(coin_name, side, volume, price, ord_type, first | ... | @@ -171,10 +170,9 @@ async function transaction_coin(coin_name, side, volume, price, ord_type, first |
171 | var my_asset = await asset(1000); | 170 | var my_asset = await asset(1000); |
172 | 171 | ||
173 | if(avg_buy_price!=0){ | 172 | if(avg_buy_price!=0){ |
174 | - console.log(avg_buy_price); | 173 | + lookup_order(result.uuid,avg_buy_price,result.market.split("-")[1]); |
175 | - lookup_order(result.uuid,avg_buy_price,market); | ||
176 | }else{ | 174 | }else{ |
177 | - lookup_order(result.uuid,0,market); | 175 | + lookup_order(result.uuid,0,result.market.split("-")[1]); |
178 | } | 176 | } |
179 | if (side == "bid") { | 177 | if (side == "bid") { |
180 | if (first) { | 178 | if (first) { |
... | @@ -438,7 +436,6 @@ function trading_notice(side, price, funds, volume,yield_data=0,market) { | ... | @@ -438,7 +436,6 @@ function trading_notice(side, price, funds, volume,yield_data=0,market) { |
438 | 'Authorization': `Bearer ${TOKEN}` | 436 | 'Authorization': `Bearer ${TOKEN}` |
439 | }, | 437 | }, |
440 | json: { | 438 | json: { |
441 | - | ||
442 | "messages": messages | 439 | "messages": messages |
443 | } | 440 | } |
444 | }, (error, response, body) => { | 441 | }, (error, response, body) => { | ... | ... |
-
Please register or login to post a comment