@icgio/icg-exchanges-wrapper 1.14.224 → 1.14.226

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.
@@ -6,10 +6,12 @@ const ICGExchanges = require('@icgio/icg-exchanges')
6
6
  const utils = require('@icgio/icg-utils').utils
7
7
  const { coinmarketcap: get_coinmarketcap_rates, observable: Observable } = require('@icgio/icg-utils')
8
8
 
9
- const { round_price, round_amount } = require('@icgio/icg-exchanges-data')
10
-
11
9
  const Account = require('./account.js')
12
10
 
11
+ // Default precision functions - will be overridden if provided in settings
12
+ let round_price = (exchange, pair, price) => price
13
+ let round_amount = (exchange, pair, amount) => amount
14
+
13
15
  const LARGE_LIMITS = {
14
16
  public_max_concurrent: 30,
15
17
  public_interval_concurrent: 1000,
@@ -88,6 +90,15 @@ module.exports = class Orders {
88
90
  this.ExchangesRatesOnly = {}
89
91
  this.settings = settings || {}
90
92
  this.ws_enabled = settings.ws_enabled || false
93
+ // Initialize precision functions from settings if provided
94
+ if (settings.precision_functions) {
95
+ if (settings.precision_functions.round_price) {
96
+ round_price = settings.precision_functions.round_price
97
+ }
98
+ if (settings.precision_functions.round_amount) {
99
+ round_amount = settings.precision_functions.round_amount
100
+ }
101
+ }
91
102
  this.interval_dict = settings.interval_dict || {}
92
103
  this.check_init_order_opened = true
93
104
  this.check_init_order_opened_timeout = 5 * 1000
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@icgio/icg-exchanges-wrapper",
3
- "version": "1.14.224",
3
+ "version": "1.14.226",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -17,12 +17,9 @@
17
17
  },
18
18
  "homepage": "https://github.com/icgio/icg-exchanges-wrapper#readme",
19
19
  "dependencies": {
20
- "@icgio/icg-exchanges": "^1.32.115",
21
- "@icgio/icg-exchanges-data": "^1.10.98",
22
- "@icgio/icg-utils": "^1.9.37",
23
- "influx": "^5.11.0",
20
+ "@icgio/icg-exchanges": "^1.32.117",
21
+ "@icgio/icg-utils": "^1.9.38",
24
22
  "lodash": "^4.17.20",
25
- "uuid": "^11.1.0",
26
- "ws": "^8.18.3"
23
+ "uuid": "^11.1.0"
27
24
  }
28
25
  }