@icgio/icg-exchanges-wrapper 1.10.5 → 1.10.7
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/orders.js +8 -6
- package/package.json +3 -3
package/middleware/orders.js
CHANGED
|
@@ -85,6 +85,7 @@ module.exports = class Orders {
|
|
|
85
85
|
this.previous_orders_canceled_exchange_pair = {}
|
|
86
86
|
this.account_init = false
|
|
87
87
|
this.cmc_curs = settings.cmc_curs || []
|
|
88
|
+
this.cmc_source = settings.cmc_source || 'coingecko'
|
|
88
89
|
this.balance_benchmark = settings.balance_benchmark || {}
|
|
89
90
|
this.min_reserve_balance = settings.min_reserve_balance || {}
|
|
90
91
|
for (let exchange in exchange_pairs) {
|
|
@@ -195,7 +196,7 @@ module.exports = class Orders {
|
|
|
195
196
|
this.check_ohlcv()
|
|
196
197
|
}
|
|
197
198
|
if (this.function_enabled.cmc_rates_check) {
|
|
198
|
-
this.check_cmc_rates(this.cmc_curs, 'curs')
|
|
199
|
+
this.check_cmc_rates(this.cmc_curs, 'curs', this.cmc_source)
|
|
199
200
|
}
|
|
200
201
|
if (this.function_enabled.balances_check && this.function_enabled.open_orders_check && this.function_enabled.trades_check) {
|
|
201
202
|
setInterval(() => {
|
|
@@ -1379,19 +1380,20 @@ module.exports = class Orders {
|
|
|
1379
1380
|
}
|
|
1380
1381
|
get_ohlcv(this.Exchanges, this.exchange_pairs, this.interval_dict)
|
|
1381
1382
|
}
|
|
1382
|
-
check_cmc_rates(data, type) {
|
|
1383
|
-
let check_cmc_rates_base = (data) => {
|
|
1383
|
+
check_cmc_rates(data, type, source) {
|
|
1384
|
+
let check_cmc_rates_base = (data, type, source) => {
|
|
1384
1385
|
get_coinmarketcap_rates(
|
|
1385
1386
|
(rates) => {
|
|
1386
1387
|
this.cmc_rates = rates
|
|
1387
1388
|
},
|
|
1388
1389
|
data,
|
|
1389
|
-
type
|
|
1390
|
+
type,
|
|
1391
|
+
source
|
|
1390
1392
|
)
|
|
1391
1393
|
}
|
|
1392
|
-
check_cmc_rates_base(data, type)
|
|
1394
|
+
check_cmc_rates_base(data, type, source)
|
|
1393
1395
|
setInterval(() => {
|
|
1394
|
-
check_cmc_rates_base(data, type)
|
|
1396
|
+
check_cmc_rates_base(data, type, source)
|
|
1395
1397
|
}, 15 * 60 * 1000)
|
|
1396
1398
|
}
|
|
1397
1399
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@icgio/icg-exchanges-wrapper",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.7",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
},
|
|
18
18
|
"homepage": "https://github.com/icgio/icg-exchanges-wrapper#readme",
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@icgio/icg-exchanges": "^1.28.
|
|
20
|
+
"@icgio/icg-exchanges": "^1.28.6",
|
|
21
21
|
"@icgio/icg-exchanges-data": "^1.6.71",
|
|
22
|
-
"@icgio/icg-utils": "^1.7.
|
|
22
|
+
"@icgio/icg-utils": "^1.7.40",
|
|
23
23
|
"influx": "^5.7.0",
|
|
24
24
|
"lodash": "^4.17.20",
|
|
25
25
|
"uuid": "^8.3.2",
|