fix detailed balance total, add age to formulas, add anon keysend msgs

This commit is contained in:
Alex Bosworth 2021-09-24 19:42:24 -07:00
parent 5a8d468905
commit c651c59ab8
No known key found for this signature in database
GPG key ID: E80D2F3F311FD87E
15 changed files with 827 additions and 81 deletions

View file

@ -1,5 +1,12 @@
# Versions
## Version 10.19.0
- `balance`: Included locked UTXO value as on-chain value in `--detailed` balance output
- `increase-inbound-liquidity|pay|probe|rebalance|send`: Add `AGE` to avoid formulas
- `peers`: Avoid errors when network name is unknown
- `push`: Add `--message-omit-from-key` to send messages without including "from" key
## Version 10.18.1
- `open`: In final tx id indication use original external tx id when available

View file

@ -12,8 +12,8 @@ Commands for working with LND balances.
If you want to try out any command without npm install, you can also do `npx
balanceofsatoshis` to run a command directly.
If you have [Docker](https://docs.docker.com/get-docker/) installed, you can
[run through Docker](#docker) instead.
If you have [Docker](https://docs.docker.com/get-docker/) installed or are using a Docker based
platform like Umbrel or BTCPayServer, you can [run through Docker](#docker) instead.
```shell
npm install -g balanceofsatoshis
@ -451,6 +451,17 @@ Or on Linux:
--network="host" -v $HOME/.lnd:/home/node/.lnd:ro
```
On BTCpayServer:
Create the credential.json file as explained in the saved nodes section, and for socket put:
`"socket": "lnd_bitcoin:10009"`
For Docker network use the Docker bridged network:
```
docker run -it --rm --network="generated_default" -v $HOME/.bos:/home/node/.bos alexbosworth/balanceofsatoshis balance --node SAVEDNODENAME
```
On Umbrel this would be:
```

View file

@ -31,6 +31,9 @@ const witnessSizeCounterVByteLength = 0.25;
tokens: <Payment Size Tokens Number>
}]
}]
locked: [{
tokens: <Unspent Tokens Number>
}]
pending: [{
is_opening: <Channel is Pending Bool>
is_partner_initiated: <Partner Responsible For Chain Fees Bool>
@ -64,7 +67,7 @@ const witnessSizeCounterVByteLength = 0.25;
onchain_vbytes: <Estimated Virtual Bytes to Spend On-Chain Funds Number>
}
*/
module.exports = ({channels, pending, transactions, utxos}) => {
module.exports = ({channels, locked, pending, transactions, utxos}) => {
const channelBalances = channels.map(n => n.local_balance);
const confirmedUtxos = utxos.filter(n => !!n.confirmation_count);
@ -115,6 +118,7 @@ module.exports = ({channels, pending, transactions, utxos}) => {
const chainBalance = sumOf([]
.concat(confirmedUtxos)
.concat(changeUtxos)
.concat(locked)
.map(n => n.tokens)
);

View file

@ -21,7 +21,7 @@ const none = 0;
lnd: <Authenticated LND API Object>
}
@returns via cbk
@returns via cbk or Promise
{
balance: <Tokens Number>
channel_balance: <Channel Balance Minus Commit Fees Tokens Number>

View file

@ -2,12 +2,16 @@ const asyncAuto = require('async/auto');
const {formatTokens} = require('ln-sync');
const {getChainTransactions} = require('ln-service');
const {getChannels} = require('ln-service');
const {getLockedUtxos} = require('ln-service');
const {getPendingChannels} = require('ln-service');
const {getUtxos} = require('ln-service');
const {returnResult} = require('asyncjs-util');
const {Transaction} = require('bitcoinjs-lib');
const detailedBalances = require('./detailed_balances');
const {fromHex} = Transaction;
/** Get a detailed balance that categorizes balance of tokens on the node
{
@ -39,6 +43,18 @@ module.exports = (args, cbk) => {
return getChannels({lnd: args.lnd}, cbk);
}],
// Get locked UTXOs
getLocked: ['validate', ({}, cbk) => {
return getLockedUtxos({lnd: args.lnd}, (err, res) => {
// Ignore errors
if (!!err) {
return cbk(null, []);
}
return cbk(null, res.utxos);
});
}],
// Get pending channels
getPending: ['validate', ({}, cbk) => {
return getPendingChannels({lnd: args.lnd}, cbk);
@ -52,17 +68,49 @@ module.exports = (args, cbk) => {
// Get the UTXOs
getUtxos: ['validate', ({}, cbk) => getUtxos({lnd: args.lnd}, cbk)],
// Cross reference locked transactions to UTXO data
locked: ['getLocked', 'getTx', ({getLocked, getTx}, cbk) => {
const {transactions} = getTx;
const utxos = getLocked.map(locked => {
// Exit early when the lock is expired
if (locked.lock_expires_at < new Date().toISOString()) {
return;
}
const tx = transactions.find(n => n.id === locked.transaction_id);
// Exit early when there is no related confirmed transaction
if (!tx || !tx.transaction || !tx.confirmation_count) {
return;
}
const output = fromHex(tx.transaction).outs[locked.transaction_vout];
// Exit early when the output is not found in the transaction
if (!output) {
return;
}
return {tokens: output.value};
});
return cbk(null, utxos.filter(n => !!n));
}],
// Calculate balance
balance: [
'getChannels',
'getPending',
'getTx',
'getUtxos',
({getChannels, getPending, getTx, getUtxos}, cbk) =>
'locked',
({getChannels, getPending, getTx, getUtxos, locked}, cbk) =>
{
const format = tokens => formatTokens({tokens}).display.trim();
const balances = detailedBalances({
locked,
channels: getChannels.channels,
pending: getPending.pending_channels,
transactions: getTx.transactions,

View file

@ -21,14 +21,14 @@ const topPercentile = 0.9;
[below]: <Tokens Below Tokens Number>
[is_outbound]: <Return Outbound Liquidity Bool>
[is_top]: <Return Top Liquidity Bool>
lnd: <Authenticated LND gRPC API Object>
lnd: <Authenticated LND API Object>
[min_node_score]: <Minimum Node Score Number>
[max_fee_rate]: <Max Inbound Fee Rate Parts Per Million Number>
[request]: <Request Function>
[with]: <Liquidity With Specific Node Public Key Hex String>
}
@returns via cbk
@returns via cbk or Promise
{
balance: <Liquid Tokens Number>
}

6
bos
View file

@ -952,7 +952,7 @@ prog
// Open channels
.command('open', 'Open channels, optionally using an external wallet')
.help('Create channels from an external wallet. Note: do not self-broadcast')
.help('When creating channels from an external wallet do not self-broadcast')
.argument('<peer_public_keys...>', 'With nodes with public keys')
.option('--amount <channel_capacity>', 'Capacities to open', REPEATABLE)
.option('--external-funding', 'Use external funds for the channel open')
@ -1191,7 +1191,7 @@ prog
.help('--avoid can take a channel id or a public key to avoid')
.help('--avoid can take a public_key/public_key to avoid a directed pair')
.help('--avoid can take a FORMULA/public_key to avoid inbound peers')
.help('--avoid FORMULA variables: FEE_RATE, BASE_FEE, HEIGHT')
.help('--avoid FORMULA variables: FEE_RATE, BASE_FEE, HEIGHT, AGE')
.help('--in decreases the inbound liquidity with a specific peer/tag')
.help('--out increases the inbound liquidity with a specific peer/tag')
.option('--amount <amount>', 'Maximum amount to rebalance')
@ -1348,6 +1348,7 @@ prog
.option('--in <pubkey_or_alias>', 'Route in through a specific node')
.option('--max-fee <fee>', 'Maximum fee tokens', INT, 1337)
.option('--message <message>', 'Message to include with payment')
.option('--message-omit-from-key', 'Leave out the from key on messages')
.option('--no-color', 'Mute all colors')
.option('--node <name>', 'Node to send funds from')
.option('--out <pubkey_or_alias>', 'Route out through a specific peer')
@ -1368,6 +1369,7 @@ prog
fs: {getFile: readFile},
in_through: options.in,
is_dry_run: options.dryrun,
is_omitting_message_from: options.messageOmitFromKey,
max_fee: options.maxFee,
message: options.message,
quiz_answers: flatten([options.quiz].filter(n => !!n)),

View file

@ -1,5 +1,6 @@
const asyncAuto = require('async/auto');
const asyncMap = require('async/map');
const asyncReflect = require('async/reflect');
const asyncUntil = require('async/until');
const {bold} = require('colorette');
const {decodeChanId} = require('bolt07');
@ -191,6 +192,11 @@ module.exports = (args, cbk) => {
);
}],
// Get the network name
getNetwork: ['validate', asyncReflect(({}, cbk) => {
return getNetwork({lnd: args.lnd}, cbk);
})],
// Get payments
getPayments: ['validate', ({}, cbk) => {
// Exit early and skip long payments lookup when idle days not needed
@ -330,6 +336,7 @@ module.exports = (args, cbk) => {
'forwards',
'getChannels',
'getInvoices',
'getNetwork',
'getPayments',
'getPeers',
'getPending',
@ -339,6 +346,7 @@ module.exports = (args, cbk) => {
forwards,
getChannels,
getInvoices,
getNetwork,
getPayments,
getPeers,
getPending,
@ -400,7 +408,7 @@ module.exports = (args, cbk) => {
const maxInbound = args.inbound_liquidity_below;
const maxOutbound = args.outbound_liquidity_below;
const {network} = await getNetwork({lnd: args.lnd});
const {network} = getNetwork.value || {};
const peerKeys = getChannels.channels.map(n => n.partner_public_key);
const wallet = await getHeight({lnd: args.lnd});

View file

@ -53,6 +53,7 @@ const tokAsMtok = tokens => (BigInt(tokens || 0) * BigInt(1e3)).toString();
[to_public_key]: <Avoid Routing To Node With Public Key Hex String>
}]
[in_through]: <Pay In Through Public Key Hex String>
[is_omitting_message_from]: <Omit Message From Fields Bool>
[is_push]: <Is Push Payment Bool>
[is_real_payment]: <Pay the Request after Probing Bool> // default: false
[is_strict_max_fee]: <Avoid Probing Too-High Fee Routes Bool>
@ -238,14 +239,17 @@ module.exports = (args, cbk) => {
date.writeUIntBE(now(), Number(), datePrecisionLength);
// Add message
if (!!args.message) {
messages.push({type: dateType, value: date.toString('hex')});
messages.push({
type: messageType,
value: Buffer.from(args.message).toString('hex'),
});
}
// Add message from fields
if (!!args.message && !args.is_omitting_message_from) {
messages.push({type: dateType, value: date.toString('hex')});
messages.push({type: fromKeyType, value: getIdentity.public_key});
const preimage = Buffer.concat([

View file

@ -39,6 +39,7 @@ const utf8AsHex = n => Buffer.from(n, 'utf8').toString('hex');
}
[in_through]: <Pay In Through Peer String>
[is_dry_run]: <Do Not Push Payment Bool>
[is_omitting_message_from]: <Do Not Include From Key In Message Bool>
lnd: <Authenticated LND API Object>
logger: <Winston Logger Object>
max_fee: <Maximum Fee Tokens Number>
@ -74,6 +75,10 @@ module.exports = (args, cbk) => {
return cbk([400, 'MultipleInboundPeersNotSupported']);
}
if (!!args.is_omitting_message_from && !args.message) {
return cbk([400, 'ExpectedMessageToSendWhenSpecifyingOmitFromKey']);
}
if (!args.lnd) {
return cbk([400, 'ExpectedAuthenticatedLndToPushPayment']);
}
@ -365,6 +370,7 @@ module.exports = (args, cbk) => {
lnd: args.lnd,
logger: args.logger,
in_through: getInKey,
is_omitting_message_from: args.is_omitting_message_from,
is_push: true,
is_real_payment: true,
max_fee: args.max_fee,

757
package-lock.json generated
View file

@ -1,12 +1,12 @@
{
"name": "balanceofsatoshis",
"version": "10.18.1",
"version": "10.19.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "balanceofsatoshis",
"version": "10.18.1",
"version": "10.19.0",
"license": "MIT",
"dependencies": {
"@alexbosworth/html2unicode": "1.1.5",
@ -24,7 +24,7 @@
"caporal": "1.4.0",
"cbor": "8.0.0",
"cert-info": "1.5.1",
"colorette": "2.0.2",
"colorette": "2.0.10",
"crypto-js": "4.1.1",
"csv-parse": "4.16.3",
"goldengate": "10.4.0",
@ -34,8 +34,8 @@
"inquirer": "8.1.5",
"invoices": "2.0.0",
"ln-accounting": "5.0.3",
"ln-service": "52.6.0",
"ln-sync": "2.0.1",
"ln-service": "52.8.0",
"ln-sync": "2.0.2",
"ln-telegram": "3.3.0",
"moment": "2.29.1",
"paid-services": "3.0.0",
@ -4001,9 +4001,9 @@
}
},
"node_modules/colorette": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.2.tgz",
"integrity": "sha512-iO5Ycn8HKVhTGGKpwJtyzrrvOGI9YC4u4dppP5yKSGP47ApaZNwX7ne4PtgpTzq+JBwQh6FrdAfCSYTBQe1+FA=="
"version": "2.0.10",
"resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.10.tgz",
"integrity": "sha512-tQ7Prvd+zU6EUsQVXJNqxJUZdZ4btI34jlp/W1N/bNyWsY55dxe2oSg+ss3COV4vKbWLVlwLJt5xMSCuZ3R4og=="
},
"node_modules/colors": {
"version": "1.4.0",
@ -5823,14 +5823,14 @@
}
},
"node_modules/lightning": {
"version": "4.7.0",
"resolved": "https://registry.npmjs.org/lightning/-/lightning-4.7.0.tgz",
"integrity": "sha512-HtoVfuc9p8fcAOTXOBgIfH04S91A/1xlUZTRnYAdZx0h2zMjQaZ5/mpbDQjQkBn4Swf0EOHkcSI82scKm37JQg==",
"version": "4.7.2",
"resolved": "https://registry.npmjs.org/lightning/-/lightning-4.7.2.tgz",
"integrity": "sha512-8EJA+1Tx5637U1DJVfOogphicY2xPNp0krIt/eWphEXyWYXS/i0iu/3nI5FHM5vc9HDVyJHBWrU9rRWth9pn8A==",
"dependencies": {
"@grpc/grpc-js": "1.3.7",
"@grpc/proto-loader": "0.6.5",
"@types/express": "4.17.13",
"@types/node": "16.9.1",
"@types/node": "16.9.6",
"@types/request": "2.48.7",
"@types/ws": "7.4.7",
"async": "3.2.1",
@ -5839,7 +5839,7 @@
"bn.js": "5.2.0",
"body-parser": "1.19.0",
"bolt07": "1.7.3",
"bolt09": "0.1.5",
"bolt09": "0.2.0",
"cbor": "8.0.0",
"express": "4.17.1",
"invoices": "2.0.0",
@ -5868,9 +5868,9 @@
}
},
"node_modules/lightning/node_modules/@types/node": {
"version": "16.9.1",
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.9.1.tgz",
"integrity": "sha512-QpLcX9ZSsq3YYUUnD3nFDY8H7wctAhQj/TFKL8Ya8v5fMm3CFXxo8zStsLAl780ltoYoo1WvKUVGBQK+1ifr7g=="
"version": "16.9.6",
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.9.6.tgz",
"integrity": "sha512-YHUZhBOMTM3mjFkXVcK+WwAcYmyhe1wL4lfqNtzI0b3qAy7yuSetnM7QJazgE5PFmgVTNGiLOgRFfJMqW7XpSQ=="
},
"node_modules/lightning/node_modules/ansi-styles": {
"version": "4.3.0",
@ -5886,6 +5886,14 @@
"url": "https://github.com/chalk/ansi-styles?sponsor=1"
}
},
"node_modules/lightning/node_modules/bolt09": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/bolt09/-/bolt09-0.2.0.tgz",
"integrity": "sha512-s6QWo7qqu6fKGLISGMSG+vFxIRzeUT3KQHDiHpvhflyI3TQD6zdaMu4fEpP7PoyMFJt2Ve26SBvvRP3MM7V0bw==",
"engines": {
"node": ">=10.4.0"
}
},
"node_modules/lightning/node_modules/cliui": {
"version": "7.0.4",
"resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz",
@ -5921,13 +5929,13 @@
}
},
"node_modules/lightning/node_modules/string-width": {
"version": "4.2.2",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz",
"integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==",
"version": "4.2.3",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
"integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
"dependencies": {
"emoji-regex": "^8.0.0",
"is-fullwidth-code-point": "^3.0.0",
"strip-ansi": "^6.0.0"
"strip-ansi": "^6.0.1"
},
"engines": {
"node": ">=8"
@ -6177,15 +6185,15 @@
}
},
"node_modules/ln-service": {
"version": "52.6.0",
"resolved": "https://registry.npmjs.org/ln-service/-/ln-service-52.6.0.tgz",
"integrity": "sha512-tLJMrknIzK6MMIx/N1r8iRjVWBPFmt0S1hI2l+DNL6+ln930nSUN+/aW3SUZho48ACLPBJDSgXwAU50ExrC+rQ==",
"version": "52.8.0",
"resolved": "https://registry.npmjs.org/ln-service/-/ln-service-52.8.0.tgz",
"integrity": "sha512-slZ62J04S3p19z/7r8AYradKVDohpzWppU1ejG9h8Yfwz8ZMzHbHW7H0dTp64/U0PaMQQIFRoAzGSBj1ej6/wA==",
"dependencies": {
"bolt07": "1.7.3",
"cors": "2.8.5",
"express": "4.17.1",
"invoices": "2.0.0",
"lightning": "4.7.0",
"lightning": "4.7.2",
"macaroon": "3.0.4",
"morgan": "1.10.0",
"ws": "8.2.2"
@ -6195,22 +6203,195 @@
}
},
"node_modules/ln-sync": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/ln-sync/-/ln-sync-2.0.1.tgz",
"integrity": "sha512-+WJ/qQrDJu3sY48IXQf3r1jDe4AFyLRA0HV4Nm78zL2S6iZ+axXD/+4qVE9IN7OlMOfpkmAAunSu6tIlIltuLA==",
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/ln-sync/-/ln-sync-2.0.2.tgz",
"integrity": "sha512-tPT6irw2Ad6W/uoLZ9H0mT3S59XPMRY7j7ygu+ALztbAcuixEOn3kv80+3hFjOzqXXFo/FDsXHw3DWfO2dDDng==",
"dependencies": {
"async": "3.2.1",
"asyncjs-util": "1.2.6",
"bitcoinjs-lib": "5.2.0",
"cbor": "8.0.0",
"colorette": "2.0.2",
"lightning": "4.7.0",
"colorette": "2.0.7",
"lightning": "4.7.1",
"stats-lite": "2.2.0"
},
"engines": {
"node": ">=12"
}
},
"node_modules/ln-sync/node_modules/@grpc/proto-loader": {
"version": "0.6.5",
"resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.6.5.tgz",
"integrity": "sha512-GZdzyVQI1Bln/kCzIYgTKu+rQJ5dno0gVrfmLe4jqQu7T2e7svSwJzpCBqVU5hhBSJP3peuPjOMWsj5GR61YmQ==",
"dependencies": {
"@types/long": "^4.0.1",
"lodash.camelcase": "^4.3.0",
"long": "^4.0.0",
"protobufjs": "^6.10.0",
"yargs": "^16.1.1"
},
"bin": {
"proto-loader-gen-types": "build/bin/proto-loader-gen-types.js"
},
"engines": {
"node": ">=6"
}
},
"node_modules/ln-sync/node_modules/@types/node": {
"version": "16.9.6",
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.9.6.tgz",
"integrity": "sha512-YHUZhBOMTM3mjFkXVcK+WwAcYmyhe1wL4lfqNtzI0b3qAy7yuSetnM7QJazgE5PFmgVTNGiLOgRFfJMqW7XpSQ=="
},
"node_modules/ln-sync/node_modules/ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"dependencies": {
"color-convert": "^2.0.1"
},
"engines": {
"node": ">=8"
},
"funding": {
"url": "https://github.com/chalk/ansi-styles?sponsor=1"
}
},
"node_modules/ln-sync/node_modules/bolt09": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/bolt09/-/bolt09-0.2.0.tgz",
"integrity": "sha512-s6QWo7qqu6fKGLISGMSG+vFxIRzeUT3KQHDiHpvhflyI3TQD6zdaMu4fEpP7PoyMFJt2Ve26SBvvRP3MM7V0bw==",
"engines": {
"node": ">=10.4.0"
}
},
"node_modules/ln-sync/node_modules/cliui": {
"version": "7.0.4",
"resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz",
"integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==",
"dependencies": {
"string-width": "^4.2.0",
"strip-ansi": "^6.0.0",
"wrap-ansi": "^7.0.0"
}
},
"node_modules/ln-sync/node_modules/color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"dependencies": {
"color-name": "~1.1.4"
},
"engines": {
"node": ">=7.0.0"
}
},
"node_modules/ln-sync/node_modules/color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
},
"node_modules/ln-sync/node_modules/colorette": {
"version": "2.0.7",
"resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.7.tgz",
"integrity": "sha512-wSXeeDPxoi5xKvjvOGxyYlyqB3J+tbowaSsFm1rEsDsDE942aTLftbOE3XMqf3XaYC7QUtcd/3qadNAIEIsAYw=="
},
"node_modules/ln-sync/node_modules/is-fullwidth-code-point": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
"integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
"engines": {
"node": ">=8"
}
},
"node_modules/ln-sync/node_modules/lightning": {
"version": "4.7.1",
"resolved": "https://registry.npmjs.org/lightning/-/lightning-4.7.1.tgz",
"integrity": "sha512-K/+GISxMDmpCl7bjauCxsVMslXAV6UMbfZSbeHsZuEN0yKSHq5cnPxHLGG2R12cOfKOar1fVDPbsiXO39Upqiw==",
"dependencies": {
"@grpc/grpc-js": "1.3.7",
"@grpc/proto-loader": "0.6.5",
"@types/express": "4.17.13",
"@types/node": "16.9.6",
"@types/request": "2.48.7",
"@types/ws": "7.4.7",
"async": "3.2.1",
"asyncjs-util": "1.2.6",
"bitcoinjs-lib": "5.2.0",
"bn.js": "5.2.0",
"body-parser": "1.19.0",
"bolt07": "1.7.3",
"bolt09": "0.2.0",
"cbor": "8.0.0",
"express": "4.17.1",
"invoices": "2.0.0",
"psbt": "1.1.10"
},
"engines": {
"node": ">=12"
}
},
"node_modules/ln-sync/node_modules/string-width": {
"version": "4.2.3",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
"integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
"dependencies": {
"emoji-regex": "^8.0.0",
"is-fullwidth-code-point": "^3.0.0",
"strip-ansi": "^6.0.1"
},
"engines": {
"node": ">=8"
}
},
"node_modules/ln-sync/node_modules/wrap-ansi": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
"integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==",
"dependencies": {
"ansi-styles": "^4.0.0",
"string-width": "^4.1.0",
"strip-ansi": "^6.0.0"
},
"engines": {
"node": ">=10"
},
"funding": {
"url": "https://github.com/chalk/wrap-ansi?sponsor=1"
}
},
"node_modules/ln-sync/node_modules/y18n": {
"version": "5.0.8",
"resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz",
"integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==",
"engines": {
"node": ">=10"
}
},
"node_modules/ln-sync/node_modules/yargs": {
"version": "16.2.0",
"resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz",
"integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==",
"dependencies": {
"cliui": "^7.0.2",
"escalade": "^3.1.1",
"get-caller-file": "^2.0.5",
"require-directory": "^2.1.1",
"string-width": "^4.2.0",
"y18n": "^5.0.5",
"yargs-parser": "^20.2.2"
},
"engines": {
"node": ">=10"
}
},
"node_modules/ln-sync/node_modules/yargs-parser": {
"version": "20.2.9",
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz",
"integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==",
"engines": {
"node": ">=10"
}
},
"node_modules/ln-telegram": {
"version": "3.3.0",
"resolved": "https://registry.npmjs.org/ln-telegram/-/ln-telegram-3.3.0.tgz",
@ -7276,6 +7457,184 @@
"node": ">=12"
}
},
"node_modules/paid-services/node_modules/@grpc/proto-loader": {
"version": "0.6.5",
"resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.6.5.tgz",
"integrity": "sha512-GZdzyVQI1Bln/kCzIYgTKu+rQJ5dno0gVrfmLe4jqQu7T2e7svSwJzpCBqVU5hhBSJP3peuPjOMWsj5GR61YmQ==",
"dependencies": {
"@types/long": "^4.0.1",
"lodash.camelcase": "^4.3.0",
"long": "^4.0.0",
"protobufjs": "^6.10.0",
"yargs": "^16.1.1"
},
"bin": {
"proto-loader-gen-types": "build/bin/proto-loader-gen-types.js"
},
"engines": {
"node": ">=6"
}
},
"node_modules/paid-services/node_modules/@types/node": {
"version": "16.9.1",
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.9.1.tgz",
"integrity": "sha512-QpLcX9ZSsq3YYUUnD3nFDY8H7wctAhQj/TFKL8Ya8v5fMm3CFXxo8zStsLAl780ltoYoo1WvKUVGBQK+1ifr7g=="
},
"node_modules/paid-services/node_modules/ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"dependencies": {
"color-convert": "^2.0.1"
},
"engines": {
"node": ">=8"
},
"funding": {
"url": "https://github.com/chalk/ansi-styles?sponsor=1"
}
},
"node_modules/paid-services/node_modules/cliui": {
"version": "7.0.4",
"resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz",
"integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==",
"dependencies": {
"string-width": "^4.2.0",
"strip-ansi": "^6.0.0",
"wrap-ansi": "^7.0.0"
}
},
"node_modules/paid-services/node_modules/color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"dependencies": {
"color-name": "~1.1.4"
},
"engines": {
"node": ">=7.0.0"
}
},
"node_modules/paid-services/node_modules/color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
},
"node_modules/paid-services/node_modules/is-fullwidth-code-point": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
"integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
"engines": {
"node": ">=8"
}
},
"node_modules/paid-services/node_modules/lightning": {
"version": "4.7.0",
"resolved": "https://registry.npmjs.org/lightning/-/lightning-4.7.0.tgz",
"integrity": "sha512-HtoVfuc9p8fcAOTXOBgIfH04S91A/1xlUZTRnYAdZx0h2zMjQaZ5/mpbDQjQkBn4Swf0EOHkcSI82scKm37JQg==",
"dependencies": {
"@grpc/grpc-js": "1.3.7",
"@grpc/proto-loader": "0.6.5",
"@types/express": "4.17.13",
"@types/node": "16.9.1",
"@types/request": "2.48.7",
"@types/ws": "7.4.7",
"async": "3.2.1",
"asyncjs-util": "1.2.6",
"bitcoinjs-lib": "5.2.0",
"bn.js": "5.2.0",
"body-parser": "1.19.0",
"bolt07": "1.7.3",
"bolt09": "0.1.5",
"cbor": "8.0.0",
"express": "4.17.1",
"invoices": "2.0.0",
"psbt": "1.1.10"
},
"engines": {
"node": ">=12"
}
},
"node_modules/paid-services/node_modules/ln-service": {
"version": "52.6.0",
"resolved": "https://registry.npmjs.org/ln-service/-/ln-service-52.6.0.tgz",
"integrity": "sha512-tLJMrknIzK6MMIx/N1r8iRjVWBPFmt0S1hI2l+DNL6+ln930nSUN+/aW3SUZho48ACLPBJDSgXwAU50ExrC+rQ==",
"dependencies": {
"bolt07": "1.7.3",
"cors": "2.8.5",
"express": "4.17.1",
"invoices": "2.0.0",
"lightning": "4.7.0",
"macaroon": "3.0.4",
"morgan": "1.10.0",
"ws": "8.2.2"
},
"engines": {
"node": ">=12"
}
},
"node_modules/paid-services/node_modules/string-width": {
"version": "4.2.3",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
"integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
"dependencies": {
"emoji-regex": "^8.0.0",
"is-fullwidth-code-point": "^3.0.0",
"strip-ansi": "^6.0.1"
},
"engines": {
"node": ">=8"
}
},
"node_modules/paid-services/node_modules/wrap-ansi": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
"integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==",
"dependencies": {
"ansi-styles": "^4.0.0",
"string-width": "^4.1.0",
"strip-ansi": "^6.0.0"
},
"engines": {
"node": ">=10"
},
"funding": {
"url": "https://github.com/chalk/wrap-ansi?sponsor=1"
}
},
"node_modules/paid-services/node_modules/y18n": {
"version": "5.0.8",
"resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz",
"integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==",
"engines": {
"node": ">=10"
}
},
"node_modules/paid-services/node_modules/yargs": {
"version": "16.2.0",
"resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz",
"integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==",
"dependencies": {
"cliui": "^7.0.2",
"escalade": "^3.1.1",
"get-caller-file": "^2.0.5",
"require-directory": "^2.1.1",
"string-width": "^4.2.0",
"y18n": "^5.0.5",
"yargs-parser": "^20.2.2"
},
"engines": {
"node": ">=10"
}
},
"node_modules/paid-services/node_modules/yargs-parser": {
"version": "20.2.9",
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz",
"integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==",
"engines": {
"node": ">=10"
}
},
"node_modules/parseurl": {
"version": "1.3.3",
"resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz",
@ -8433,11 +8792,11 @@
}
},
"node_modules/strip-ansi": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz",
"integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==",
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
"integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
"dependencies": {
"ansi-regex": "^5.0.0"
"ansi-regex": "^5.0.1"
},
"engines": {
"node": ">=8"
@ -12486,9 +12845,9 @@
"dev": true
},
"colorette": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.2.tgz",
"integrity": "sha512-iO5Ycn8HKVhTGGKpwJtyzrrvOGI9YC4u4dppP5yKSGP47ApaZNwX7ne4PtgpTzq+JBwQh6FrdAfCSYTBQe1+FA=="
"version": "2.0.10",
"resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.10.tgz",
"integrity": "sha512-tQ7Prvd+zU6EUsQVXJNqxJUZdZ4btI34jlp/W1N/bNyWsY55dxe2oSg+ss3COV4vKbWLVlwLJt5xMSCuZ3R4og=="
},
"colors": {
"version": "1.4.0",
@ -13895,14 +14254,14 @@
}
},
"lightning": {
"version": "4.7.0",
"resolved": "https://registry.npmjs.org/lightning/-/lightning-4.7.0.tgz",
"integrity": "sha512-HtoVfuc9p8fcAOTXOBgIfH04S91A/1xlUZTRnYAdZx0h2zMjQaZ5/mpbDQjQkBn4Swf0EOHkcSI82scKm37JQg==",
"version": "4.7.2",
"resolved": "https://registry.npmjs.org/lightning/-/lightning-4.7.2.tgz",
"integrity": "sha512-8EJA+1Tx5637U1DJVfOogphicY2xPNp0krIt/eWphEXyWYXS/i0iu/3nI5FHM5vc9HDVyJHBWrU9rRWth9pn8A==",
"requires": {
"@grpc/grpc-js": "1.3.7",
"@grpc/proto-loader": "0.6.5",
"@types/express": "4.17.13",
"@types/node": "16.9.1",
"@types/node": "16.9.6",
"@types/request": "2.48.7",
"@types/ws": "7.4.7",
"async": "3.2.1",
@ -13911,7 +14270,7 @@
"bn.js": "5.2.0",
"body-parser": "1.19.0",
"bolt07": "1.7.3",
"bolt09": "0.1.5",
"bolt09": "0.2.0",
"cbor": "8.0.0",
"express": "4.17.1",
"invoices": "2.0.0",
@ -13931,9 +14290,9 @@
}
},
"@types/node": {
"version": "16.9.1",
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.9.1.tgz",
"integrity": "sha512-QpLcX9ZSsq3YYUUnD3nFDY8H7wctAhQj/TFKL8Ya8v5fMm3CFXxo8zStsLAl780ltoYoo1WvKUVGBQK+1ifr7g=="
"version": "16.9.6",
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.9.6.tgz",
"integrity": "sha512-YHUZhBOMTM3mjFkXVcK+WwAcYmyhe1wL4lfqNtzI0b3qAy7yuSetnM7QJazgE5PFmgVTNGiLOgRFfJMqW7XpSQ=="
},
"ansi-styles": {
"version": "4.3.0",
@ -13943,6 +14302,11 @@
"color-convert": "^2.0.1"
}
},
"bolt09": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/bolt09/-/bolt09-0.2.0.tgz",
"integrity": "sha512-s6QWo7qqu6fKGLISGMSG+vFxIRzeUT3KQHDiHpvhflyI3TQD6zdaMu4fEpP7PoyMFJt2Ve26SBvvRP3MM7V0bw=="
},
"cliui": {
"version": "7.0.4",
"resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz",
@ -13972,13 +14336,13 @@
"integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg=="
},
"string-width": {
"version": "4.2.2",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz",
"integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==",
"version": "4.2.3",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
"integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
"requires": {
"emoji-regex": "^8.0.0",
"is-fullwidth-code-point": "^3.0.0",
"strip-ansi": "^6.0.0"
"strip-ansi": "^6.0.1"
}
},
"wrap-ansi": {
@ -14169,32 +14533,165 @@
}
},
"ln-service": {
"version": "52.6.0",
"resolved": "https://registry.npmjs.org/ln-service/-/ln-service-52.6.0.tgz",
"integrity": "sha512-tLJMrknIzK6MMIx/N1r8iRjVWBPFmt0S1hI2l+DNL6+ln930nSUN+/aW3SUZho48ACLPBJDSgXwAU50ExrC+rQ==",
"version": "52.8.0",
"resolved": "https://registry.npmjs.org/ln-service/-/ln-service-52.8.0.tgz",
"integrity": "sha512-slZ62J04S3p19z/7r8AYradKVDohpzWppU1ejG9h8Yfwz8ZMzHbHW7H0dTp64/U0PaMQQIFRoAzGSBj1ej6/wA==",
"requires": {
"bolt07": "1.7.3",
"cors": "2.8.5",
"express": "4.17.1",
"invoices": "2.0.0",
"lightning": "4.7.0",
"lightning": "4.7.2",
"macaroon": "3.0.4",
"morgan": "1.10.0",
"ws": "8.2.2"
}
},
"ln-sync": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/ln-sync/-/ln-sync-2.0.1.tgz",
"integrity": "sha512-+WJ/qQrDJu3sY48IXQf3r1jDe4AFyLRA0HV4Nm78zL2S6iZ+axXD/+4qVE9IN7OlMOfpkmAAunSu6tIlIltuLA==",
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/ln-sync/-/ln-sync-2.0.2.tgz",
"integrity": "sha512-tPT6irw2Ad6W/uoLZ9H0mT3S59XPMRY7j7ygu+ALztbAcuixEOn3kv80+3hFjOzqXXFo/FDsXHw3DWfO2dDDng==",
"requires": {
"async": "3.2.1",
"asyncjs-util": "1.2.6",
"bitcoinjs-lib": "5.2.0",
"cbor": "8.0.0",
"colorette": "2.0.2",
"lightning": "4.7.0",
"colorette": "2.0.7",
"lightning": "4.7.1",
"stats-lite": "2.2.0"
},
"dependencies": {
"@grpc/proto-loader": {
"version": "0.6.5",
"resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.6.5.tgz",
"integrity": "sha512-GZdzyVQI1Bln/kCzIYgTKu+rQJ5dno0gVrfmLe4jqQu7T2e7svSwJzpCBqVU5hhBSJP3peuPjOMWsj5GR61YmQ==",
"requires": {
"@types/long": "^4.0.1",
"lodash.camelcase": "^4.3.0",
"long": "^4.0.0",
"protobufjs": "^6.10.0",
"yargs": "^16.1.1"
}
},
"@types/node": {
"version": "16.9.6",
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.9.6.tgz",
"integrity": "sha512-YHUZhBOMTM3mjFkXVcK+WwAcYmyhe1wL4lfqNtzI0b3qAy7yuSetnM7QJazgE5PFmgVTNGiLOgRFfJMqW7XpSQ=="
},
"ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"requires": {
"color-convert": "^2.0.1"
}
},
"bolt09": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/bolt09/-/bolt09-0.2.0.tgz",
"integrity": "sha512-s6QWo7qqu6fKGLISGMSG+vFxIRzeUT3KQHDiHpvhflyI3TQD6zdaMu4fEpP7PoyMFJt2Ve26SBvvRP3MM7V0bw=="
},
"cliui": {
"version": "7.0.4",
"resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz",
"integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==",
"requires": {
"string-width": "^4.2.0",
"strip-ansi": "^6.0.0",
"wrap-ansi": "^7.0.0"
}
},
"color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"requires": {
"color-name": "~1.1.4"
}
},
"color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
},
"colorette": {
"version": "2.0.7",
"resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.7.tgz",
"integrity": "sha512-wSXeeDPxoi5xKvjvOGxyYlyqB3J+tbowaSsFm1rEsDsDE942aTLftbOE3XMqf3XaYC7QUtcd/3qadNAIEIsAYw=="
},
"is-fullwidth-code-point": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
"integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg=="
},
"lightning": {
"version": "4.7.1",
"resolved": "https://registry.npmjs.org/lightning/-/lightning-4.7.1.tgz",
"integrity": "sha512-K/+GISxMDmpCl7bjauCxsVMslXAV6UMbfZSbeHsZuEN0yKSHq5cnPxHLGG2R12cOfKOar1fVDPbsiXO39Upqiw==",
"requires": {
"@grpc/grpc-js": "1.3.7",
"@grpc/proto-loader": "0.6.5",
"@types/express": "4.17.13",
"@types/node": "16.9.6",
"@types/request": "2.48.7",
"@types/ws": "7.4.7",
"async": "3.2.1",
"asyncjs-util": "1.2.6",
"bitcoinjs-lib": "5.2.0",
"bn.js": "5.2.0",
"body-parser": "1.19.0",
"bolt07": "1.7.3",
"bolt09": "0.2.0",
"cbor": "8.0.0",
"express": "4.17.1",
"invoices": "2.0.0",
"psbt": "1.1.10"
}
},
"string-width": {
"version": "4.2.3",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
"integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
"requires": {
"emoji-regex": "^8.0.0",
"is-fullwidth-code-point": "^3.0.0",
"strip-ansi": "^6.0.1"
}
},
"wrap-ansi": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
"integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==",
"requires": {
"ansi-styles": "^4.0.0",
"string-width": "^4.1.0",
"strip-ansi": "^6.0.0"
}
},
"y18n": {
"version": "5.0.8",
"resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz",
"integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA=="
},
"yargs": {
"version": "16.2.0",
"resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz",
"integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==",
"requires": {
"cliui": "^7.0.2",
"escalade": "^3.1.1",
"get-caller-file": "^2.0.5",
"require-directory": "^2.1.1",
"string-width": "^4.2.0",
"y18n": "^5.0.5",
"yargs-parser": "^20.2.2"
}
},
"yargs-parser": {
"version": "20.2.9",
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz",
"integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w=="
}
}
},
"ln-telegram": {
@ -15002,6 +15499,144 @@
"bolt01": "1.2.2",
"invoices": "2.0.0",
"ln-service": "52.6.0"
},
"dependencies": {
"@grpc/proto-loader": {
"version": "0.6.5",
"resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.6.5.tgz",
"integrity": "sha512-GZdzyVQI1Bln/kCzIYgTKu+rQJ5dno0gVrfmLe4jqQu7T2e7svSwJzpCBqVU5hhBSJP3peuPjOMWsj5GR61YmQ==",
"requires": {
"@types/long": "^4.0.1",
"lodash.camelcase": "^4.3.0",
"long": "^4.0.0",
"protobufjs": "^6.10.0",
"yargs": "^16.1.1"
}
},
"@types/node": {
"version": "16.9.1",
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.9.1.tgz",
"integrity": "sha512-QpLcX9ZSsq3YYUUnD3nFDY8H7wctAhQj/TFKL8Ya8v5fMm3CFXxo8zStsLAl780ltoYoo1WvKUVGBQK+1ifr7g=="
},
"ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"requires": {
"color-convert": "^2.0.1"
}
},
"cliui": {
"version": "7.0.4",
"resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz",
"integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==",
"requires": {
"string-width": "^4.2.0",
"strip-ansi": "^6.0.0",
"wrap-ansi": "^7.0.0"
}
},
"color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"requires": {
"color-name": "~1.1.4"
}
},
"color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
},
"is-fullwidth-code-point": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
"integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg=="
},
"lightning": {
"version": "4.7.0",
"resolved": "https://registry.npmjs.org/lightning/-/lightning-4.7.0.tgz",
"integrity": "sha512-HtoVfuc9p8fcAOTXOBgIfH04S91A/1xlUZTRnYAdZx0h2zMjQaZ5/mpbDQjQkBn4Swf0EOHkcSI82scKm37JQg==",
"requires": {
"@grpc/grpc-js": "1.3.7",
"@grpc/proto-loader": "0.6.5",
"@types/express": "4.17.13",
"@types/node": "16.9.1",
"@types/request": "2.48.7",
"@types/ws": "7.4.7",
"async": "3.2.1",
"asyncjs-util": "1.2.6",
"bitcoinjs-lib": "5.2.0",
"bn.js": "5.2.0",
"body-parser": "1.19.0",
"bolt07": "1.7.3",
"bolt09": "0.1.5",
"cbor": "8.0.0",
"express": "4.17.1",
"invoices": "2.0.0",
"psbt": "1.1.10"
}
},
"ln-service": {
"version": "52.6.0",
"resolved": "https://registry.npmjs.org/ln-service/-/ln-service-52.6.0.tgz",
"integrity": "sha512-tLJMrknIzK6MMIx/N1r8iRjVWBPFmt0S1hI2l+DNL6+ln930nSUN+/aW3SUZho48ACLPBJDSgXwAU50ExrC+rQ==",
"requires": {
"bolt07": "1.7.3",
"cors": "2.8.5",
"express": "4.17.1",
"invoices": "2.0.0",
"lightning": "4.7.0",
"macaroon": "3.0.4",
"morgan": "1.10.0",
"ws": "8.2.2"
}
},
"string-width": {
"version": "4.2.3",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
"integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
"requires": {
"emoji-regex": "^8.0.0",
"is-fullwidth-code-point": "^3.0.0",
"strip-ansi": "^6.0.1"
}
},
"wrap-ansi": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
"integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==",
"requires": {
"ansi-styles": "^4.0.0",
"string-width": "^4.1.0",
"strip-ansi": "^6.0.0"
}
},
"y18n": {
"version": "5.0.8",
"resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz",
"integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA=="
},
"yargs": {
"version": "16.2.0",
"resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz",
"integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==",
"requires": {
"cliui": "^7.0.2",
"escalade": "^3.1.1",
"get-caller-file": "^2.0.5",
"require-directory": "^2.1.1",
"string-width": "^4.2.0",
"y18n": "^5.0.5",
"yargs-parser": "^20.2.2"
}
},
"yargs-parser": {
"version": "20.2.9",
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz",
"integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w=="
}
}
},
"parseurl": {
@ -15896,11 +16531,11 @@
}
},
"strip-ansi": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz",
"integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==",
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
"integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
"requires": {
"ansi-regex": "^5.0.0"
"ansi-regex": "^5.0.1"
}
},
"strip-bom": {

View file

@ -25,7 +25,7 @@
"caporal": "1.4.0",
"cbor": "8.0.0",
"cert-info": "1.5.1",
"colorette": "2.0.2",
"colorette": "2.0.10",
"crypto-js": "4.1.1",
"csv-parse": "4.16.3",
"goldengate": "10.4.0",
@ -35,8 +35,8 @@
"inquirer": "8.1.5",
"invoices": "2.0.0",
"ln-accounting": "5.0.3",
"ln-service": "52.6.0",
"ln-sync": "2.0.1",
"ln-service": "52.8.0",
"ln-sync": "2.0.2",
"ln-telegram": "3.3.0",
"moment": "2.29.1",
"paid-services": "3.0.0",
@ -80,5 +80,5 @@
"postpublish": "docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t alexbosworth/balanceofsatoshis --push .",
"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/fiat/*.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/wallets/*.js"
},
"version": "10.18.1"
"version": "10.19.0"
}

View file

@ -2,6 +2,7 @@ const asyncAuto = require('async/auto');
const asyncMap = require('async/map');
const {findKey} = require('ln-sync');
const {getChannel} = require('ln-service');
const {getHeight} = require('ln-service');
const {getNode} = require('ln-service');
const {Parser} = require('hot-formula-parser');
const {returnResult} = require('asyncjs-util');
@ -158,8 +159,24 @@ module.exports = (args, cbk) => {
cbk);
}],
// Get the block height for use in formulas
getHeight: ['sortedAvoids', ({sortedAvoids}, cbk) => {
const formulas = sortedAvoids.filter(n => n.formula);
// Exit early when there are no formulas
if (!formulas.length) {
return cbk();
}
return getHeight({lnd: args.lnd}, cbk);
}],
// Get formula avoids
getFormulaIgnores: ['sortedAvoids', ({sortedAvoids}, cbk) => {
getFormulaIgnores: [
'getHeight',
'sortedAvoids',
({getHeight, sortedAvoids}, cbk) =>
{
const formulas = sortedAvoids.filter(n => n.formula);
return asyncMap(formulas, ({formula, key}, cbk) => {
@ -181,6 +198,7 @@ module.exports = (args, cbk) => {
const variables = {
height,
age: getHeight.current_block_height - height,
base_fee: Number(inPolicy.base_fee_mtokens) || Number(),
fee_rate: inPolicy.fee_rate || Number(),
};

View file

@ -19,6 +19,9 @@ const tests = [
pending_payments: [{is_outgoing: false, tokens: 6}],
},
],
locked: [{
tokens: 1,
}],
pending: [
{
is_closing: true,
@ -92,12 +95,12 @@ const tests = [
closing_balance: 1,
offchain_balance: 14,
offchain_pending: 35,
onchain_balance: 3,
onchain_balance: 4,
onchain_vbytes: 211,
},
},
{
args: {channels: [], pending: [], transactions: [], utxos: []},
args: {channels: [], locked: [], pending: [], transactions: [], utxos: []},
description: 'Balance totals are calculated when there are no funds',
expected: {
closing_balance: 0,

View file

@ -68,7 +68,7 @@ const makeLnd = overrides => {
overrides.pendingChannelsResponse || pendingChannelsResponse
);
},
updateChannelPolicy: ({}, cbk) => cbk(null, {}),
updateChannelPolicy: ({}, cbk) => cbk(null, {failed_updates: []}),
},
};
};