balanceofsatoshis 11.63.1 → 11.64.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,13 @@
1
1
  # Versions
2
2
 
3
+ ## 11.64.2
4
+
5
+ - `trade-secret`: Fix connecting when not already peered with seller
6
+
7
+ ## 11.64.0
8
+
9
+ - `lnurl`: Add `--avoid`, `--max-paths`, `--out` options to control payments
10
+
3
11
  ## 11.63.1
4
12
 
5
13
  - `lnurl`: Add command to decode and make payments to LNURL payRequests
package/Dockerfile CHANGED
@@ -9,6 +9,8 @@ ENV GROUP_ID=$GROUP_ID
9
9
 
10
10
  WORKDIR /app/
11
11
 
12
+ RUN apk add --no-cache --upgrade bash
13
+
12
14
  RUN chown -R $USER_ID:$GROUP_ID /app/
13
15
 
14
16
  USER $USER_ID:$GROUP_ID
package/bos CHANGED
@@ -1023,8 +1023,11 @@ prog
1023
1023
  .command('lnurl', 'Collection of lnurl features')
1024
1024
  .argument('<function>', 'lnurl function', keys(lnurlFunctions))
1025
1025
  .help(`Functions: ${keys(lnurlFunctions).join(', ')}`)
1026
+ .option('--avoid <avoid>', 'Avoid forwarding via node/chan/tag', REPEATABLE)
1026
1027
  .option('--max-fee <max_fee>', 'Maximum fee to pay', INT, 1337)
1028
+ .option('--max-paths <max_paths>', 'Maximum paths to use', INT, 1)
1027
1029
  .option('--node <node_name>', 'Node to run a lnurl function')
1030
+ .option('--out <public_key>', 'Make first hop through peer', REPEATABLE)
1028
1031
  .option('--url <url>', 'URL to pay', STRING)
1029
1032
  .action((args, options, logger) => {
1030
1033
  return new Promise(async (resolve, reject) => {
@@ -1032,10 +1035,13 @@ prog
1032
1035
  return lnurl.pay({
1033
1036
  logger,
1034
1037
  ask: (n, cbk) => inquirer.prompt(n).then(n => cbk(n)),
1038
+ avoid: flatten([options.avoid].filter(n => !!n)),
1035
1039
  function: args.function,
1036
1040
  lnd: (await lnd.authenticatedLnd({logger, node: options.node})).lnd,
1037
1041
  lnurl: options.url,
1038
1042
  max_fee: options.maxFee,
1043
+ max_paths: options.maxPaths,
1044
+ out: flatten([options.out].filter(n => !!n)),
1039
1045
  request: commands.simpleRequest,
1040
1046
  },
1041
1047
  responses.returnObject({logger, reject, resolve}));
package/lnurl/pay.js CHANGED
@@ -13,7 +13,6 @@ const asLnurl = n => n.substring(n.startsWith('lightning:') ? 10 : 0);
13
13
  const bech32CharLimit = 2000;
14
14
  const errorStatus = 'ERROR';
15
15
  const {decode} = bech32;
16
- const defaultMaxPaths = 1;
17
16
  const {isArray} = Array;
18
17
  const isNumber = n => !isNaN(n);
19
18
  const lowestSendableValue = 1000;
@@ -36,11 +35,14 @@ const wordsAsUtf8 = n => Buffer.from(bech32.fromWords(n)).toString('utf8');
36
35
  /** Pay to lnurl
37
36
  {
38
37
  ask: <Ask Function>
38
+ avoid: [<Avoid Forwarding Through String>]
39
39
  fetch: <Fetch Function>
40
40
  lnd: <Authenticated LND API Object>
41
41
  lnurl: <Lnurl String>
42
42
  logger: <Winston Logger Object>
43
43
  max_fee: <Max Fee Tokens Number>
44
+ max_paths: <Maximum Paths Number>
45
+ out: [<Out Through Peer With Public Key Hex String>]
44
46
  }
45
47
  */
46
48
  module.exports = (args, cbk) => {
@@ -52,6 +54,10 @@ module.exports = (args, cbk) => {
52
54
  return cbk([400, 'ExpectedAskFunctionToGetPaymentRequestFromLnurl']);
53
55
  }
54
56
 
57
+ if (!isArray(args.avoid)) {
58
+ return cbk([400, 'ExpectedAvoidArrayToGetPaymentRequestFromLnurl']);
59
+ }
60
+
55
61
  if (!args.request) {
56
62
  return cbk([400, 'ExpectedRequestFunctionToGetLnurlData']);
57
63
  }
@@ -82,6 +88,14 @@ module.exports = (args, cbk) => {
82
88
  return cbk([400, 'ExpectedMaxFeeToGetPaymentRequestFromLnurl']);
83
89
  }
84
90
 
91
+ if (!args.max_paths) {
92
+ return cbk([400, 'ExpectedMaxPathsCountToPayViaLnurl']);
93
+ }
94
+
95
+ if (!isArray(args.out)) {
96
+ return cbk([400, 'ExpectedArrayOfOutPeersToPayViaLnurl']);
97
+ }
98
+
85
99
  return cbk();
86
100
  },
87
101
 
@@ -303,12 +317,12 @@ module.exports = (args, cbk) => {
303
317
  // Pay the payment request
304
318
  pay: ['confirm', 'getRequest', ({getRequest}, cbk) => {
305
319
  return pay({
306
- avoid: [],
320
+ avoid: args.avoid,
307
321
  lnd: args.lnd,
308
322
  logger: args.logger,
309
323
  max_fee: args.max_fee,
310
- max_paths: defaultMaxPaths,
311
- out: [],
324
+ max_paths: args.max_paths,
325
+ out: args.out,
312
326
  request: getRequest,
313
327
  },
314
328
  cbk);
package/package.json CHANGED
@@ -11,38 +11,38 @@
11
11
  },
12
12
  "dependencies": {
13
13
  "@alexbosworth/caporal": "1.4.1",
14
- "@alexbosworth/fiat": "1.0.1",
14
+ "@alexbosworth/fiat": "1.0.2",
15
15
  "@alexbosworth/html2unicode": "1.1.5",
16
16
  "@alexbosworth/node-fetch": "2.6.2",
17
17
  "abort-controller": "3.0.0",
18
18
  "asciichart": "1.5.25",
19
19
  "async": "3.2.3",
20
- "asyncjs-util": "1.2.8",
20
+ "asyncjs-util": "1.2.9",
21
21
  "bech32": "2.0.0",
22
22
  "bip66": "1.1.5",
23
23
  "bitcoinjs-lib": "6.0.1",
24
- "bolt01": "1.2.3",
25
- "bolt03": "1.2.13",
26
- "bolt07": "1.8.0",
24
+ "bolt01": "1.2.4",
25
+ "bolt03": "1.2.14",
26
+ "bolt07": "1.8.1",
27
27
  "cbor": "8.1.0",
28
28
  "colorette": "2.0.16",
29
29
  "crypto-js": "4.1.1",
30
30
  "csv-parse": "5.0.4",
31
- "goldengate": "11.1.0",
31
+ "goldengate": "11.1.1",
32
32
  "grammy": "1.7.1",
33
33
  "hot-formula-parser": "4.0.0",
34
34
  "import-lazy": "4.0.0",
35
- "ini": "2.0.0",
35
+ "ini": "3.0.0",
36
36
  "inquirer": "8.2.2",
37
- "invoices": "2.0.4",
38
- "ln-accounting": "5.0.5",
39
- "ln-service": "53.9.3",
40
- "ln-sync": "3.11.0",
41
- "ln-telegram": "3.21.0",
42
- "moment": "2.29.1",
43
- "paid-services": "3.14.4",
44
- "probing": "2.0.3",
45
- "psbt": "2.0.0",
37
+ "invoices": "2.0.5",
38
+ "ln-accounting": "5.0.6",
39
+ "ln-service": "53.11.0",
40
+ "ln-sync": "3.12.0",
41
+ "ln-telegram": "3.21.1",
42
+ "moment": "2.29.2",
43
+ "paid-services": "3.14.5",
44
+ "probing": "2.0.5",
45
+ "psbt": "2.0.1",
46
46
  "qrcode-terminal": "0.12.0",
47
47
  "sanitize-filename": "1.6.3",
48
48
  "socks-proxy-agent": "6.2.0-beta.0",
@@ -53,7 +53,7 @@
53
53
  "description": "Lightning balance CLI",
54
54
  "devDependencies": {
55
55
  "@alexbosworth/tap": "15.0.11",
56
- "ln-docker-daemons": "2.2.5",
56
+ "ln-docker-daemons": "2.2.7",
57
57
  "mock-lnd": "1.4.1",
58
58
  "tiny-secp256k1": "2.2.1"
59
59
  },
@@ -78,8 +78,9 @@
78
78
  "scripts": {
79
79
  "build-docker": "docker build -t alexbosworth/balanceofsatoshis . && docker save alexbosworth/balanceofsatoshis > balanceofsatoshis.tar && gzip balanceofsatoshis.tar",
80
80
  "integration-tests": "tap --branches=1 --functions=1 --lines=1 --statements=1 -t 120 test/integration/*.js",
81
+ "postpack": "PACKAGE_VERSION=$(cat package.json | grep \\\"version\\\" | head -1 | awk -F: '{ print $2 }' | sed 's/[\",]//g' | tr -d '[[:space:]]') && git tag -s v$PACKAGE_VERSION -m v$PACKAGE_VERSION && git push github --tags",
81
82
  "postpublish": "docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t alexbosworth/balanceofsatoshis --push .",
82
83
  "test": "tap --branches=1 --functions=1 --lines=1 --statements=1 -t 60 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
84
  },
84
- "version": "11.63.1"
85
+ "version": "11.64.2"
85
86
  }