@icgio/icg-exchanges-wrapper 1.15.3 → 1.15.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.
- package/middleware/orders.js +17 -10
- package/package.json +3 -3
package/middleware/orders.js
CHANGED
|
@@ -80,8 +80,13 @@ module.exports = class Orders {
|
|
|
80
80
|
this.exchange_cur_quote_cur = exchange_cur_quote_cur
|
|
81
81
|
this.exchange_cur_quote_cur_rates_only = exchange_cur_quote_cur_rates_only
|
|
82
82
|
this.pair_map_rates_only = pair_map_rates_only || {}
|
|
83
|
-
|
|
84
|
-
let { exchange_pairs
|
|
83
|
+
const exchange_roles = settings && settings.exchange_roles ? settings.exchange_roles : null
|
|
84
|
+
let { exchange_pairs, pair_exchanges, exchange_pairs_without_affiliates, pair_exchanges_without_affiliates } = utils.exchange_cur_quote_cur_converter(exchange_cur_quote_cur, {
|
|
85
|
+
exchange_roles,
|
|
86
|
+
})
|
|
87
|
+
let { exchange_pairs: exchange_pairs_rates_only, pair_exchanges: pair_exchanges_rates_only } = utils.exchange_cur_quote_cur_converter(exchange_cur_quote_cur_rates_only, {
|
|
88
|
+
exchange_roles,
|
|
89
|
+
})
|
|
85
90
|
this.exchange_pairs = exchange_pairs
|
|
86
91
|
this.exchange_pairs_without_affiliates = exchange_pairs_without_affiliates
|
|
87
92
|
this.pair_exchanges = pair_exchanges
|
|
@@ -128,25 +133,26 @@ module.exports = class Orders {
|
|
|
128
133
|
this.balance_benchmark = settings.balance_benchmark || {}
|
|
129
134
|
this.min_reserve_balance = settings.min_reserve_balance || {}
|
|
130
135
|
for (let exchange in exchange_pairs) {
|
|
136
|
+
const exchange_base = utils.exchange_base_from_key(exchange)
|
|
131
137
|
let api_key_temp = cd[exchange]['api_keys'] || cd[exchange]['api_key'],
|
|
132
138
|
secret_key_temp = cd[exchange]['secret_keys'] || cd[exchange]['secret_key'],
|
|
133
139
|
limits
|
|
134
|
-
if (_.includes(['hkbitex'],
|
|
140
|
+
if (_.includes(['hkbitex'], exchange_base)) {
|
|
135
141
|
limits = HKBITEX_LIMITS
|
|
136
|
-
} else if (_.includes(['binance', 'gate', 'gate'],
|
|
142
|
+
} else if (_.includes(['binance', 'gate', 'gate'], exchange_base)) {
|
|
137
143
|
limits = MEDIUM_LIMITS
|
|
138
|
-
} else if (_.includes(['bitfinex', 'coinsbit', 'kucoin', 'lbank', 'okx', 'phemex', 'xt'],
|
|
144
|
+
} else if (_.includes(['bitfinex', 'coinsbit', 'kucoin', 'lbank', 'okx', 'phemex', 'xt'], exchange_base)) {
|
|
139
145
|
limits = SMALL_LIMITS
|
|
140
|
-
} else if (_.includes(['bitkub', 'poloniex'],
|
|
146
|
+
} else if (_.includes(['bitkub', 'poloniex'], exchange_base)) {
|
|
141
147
|
limits = MINIMUM_LIMITS
|
|
142
|
-
} else if (_.includes(['swft'],
|
|
148
|
+
} else if (_.includes(['swft'], exchange_base)) {
|
|
143
149
|
limits = SWFT_LIMITS
|
|
144
|
-
} else if (_.includes(['p2b'],
|
|
150
|
+
} else if (_.includes(['p2b'], exchange_base)) {
|
|
145
151
|
limits = P2B_LIMITS
|
|
146
152
|
} else {
|
|
147
153
|
limits = STANDARD_LIMITS
|
|
148
154
|
}
|
|
149
|
-
this.Exchanges[exchange] = new ICGExchanges[_.upperFirst(
|
|
155
|
+
this.Exchanges[exchange] = new ICGExchanges[_.upperFirst(exchange_base)](api_key_temp, secret_key_temp, _.assign(limits, cd[exchange]))
|
|
150
156
|
if (!this.interval_dict || !this.interval_dict[exchange]) {
|
|
151
157
|
this.interval_dict[exchange] = {
|
|
152
158
|
balances: 10 * 1000,
|
|
@@ -170,7 +176,8 @@ module.exports = class Orders {
|
|
|
170
176
|
}
|
|
171
177
|
}
|
|
172
178
|
for (let exchange in this.exchange_cur_quote_cur_rates_only) {
|
|
173
|
-
|
|
179
|
+
const exchange_base = utils.exchange_base_from_key(exchange)
|
|
180
|
+
this.ExchangesRatesOnly[exchange] = new ICGExchanges[_.upperFirst(exchange_base)]('', '', STANDARD_LIMITS)
|
|
174
181
|
}
|
|
175
182
|
this.balances = {}
|
|
176
183
|
this.positions = {}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@icgio/icg-exchanges-wrapper",
|
|
3
|
-
"version": "1.15.
|
|
3
|
+
"version": "1.15.5",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
},
|
|
18
18
|
"homepage": "https://github.com/icgio/icg-exchanges-wrapper#readme",
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@icgio/icg-exchanges": "^1.32.
|
|
21
|
-
"@icgio/icg-utils": "^1.9.
|
|
20
|
+
"@icgio/icg-exchanges": "^1.32.141",
|
|
21
|
+
"@icgio/icg-utils": "^1.9.45",
|
|
22
22
|
"lodash": "^4.17.23",
|
|
23
23
|
"pg": "^8.17.2"
|
|
24
24
|
}
|