@icgio/icg-exchanges-wrapper 1.14.204 → 1.14.205
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 +7 -11
- package/package.json +1 -1
package/middleware/account.js
CHANGED
|
@@ -2,17 +2,6 @@ const _ = require('lodash')
|
|
|
2
2
|
|
|
3
3
|
const { forex_rate, constants, utils } = require('@icgio/icg-utils')
|
|
4
4
|
|
|
5
|
-
let USDCNY, USDKRW, USDHKD
|
|
6
|
-
forex_rate.get_forex_rate('USDCNY', (res) => {
|
|
7
|
-
USDCNY = res
|
|
8
|
-
})
|
|
9
|
-
forex_rate.get_forex_rate('USDKRW', (res) => {
|
|
10
|
-
USDKRW = res
|
|
11
|
-
})
|
|
12
|
-
forex_rate.get_forex_rate('USDHKD', (res) => {
|
|
13
|
-
USDHKD = res
|
|
14
|
-
})
|
|
15
|
-
|
|
16
5
|
const CMC_RATES_EXPIRY_TIMEOUT = 4 * 60 * 60 * 1000
|
|
17
6
|
const DISTRIBUTION_MIN_BENCHMARK = 0.0001
|
|
18
7
|
|
|
@@ -45,6 +34,13 @@ module.exports = class Account {
|
|
|
45
34
|
this.assets_benchmarks = _.cloneDeep(this.raw_assets_benchmarks)
|
|
46
35
|
|
|
47
36
|
console.log('exchange_assets_benchmarks', this.exchange_assets_benchmarks)
|
|
37
|
+
|
|
38
|
+
let USDCNY, USDHKD, USDKRW
|
|
39
|
+
forex_rate.get_forex_rate_usd(['CNY', 'HKD', 'KRW'], (res) => {
|
|
40
|
+
USDCNY = res['CNY']
|
|
41
|
+
USDHKD = res['HKD']
|
|
42
|
+
USDKRW = res['KRW']
|
|
43
|
+
})
|
|
48
44
|
}
|
|
49
45
|
get_depth(rates, cmc_rates, percentages) {
|
|
50
46
|
let depth = {}
|