@icgio/icg-exchanges-wrapper 1.14.225 → 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.
- package/middleware/orders.js +13 -2
- package/package.json +1 -2
package/middleware/orders.js
CHANGED
|
@@ -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.
|
|
3
|
+
"version": "1.14.226",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -18,7 +18,6 @@
|
|
|
18
18
|
"homepage": "https://github.com/icgio/icg-exchanges-wrapper#readme",
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@icgio/icg-exchanges": "^1.32.117",
|
|
21
|
-
"@icgio/icg-exchanges-data": "^1.10.100",
|
|
22
21
|
"@icgio/icg-utils": "^1.9.38",
|
|
23
22
|
"lodash": "^4.17.20",
|
|
24
23
|
"uuid": "^11.1.0"
|