@icgio/icg-exchanges-wrapper 1.9.3 → 1.9.5

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.
@@ -1,6 +1,6 @@
1
1
  const _ = require('lodash')
2
2
 
3
- const USDCNY = 7.1, USDKRW = 1178, USDTHB = 30.3
3
+ const USDCNY = 6.74, USDKRW = 1262.75, USDTHB = 34.2
4
4
 
5
5
  module.exports = class Account {
6
6
  constructor (initial_balances) {
@@ -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 = setting.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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@icgio/icg-exchanges-wrapper",
3
- "version": "1.9.3",
3
+ "version": "1.9.5",
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.2",
20
+ "@icgio/icg-exchanges": "^1.27.3",
21
21
  "@icgio/icg-exchanges-data": "^1.6.7",
22
22
  "@icgio/icg-utils": "^1.6.31",
23
23
  "influx": "^5.7.0",