Skip to content

Commit bcf4634

Browse files
committed
remove pulse deps
1 parent cbb2502 commit bcf4634

21 files changed

+2447
-2136
lines changed

.husky/pre-commit

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/env sh
2+
3+
# only run on added/modified files
4+
git diff --name-only --cached --diff-filter=AM -- "*.js" | \
5+
while read -r file
6+
do
7+
if [ -f "$file" ]; then # don't run on deleted files
8+
npx standard "$file"
9+
fi
10+
done

CHANGELOG

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
7.0.0
2+
- chore: remove pulse deps
3+
14
6.0.0
25
- removed unused deps: chai, request-promise, request, crc-32
36
- removed bluebird Promise

docs/WS2Manager.html

+336-307
Large diffs are not rendered by default.

docs/WSv2.html

+1,938-1,663
Large diffs are not rendered by default.

docs/global.html

+27-14
Large diffs are not rendered by default.

docs/index.html

+5-2
Large diffs are not rendered by default.

docs/scripts/collapse.js

+19
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,34 @@
11
function hideAllButCurrent(){
22
//by default all submenut items are hidden
33
//but we need to rehide them for search
4+
document.querySelectorAll("nav > ul").forEach(function(parent) {
5+
if (parent.className.indexOf("collapse_top") !== -1) {
6+
parent.style.display = "none";
7+
}
8+
});
49
document.querySelectorAll("nav > ul > li > ul li").forEach(function(parent) {
510
parent.style.display = "none";
611
});
12+
document.querySelectorAll("nav > h3").forEach(function(section) {
13+
if (section.className.indexOf("collapsed_header") !== -1) {
14+
section.addEventListener("click", function(){
15+
if (section.nextSibling.style.display === "none") {
16+
section.nextSibling.style.display = "block";
17+
} else {
18+
section.nextSibling.style.display = "none";
19+
}
20+
});
21+
}
22+
});
723

824
//only current page (if it exists) should be opened
925
var file = window.location.pathname.split("/").pop().replace(/\.html/, '');
1026
document.querySelectorAll("nav > ul > li > a").forEach(function(parent) {
1127
var href = parent.attributes.href.value.replace(/\.html/, '');
1228
if (file === href) {
29+
if (parent.parentNode.parentNode.className.indexOf("collapse_top") !== -1) {
30+
parent.parentNode.parentNode.style.display = "block";
31+
}
1332
parent.parentNode.querySelectorAll("ul li").forEach(function(elem) {
1433
elem.style.display = "block";
1534
});

docs/scripts/commonNav.js

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
if (typeof fetch === 'function') {
2+
const init = () => {
3+
if (typeof scrollToNavItem !== 'function') return false
4+
scrollToNavItem()
5+
// hideAllButCurrent not always loaded
6+
if (typeof hideAllButCurrent === 'function') hideAllButCurrent()
7+
return true
8+
}
9+
fetch('./nav.inc.html')
10+
.then(response => response.ok ? response.text() : `${response.url} => ${response.status} ${response.statusText}`)
11+
.then(body => {
12+
document.querySelector('nav').innerHTML += body
13+
// nav.js should be quicker to load than nav.inc.html, a fallback just in case
14+
return init()
15+
})
16+
.then(done => {
17+
if (done) return
18+
let i = 0
19+
;(function waitUntilNavJs () {
20+
if (init()) return
21+
if (i++ < 100) return setTimeout(waitUntilNavJs, 300)
22+
console.error(Error('nav.js not loaded after 30s waiting for it'))
23+
})()
24+
})
25+
.catch(error => console.error(error))
26+
} else {
27+
console.error(Error('Browser too old to display commonNav (remove commonNav docdash option)'))
28+
}

docs/scripts/search.js

+16
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ document.getElementById("nav-search").addEventListener("keyup", function(event)
3333
document.querySelectorAll("nav > ul > li").forEach(function(elem) {
3434
elem.style.display = "block";
3535
});
36+
document.querySelectorAll("nav > ul").forEach(function(elem) {
37+
elem.style.display = "block";
38+
});
3639
//hide all results
3740
document.querySelectorAll("nav > ul > li > ul li").forEach(function(elem) {
3841
elem.style.display = "none";
@@ -79,5 +82,18 @@ document.getElementById("nav-search").addEventListener("keyup", function(event)
7982
parent.style.display = "none";
8083
}
8184
});
85+
document.querySelectorAll("nav > ul.collapse_top").forEach(function(parent) {
86+
var countVisible = 0;
87+
parent.querySelectorAll("li").forEach(function(elem) {
88+
if (elem.style.display !== "none") {
89+
countVisible++;
90+
}
91+
});
92+
93+
if (countVisible == 0) {
94+
//has no child at all and does not contain text
95+
parent.style.display = "none";
96+
}
97+
});
8298
}
8399
});

docs/styles/jsdoc.css

+13-2
Original file line numberDiff line numberDiff line change
@@ -162,12 +162,19 @@ h6 {
162162
}
163163

164164

165-
tt, code, kbd, samp {
165+
tt, code, kbd, samp, pre {
166166
font-family: Consolas, Monaco, 'Andale Mono', monospace;
167167
background: #f4f4f4;
168+
}
169+
170+
tt, code, kbd, samp{
168171
padding: 1px 5px;
169172
}
170173

174+
pre {
175+
padding-bottom: 1em;
176+
}
177+
171178
.class-description {
172179
font-size: 130%;
173180
line-height: 140%;
@@ -242,6 +249,10 @@ nav h3 {
242249
color: #000;
243250
}
244251

252+
nav h3.collapsed_header {
253+
cursor: pointer;
254+
}
255+
245256
nav ul {
246257
font-family: 'Lucida Grande', 'Lucida Sans Unicode', arial, sans-serif;
247258
font-size: 100%;
@@ -762,4 +773,4 @@ html[data-search-mode] .level-hide {
762773
font-weight: 300;
763774
font-style: normal;
764775

765-
}
776+
}

docs/styles/prettify.css

+1
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,5 @@
7676
ol.linenums {
7777
margin-top: 0;
7878
margin-bottom: 0;
79+
padding-bottom: 2px;
7980
}

docs/transports_ws2.js.html

+6-3
Large diffs are not rendered by default.

docs/util_precision.js.html

+5-2
Large diffs are not rendered by default.

docs/util_ws2.js.html

+5-2
Large diffs are not rendered by default.

docs/ws2_manager.js.html

+5-2
Large diffs are not rendered by default.

examples/rest2/pulse.js

-111
This file was deleted.

examples/util/args_from_env.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
'use strict'
22

3-
const SocksProxyAgent = require('socks-proxy-agent')
43
const _isString = require('lodash/isString')
54
const _isEmpty = require('lodash/isEmpty')
5+
const { SocksProxyAgent } = require('socks-proxy-agent')
66

77
const validArg = v => _isString(v) && !_isEmpty(v)
88

lib/transports/ws2.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ class WSv2 extends EventEmitter {
472472
return authSeq !== this._lastAuthSeq
473473
? new Error(
474474
`invalid auth seq #, expected no advancement but got ${authSeq}`
475-
)
475+
)
476476
: null
477477
}
478478

package.json

+18-16
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"name": "bitfinex-api-node",
3-
"version": "6.0.0",
3+
"version": "7.0.0",
44
"description": "Node reference library for Bitfinex API",
55
"engines": {
6-
"node": ">=16.20.0"
6+
"node": ">=18.0"
77
},
88
"main": "index.js",
99
"husky": {
@@ -13,9 +13,11 @@
1313
},
1414
"scripts": {
1515
"lint": "standard",
16+
"lint:fix": "standard --fix",
1617
"test": "npm run lint && npm run unit",
1718
"unit": "NODE_ENV=test mocha -b --recursive",
18-
"docs": "rm -rf docs && node_modules/.bin/jsdoc --configure .jsdoc.json --verbose"
19+
"docs": "rm -rf docs && node_modules/.bin/jsdoc --configure .jsdoc.json --verbose",
20+
"prepare": "husky install"
1921
},
2022
"repository": {
2123
"type": "git",
@@ -43,31 +45,31 @@
4345
"devDependencies": {
4446
"bfx-api-mock-srv": "^1.0.4",
4547
"blessed": "0.1.81",
46-
"blessed-contrib": "4.11.0",
47-
"cli-table3": "0.6.0",
48-
"docdash": "^2.0.1",
49-
"dotenv": "^8.2.0",
50-
"husky": "^4.2.3",
51-
"jsdoc-to-markdown": "^8.0.0",
52-
"mocha": "^10.2.0",
48+
"blessed-contrib": "^1.0.11",
49+
"cli-table3": "^0.6.5",
50+
"docdash": "^2.0.2",
51+
"dotenv": "^16.4.5",
52+
"husky": "^9.1.6",
53+
"jsdoc-to-markdown": "^9.0.1",
54+
"mocha": "^10.7.3",
5355
"p-iteration": "1.1.8",
5456
"readline-promise": "1.0.4",
55-
"socks-proxy-agent": "^5.0.0",
56-
"standard": "^16.0.3"
57+
"socks-proxy-agent": "^8.0.4",
58+
"standard": "^17.1.2"
5759
},
5860
"dependencies": {
59-
"bfx-api-node-models": "^1.7.1",
60-
"bfx-api-node-rest": "^5.1.1",
61+
"bfx-api-node-models": "^2.0.0",
62+
"bfx-api-node-rest": "^6.0.0",
6163
"bfx-api-node-util": "^1.0.10",
6264
"bfx-api-node-ws1": "^1.0.0",
6365
"bignumber.js": "9.0.0",
6466
"cbq": "0.0.1",
65-
"debug": "4.1.1",
67+
"debug": "4.3.3",
6668
"lodash": "^4.17.4",
6769
"lodash.throttle": "4.1.1",
6870
"lossless-json": "1.0.3",
6971
"promise-throttle": "1.0.1",
70-
"ws": "7.5.9"
72+
"ws": "7.5.10"
7173
},
7274
"standard": {
7375
"ignore": [

test/examples/args_from_env.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const _isUndefined = require('lodash/isUndefined')
66
const _isObject = require('lodash/isObject')
77
const _isString = require('lodash/isString')
88
const _isEmpty = require('lodash/isEmpty')
9-
const SocksProxyAgent = require('socks-proxy-agent')
9+
const { SocksProxyAgent } = require('socks-proxy-agent')
1010
const argsFromEnv = require('../../examples/util/args_from_env')
1111

1212
describe('argsFromEnv', () => {
@@ -44,7 +44,7 @@ describe('argsFromEnv', () => {
4444
args = argsFromEnv()
4545

4646
assert.ok(_isObject(args), 'did not return an object')
47-
assert.ok(args.agent instanceof SocksProxyAgent, 'did not provide a SocksProxyAgent instance')
47+
assert.ok((args.agent instanceof SocksProxyAgent), 'did not provide a SocksProxyAgent instance')
4848
assert.ok(/localhost/.test(args.agent.proxy.host), 'provided agent does not use proxy url from env')
4949
})
5050

0 commit comments

Comments
 (0)