@icgio/icg-exchanges-wrapper 1.9.11 → 1.9.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/middleware/account.js +6 -8
- package/middleware/orders.js +1 -1
- package/package.json +2 -2
package/middleware/account.js
CHANGED
|
@@ -65,13 +65,6 @@ module.exports = class Account {
|
|
|
65
65
|
USD: 0
|
|
66
66
|
}
|
|
67
67
|
for (let cur in exchange_position[exchange]) {
|
|
68
|
-
if (!cmc_rates[cur]) {
|
|
69
|
-
// console.error('get_exchange_profit rates_cmc %s does not exist', cur)
|
|
70
|
-
continue
|
|
71
|
-
} else if (cmc_rates[cur].update_time < new Date().getTime() - 4 * 60 * 60 * 1000) { // some currencies like USDT are updating slow
|
|
72
|
-
console.error('get_exchange_profit rates_cmc %s expired', cur)
|
|
73
|
-
continue
|
|
74
|
-
}
|
|
75
68
|
let position = exchange_position[exchange][cur].amount
|
|
76
69
|
if (_.includes(constants.stablecoins, cur)) {
|
|
77
70
|
profit.USD += position
|
|
@@ -82,7 +75,12 @@ module.exports = class Account {
|
|
|
82
75
|
} else if (_.includes(['CNYT'], cur)) {
|
|
83
76
|
profit.USD += position / USDCNY
|
|
84
77
|
} else {
|
|
85
|
-
|
|
78
|
+
if (!cmc_rates[cur]) {
|
|
79
|
+
console.error('get_exchange_profit rates_cmc %s does not exist', cur)
|
|
80
|
+
} else if (cmc_rates[cur].update_time < new Date().getTime() - 4 * 60 * 60 * 1000) { // some currencies like USDT are updating slow
|
|
81
|
+
console.error('get_exchange_profit rates_cmc %s expired', cur)
|
|
82
|
+
}
|
|
83
|
+
profit.USD += position * _.get(cmc_rates, [cur, 'USD'], 0)
|
|
86
84
|
}
|
|
87
85
|
}
|
|
88
86
|
_.set(exchange_profit, [exchange], profit)
|
package/middleware/orders.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@icgio/icg-exchanges-wrapper",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.13",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
},
|
|
18
18
|
"homepage": "https://github.com/icgio/icg-exchanges-wrapper#readme",
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@icgio/icg-exchanges": "^1.27.
|
|
20
|
+
"@icgio/icg-exchanges": "^1.27.5",
|
|
21
21
|
"@icgio/icg-exchanges-data": "^1.6.8",
|
|
22
22
|
"@icgio/icg-utils": "^1.7.3",
|
|
23
23
|
"influx": "^5.7.0",
|