balanceofsatoshis 22.1.0 → 22.1.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Versions
2
2
 
3
+ ## 22.1.2
4
+
5
+ - Improve support for SOCKS proxy on old node versions
6
+
3
7
  ## 22.1.0
4
8
 
5
9
  - Add support for LND 0.21.0
@@ -104,7 +104,7 @@ module.exports = (args, cbk) => {
104
104
  },
105
105
 
106
106
  // Create a key pair for a virtual channel invoice
107
- getKeyPair: ['validate', async ({}, cbk) => {
107
+ getKeyPair: ['validate', async ({}) => {
108
108
  // Exit early when not using a virtual channel
109
109
  if (!args.is_virtual) {
110
110
  return;
package/package.json CHANGED
@@ -31,22 +31,22 @@
31
31
  "csv-parse": "6.2.1",
32
32
  "ecpair": "2.1.0",
33
33
  "goldengate": "16.0.2",
34
- "grammy": "1.43.0",
34
+ "grammy": "1.44.0",
35
35
  "hot-formula-parser": "4.0.0",
36
36
  "import-lazy": "4.0.0",
37
37
  "ini": "7.0.0",
38
38
  "inquirer": "14.0.2",
39
39
  "ln-accounting": "10.0.2",
40
- "ln-service": "59.1.0",
40
+ "ln-service": "59.1.1",
41
41
  "ln-sync": "8.0.2",
42
42
  "ln-telegram": "8.0.2",
43
43
  "minimist": "1.2.8",
44
44
  "moment": "2.30.1",
45
45
  "paid-services": "8.0.2",
46
- "probing": "6.0.0",
46
+ "probing": "7.0.0",
47
47
  "qrcode-terminal": "0.12.0",
48
48
  "sanitize-filename": "1.6.4",
49
- "socks-proxy-agent": "10.0.0",
49
+ "socks-proxy-agent": "10.1.0",
50
50
  "table": "6.9.0",
51
51
  "tiny-secp256k1": "2.2.4",
52
52
  "window-size": "1.1.1"
@@ -81,5 +81,5 @@
81
81
  "postpublish": "docker buildx build --platform linux/amd64,linux/arm64 -t alexbosworth/balanceofsatoshis -t alexbosworth/balanceofsatoshis:$npm_package_version --push .",
82
82
  "test": "npx nyc@17.1.0 node --experimental-test-coverage --test test/arrays/*.js test/balances/*.js test/chain/*.js test/display/*.js test/encryption/*.js test/lnd/*.js test/network/*.js test/nodes/*.js test/peers/*.js test/responses/*.js test/routing/*.js test/services/*.js test/swaps/*.js test/tags/*.js test/telegram/*.js test/wallets/*.js"
83
83
  },
84
- "version": "22.1.0"
84
+ "version": "22.1.2"
85
85
  }
@@ -1,11 +1,9 @@
1
1
  const asyncAuto = require('async/auto');
2
2
  const {returnResult} = require('asyncjs-util');
3
- const {SocksProxyAgent} = require('socks-proxy-agent');
4
3
 
5
4
  const {parse} = JSON;
6
5
 
7
6
  /** Get a SOCKS proxy given a JSON configuration file path
8
-
9
7
  {
10
8
  fs: {
11
9
  getFile: <Get File From Filesystem Function>
@@ -34,6 +32,17 @@ module.exports = ({fs, path}, cbk) => {
34
32
  return cbk();
35
33
  },
36
34
 
35
+ // Import socks-proxy-agent as ESM
36
+ getSocksAgent: ['validate', async ({}) => {
37
+ try {
38
+ const {SocksProxyAgent} = await import('socks-proxy-agent');
39
+
40
+ return SocksProxyAgent;
41
+ } catch (err) {
42
+ throw([503, 'FailedToImportSocksProxyAgent', {err}]);
43
+ }
44
+ }],
45
+
37
46
  // Get the configuration file
38
47
  getFile: ['validate', ({}, cbk) => {
39
48
  return fs.getFile(path, (err, res) => {
@@ -50,7 +59,7 @@ module.exports = ({fs, path}, cbk) => {
50
59
  }],
51
60
 
52
61
  // Construct the SOCKS proxy agent
53
- agent: ['getFile', ({getFile}, cbk) => {
62
+ agent: ['getFile', 'getSocksAgent', ({getFile, getSocksAgent}, cbk) => {
54
63
  try {
55
64
  parse(getFile);
56
65
  } catch (err) {
@@ -78,7 +87,7 @@ module.exports = ({fs, path}, cbk) => {
78
87
  url.username = userId;
79
88
  }
80
89
 
81
- const agent = new SocksProxyAgent(url.toString());
90
+ const agent = new getSocksAgent(url.toString());
82
91
 
83
92
  return cbk(null, {agent});
84
93
  } catch (err) {