@icgio/icg-exchanges-wrapper 1.9.4 → 1.9.6
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 +1 -1
- package/middleware/orders.js +7 -6
- package/package.json +1 -1
package/middleware/account.js
CHANGED
package/middleware/orders.js
CHANGED
|
@@ -61,6 +61,7 @@ module.exports = class Orders {
|
|
|
61
61
|
this.previous_orders_canceled_exchange_pair = {}
|
|
62
62
|
this.init_account_from_first_balances = settings.init_account_from_first_balances || true
|
|
63
63
|
this.account_init = false
|
|
64
|
+
this.cmc_curs = settings.cmc_curs || []
|
|
64
65
|
for (let exchange in exchange_pairs) {
|
|
65
66
|
if (exchange === 'bitfinex') {
|
|
66
67
|
this.Exchanges[exchange] = new icg_exchanges[_.upperFirst(exchange)](cd[exchange]['api_keys'], cd[exchange]['secret_keys'], _.assign(small_limits, cd[exchange]))
|
|
@@ -143,7 +144,7 @@ module.exports = class Orders {
|
|
|
143
144
|
this.check_volumes()
|
|
144
145
|
}
|
|
145
146
|
if (this.enabled.cmc_rates_check) {
|
|
146
|
-
this.check_cmc_rates()
|
|
147
|
+
this.check_cmc_rates(this.cmc_curs)
|
|
147
148
|
}
|
|
148
149
|
if (this.enabled.balances_check && this.enabled.open_orders_check && this.enabled.trades_check) {
|
|
149
150
|
setInterval(() => {
|
|
@@ -1012,15 +1013,15 @@ module.exports = class Orders {
|
|
|
1012
1013
|
check_volumes_base()
|
|
1013
1014
|
}, 15 * 60 * 1000)
|
|
1014
1015
|
}
|
|
1015
|
-
check_cmc_rates () {
|
|
1016
|
-
let check_cmc_rates_base = () => {
|
|
1016
|
+
check_cmc_rates (pairs_or_pair_or_curs_or_cur) {
|
|
1017
|
+
let check_cmc_rates_base = (pairs_or_pair_or_curs_or_cur) => {
|
|
1017
1018
|
get_coinmarketcap_rates(rates => {
|
|
1018
1019
|
this.cmc_rates = rates
|
|
1019
|
-
})
|
|
1020
|
+
}, pairs_or_pair_or_curs_or_cur)
|
|
1020
1021
|
}
|
|
1021
|
-
check_cmc_rates_base()
|
|
1022
|
+
check_cmc_rates_base(pairs_or_pair_or_curs_or_cur)
|
|
1022
1023
|
setInterval(() => {
|
|
1023
|
-
check_cmc_rates_base()
|
|
1024
|
+
check_cmc_rates_base(pairs_or_pair_or_curs_or_cur)
|
|
1024
1025
|
}, 15 * 60 * 1000)
|
|
1025
1026
|
}
|
|
1026
1027
|
}
|