@icgio/icg-exchanges-wrapper 1.14.159 → 1.14.161
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 +4 -0
- package/package.json +2 -2
package/middleware/account.js
CHANGED
|
@@ -52,6 +52,10 @@ module.exports = class Account {
|
|
|
52
52
|
for (let pair in rates[exchange]) {
|
|
53
53
|
let [cur, quote_cur] = utils.parse_pair(pair)
|
|
54
54
|
let { asks, bids } = rates[exchange][pair]
|
|
55
|
+
if (asks.length === 0 || bids.length === 0) {
|
|
56
|
+
console.error('get_depth %s %s asks or bids is empty', exchange, pair)
|
|
57
|
+
continue
|
|
58
|
+
}
|
|
55
59
|
let mid = (asks[0][0] + bids[0][0]) / 2
|
|
56
60
|
for (let percentage of percentages) {
|
|
57
61
|
let ask_depth = utils.price_position(asks, mid * (1 + percentage)).sum
|
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.161",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
},
|
|
18
18
|
"homepage": "https://github.com/icgio/icg-exchanges-wrapper#readme",
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@icgio/icg-exchanges": "^1.32.
|
|
20
|
+
"@icgio/icg-exchanges": "^1.32.86",
|
|
21
21
|
"@icgio/icg-exchanges-data": "^1.10.79",
|
|
22
22
|
"@icgio/icg-utils": "^1.9.29",
|
|
23
23
|
"influx": "^5.10.0",
|