@icgio/clients-config 1.0.229 → 1.0.230

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/config.js CHANGED
@@ -13,12 +13,22 @@ module.exports.client_pair_main_exchanges = client_pair_main_exchanges
13
13
  let client_exchange_currencies = {}
14
14
  for (let client in client_exchange_pairs) {
15
15
  for (let exchange in client_exchange_pairs[client]) {
16
- _.set(
17
- client_exchange_currencies,
18
- [client, exchange],
19
- client_exchange_pairs[client][exchange].map((pair) => pair.replace(client, ''))
20
- )
21
- client_exchange_currencies[client][exchange].push(client)
16
+ const pairs = client_exchange_pairs[client][exchange]
17
+
18
+ const currencies = new Set()
19
+ pairs.forEach((pair) => {
20
+ let match = pair.match(/^([A-Z0-9]+?)(USDT|USDC|USD|HKD|BTC|ETH)$/)
21
+ if (match) {
22
+ currencies.add(match[1])
23
+ currencies.add(match[2])
24
+ } else {
25
+ currencies.add(pair.replace(client, ''))
26
+ }
27
+ })
28
+
29
+ currencies.add(client)
30
+
31
+ _.set(client_exchange_currencies, [client, exchange], Array.from(currencies))
22
32
  }
23
33
  }
24
34
  module.exports.client_exchange_currencies = client_exchange_currencies
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@icgio/clients-config",
3
- "version": "1.0.229",
3
+ "version": "1.0.230",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
Binary file