diff --git a/CHANGELOG.md b/CHANGELOG.md index e8246c8..db8971c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Versions +## 13.11.0 + +- `balance`: Add support for multiple nodes when using --detailed balance +- `telegram`: Add support for showing balance information with /balance command + ## 13.10.7 - `invoice`: Fix issue creating `--virtual` invoices diff --git a/balances/conflicting_balances.js b/balances/conflicting_balances.js deleted file mode 100644 index 4f40d58..0000000 --- a/balances/conflicting_balances.js +++ /dev/null @@ -1,93 +0,0 @@ -const {Transaction} = require('bitcoinjs-lib'); - -const inputAsOutpoint = (txId, outputIndex) => `${txId}:${outputIndex}`; -const {fromHex} = Transaction; -const sumOf = arr => arr.reduce((sum, n) => sum + n, Number()); -const txIdFromHash = hash => hash.slice().reverse().toString('hex'); -const uniq = arr => Array.from(new Set(arr)); - -/** Derive conflicted on-chain pending balances where funds are double spent or - multiple versions of the spend exist - - { - transactions: [{ - is_confirmed: - transaction: - }] - utxos: [{ - confirmation_count: - tokens: - transaction_id: - }] - } - - @returns - { - conflicting_pending_balance: - invalid_pending_balance: - } -*/ -module.exports = ({transactions, utxos}) => { - const conflictingUtxos = []; - const invalidUtxos = []; - const spends = {} - - // Look at unconfirmed UTXOs and collect spends of outpoints - utxos.filter(n => !n.confirmation_count).forEach((utxo, i) => { - const tx = transactions.find(n => n.id === utxo.transaction_id); - - // Exit early when the raw transaction is not known - if (!tx || !tx.transaction) { - return; - } - - // Register all the inputs into the spends map - return fromHex(tx.transaction).ins.forEach(input => { - const outpoint = inputAsOutpoint(txIdFromHash(input.hash), input.index); - - const existing = spends[outpoint]; - - // When existing UTXO spends the same input this is a conflict - if (!!existing) { - conflictingUtxos.push(i); - } - - // Collect spends of the outpoint - const spending = !existing ? [i] : [].concat(existing).concat(i); - - return spends[outpoint] = spending; - }); - }); - - // Look at confirmed txs and see if any unspents spend a confirmed outpoint - transactions.forEach(tx => { - // Exit early when there is no confirmed tx - if (!tx.transaction || !tx.is_confirmed) { - return; - } - - // Look for pending inputs that are conflicted with a confirmed tx - return fromHex(tx.transaction).ins.forEach(input => { - const outpoint = inputAsOutpoint(txIdFromHash(input.hash), input.index); - - // Exit early when nothing pending spends this outpoint - if (!spends[outpoint]) { - return; - } - - // Pending things that spend a confirmed input are invalid - return spends[outpoint].forEach(n => invalidUtxos.push(n)); - }); - }); - - const conflictingTokens = uniq(conflictingUtxos) - .filter(utxoIndex => !invalidUtxos.includes(utxoIndex)) - .map(n => utxos[n].tokens); - - const invalidTokens = uniq(invalidUtxos).map(n => utxos[n].tokens); - - return { - conflicting_pending_balance: sumOf(conflictingTokens), - invalid_pending_balance: sumOf(invalidTokens), - }; -}; diff --git a/balances/detailed_balances.js b/balances/detailed_balances.js deleted file mode 100644 index 1b9acdf..0000000 --- a/balances/detailed_balances.js +++ /dev/null @@ -1,188 +0,0 @@ -const conflictingBalances = require('./conflicting_balances'); - -const {ceil} = Math; -const flatten = arr => [].concat(...arr); -const inputsCounterVBytesLength = 3; -const inputSequenceVByteLength = 4; -const nestedPublicKeyAddressType = 'np2wpkh'; -const nestedPublicKeyVByteLength = 22; -const outputCounterVBytesLength = 1; -const outputValueVBytesLength = 8; -const outputScriptCounterVBytesLength = 1; -const outputScriptVBytesLength = 34; -const sumOf = arr => arr.reduce((sum, n) => sum + n, Number()); -const transactionIdVByteLength = 32; -const transactionLockTimeVBytesLength = 4; -const transactionOutputIndexVByteLength = 4; -const transactionVersionVBytesLength = 4; -const witnessElementsCounterVByteLength = 0.25; -const witnessPublicKeySizeVByteLength = 0.25; -const witnessPublicKeyVByteLength = 8.25; -const witnessSignatureVByteLength = 18; -const witnessSizeCounterVByteLength = 0.25; - -/** Determine balances from components - - { - channels: [{ - commit_transaction_fee: - is_partner_initiated: - local_balance: - pending_payments: [{ - is_outgoing: - tokens: - }] - }] - locked: [{ - tokens: - }] - pending: [{ - is_opening: - is_partner_initiated: - local_balance: - [pending_payments]: [{ - is_outgoing: - tokens: - }] - [recovered_tokens]: - [transaction_fee]: - }] - transactions: [{ - is_confirmed: - is_outgoing: - output_addresses: [
] - }] - utxos: [{ - address: - address_format: - confirmation_count: - tokens: - }] - } - - @returns - { - closing_balance: - conflicted_pending: - invalid_pending: - offchain_balance: - offchain_pending: - onchain_balance: - onchain_vbytes: - } -*/ -module.exports = ({channels, locked, pending, transactions, utxos}) => { - const channelBalances = channels.map(n => n.local_balance); - const confirmedUtxos = utxos.filter(n => !!n.confirmation_count); - - // Unconfirmed addresses in outgoing transactions - const outgoingAddresses = flatten(transactions - .filter(n => !n.is_confirmed && n.is_outgoing) - .map(n => n.output_addresses)); - - // Unconfirmed change UTXOs - const changeUtxos = utxos - .filter(n => !n.confirmation_count) - .filter(n => outgoingAddresses.includes(n.address)); - - // Calculate the local tokens that are still in the process of opening - const opening = pending - .filter(n => n.is_partner_initiated === false && n.is_opening) - .map(n => n.local_balance); - - // Calculate the balances coming back in closing - const closing = pending - .filter(n => n.is_closing) - .map(n => n.local_balance - (n.recovered_tokens || Number())); - - // For in-flight payments assume refund/timeout resolutions will happen - const channelHtlcs = channels.map(chan => { - return chan.pending_payments.filter(n => n.is_outgoing).map(n => n.tokens); - }); - - // Some in-flight payments will be in on-chain HTLCs - const pendingHtlcs = pending - .map(chan => { - return (chan.pending_payments || []) - .filter(n => n.is_outgoing) - .map(n => n.tokens); - }); - - // Initiator commitment fees are deducted from channel local balances - const commitFees = channels - .filter(n => n.is_partner_initiated === false) - .map(n => n.commit_transaction_fee); - - // Pending channels also have commit transaction fees - const pendingCommitFees = pending - .filter(n => n.is_opening && n.is_partner_initiated === false) - .map(n => n.transaction_fee || Number()); - - // Total balance to consider owned on-chain - const chainBalance = sumOf([] - .concat(confirmedUtxos) - .concat(changeUtxos) - .concat(locked) - .map(n => n.tokens) - ); - - // Input element virtual bytes - const inputElements = flatten([] - .concat(confirmedUtxos) - .concat(changeUtxos) - .map(utxo => { - const inputData = [] - .concat(transactionIdVByteLength) // Previous outpoint tx id - .concat(transactionOutputIndexVByteLength) // Previous tx out index - .concat(inputSequenceVByteLength) // Input sequence number - .concat(witnessElementsCounterVByteLength) // Witness elements count - .concat(witnessSizeCounterVByteLength) // Witness sig size counter - .concat(witnessSignatureVByteLength) // Witness signature - .concat(witnessPublicKeySizeVByteLength) // Public key size counter - .concat(witnessPublicKeyVByteLength); // Witness public key - - // Exit early with nested data - if (utxo.address_format === nestedPublicKeyAddressType) { - return inputData.concat(nestedPublicKeyVByteLength); - } - - return inputData; - })); - - // Total balance to consider owned in channels - const channelBalance = sumOf(flatten([] - .concat(channelBalances) - .concat(commitFees) - .concat(flatten(channelHtlcs)) - )); - - // Total pending balance to consider owned - const pendingBalance = sumOf(flatten([] - .concat(opening) - .concat(pendingCommitFees) - .concat(flatten(pendingHtlcs)) - )); - - // Estimate the virtual bytes size of a tx that spends all inputs - const vbyteComponents = !inputElements.length ? [] : flatten([] - .concat(transactionVersionVBytesLength) - .concat(inputsCounterVBytesLength) - .concat(outputCounterVBytesLength) - .concat(outputValueVBytesLength) - .concat(outputScriptCounterVBytesLength) - .concat(outputScriptVBytesLength) - .concat(transactionLockTimeVBytesLength) - .concat(inputElements)); - - const conflicts = conflictingBalances({transactions, utxos}); - - return { - closing_balance: sumOf(closing), - conflicted_pending: conflicts.conflicting_pending_balance, - invalid_pending: conflicts.invalid_pending_balance, - offchain_balance: channelBalance, - offchain_pending: pendingBalance, - onchain_balance: chainBalance, - onchain_vbytes: ceil(sumOf(vbyteComponents)), - }; -}; diff --git a/balances/get_detailed_balance.js b/balances/get_detailed_balance.js index a08c3ac..e3d3ba0 100644 --- a/balances/get_detailed_balance.js +++ b/balances/get_detailed_balance.js @@ -1,22 +1,17 @@ const asyncAuto = require('async/auto'); +const asyncMap = require('async/map'); 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 {getNodeFunds} = require('ln-sync'); const {returnResult} = require('asyncjs-util'); -const {Transaction} = require('bitcoinjs-lib'); -const detailedBalances = require('./detailed_balances'); - -const {fromHex} = Transaction; +const format = tokens => formatTokens({tokens}).display.trim(); +const {isArray} = Array; /** Get a detailed balance that categorizes balance of tokens on the node { [is_confirmed]: - lnd: + lnds: [] } @returns via cbk or Promise @@ -37,104 +32,48 @@ module.exports = (args, cbk) => { return asyncAuto({ // Check arguments validate: cbk => { - if (!args.lnd) { - return cbk([400, 'ExpectedAuthenticatedLndToGetDetailedBalance']); + if (!isArray(args.lnds)) { + return cbk([400, 'ExpectedAuthenticatedLndsToGetDetailedBalance']); } return cbk(); }, - // Get the channels - getChannels: ['validate', ({}, cbk) => { - return getChannels({lnd: args.lnd}, cbk); + // Get info about the funds on the node + getFunds: ['validate', ({}, cbk) => { + return asyncMap(args.lnds, (lnd, cbk) => { + return getNodeFunds({lnd, is_confirmed: args.is_confirmed}, cbk); + }, + 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); + // Return a formatted balance summary + balance: ['getFunds', ({getFunds}, cbk) => { + // Sum balances from all nodes + const balances = getFunds.reduce((sum, n) => { + return { + closing_balance: sum.closing_balance + n.closing_balance, + conflicted_pending: sum.conflicted_pending + n.conflicted_pending, + invalid_pending: sum.invalid_pending + n.invalid_pending, + offchain_balance: sum.offchain_balance + n.offchain_balance, + offchain_pending: sum.offchain_pending + n.offchain_pending, + onchain_confirmed: sum.onchain_confirmed + n.onchain_confirmed, + onchain_pending: sum.onchain_pending + n.onchain_pending, + onchain_vbytes: sum.onchain_vbytes + n.onchain_vbytes, + utxos_count: sum.utxos_count + n.utxos_count, + }; + }, + { + closing_balance: Number(), + conflicted_pending: Number(), + invalid_pending: Number(), + offchain_balance: Number(), + offchain_pending: Number(), + onchain_confirmed: Number(), + onchain_pending: Number(), + onchain_vbytes: Number(), + utxos_count: Number(), }); - }], - - // Get pending channels - getPending: ['validate', ({}, cbk) => { - return getPendingChannels({lnd: args.lnd}, cbk); - }], - - // Get the chain transactions - getTx: ['validate', ({}, cbk) => { - return getChainTransactions({lnd: args.lnd}, 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', - 'locked', - ({getChannels, getPending, getTx, getUtxos, locked}, cbk) => - { - const confUtxos = getUtxos.utxos.filter(n => !!n.confirmation_count); - const confirmedTx = getTx.transactions.filter(n => !!n.is_confirmed); - const format = tokens => formatTokens({tokens}).display.trim(); - - const confirmed = detailedBalances({ - locked, - channels: getChannels.channels, - pending: getPending.pending_channels, - transactions: confirmedTx, - utxos: confUtxos, - }); - - const unconfirmed = detailedBalances({ - locked, - channels: getChannels.channels, - pending: getPending.pending_channels, - transactions: getTx.transactions, - utxos: getUtxos.utxos, - }); - - const balances = !!args.is_confirmed ? confirmed : unconfirmed; - const limbo = unconfirmed.onchain_balance - confirmed.onchain_balance; return cbk(null, { closing_balance: format(balances.closing_balance) || undefined, @@ -142,10 +81,10 @@ module.exports = (args, cbk) => { invalid_pending: format(balances.invalid_pending) || undefined, offchain_balance: format(balances.offchain_balance) || undefined, offchain_pending: format(balances.offchain_pending) || undefined, - onchain_confirmed: format(confirmed.onchain_balance) || undefined, - onchain_pending: format(limbo) || undefined, + onchain_confirmed: format(balances.onchain_confirmed) || undefined, + onchain_pending: format(balances.onchain_pending) || undefined, onchain_vbytes: balances.onchain_vbytes || undefined, - utxos_count: getUtxos.utxos.length || undefined, + utxos_count: balances.utxos_count || undefined, }); }], }, diff --git a/bos b/bos index f9d1c52..7fddd56 100755 --- a/bos +++ b/bos @@ -167,34 +167,33 @@ prog // Get local balance information .command('balance', 'Get total tokens') .help('Sums balances on-chain, in channels, and pending, plus commit fees') + .help('Multiple --node arguments are supported to sum across nodes') .option('--above ', 'Return tokens above watermark', INT) .option('--below ', 'Return tokens below watermark', INT) .option('--confirmed', 'Return confirmed funds only') .option('--detailed', 'Return detailed balance information') - .option('--node ', 'Node to get balance for') + .option('--node ', 'Node to get balance for', REPEATABLE) .option('--offchain', 'List only off-chain tokens') .option('--onchain', 'List only on-chain tokens') .action((args, options, logger) => { return new Promise(async (resolve, reject) => { try { - const {lnd} = await lndForNode(logger, options.node); - // Exit early when detailed balance details are requested if (!!options.detailed) { return balances.getDetailedBalance({ - lnd, + lnds: (await lnd.getLnds({logger, nodes: options.node})).lnds, is_confirmed: options.confirmed, }, responses.returnObject({logger, reject, resolve})); } return balances.getBalance({ - lnd, above: options.above, below: options.below, is_confirmed: !!options.confirmed, is_offchain_only: !!options.offchain, is_onchain_only: !!options.onchain, + lnd: (await lndForNode(logger, options.node)).lnd, }, responses.returnNumber({logger, reject, resolve, number: 'balance'})); } catch (err) { diff --git a/package-lock.json b/package-lock.json index c5cf732..28561a2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "balanceofsatoshis", - "version": "13.10.7", + "version": "13.11.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "balanceofsatoshis", - "version": "13.10.7", + "version": "13.11.0", "license": "MIT", "dependencies": { "@alexbosworth/caporal": "1.4.4", @@ -29,15 +29,15 @@ "csv-parse": "5.3.3", "ecpair": "2.1.0", "goldengate": "11.4.0", - "grammy": "1.12.0", + "grammy": "1.12.1", "hot-formula-parser": "4.0.0", "import-lazy": "4.0.0", "ini": "3.0.1", "inquirer": "9.1.4", "ln-accounting": "6.1.1", - "ln-service": "54.6.0", - "ln-sync": "4.0.5", - "ln-telegram": "4.3.1", + "ln-service": "54.8.0", + "ln-sync": "4.1.0", + "ln-telegram": "4.4.0", "moment": "2.29.4", "paid-services": "4.1.0", "probing": "3.0.0", @@ -2244,30 +2244,30 @@ } }, "node_modules/@babel/compat-data": { - "version": "7.20.5", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.20.5.tgz", - "integrity": "sha512-KZXo2t10+/jxmkhNXc7pZTqRvSOIvVv/+lJwHS+B2rErwOyjuVRh60yVpb7liQ1U5t7lLJ1bz+t8tSypUZdm0g==", + "version": "7.20.10", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.20.10.tgz", + "integrity": "sha512-sEnuDPpOJR/fcafHMjpcpGN5M2jbUGUHwmuWKM/YdPzeEDJg8bgmbcWQFUfE32MQjti1koACvoPVsDe8Uq+idg==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/core": { - "version": "7.20.5", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.20.5.tgz", - "integrity": "sha512-UdOWmk4pNWTm/4DlPUl/Pt4Gz4rcEMb7CY0Y3eJl5Yz1vI8ZJGmHWaVE55LoxRjdpx0z259GE9U5STA9atUinQ==", + "version": "7.20.7", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.20.7.tgz", + "integrity": "sha512-t1ZjCluspe5DW24bn2Rr1CDb2v9rn/hROtg9a2tmd0+QYf4bsloYfLQzjG4qHPNMhWtKdGC33R5AxGR2Af2cBw==", "dev": true, "dependencies": { "@ampproject/remapping": "^2.1.0", "@babel/code-frame": "^7.18.6", - "@babel/generator": "^7.20.5", - "@babel/helper-compilation-targets": "^7.20.0", - "@babel/helper-module-transforms": "^7.20.2", - "@babel/helpers": "^7.20.5", - "@babel/parser": "^7.20.5", - "@babel/template": "^7.18.10", - "@babel/traverse": "^7.20.5", - "@babel/types": "^7.20.5", + "@babel/generator": "^7.20.7", + "@babel/helper-compilation-targets": "^7.20.7", + "@babel/helper-module-transforms": "^7.20.7", + "@babel/helpers": "^7.20.7", + "@babel/parser": "^7.20.7", + "@babel/template": "^7.20.7", + "@babel/traverse": "^7.20.7", + "@babel/types": "^7.20.7", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", @@ -2306,12 +2306,12 @@ "dev": true }, "node_modules/@babel/generator": { - "version": "7.20.5", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.20.5.tgz", - "integrity": "sha512-jl7JY2Ykn9S0yj4DQP82sYvPU+T3g0HFcWTqDLqiuA9tGRNIj9VfbtXGAYTTkyNEnQk1jkMGOdYka8aG/lulCA==", + "version": "7.20.7", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.20.7.tgz", + "integrity": "sha512-7wqMOJq8doJMZmP4ApXTzLxSr7+oO2jroJURrVEp6XShrQUObV8Tq/D0NCcoYg2uHqUrjzO0zwBjoYzelxK+sw==", "dev": true, "dependencies": { - "@babel/types": "^7.20.5", + "@babel/types": "^7.20.7", "@jridgewell/gen-mapping": "^0.3.2", "jsesc": "^2.5.1" }, @@ -2334,14 +2334,15 @@ } }, "node_modules/@babel/helper-compilation-targets": { - "version": "7.20.0", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.20.0.tgz", - "integrity": "sha512-0jp//vDGp9e8hZzBc6N/KwA5ZK3Wsm/pfm4CrY7vzegkVxc65SgSn6wYOnwHe9Js9HRQ1YTCKLGPzDtaS3RoLQ==", + "version": "7.20.7", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.20.7.tgz", + "integrity": "sha512-4tGORmfQcrc+bvrjb5y3dG9Mx1IOZjsHqQVUz7XCNHO+iTmqxWnVg3KRygjGmpRLJGdQSKuvFinbIb0CnZwHAQ==", "dev": true, "dependencies": { - "@babel/compat-data": "^7.20.0", + "@babel/compat-data": "^7.20.5", "@babel/helper-validator-option": "^7.18.6", "browserslist": "^4.21.3", + "lru-cache": "^5.1.1", "semver": "^6.3.0" }, "engines": { @@ -2398,9 +2399,9 @@ } }, "node_modules/@babel/helper-module-transforms": { - "version": "7.20.2", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.20.2.tgz", - "integrity": "sha512-zvBKyJXRbmK07XhMuujYoJ48B5yvvmM6+wcpv6Ivj4Yg6qO7NOZOSnvZN9CRl1zz1Z4cKf8YejmCMh8clOoOeA==", + "version": "7.20.11", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.20.11.tgz", + "integrity": "sha512-uRy78kN4psmji1s2QtbtcCSaj/LILFDp0f/ymhpQH5QY3nljUZCaNWz9X1dEj/8MBdBEFECs7yRhKn8i7NjZgg==", "dev": true, "dependencies": { "@babel/helper-environment-visitor": "^7.18.9", @@ -2408,9 +2409,9 @@ "@babel/helper-simple-access": "^7.20.2", "@babel/helper-split-export-declaration": "^7.18.6", "@babel/helper-validator-identifier": "^7.19.1", - "@babel/template": "^7.18.10", - "@babel/traverse": "^7.20.1", - "@babel/types": "^7.20.2" + "@babel/template": "^7.20.7", + "@babel/traverse": "^7.20.10", + "@babel/types": "^7.20.7" }, "engines": { "node": ">=6.9.0" @@ -2468,14 +2469,14 @@ } }, "node_modules/@babel/helpers": { - "version": "7.20.6", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.20.6.tgz", - "integrity": "sha512-Pf/OjgfgFRW5bApskEz5pvidpim7tEDPlFtKcNRXWmfHGn9IEI2W2flqRQXTFb7gIPTyK++N6rVHuwKut4XK6w==", + "version": "7.20.7", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.20.7.tgz", + "integrity": "sha512-PBPjs5BppzsGaxHQCDKnZ6Gd9s6xl8bBCluz3vEInLGRJmnZan4F6BYCeqtyXqkk4W5IlPmjK4JlOuZkpJ3xZA==", "dev": true, "dependencies": { - "@babel/template": "^7.18.10", - "@babel/traverse": "^7.20.5", - "@babel/types": "^7.20.5" + "@babel/template": "^7.20.7", + "@babel/traverse": "^7.20.7", + "@babel/types": "^7.20.7" }, "engines": { "node": ">=6.9.0" @@ -2496,9 +2497,9 @@ } }, "node_modules/@babel/parser": { - "version": "7.20.5", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.20.5.tgz", - "integrity": "sha512-r27t/cy/m9uKLXQNWWebeCUHgnAZq0CpG1OwKRxzJMP1vpSU4bSIK2hq+/cp0bQxetkXx38n09rNu8jVkcK/zA==", + "version": "7.20.7", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.20.7.tgz", + "integrity": "sha512-T3Z9oHybU+0vZlY9CiDSJQTD5ZapcW18ZctFMi0MOAl/4BjFF4ul7NVSARLdbGO5vDqy9eQiGTV0LtKfvCYvcg==", "dev": true, "bin": { "parser": "bin/babel-parser.js" @@ -2508,33 +2509,33 @@ } }, "node_modules/@babel/template": { - "version": "7.18.10", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.18.10.tgz", - "integrity": "sha512-TI+rCtooWHr3QJ27kJxfjutghu44DLnasDMwpDqCXVTal9RLp3RSYNh4NdBrRP2cQAoG9A8juOQl6P6oZG4JxA==", + "version": "7.20.7", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.20.7.tgz", + "integrity": "sha512-8SegXApWe6VoNw0r9JHpSteLKTpTiLZ4rMlGIm9JQ18KiCtyQiAMEazujAHrUS5flrcqYZa75ukev3P6QmUwUw==", "dev": true, "dependencies": { "@babel/code-frame": "^7.18.6", - "@babel/parser": "^7.18.10", - "@babel/types": "^7.18.10" + "@babel/parser": "^7.20.7", + "@babel/types": "^7.20.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/traverse": { - "version": "7.20.5", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.20.5.tgz", - "integrity": "sha512-WM5ZNN3JITQIq9tFZaw1ojLU3WgWdtkxnhM1AegMS+PvHjkM5IXjmYEGY7yukz5XS4sJyEf2VzWjI8uAavhxBQ==", + "version": "7.20.10", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.20.10.tgz", + "integrity": "sha512-oSf1juCgymrSez8NI4A2sr4+uB/mFd9MXplYGPEBnfAuWmmyeVcHa6xLPiaRBcXkcb/28bgxmQLTVwFKE1yfsg==", "dev": true, "dependencies": { "@babel/code-frame": "^7.18.6", - "@babel/generator": "^7.20.5", + "@babel/generator": "^7.20.7", "@babel/helper-environment-visitor": "^7.18.9", "@babel/helper-function-name": "^7.19.0", "@babel/helper-hoist-variables": "^7.18.6", "@babel/helper-split-export-declaration": "^7.18.6", - "@babel/parser": "^7.20.5", - "@babel/types": "^7.20.5", + "@babel/parser": "^7.20.7", + "@babel/types": "^7.20.7", "debug": "^4.1.0", "globals": "^11.1.0" }, @@ -2566,9 +2567,9 @@ "dev": true }, "node_modules/@babel/types": { - "version": "7.20.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.20.5.tgz", - "integrity": "sha512-c9fst/h2/dcF7H+MJKZ2T0KjEQ8hY/BNnDk/H3XY8C4Aw/eWQXWn/lWntHF9ooUBnGmEvbfGrTgLWc+um0YDUg==", + "version": "7.20.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.20.7.tgz", + "integrity": "sha512-69OnhBxSSgK0OzTJai4kyPDiKTIe3j+ctaHdIGVbRahTLAT7L3R9oeXHC2aVSuGYt3cVnoAMDmOCgJ2yaiLMvg==", "dev": true, "dependencies": { "@babel/helper-string-parser": "^7.19.4", @@ -2879,9 +2880,9 @@ "integrity": "sha512-Y4XFY5VJAuw0FgAqPNd6NNoV44jbq9Bz2L7Rh/J6jLTiHBSBJa9fxqQIvkIld4GsoDOcCbvzOUAbLPsSKKg+uA==" }, "node_modules/@types/node": { - "version": "18.11.16", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.16.tgz", - "integrity": "sha512-6T7P5bDkRhqRxrQtwj7vru+bWTpelgtcETAZEUSdq0YISKz8WKdoBukQLYQQ6DFHvU9JRsbFq0JH5C51X2ZdnA==" + "version": "18.11.17", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.17.tgz", + "integrity": "sha512-HJSUJmni4BeDHhfzn6nF0sVmd1SMezP7/4F0Lq+aXzmp2xm9O7WXrUtHW/CHlYVtZUbByEvWidHqRtcJXGF2Ng==" }, "node_modules/@types/qs": { "version": "6.9.7", @@ -3601,9 +3602,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001439", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001439.tgz", - "integrity": "sha512-1MgUzEkoMO6gKfXflStpYgZDlFM7M/ck/bgfVCACO5vnAf0fXoNVHdWtqGU+MYca+4bL9Z5bpOVmR33cWW9G2A==", + "version": "1.0.30001441", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001441.tgz", + "integrity": "sha512-OyxRR4Vof59I3yGWXws6i908EtGbMzVUi3ganaZQHmydk1iwDhRnvaPG2WaR0KcqrDFKrxVZHULT396LEPhXfg==", "dev": true, "funding": [ { @@ -5103,11 +5104,11 @@ "dev": true }, "node_modules/grammy": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/grammy/-/grammy-1.12.0.tgz", - "integrity": "sha512-/2Mi4MyVPeFXjTd4v3pRK8gb/YdWFbZrj/8HTp5daQyTOx4/U95XFL0Ao+e9hf4XbL7RCOpanXaTL8+UXXcNqw==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/grammy/-/grammy-1.12.1.tgz", + "integrity": "sha512-pnAVs5ZqA4Dfby+JUDIzcq5xgRZm1qDKveU/kQyt31Ln19NF0PgUooczQ1AiTUTC8Yv/et9Ok8R2BiQcskoJew==", "dependencies": { - "@grammyjs/types": "^2.10.0", + "@grammyjs/types": "^2.10.3", "abort-controller": "^3.0.0", "debug": "^4.3.4", "node-fetch": "^2.6.7" @@ -5881,6 +5882,7 @@ "version": "6.6.0", "resolved": "https://registry.npmjs.org/lightning/-/lightning-6.6.0.tgz", "integrity": "sha512-S+lUitqP/fbQWNYffor/74jKoyjbT/hZuzgHlCH/WH5bmoognl6BpcK7qAJ6Qw9hDQPnDXUB5CyfjJmmOCtOlw==", + "dev": true, "dependencies": { "@grpc/grpc-js": "1.8.0", "@grpc/proto-loader": "0.7.4", @@ -5911,6 +5913,7 @@ "version": "1.8.0", "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.8.0.tgz", "integrity": "sha512-ySMTXQuMvvswoobvN+0LsaPf7ITO2JVfJmHxQKI4cGehNrrUms+n81BlHEX7Hl/LExji6XE3fnI9U04GSkRruA==", + "dev": true, "dependencies": { "@grpc/proto-loader": "^0.7.0", "@types/node": ">=12.12.47" @@ -5923,6 +5926,7 @@ "version": "0.7.4", "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.7.4.tgz", "integrity": "sha512-MnWjkGwqQ3W8fx94/c1CwqLsNmHHv2t0CFn+9++6+cDphC1lolpg9M2OU0iebIjK//pBNX9e94ho+gjx6vz39w==", + "dev": true, "dependencies": { "@types/long": "^4.0.1", "lodash.camelcase": "^4.3.0", @@ -5940,12 +5944,14 @@ "node_modules/lightning/node_modules/@types/node": { "version": "18.11.15", "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.15.tgz", - "integrity": "sha512-VkhBbVo2+2oozlkdHXLrb3zjsRkpdnaU2bXmX8Wgle3PUi569eLRaHGlgETQHR7lLL1w7GiG3h9SnePhxNDecw==" + "integrity": "sha512-VkhBbVo2+2oozlkdHXLrb3zjsRkpdnaU2bXmX8Wgle3PUi569eLRaHGlgETQHR7lLL1w7GiG3h9SnePhxNDecw==", + "dev": true }, "node_modules/lightning/node_modules/body-parser": { "version": "1.20.1", "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz", "integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==", + "dev": true, "dependencies": { "bytes": "3.1.2", "content-type": "~1.0.4", @@ -5969,6 +5975,7 @@ "version": "6.11.0", "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", + "dev": true, "dependencies": { "side-channel": "^1.0.4" }, @@ -5983,6 +5990,7 @@ "version": "3.4.0", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-3.4.0.tgz", "integrity": "sha512-PEPg6RHlB9cFwoTMNENNrQFL0cXX04voWr2UPwQBJ3pVs7Mt8Y1oLWdUeMdGEwZE8HFFlujq8gS9enmyiQ8pLg==", + "dev": true, "engines": { "node": ">=14.16" }, @@ -5994,6 +6002,7 @@ "version": "5.0.8", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, "engines": { "node": ">=10" } @@ -6002,6 +6011,7 @@ "version": "16.2.0", "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dev": true, "dependencies": { "cliui": "^7.0.2", "escalade": "^3.1.1", @@ -6019,6 +6029,7 @@ "version": "20.2.9", "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "dev": true, "engines": { "node": ">=10" } @@ -6296,15 +6307,15 @@ } }, "node_modules/ln-service": { - "version": "54.6.0", - "resolved": "https://registry.npmjs.org/ln-service/-/ln-service-54.6.0.tgz", - "integrity": "sha512-kDbClE4eTNCaaipDkj2o0TsqZWv8TKyxgUXah4Bs3mM92lL1tqLHPAfSMdE/EFzA82tBLkvByXwNUL4xTqSGrA==", + "version": "54.8.0", + "resolved": "https://registry.npmjs.org/ln-service/-/ln-service-54.8.0.tgz", + "integrity": "sha512-QNOek7A5BFKGiHlCYHQfIwhehtRyO/oFndeaSn/11x2cvo461pgJXyu/zQETCb4yhGZUa1v3LU1Lmk4bPqsvyw==", "dependencies": { "bolt07": "1.8.2", "cors": "2.8.5", "express": "4.18.2", "invoices": "2.2.2", - "lightning": "6.6.0", + "lightning": "6.8.0", "macaroon": "3.0.4", "morgan": "1.10.0", "ws": "8.11.0" @@ -6313,30 +6324,10 @@ "node": ">=14" } }, - "node_modules/ln-sync": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/ln-sync/-/ln-sync-4.0.5.tgz", - "integrity": "sha512-zzFK2CMBAiDlnLu/m+kpD4Oqz6YGXg4aiTbtygUOOFEBSdvHtXG4WaM2xFpKf7g4cvHGhYS6xsmMYwVepwsypA==", - "dependencies": { - "async": "3.2.4", - "asyncjs-util": "1.2.10", - "bech32": "2.0.0", - "bitcoinjs-lib": "6.0.2", - "bolt07": "1.8.2", - "colorette": "2.0.19", - "ecpair": "2.1.0", - "ln-service": "54.2.6", - "psbt": "2.7.1", - "tiny-secp256k1": "2.2.1" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/ln-sync/node_modules/@grpc/grpc-js": { - "version": "1.7.3", - "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.7.3.tgz", - "integrity": "sha512-H9l79u4kJ2PVSxUNA08HMYAnUBLj9v6KjYQ7SQ71hOZcEXhShE/y5iQCesP8+6/Ik/7i2O0a10bPquIcYfufog==", + "node_modules/ln-service/node_modules/@grpc/grpc-js": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.8.0.tgz", + "integrity": "sha512-ySMTXQuMvvswoobvN+0LsaPf7ITO2JVfJmHxQKI4cGehNrrUms+n81BlHEX7Hl/LExji6XE3fnI9U04GSkRruA==", "dependencies": { "@grpc/proto-loader": "^0.7.0", "@types/node": ">=12.12.47" @@ -6345,10 +6336,10 @@ "node": "^8.13.0 || >=10.10.0" } }, - "node_modules/ln-sync/node_modules/@grpc/proto-loader": { - "version": "0.7.3", - "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.7.3.tgz", - "integrity": "sha512-5dAvoZwna2Py3Ef96Ux9jIkp3iZ62TUsV00p3wVBPNX5K178UbNi8Q7gQVqwXT1Yq9RejIGG9G2IPEo93T6RcA==", + "node_modules/ln-service/node_modules/@grpc/proto-loader": { + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.7.4.tgz", + "integrity": "sha512-MnWjkGwqQ3W8fx94/c1CwqLsNmHHv2t0CFn+9++6+cDphC1lolpg9M2OU0iebIjK//pBNX9e94ho+gjx6vz39w==", "dependencies": { "@types/long": "^4.0.1", "lodash.camelcase": "^4.3.0", @@ -6363,41 +6354,12 @@ "node": ">=6" } }, - "node_modules/ln-sync/node_modules/@types/express": { - "version": "4.17.14", - "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.14.tgz", - "integrity": "sha512-TEbt+vaPFQ+xpxFLFssxUDXj5cWCxZJjIcB7Yg0k0GMHGtgtQgpvx/MUQUeAkNbA9AAGrwkAsoeItdTgS7FMyg==", - "dependencies": { - "@types/body-parser": "*", - "@types/express-serve-static-core": "^4.17.18", - "@types/qs": "*", - "@types/serve-static": "*" - } + "node_modules/ln-service/node_modules/@types/node": { + "version": "18.11.16", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.16.tgz", + "integrity": "sha512-6T7P5bDkRhqRxrQtwj7vru+bWTpelgtcETAZEUSdq0YISKz8WKdoBukQLYQQ6DFHvU9JRsbFq0JH5C51X2ZdnA==" }, - "node_modules/ln-sync/node_modules/@types/node": { - "version": "18.11.9", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.9.tgz", - "integrity": "sha512-CRpX21/kGdzjOpFsZSkcrXMGIBWMGNIHXXBVFSH+ggkftxg+XYP20TESbh+zFvFj3EQOl5byk0HTRn1IL6hbqg==" - }, - "node_modules/ln-sync/node_modules/bitcoinjs-lib": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/bitcoinjs-lib/-/bitcoinjs-lib-6.0.2.tgz", - "integrity": "sha512-I994pGt9cL5s5OA6mkv1e8IuYcsKN2ORXnWbkqAXLNGvEnOHBhKBSvCjFl7YC2uVoJnfr/iwq7JMrq575SYO5w==", - "dependencies": { - "bech32": "^2.0.0", - "bip174": "^2.0.1", - "bs58check": "^2.1.2", - "create-hash": "^1.1.0", - "ripemd160": "^2.0.2", - "typeforce": "^1.11.3", - "varuint-bitcoin": "^1.1.2", - "wif": "^2.0.1" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/ln-sync/node_modules/body-parser": { + "node_modules/ln-service/node_modules/body-parser": { "version": "1.20.1", "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz", "integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==", @@ -6420,44 +6382,20 @@ "npm": "1.2.8000 || >= 1.4.16" } }, - "node_modules/ln-sync/node_modules/invoices": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/invoices/-/invoices-2.2.0.tgz", - "integrity": "sha512-uVe0WdHGdhkKubfrH1rSC/RpFREC7D0dh1IHxEgmUhV1lhn2+1UFVUxhri4dGyklBgIi+DNzE8q3665PF8z5Vw==", + "node_modules/ln-service/node_modules/lightning": { + "version": "6.8.0", + "resolved": "https://registry.npmjs.org/lightning/-/lightning-6.8.0.tgz", + "integrity": "sha512-HzcRq5n4zkGIXuGefFCoCjKIG/4IbpGESUyKA/+3UvfiGhtrKymRM8zoSFjWRFoaLaosR2P2SuKlrTyMfDmPHg==", "dependencies": { - "bech32": "2.0.0", - "bitcoinjs-lib": "6.0.2", - "bn.js": "5.2.1", - "bolt07": "1.8.2", - "bolt09": "0.2.3", - "tiny-secp256k1": "2.2.1" - }, - "engines": { - "node": ">=12.20.0" - } - }, - "node_modules/ln-sync/node_modules/invoices/node_modules/bolt09": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/bolt09/-/bolt09-0.2.3.tgz", - "integrity": "sha512-xEt5GE6pXB8wMIWHAoyF28k0Yt2rFqIou1LCyIeNadAOQhu/F7GTjZwreFwLl07YYkhOH23avewRt5PD8JnKKg==", - "engines": { - "node": ">=12.20.0" - } - }, - "node_modules/ln-sync/node_modules/lightning": { - "version": "6.2.7", - "resolved": "https://registry.npmjs.org/lightning/-/lightning-6.2.7.tgz", - "integrity": "sha512-2O68CU67XWqbahWRG4Ut5OsdqzxWh3Pg2bboiGcSSBA1boRECQLvw3cpnsFZK7Sef5s4NhgslDu7bZxyrDa8pw==", - "dependencies": { - "@grpc/grpc-js": "1.7.3", - "@grpc/proto-loader": "0.7.3", - "@types/express": "4.17.14", - "@types/node": "18.11.9", + "@grpc/grpc-js": "1.8.0", + "@grpc/proto-loader": "0.7.4", + "@types/express": "4.17.15", + "@types/node": "18.11.16", "@types/request": "2.48.8", "@types/ws": "8.5.3", "async": "3.2.4", "asyncjs-util": "1.2.10", - "bitcoinjs-lib": "6.0.2", + "bitcoinjs-lib": "6.1.0", "bn.js": "5.2.1", "body-parser": "1.20.1", "bolt07": "1.8.2", @@ -6465,34 +6403,16 @@ "cbor": "8.1.0", "ecpair": "2.1.0", "express": "4.18.2", - "invoices": "2.2.0", + "invoices": "2.2.2", "psbt": "2.7.1", "tiny-secp256k1": "2.2.1", - "type-fest": "3.1.0" + "type-fest": "3.4.0" }, "engines": { "node": ">=14" } }, - "node_modules/ln-sync/node_modules/ln-service": { - "version": "54.2.6", - "resolved": "https://registry.npmjs.org/ln-service/-/ln-service-54.2.6.tgz", - "integrity": "sha512-HEFcTdVj1nYfhkLzPKtCtBZhw+I9FB8qoJhMb4ro8cwMebRSG/lDDcIvkANfi7ccFLbRNB+M7Tk1vHRaFdQAzw==", - "dependencies": { - "bolt07": "1.8.2", - "cors": "2.8.5", - "express": "4.18.2", - "invoices": "2.2.0", - "lightning": "6.2.7", - "macaroon": "3.0.4", - "morgan": "1.10.0", - "ws": "8.10.0" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/ln-sync/node_modules/qs": { + "node_modules/ln-service/node_modules/qs": { "version": "6.11.0", "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", @@ -6506,10 +6426,10 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/ln-sync/node_modules/type-fest": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-3.1.0.tgz", - "integrity": "sha512-StmrZmK3eD9mDF9Vt7UhqthrDSk66O9iYl5t5a0TSoVkHjl0XZx/xuc/BRz4urAXXGHOY5OLsE0RdJFIApSFmw==", + "node_modules/ln-service/node_modules/type-fest": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-3.4.0.tgz", + "integrity": "sha512-PEPg6RHlB9cFwoTMNENNrQFL0cXX04voWr2UPwQBJ3pVs7Mt8Y1oLWdUeMdGEwZE8HFFlujq8gS9enmyiQ8pLg==", "engines": { "node": ">=14.16" }, @@ -6517,27 +6437,7 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/ln-sync/node_modules/ws": { - "version": "8.10.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.10.0.tgz", - "integrity": "sha512-+s49uSmZpvtAsd2h37vIPy1RBusaLawVe8of+GyEPsaJTCMpj/2v8NpeK1SHXjBlQ95lQTmQofOJnFiLoaN3yw==", - "engines": { - "node": ">=10.0.0" - }, - "peerDependencies": { - "bufferutil": "^4.0.1", - "utf-8-validate": "^5.0.2" - }, - "peerDependenciesMeta": { - "bufferutil": { - "optional": true - }, - "utf-8-validate": { - "optional": true - } - } - }, - "node_modules/ln-sync/node_modules/y18n": { + "node_modules/ln-service/node_modules/y18n": { "version": "5.0.8", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", @@ -6545,7 +6445,7 @@ "node": ">=10" } }, - "node_modules/ln-sync/node_modules/yargs": { + "node_modules/ln-service/node_modules/yargs": { "version": "16.2.0", "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", @@ -6562,7 +6462,7 @@ "node": ">=10" } }, - "node_modules/ln-sync/node_modules/yargs-parser": { + "node_modules/ln-service/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==", @@ -6570,21 +6470,41 @@ "node": ">=10" } }, + "node_modules/ln-sync": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ln-sync/-/ln-sync-4.1.0.tgz", + "integrity": "sha512-N02s3tCvlyiTSmhJYoawDLqVmZ63Yk/7k27F+244J8kOorwLNrtAjcy8WHn+YnR44yreAph9xHwacU4Nr+VQuQ==", + "dependencies": { + "async": "3.2.4", + "asyncjs-util": "1.2.10", + "bech32": "2.0.0", + "bitcoinjs-lib": "6.1.0", + "bolt07": "1.8.2", + "colorette": "2.0.19", + "ecpair": "2.1.0", + "ln-service": "54.8.0", + "psbt": "2.7.1", + "tiny-secp256k1": "2.2.1" + }, + "engines": { + "node": ">=14" + } + }, "node_modules/ln-telegram": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/ln-telegram/-/ln-telegram-4.3.1.tgz", - "integrity": "sha512-lAR12uidLQhvAIZGWFMi9rFtOAuy+sfw0YzlqRiTiiUuxcRL22v224vx0ffPY4YOwfqPdiQC61JKEdVYGwLmuA==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/ln-telegram/-/ln-telegram-4.4.0.tgz", + "integrity": "sha512-8uOztCmxGHMFuy7I1G83eA9Htafrw1xxfl20ThQheFxvBWnDGQiIxudqIKA/JB1BbtbQy9l1SMdg9RDW1hJDaA==", "dependencies": { "@alexbosworth/fiat": "^1.0.3", "async": "3.2.4", "asyncjs-util": "1.2.10", "bolt07": "1.8.2", "goldengate": "11.4.0", - "grammy": "1.12.0", + "grammy": "1.12.1", "ln-accounting": "6.1.1", - "ln-service": "54.3.2", - "ln-sync": "4.0.5", - "luxon": "3.1.0", + "ln-service": "54.8.0", + "ln-sync": "4.1.0", + "luxon": "3.1.1", "paid-services": "4.1.0", "table": "6.8.1" }, @@ -6592,199 +6512,6 @@ "node": ">=14" } }, - "node_modules/ln-telegram/node_modules/@grpc/grpc-js": { - "version": "1.7.3", - "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.7.3.tgz", - "integrity": "sha512-H9l79u4kJ2PVSxUNA08HMYAnUBLj9v6KjYQ7SQ71hOZcEXhShE/y5iQCesP8+6/Ik/7i2O0a10bPquIcYfufog==", - "dependencies": { - "@grpc/proto-loader": "^0.7.0", - "@types/node": ">=12.12.47" - }, - "engines": { - "node": "^8.13.0 || >=10.10.0" - } - }, - "node_modules/ln-telegram/node_modules/@grpc/proto-loader": { - "version": "0.7.3", - "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.7.3.tgz", - "integrity": "sha512-5dAvoZwna2Py3Ef96Ux9jIkp3iZ62TUsV00p3wVBPNX5K178UbNi8Q7gQVqwXT1Yq9RejIGG9G2IPEo93T6RcA==", - "dependencies": { - "@types/long": "^4.0.1", - "lodash.camelcase": "^4.3.0", - "long": "^4.0.0", - "protobufjs": "^7.0.0", - "yargs": "^16.2.0" - }, - "bin": { - "proto-loader-gen-types": "build/bin/proto-loader-gen-types.js" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/ln-telegram/node_modules/@types/express": { - "version": "4.17.14", - "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.14.tgz", - "integrity": "sha512-TEbt+vaPFQ+xpxFLFssxUDXj5cWCxZJjIcB7Yg0k0GMHGtgtQgpvx/MUQUeAkNbA9AAGrwkAsoeItdTgS7FMyg==", - "dependencies": { - "@types/body-parser": "*", - "@types/express-serve-static-core": "^4.17.18", - "@types/qs": "*", - "@types/serve-static": "*" - } - }, - "node_modules/ln-telegram/node_modules/@types/node": { - "version": "18.11.9", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.9.tgz", - "integrity": "sha512-CRpX21/kGdzjOpFsZSkcrXMGIBWMGNIHXXBVFSH+ggkftxg+XYP20TESbh+zFvFj3EQOl5byk0HTRn1IL6hbqg==" - }, - "node_modules/ln-telegram/node_modules/bitcoinjs-lib": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/bitcoinjs-lib/-/bitcoinjs-lib-6.0.2.tgz", - "integrity": "sha512-I994pGt9cL5s5OA6mkv1e8IuYcsKN2ORXnWbkqAXLNGvEnOHBhKBSvCjFl7YC2uVoJnfr/iwq7JMrq575SYO5w==", - "dependencies": { - "bech32": "^2.0.0", - "bip174": "^2.0.1", - "bs58check": "^2.1.2", - "create-hash": "^1.1.0", - "ripemd160": "^2.0.2", - "typeforce": "^1.11.3", - "varuint-bitcoin": "^1.1.2", - "wif": "^2.0.1" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/ln-telegram/node_modules/body-parser": { - "version": "1.20.1", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz", - "integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==", - "dependencies": { - "bytes": "3.1.2", - "content-type": "~1.0.4", - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "1.2.0", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "on-finished": "2.4.1", - "qs": "6.11.0", - "raw-body": "2.5.1", - "type-is": "~1.6.18", - "unpipe": "1.0.0" - }, - "engines": { - "node": ">= 0.8", - "npm": "1.2.8000 || >= 1.4.16" - } - }, - "node_modules/ln-telegram/node_modules/lightning": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/lightning/-/lightning-6.3.1.tgz", - "integrity": "sha512-ItcPt/FbMXZcCY65P0alYwMQCmhX4HEDlNaM54qjYsVmrDRGML5PN+zBlBvosvIoo47/0rQsdKpFnBSbo4oPEQ==", - "dependencies": { - "@grpc/grpc-js": "1.7.3", - "@grpc/proto-loader": "0.7.3", - "@types/express": "4.17.14", - "@types/node": "18.11.9", - "@types/request": "2.48.8", - "@types/ws": "8.5.3", - "async": "3.2.4", - "asyncjs-util": "1.2.10", - "bitcoinjs-lib": "6.0.2", - "bn.js": "5.2.1", - "body-parser": "1.20.1", - "bolt07": "1.8.2", - "bolt09": "0.2.4", - "cbor": "8.1.0", - "ecpair": "2.1.0", - "express": "4.18.2", - "invoices": "2.2.2", - "psbt": "2.7.1", - "tiny-secp256k1": "2.2.1", - "type-fest": "3.2.0" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/ln-telegram/node_modules/ln-service": { - "version": "54.3.2", - "resolved": "https://registry.npmjs.org/ln-service/-/ln-service-54.3.2.tgz", - "integrity": "sha512-3wIZfpHKOo2L+MgqH4PtLdYQerRQTpd4Rdjhs9U7PMi9ar3PSZ/20URv0bPgA05DSc9Q7NGYmmj4vUY504iNaw==", - "dependencies": { - "bolt07": "1.8.2", - "cors": "2.8.5", - "express": "4.18.2", - "invoices": "2.2.2", - "lightning": "6.3.1", - "macaroon": "3.0.4", - "morgan": "1.10.0", - "ws": "8.11.0" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/ln-telegram/node_modules/qs": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", - "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", - "dependencies": { - "side-channel": "^1.0.4" - }, - "engines": { - "node": ">=0.6" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/ln-telegram/node_modules/type-fest": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-3.2.0.tgz", - "integrity": "sha512-Il3wdLRzWvbAEtocgxGQA9YOoRVeVUGOMBtel5LdEpNeEAol6GJTLw8GbX6Z8EIMfvfhoOXs2bwOijtAZdK5og==", - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/ln-telegram/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-telegram/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-telegram/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/locate-path": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", @@ -6908,10 +6635,19 @@ "loose-envify": "cli.js" } }, + "node_modules/lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "dependencies": { + "yallist": "^3.0.2" + } + }, "node_modules/luxon": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/luxon/-/luxon-3.1.0.tgz", - "integrity": "sha512-7w6hmKC0/aoWnEsmPCu5Br54BmbmUp5GfcqBxQngRcXJ+q5fdfjEzn7dxmJh2YdDhgW8PccYtlWKSv4tQkrTQg==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/luxon/-/luxon-3.1.1.tgz", + "integrity": "sha512-Ah6DloGmvseB/pX1cAmjbFvyU/pKuwQMQqz7d0yvuDlVYLTs2WeDHQMpC8tGjm1da+BriHROW/OEIT/KfYg6xw==", "engines": { "node": ">=12" } @@ -7059,6 +6795,12 @@ "node": ">=8" } }, + "node_modules/minipass/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, "node_modules/mkdirp": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", @@ -7242,9 +6984,9 @@ } }, "node_modules/node-releases": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.7.tgz", - "integrity": "sha512-EJ3rzxL9pTWPjk5arA0s0dgXpnyiAbJDE6wHT62g7VsgrgQgmmZ+Ru++M1BFofncWja+Pnn3rEr3fieRySAdKQ==", + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.8.tgz", + "integrity": "sha512-dFSmB8fFHEH/s81Xi+Y/15DQY6VHW81nXRj86EMSL3lmuTmK1e+aT4wrFCkTbm+gSwkw4KpX+rT/pMM2c1mF+A==", "dev": true }, "node_modules/nofilter": { @@ -7670,6 +7412,129 @@ "node": ">=14" } }, + "node_modules/paid-services/node_modules/ln-sync": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/ln-sync/-/ln-sync-4.0.5.tgz", + "integrity": "sha512-zzFK2CMBAiDlnLu/m+kpD4Oqz6YGXg4aiTbtygUOOFEBSdvHtXG4WaM2xFpKf7g4cvHGhYS6xsmMYwVepwsypA==", + "dependencies": { + "async": "3.2.4", + "asyncjs-util": "1.2.10", + "bech32": "2.0.0", + "bitcoinjs-lib": "6.0.2", + "bolt07": "1.8.2", + "colorette": "2.0.19", + "ecpair": "2.1.0", + "ln-service": "54.2.6", + "psbt": "2.7.1", + "tiny-secp256k1": "2.2.1" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/paid-services/node_modules/ln-sync/node_modules/invoices": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/invoices/-/invoices-2.2.0.tgz", + "integrity": "sha512-uVe0WdHGdhkKubfrH1rSC/RpFREC7D0dh1IHxEgmUhV1lhn2+1UFVUxhri4dGyklBgIi+DNzE8q3665PF8z5Vw==", + "dependencies": { + "bech32": "2.0.0", + "bitcoinjs-lib": "6.0.2", + "bn.js": "5.2.1", + "bolt07": "1.8.2", + "bolt09": "0.2.3", + "tiny-secp256k1": "2.2.1" + }, + "engines": { + "node": ">=12.20.0" + } + }, + "node_modules/paid-services/node_modules/ln-sync/node_modules/invoices/node_modules/bolt09": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/bolt09/-/bolt09-0.2.3.tgz", + "integrity": "sha512-xEt5GE6pXB8wMIWHAoyF28k0Yt2rFqIou1LCyIeNadAOQhu/F7GTjZwreFwLl07YYkhOH23avewRt5PD8JnKKg==", + "engines": { + "node": ">=12.20.0" + } + }, + "node_modules/paid-services/node_modules/ln-sync/node_modules/lightning": { + "version": "6.2.7", + "resolved": "https://registry.npmjs.org/lightning/-/lightning-6.2.7.tgz", + "integrity": "sha512-2O68CU67XWqbahWRG4Ut5OsdqzxWh3Pg2bboiGcSSBA1boRECQLvw3cpnsFZK7Sef5s4NhgslDu7bZxyrDa8pw==", + "dependencies": { + "@grpc/grpc-js": "1.7.3", + "@grpc/proto-loader": "0.7.3", + "@types/express": "4.17.14", + "@types/node": "18.11.9", + "@types/request": "2.48.8", + "@types/ws": "8.5.3", + "async": "3.2.4", + "asyncjs-util": "1.2.10", + "bitcoinjs-lib": "6.0.2", + "bn.js": "5.2.1", + "body-parser": "1.20.1", + "bolt07": "1.8.2", + "bolt09": "0.2.4", + "cbor": "8.1.0", + "ecpair": "2.1.0", + "express": "4.18.2", + "invoices": "2.2.0", + "psbt": "2.7.1", + "tiny-secp256k1": "2.2.1", + "type-fest": "3.1.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/paid-services/node_modules/ln-sync/node_modules/ln-service": { + "version": "54.2.6", + "resolved": "https://registry.npmjs.org/ln-service/-/ln-service-54.2.6.tgz", + "integrity": "sha512-HEFcTdVj1nYfhkLzPKtCtBZhw+I9FB8qoJhMb4ro8cwMebRSG/lDDcIvkANfi7ccFLbRNB+M7Tk1vHRaFdQAzw==", + "dependencies": { + "bolt07": "1.8.2", + "cors": "2.8.5", + "express": "4.18.2", + "invoices": "2.2.0", + "lightning": "6.2.7", + "macaroon": "3.0.4", + "morgan": "1.10.0", + "ws": "8.10.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/paid-services/node_modules/ln-sync/node_modules/type-fest": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-3.1.0.tgz", + "integrity": "sha512-StmrZmK3eD9mDF9Vt7UhqthrDSk66O9iYl5t5a0TSoVkHjl0XZx/xuc/BRz4urAXXGHOY5OLsE0RdJFIApSFmw==", + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/paid-services/node_modules/ln-sync/node_modules/ws": { + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.10.0.tgz", + "integrity": "sha512-+s49uSmZpvtAsd2h37vIPy1RBusaLawVe8of+GyEPsaJTCMpj/2v8NpeK1SHXjBlQ95lQTmQofOJnFiLoaN3yw==", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, "node_modules/paid-services/node_modules/qs": { "version": "6.11.0", "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", @@ -9802,9 +9667,9 @@ "dev": true }, "node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", "dev": true }, "node_modules/yaml": { @@ -11399,27 +11264,27 @@ } }, "@babel/compat-data": { - "version": "7.20.5", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.20.5.tgz", - "integrity": "sha512-KZXo2t10+/jxmkhNXc7pZTqRvSOIvVv/+lJwHS+B2rErwOyjuVRh60yVpb7liQ1U5t7lLJ1bz+t8tSypUZdm0g==", + "version": "7.20.10", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.20.10.tgz", + "integrity": "sha512-sEnuDPpOJR/fcafHMjpcpGN5M2jbUGUHwmuWKM/YdPzeEDJg8bgmbcWQFUfE32MQjti1koACvoPVsDe8Uq+idg==", "dev": true }, "@babel/core": { - "version": "7.20.5", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.20.5.tgz", - "integrity": "sha512-UdOWmk4pNWTm/4DlPUl/Pt4Gz4rcEMb7CY0Y3eJl5Yz1vI8ZJGmHWaVE55LoxRjdpx0z259GE9U5STA9atUinQ==", + "version": "7.20.7", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.20.7.tgz", + "integrity": "sha512-t1ZjCluspe5DW24bn2Rr1CDb2v9rn/hROtg9a2tmd0+QYf4bsloYfLQzjG4qHPNMhWtKdGC33R5AxGR2Af2cBw==", "dev": true, "requires": { "@ampproject/remapping": "^2.1.0", "@babel/code-frame": "^7.18.6", - "@babel/generator": "^7.20.5", - "@babel/helper-compilation-targets": "^7.20.0", - "@babel/helper-module-transforms": "^7.20.2", - "@babel/helpers": "^7.20.5", - "@babel/parser": "^7.20.5", - "@babel/template": "^7.18.10", - "@babel/traverse": "^7.20.5", - "@babel/types": "^7.20.5", + "@babel/generator": "^7.20.7", + "@babel/helper-compilation-targets": "^7.20.7", + "@babel/helper-module-transforms": "^7.20.7", + "@babel/helpers": "^7.20.7", + "@babel/parser": "^7.20.7", + "@babel/template": "^7.20.7", + "@babel/traverse": "^7.20.7", + "@babel/types": "^7.20.7", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", @@ -11445,12 +11310,12 @@ } }, "@babel/generator": { - "version": "7.20.5", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.20.5.tgz", - "integrity": "sha512-jl7JY2Ykn9S0yj4DQP82sYvPU+T3g0HFcWTqDLqiuA9tGRNIj9VfbtXGAYTTkyNEnQk1jkMGOdYka8aG/lulCA==", + "version": "7.20.7", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.20.7.tgz", + "integrity": "sha512-7wqMOJq8doJMZmP4ApXTzLxSr7+oO2jroJURrVEp6XShrQUObV8Tq/D0NCcoYg2uHqUrjzO0zwBjoYzelxK+sw==", "dev": true, "requires": { - "@babel/types": "^7.20.5", + "@babel/types": "^7.20.7", "@jridgewell/gen-mapping": "^0.3.2", "jsesc": "^2.5.1" }, @@ -11469,14 +11334,15 @@ } }, "@babel/helper-compilation-targets": { - "version": "7.20.0", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.20.0.tgz", - "integrity": "sha512-0jp//vDGp9e8hZzBc6N/KwA5ZK3Wsm/pfm4CrY7vzegkVxc65SgSn6wYOnwHe9Js9HRQ1YTCKLGPzDtaS3RoLQ==", + "version": "7.20.7", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.20.7.tgz", + "integrity": "sha512-4tGORmfQcrc+bvrjb5y3dG9Mx1IOZjsHqQVUz7XCNHO+iTmqxWnVg3KRygjGmpRLJGdQSKuvFinbIb0CnZwHAQ==", "dev": true, "requires": { - "@babel/compat-data": "^7.20.0", + "@babel/compat-data": "^7.20.5", "@babel/helper-validator-option": "^7.18.6", "browserslist": "^4.21.3", + "lru-cache": "^5.1.1", "semver": "^6.3.0" } }, @@ -11515,9 +11381,9 @@ } }, "@babel/helper-module-transforms": { - "version": "7.20.2", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.20.2.tgz", - "integrity": "sha512-zvBKyJXRbmK07XhMuujYoJ48B5yvvmM6+wcpv6Ivj4Yg6qO7NOZOSnvZN9CRl1zz1Z4cKf8YejmCMh8clOoOeA==", + "version": "7.20.11", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.20.11.tgz", + "integrity": "sha512-uRy78kN4psmji1s2QtbtcCSaj/LILFDp0f/ymhpQH5QY3nljUZCaNWz9X1dEj/8MBdBEFECs7yRhKn8i7NjZgg==", "dev": true, "requires": { "@babel/helper-environment-visitor": "^7.18.9", @@ -11525,9 +11391,9 @@ "@babel/helper-simple-access": "^7.20.2", "@babel/helper-split-export-declaration": "^7.18.6", "@babel/helper-validator-identifier": "^7.19.1", - "@babel/template": "^7.18.10", - "@babel/traverse": "^7.20.1", - "@babel/types": "^7.20.2" + "@babel/template": "^7.20.7", + "@babel/traverse": "^7.20.10", + "@babel/types": "^7.20.7" } }, "@babel/helper-simple-access": { @@ -11567,14 +11433,14 @@ "dev": true }, "@babel/helpers": { - "version": "7.20.6", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.20.6.tgz", - "integrity": "sha512-Pf/OjgfgFRW5bApskEz5pvidpim7tEDPlFtKcNRXWmfHGn9IEI2W2flqRQXTFb7gIPTyK++N6rVHuwKut4XK6w==", + "version": "7.20.7", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.20.7.tgz", + "integrity": "sha512-PBPjs5BppzsGaxHQCDKnZ6Gd9s6xl8bBCluz3vEInLGRJmnZan4F6BYCeqtyXqkk4W5IlPmjK4JlOuZkpJ3xZA==", "dev": true, "requires": { - "@babel/template": "^7.18.10", - "@babel/traverse": "^7.20.5", - "@babel/types": "^7.20.5" + "@babel/template": "^7.20.7", + "@babel/traverse": "^7.20.7", + "@babel/types": "^7.20.7" } }, "@babel/highlight": { @@ -11589,36 +11455,36 @@ } }, "@babel/parser": { - "version": "7.20.5", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.20.5.tgz", - "integrity": "sha512-r27t/cy/m9uKLXQNWWebeCUHgnAZq0CpG1OwKRxzJMP1vpSU4bSIK2hq+/cp0bQxetkXx38n09rNu8jVkcK/zA==", + "version": "7.20.7", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.20.7.tgz", + "integrity": "sha512-T3Z9oHybU+0vZlY9CiDSJQTD5ZapcW18ZctFMi0MOAl/4BjFF4ul7NVSARLdbGO5vDqy9eQiGTV0LtKfvCYvcg==", "dev": true }, "@babel/template": { - "version": "7.18.10", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.18.10.tgz", - "integrity": "sha512-TI+rCtooWHr3QJ27kJxfjutghu44DLnasDMwpDqCXVTal9RLp3RSYNh4NdBrRP2cQAoG9A8juOQl6P6oZG4JxA==", + "version": "7.20.7", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.20.7.tgz", + "integrity": "sha512-8SegXApWe6VoNw0r9JHpSteLKTpTiLZ4rMlGIm9JQ18KiCtyQiAMEazujAHrUS5flrcqYZa75ukev3P6QmUwUw==", "dev": true, "requires": { "@babel/code-frame": "^7.18.6", - "@babel/parser": "^7.18.10", - "@babel/types": "^7.18.10" + "@babel/parser": "^7.20.7", + "@babel/types": "^7.20.7" } }, "@babel/traverse": { - "version": "7.20.5", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.20.5.tgz", - "integrity": "sha512-WM5ZNN3JITQIq9tFZaw1ojLU3WgWdtkxnhM1AegMS+PvHjkM5IXjmYEGY7yukz5XS4sJyEf2VzWjI8uAavhxBQ==", + "version": "7.20.10", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.20.10.tgz", + "integrity": "sha512-oSf1juCgymrSez8NI4A2sr4+uB/mFd9MXplYGPEBnfAuWmmyeVcHa6xLPiaRBcXkcb/28bgxmQLTVwFKE1yfsg==", "dev": true, "requires": { "@babel/code-frame": "^7.18.6", - "@babel/generator": "^7.20.5", + "@babel/generator": "^7.20.7", "@babel/helper-environment-visitor": "^7.18.9", "@babel/helper-function-name": "^7.19.0", "@babel/helper-hoist-variables": "^7.18.6", "@babel/helper-split-export-declaration": "^7.18.6", - "@babel/parser": "^7.20.5", - "@babel/types": "^7.20.5", + "@babel/parser": "^7.20.7", + "@babel/types": "^7.20.7", "debug": "^4.1.0", "globals": "^11.1.0" }, @@ -11641,9 +11507,9 @@ } }, "@babel/types": { - "version": "7.20.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.20.5.tgz", - "integrity": "sha512-c9fst/h2/dcF7H+MJKZ2T0KjEQ8hY/BNnDk/H3XY8C4Aw/eWQXWn/lWntHF9ooUBnGmEvbfGrTgLWc+um0YDUg==", + "version": "7.20.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.20.7.tgz", + "integrity": "sha512-69OnhBxSSgK0OzTJai4kyPDiKTIe3j+ctaHdIGVbRahTLAT7L3R9oeXHC2aVSuGYt3cVnoAMDmOCgJ2yaiLMvg==", "dev": true, "requires": { "@babel/helper-string-parser": "^7.19.4", @@ -11911,9 +11777,9 @@ "integrity": "sha512-Y4XFY5VJAuw0FgAqPNd6NNoV44jbq9Bz2L7Rh/J6jLTiHBSBJa9fxqQIvkIld4GsoDOcCbvzOUAbLPsSKKg+uA==" }, "@types/node": { - "version": "18.11.16", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.16.tgz", - "integrity": "sha512-6T7P5bDkRhqRxrQtwj7vru+bWTpelgtcETAZEUSdq0YISKz8WKdoBukQLYQQ6DFHvU9JRsbFq0JH5C51X2ZdnA==" + "version": "18.11.17", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.17.tgz", + "integrity": "sha512-HJSUJmni4BeDHhfzn6nF0sVmd1SMezP7/4F0Lq+aXzmp2xm9O7WXrUtHW/CHlYVtZUbByEvWidHqRtcJXGF2Ng==" }, "@types/qs": { "version": "6.9.7", @@ -12489,9 +12355,9 @@ "dev": true }, "caniuse-lite": { - "version": "1.0.30001439", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001439.tgz", - "integrity": "sha512-1MgUzEkoMO6gKfXflStpYgZDlFM7M/ck/bgfVCACO5vnAf0fXoNVHdWtqGU+MYca+4bL9Z5bpOVmR33cWW9G2A==", + "version": "1.0.30001441", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001441.tgz", + "integrity": "sha512-OyxRR4Vof59I3yGWXws6i908EtGbMzVUi3ganaZQHmydk1iwDhRnvaPG2WaR0KcqrDFKrxVZHULT396LEPhXfg==", "dev": true }, "cbor": { @@ -13671,11 +13537,11 @@ "dev": true }, "grammy": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/grammy/-/grammy-1.12.0.tgz", - "integrity": "sha512-/2Mi4MyVPeFXjTd4v3pRK8gb/YdWFbZrj/8HTp5daQyTOx4/U95XFL0Ao+e9hf4XbL7RCOpanXaTL8+UXXcNqw==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/grammy/-/grammy-1.12.1.tgz", + "integrity": "sha512-pnAVs5ZqA4Dfby+JUDIzcq5xgRZm1qDKveU/kQyt31Ln19NF0PgUooczQ1AiTUTC8Yv/et9Ok8R2BiQcskoJew==", "requires": { - "@grammyjs/types": "^2.10.0", + "@grammyjs/types": "^2.10.3", "abort-controller": "^3.0.0", "debug": "^4.3.4", "node-fetch": "^2.6.7" @@ -14249,6 +14115,7 @@ "version": "6.6.0", "resolved": "https://registry.npmjs.org/lightning/-/lightning-6.6.0.tgz", "integrity": "sha512-S+lUitqP/fbQWNYffor/74jKoyjbT/hZuzgHlCH/WH5bmoognl6BpcK7qAJ6Qw9hDQPnDXUB5CyfjJmmOCtOlw==", + "dev": true, "requires": { "@grpc/grpc-js": "1.8.0", "@grpc/proto-loader": "0.7.4", @@ -14276,6 +14143,7 @@ "version": "1.8.0", "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.8.0.tgz", "integrity": "sha512-ySMTXQuMvvswoobvN+0LsaPf7ITO2JVfJmHxQKI4cGehNrrUms+n81BlHEX7Hl/LExji6XE3fnI9U04GSkRruA==", + "dev": true, "requires": { "@grpc/proto-loader": "^0.7.0", "@types/node": ">=12.12.47" @@ -14285,6 +14153,7 @@ "version": "0.7.4", "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.7.4.tgz", "integrity": "sha512-MnWjkGwqQ3W8fx94/c1CwqLsNmHHv2t0CFn+9++6+cDphC1lolpg9M2OU0iebIjK//pBNX9e94ho+gjx6vz39w==", + "dev": true, "requires": { "@types/long": "^4.0.1", "lodash.camelcase": "^4.3.0", @@ -14296,12 +14165,14 @@ "@types/node": { "version": "18.11.15", "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.15.tgz", - "integrity": "sha512-VkhBbVo2+2oozlkdHXLrb3zjsRkpdnaU2bXmX8Wgle3PUi569eLRaHGlgETQHR7lLL1w7GiG3h9SnePhxNDecw==" + "integrity": "sha512-VkhBbVo2+2oozlkdHXLrb3zjsRkpdnaU2bXmX8Wgle3PUi569eLRaHGlgETQHR7lLL1w7GiG3h9SnePhxNDecw==", + "dev": true }, "body-parser": { "version": "1.20.1", "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz", "integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==", + "dev": true, "requires": { "bytes": "3.1.2", "content-type": "~1.0.4", @@ -14321,6 +14192,7 @@ "version": "6.11.0", "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", + "dev": true, "requires": { "side-channel": "^1.0.4" } @@ -14328,17 +14200,20 @@ "type-fest": { "version": "3.4.0", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-3.4.0.tgz", - "integrity": "sha512-PEPg6RHlB9cFwoTMNENNrQFL0cXX04voWr2UPwQBJ3pVs7Mt8Y1oLWdUeMdGEwZE8HFFlujq8gS9enmyiQ8pLg==" + "integrity": "sha512-PEPg6RHlB9cFwoTMNENNrQFL0cXX04voWr2UPwQBJ3pVs7Mt8Y1oLWdUeMdGEwZE8HFFlujq8gS9enmyiQ8pLg==", + "dev": true }, "y18n": { "version": "5.0.8", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", - "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==" + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true }, "yargs": { "version": "16.2.0", "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dev": true, "requires": { "cliui": "^7.0.2", "escalade": "^3.1.1", @@ -14352,7 +14227,8 @@ "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==" + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "dev": true } } }, @@ -14564,50 +14440,33 @@ } }, "ln-service": { - "version": "54.6.0", - "resolved": "https://registry.npmjs.org/ln-service/-/ln-service-54.6.0.tgz", - "integrity": "sha512-kDbClE4eTNCaaipDkj2o0TsqZWv8TKyxgUXah4Bs3mM92lL1tqLHPAfSMdE/EFzA82tBLkvByXwNUL4xTqSGrA==", + "version": "54.8.0", + "resolved": "https://registry.npmjs.org/ln-service/-/ln-service-54.8.0.tgz", + "integrity": "sha512-QNOek7A5BFKGiHlCYHQfIwhehtRyO/oFndeaSn/11x2cvo461pgJXyu/zQETCb4yhGZUa1v3LU1Lmk4bPqsvyw==", "requires": { "bolt07": "1.8.2", "cors": "2.8.5", "express": "4.18.2", "invoices": "2.2.2", - "lightning": "6.6.0", + "lightning": "6.8.0", "macaroon": "3.0.4", "morgan": "1.10.0", "ws": "8.11.0" - } - }, - "ln-sync": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/ln-sync/-/ln-sync-4.0.5.tgz", - "integrity": "sha512-zzFK2CMBAiDlnLu/m+kpD4Oqz6YGXg4aiTbtygUOOFEBSdvHtXG4WaM2xFpKf7g4cvHGhYS6xsmMYwVepwsypA==", - "requires": { - "async": "3.2.4", - "asyncjs-util": "1.2.10", - "bech32": "2.0.0", - "bitcoinjs-lib": "6.0.2", - "bolt07": "1.8.2", - "colorette": "2.0.19", - "ecpair": "2.1.0", - "ln-service": "54.2.6", - "psbt": "2.7.1", - "tiny-secp256k1": "2.2.1" }, "dependencies": { "@grpc/grpc-js": { - "version": "1.7.3", - "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.7.3.tgz", - "integrity": "sha512-H9l79u4kJ2PVSxUNA08HMYAnUBLj9v6KjYQ7SQ71hOZcEXhShE/y5iQCesP8+6/Ik/7i2O0a10bPquIcYfufog==", + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.8.0.tgz", + "integrity": "sha512-ySMTXQuMvvswoobvN+0LsaPf7ITO2JVfJmHxQKI4cGehNrrUms+n81BlHEX7Hl/LExji6XE3fnI9U04GSkRruA==", "requires": { "@grpc/proto-loader": "^0.7.0", "@types/node": ">=12.12.47" } }, "@grpc/proto-loader": { - "version": "0.7.3", - "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.7.3.tgz", - "integrity": "sha512-5dAvoZwna2Py3Ef96Ux9jIkp3iZ62TUsV00p3wVBPNX5K178UbNi8Q7gQVqwXT1Yq9RejIGG9G2IPEo93T6RcA==", + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.7.4.tgz", + "integrity": "sha512-MnWjkGwqQ3W8fx94/c1CwqLsNmHHv2t0CFn+9++6+cDphC1lolpg9M2OU0iebIjK//pBNX9e94ho+gjx6vz39w==", "requires": { "@types/long": "^4.0.1", "lodash.camelcase": "^4.3.0", @@ -14616,36 +14475,10 @@ "yargs": "^16.2.0" } }, - "@types/express": { - "version": "4.17.14", - "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.14.tgz", - "integrity": "sha512-TEbt+vaPFQ+xpxFLFssxUDXj5cWCxZJjIcB7Yg0k0GMHGtgtQgpvx/MUQUeAkNbA9AAGrwkAsoeItdTgS7FMyg==", - "requires": { - "@types/body-parser": "*", - "@types/express-serve-static-core": "^4.17.18", - "@types/qs": "*", - "@types/serve-static": "*" - } - }, "@types/node": { - "version": "18.11.9", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.9.tgz", - "integrity": "sha512-CRpX21/kGdzjOpFsZSkcrXMGIBWMGNIHXXBVFSH+ggkftxg+XYP20TESbh+zFvFj3EQOl5byk0HTRn1IL6hbqg==" - }, - "bitcoinjs-lib": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/bitcoinjs-lib/-/bitcoinjs-lib-6.0.2.tgz", - "integrity": "sha512-I994pGt9cL5s5OA6mkv1e8IuYcsKN2ORXnWbkqAXLNGvEnOHBhKBSvCjFl7YC2uVoJnfr/iwq7JMrq575SYO5w==", - "requires": { - "bech32": "^2.0.0", - "bip174": "^2.0.1", - "bs58check": "^2.1.2", - "create-hash": "^1.1.0", - "ripemd160": "^2.0.2", - "typeforce": "^1.11.3", - "varuint-bitcoin": "^1.1.2", - "wif": "^2.0.1" - } + "version": "18.11.16", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.16.tgz", + "integrity": "sha512-6T7P5bDkRhqRxrQtwj7vru+bWTpelgtcETAZEUSdq0YISKz8WKdoBukQLYQQ6DFHvU9JRsbFq0JH5C51X2ZdnA==" }, "body-parser": { "version": "1.20.1", @@ -14666,40 +14499,20 @@ "unpipe": "1.0.0" } }, - "invoices": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/invoices/-/invoices-2.2.0.tgz", - "integrity": "sha512-uVe0WdHGdhkKubfrH1rSC/RpFREC7D0dh1IHxEgmUhV1lhn2+1UFVUxhri4dGyklBgIi+DNzE8q3665PF8z5Vw==", - "requires": { - "bech32": "2.0.0", - "bitcoinjs-lib": "6.0.2", - "bn.js": "5.2.1", - "bolt07": "1.8.2", - "bolt09": "0.2.3", - "tiny-secp256k1": "2.2.1" - }, - "dependencies": { - "bolt09": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/bolt09/-/bolt09-0.2.3.tgz", - "integrity": "sha512-xEt5GE6pXB8wMIWHAoyF28k0Yt2rFqIou1LCyIeNadAOQhu/F7GTjZwreFwLl07YYkhOH23avewRt5PD8JnKKg==" - } - } - }, "lightning": { - "version": "6.2.7", - "resolved": "https://registry.npmjs.org/lightning/-/lightning-6.2.7.tgz", - "integrity": "sha512-2O68CU67XWqbahWRG4Ut5OsdqzxWh3Pg2bboiGcSSBA1boRECQLvw3cpnsFZK7Sef5s4NhgslDu7bZxyrDa8pw==", + "version": "6.8.0", + "resolved": "https://registry.npmjs.org/lightning/-/lightning-6.8.0.tgz", + "integrity": "sha512-HzcRq5n4zkGIXuGefFCoCjKIG/4IbpGESUyKA/+3UvfiGhtrKymRM8zoSFjWRFoaLaosR2P2SuKlrTyMfDmPHg==", "requires": { - "@grpc/grpc-js": "1.7.3", - "@grpc/proto-loader": "0.7.3", - "@types/express": "4.17.14", - "@types/node": "18.11.9", + "@grpc/grpc-js": "1.8.0", + "@grpc/proto-loader": "0.7.4", + "@types/express": "4.17.15", + "@types/node": "18.11.16", "@types/request": "2.48.8", "@types/ws": "8.5.3", "async": "3.2.4", "asyncjs-util": "1.2.10", - "bitcoinjs-lib": "6.0.2", + "bitcoinjs-lib": "6.1.0", "bn.js": "5.2.1", "body-parser": "1.20.1", "bolt07": "1.8.2", @@ -14707,25 +14520,10 @@ "cbor": "8.1.0", "ecpair": "2.1.0", "express": "4.18.2", - "invoices": "2.2.0", + "invoices": "2.2.2", "psbt": "2.7.1", "tiny-secp256k1": "2.2.1", - "type-fest": "3.1.0" - } - }, - "ln-service": { - "version": "54.2.6", - "resolved": "https://registry.npmjs.org/ln-service/-/ln-service-54.2.6.tgz", - "integrity": "sha512-HEFcTdVj1nYfhkLzPKtCtBZhw+I9FB8qoJhMb4ro8cwMebRSG/lDDcIvkANfi7ccFLbRNB+M7Tk1vHRaFdQAzw==", - "requires": { - "bolt07": "1.8.2", - "cors": "2.8.5", - "express": "4.18.2", - "invoices": "2.2.0", - "lightning": "6.2.7", - "macaroon": "3.0.4", - "morgan": "1.10.0", - "ws": "8.10.0" + "type-fest": "3.4.0" } }, "qs": { @@ -14737,15 +14535,9 @@ } }, "type-fest": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-3.1.0.tgz", - "integrity": "sha512-StmrZmK3eD9mDF9Vt7UhqthrDSk66O9iYl5t5a0TSoVkHjl0XZx/xuc/BRz4urAXXGHOY5OLsE0RdJFIApSFmw==" - }, - "ws": { - "version": "8.10.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.10.0.tgz", - "integrity": "sha512-+s49uSmZpvtAsd2h37vIPy1RBusaLawVe8of+GyEPsaJTCMpj/2v8NpeK1SHXjBlQ95lQTmQofOJnFiLoaN3yw==", - "requires": {} + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-3.4.0.tgz", + "integrity": "sha512-PEPg6RHlB9cFwoTMNENNrQFL0cXX04voWr2UPwQBJ3pVs7Mt8Y1oLWdUeMdGEwZE8HFFlujq8gS9enmyiQ8pLg==" }, "y18n": { "version": "5.0.8", @@ -14773,175 +14565,40 @@ } } }, + "ln-sync": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ln-sync/-/ln-sync-4.1.0.tgz", + "integrity": "sha512-N02s3tCvlyiTSmhJYoawDLqVmZ63Yk/7k27F+244J8kOorwLNrtAjcy8WHn+YnR44yreAph9xHwacU4Nr+VQuQ==", + "requires": { + "async": "3.2.4", + "asyncjs-util": "1.2.10", + "bech32": "2.0.0", + "bitcoinjs-lib": "6.1.0", + "bolt07": "1.8.2", + "colorette": "2.0.19", + "ecpair": "2.1.0", + "ln-service": "54.8.0", + "psbt": "2.7.1", + "tiny-secp256k1": "2.2.1" + } + }, "ln-telegram": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/ln-telegram/-/ln-telegram-4.3.1.tgz", - "integrity": "sha512-lAR12uidLQhvAIZGWFMi9rFtOAuy+sfw0YzlqRiTiiUuxcRL22v224vx0ffPY4YOwfqPdiQC61JKEdVYGwLmuA==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/ln-telegram/-/ln-telegram-4.4.0.tgz", + "integrity": "sha512-8uOztCmxGHMFuy7I1G83eA9Htafrw1xxfl20ThQheFxvBWnDGQiIxudqIKA/JB1BbtbQy9l1SMdg9RDW1hJDaA==", "requires": { "@alexbosworth/fiat": "^1.0.3", "async": "3.2.4", "asyncjs-util": "1.2.10", "bolt07": "1.8.2", "goldengate": "11.4.0", - "grammy": "1.12.0", + "grammy": "1.12.1", "ln-accounting": "6.1.1", - "ln-service": "54.3.2", - "ln-sync": "4.0.5", - "luxon": "3.1.0", + "ln-service": "54.8.0", + "ln-sync": "4.1.0", + "luxon": "3.1.1", "paid-services": "4.1.0", "table": "6.8.1" - }, - "dependencies": { - "@grpc/grpc-js": { - "version": "1.7.3", - "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.7.3.tgz", - "integrity": "sha512-H9l79u4kJ2PVSxUNA08HMYAnUBLj9v6KjYQ7SQ71hOZcEXhShE/y5iQCesP8+6/Ik/7i2O0a10bPquIcYfufog==", - "requires": { - "@grpc/proto-loader": "^0.7.0", - "@types/node": ">=12.12.47" - } - }, - "@grpc/proto-loader": { - "version": "0.7.3", - "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.7.3.tgz", - "integrity": "sha512-5dAvoZwna2Py3Ef96Ux9jIkp3iZ62TUsV00p3wVBPNX5K178UbNi8Q7gQVqwXT1Yq9RejIGG9G2IPEo93T6RcA==", - "requires": { - "@types/long": "^4.0.1", - "lodash.camelcase": "^4.3.0", - "long": "^4.0.0", - "protobufjs": "^7.0.0", - "yargs": "^16.2.0" - } - }, - "@types/express": { - "version": "4.17.14", - "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.14.tgz", - "integrity": "sha512-TEbt+vaPFQ+xpxFLFssxUDXj5cWCxZJjIcB7Yg0k0GMHGtgtQgpvx/MUQUeAkNbA9AAGrwkAsoeItdTgS7FMyg==", - "requires": { - "@types/body-parser": "*", - "@types/express-serve-static-core": "^4.17.18", - "@types/qs": "*", - "@types/serve-static": "*" - } - }, - "@types/node": { - "version": "18.11.9", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.9.tgz", - "integrity": "sha512-CRpX21/kGdzjOpFsZSkcrXMGIBWMGNIHXXBVFSH+ggkftxg+XYP20TESbh+zFvFj3EQOl5byk0HTRn1IL6hbqg==" - }, - "bitcoinjs-lib": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/bitcoinjs-lib/-/bitcoinjs-lib-6.0.2.tgz", - "integrity": "sha512-I994pGt9cL5s5OA6mkv1e8IuYcsKN2ORXnWbkqAXLNGvEnOHBhKBSvCjFl7YC2uVoJnfr/iwq7JMrq575SYO5w==", - "requires": { - "bech32": "^2.0.0", - "bip174": "^2.0.1", - "bs58check": "^2.1.2", - "create-hash": "^1.1.0", - "ripemd160": "^2.0.2", - "typeforce": "^1.11.3", - "varuint-bitcoin": "^1.1.2", - "wif": "^2.0.1" - } - }, - "body-parser": { - "version": "1.20.1", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz", - "integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==", - "requires": { - "bytes": "3.1.2", - "content-type": "~1.0.4", - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "1.2.0", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "on-finished": "2.4.1", - "qs": "6.11.0", - "raw-body": "2.5.1", - "type-is": "~1.6.18", - "unpipe": "1.0.0" - } - }, - "lightning": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/lightning/-/lightning-6.3.1.tgz", - "integrity": "sha512-ItcPt/FbMXZcCY65P0alYwMQCmhX4HEDlNaM54qjYsVmrDRGML5PN+zBlBvosvIoo47/0rQsdKpFnBSbo4oPEQ==", - "requires": { - "@grpc/grpc-js": "1.7.3", - "@grpc/proto-loader": "0.7.3", - "@types/express": "4.17.14", - "@types/node": "18.11.9", - "@types/request": "2.48.8", - "@types/ws": "8.5.3", - "async": "3.2.4", - "asyncjs-util": "1.2.10", - "bitcoinjs-lib": "6.0.2", - "bn.js": "5.2.1", - "body-parser": "1.20.1", - "bolt07": "1.8.2", - "bolt09": "0.2.4", - "cbor": "8.1.0", - "ecpair": "2.1.0", - "express": "4.18.2", - "invoices": "2.2.2", - "psbt": "2.7.1", - "tiny-secp256k1": "2.2.1", - "type-fest": "3.2.0" - } - }, - "ln-service": { - "version": "54.3.2", - "resolved": "https://registry.npmjs.org/ln-service/-/ln-service-54.3.2.tgz", - "integrity": "sha512-3wIZfpHKOo2L+MgqH4PtLdYQerRQTpd4Rdjhs9U7PMi9ar3PSZ/20URv0bPgA05DSc9Q7NGYmmj4vUY504iNaw==", - "requires": { - "bolt07": "1.8.2", - "cors": "2.8.5", - "express": "4.18.2", - "invoices": "2.2.2", - "lightning": "6.3.1", - "macaroon": "3.0.4", - "morgan": "1.10.0", - "ws": "8.11.0" - } - }, - "qs": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", - "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", - "requires": { - "side-channel": "^1.0.4" - } - }, - "type-fest": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-3.2.0.tgz", - "integrity": "sha512-Il3wdLRzWvbAEtocgxGQA9YOoRVeVUGOMBtel5LdEpNeEAol6GJTLw8GbX6Z8EIMfvfhoOXs2bwOijtAZdK5og==" - }, - "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==" - } } }, "locate-path": { @@ -15053,10 +14710,19 @@ "js-tokens": "^3.0.0 || ^4.0.0" } }, + "lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "requires": { + "yallist": "^3.0.2" + } + }, "luxon": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/luxon/-/luxon-3.1.0.tgz", - "integrity": "sha512-7w6hmKC0/aoWnEsmPCu5Br54BmbmUp5GfcqBxQngRcXJ+q5fdfjEzn7dxmJh2YdDhgW8PccYtlWKSv4tQkrTQg==" + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/luxon/-/luxon-3.1.1.tgz", + "integrity": "sha512-Ah6DloGmvseB/pX1cAmjbFvyU/pKuwQMQqz7d0yvuDlVYLTs2WeDHQMpC8tGjm1da+BriHROW/OEIT/KfYg6xw==" }, "macaroon": { "version": "3.0.4", @@ -15166,6 +14832,14 @@ "dev": true, "requires": { "yallist": "^4.0.0" + }, + "dependencies": { + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + } } }, "mkdirp": { @@ -15306,9 +14980,9 @@ } }, "node-releases": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.7.tgz", - "integrity": "sha512-EJ3rzxL9pTWPjk5arA0s0dgXpnyiAbJDE6wHT62g7VsgrgQgmmZ+Ru++M1BFofncWja+Pnn3rEr3fieRySAdKQ==", + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.8.tgz", + "integrity": "sha512-dFSmB8fFHEH/s81Xi+Y/15DQY6VHW81nXRj86EMSL3lmuTmK1e+aT4wrFCkTbm+gSwkw4KpX+rT/pMM2c1mF+A==", "dev": true }, "nofilter": { @@ -15641,6 +15315,98 @@ "ws": "8.11.0" } }, + "ln-sync": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/ln-sync/-/ln-sync-4.0.5.tgz", + "integrity": "sha512-zzFK2CMBAiDlnLu/m+kpD4Oqz6YGXg4aiTbtygUOOFEBSdvHtXG4WaM2xFpKf7g4cvHGhYS6xsmMYwVepwsypA==", + "requires": { + "async": "3.2.4", + "asyncjs-util": "1.2.10", + "bech32": "2.0.0", + "bitcoinjs-lib": "6.0.2", + "bolt07": "1.8.2", + "colorette": "2.0.19", + "ecpair": "2.1.0", + "ln-service": "54.2.6", + "psbt": "2.7.1", + "tiny-secp256k1": "2.2.1" + }, + "dependencies": { + "invoices": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/invoices/-/invoices-2.2.0.tgz", + "integrity": "sha512-uVe0WdHGdhkKubfrH1rSC/RpFREC7D0dh1IHxEgmUhV1lhn2+1UFVUxhri4dGyklBgIi+DNzE8q3665PF8z5Vw==", + "requires": { + "bech32": "2.0.0", + "bitcoinjs-lib": "6.0.2", + "bn.js": "5.2.1", + "bolt07": "1.8.2", + "bolt09": "0.2.3", + "tiny-secp256k1": "2.2.1" + }, + "dependencies": { + "bolt09": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/bolt09/-/bolt09-0.2.3.tgz", + "integrity": "sha512-xEt5GE6pXB8wMIWHAoyF28k0Yt2rFqIou1LCyIeNadAOQhu/F7GTjZwreFwLl07YYkhOH23avewRt5PD8JnKKg==" + } + } + }, + "lightning": { + "version": "6.2.7", + "resolved": "https://registry.npmjs.org/lightning/-/lightning-6.2.7.tgz", + "integrity": "sha512-2O68CU67XWqbahWRG4Ut5OsdqzxWh3Pg2bboiGcSSBA1boRECQLvw3cpnsFZK7Sef5s4NhgslDu7bZxyrDa8pw==", + "requires": { + "@grpc/grpc-js": "1.7.3", + "@grpc/proto-loader": "0.7.3", + "@types/express": "4.17.14", + "@types/node": "18.11.9", + "@types/request": "2.48.8", + "@types/ws": "8.5.3", + "async": "3.2.4", + "asyncjs-util": "1.2.10", + "bitcoinjs-lib": "6.0.2", + "bn.js": "5.2.1", + "body-parser": "1.20.1", + "bolt07": "1.8.2", + "bolt09": "0.2.4", + "cbor": "8.1.0", + "ecpair": "2.1.0", + "express": "4.18.2", + "invoices": "2.2.0", + "psbt": "2.7.1", + "tiny-secp256k1": "2.2.1", + "type-fest": "3.1.0" + } + }, + "ln-service": { + "version": "54.2.6", + "resolved": "https://registry.npmjs.org/ln-service/-/ln-service-54.2.6.tgz", + "integrity": "sha512-HEFcTdVj1nYfhkLzPKtCtBZhw+I9FB8qoJhMb4ro8cwMebRSG/lDDcIvkANfi7ccFLbRNB+M7Tk1vHRaFdQAzw==", + "requires": { + "bolt07": "1.8.2", + "cors": "2.8.5", + "express": "4.18.2", + "invoices": "2.2.0", + "lightning": "6.2.7", + "macaroon": "3.0.4", + "morgan": "1.10.0", + "ws": "8.10.0" + } + }, + "type-fest": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-3.1.0.tgz", + "integrity": "sha512-StmrZmK3eD9mDF9Vt7UhqthrDSk66O9iYl5t5a0TSoVkHjl0XZx/xuc/BRz4urAXXGHOY5OLsE0RdJFIApSFmw==" + }, + "ws": { + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.10.0.tgz", + "integrity": "sha512-+s49uSmZpvtAsd2h37vIPy1RBusaLawVe8of+GyEPsaJTCMpj/2v8NpeK1SHXjBlQ95lQTmQofOJnFiLoaN3yw==", + "requires": {} + } + } + }, "qs": { "version": "6.11.0", "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", @@ -17284,9 +17050,9 @@ "dev": true }, "yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", "dev": true }, "yaml": { diff --git a/package.json b/package.json index 209c6fe..c6f81f4 100644 --- a/package.json +++ b/package.json @@ -30,15 +30,15 @@ "csv-parse": "5.3.3", "ecpair": "2.1.0", "goldengate": "11.4.0", - "grammy": "1.12.0", + "grammy": "1.12.1", "hot-formula-parser": "4.0.0", "import-lazy": "4.0.0", "ini": "3.0.1", "inquirer": "9.1.4", "ln-accounting": "6.1.1", - "ln-service": "54.6.0", - "ln-sync": "4.0.5", - "ln-telegram": "4.3.1", + "ln-service": "54.8.0", + "ln-sync": "4.1.0", + "ln-telegram": "4.4.0", "moment": "2.29.4", "paid-services": "4.1.0", "probing": "3.0.0", @@ -83,5 +83,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/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" }, - "version": "13.10.7" + "version": "13.11.0" } diff --git a/telegram/start_telegram_bot.js b/telegram/start_telegram_bot.js index ae14a8d..baa73c6 100644 --- a/telegram/start_telegram_bot.js +++ b/telegram/start_telegram_bot.js @@ -9,6 +9,7 @@ const {getNetwork} = require('ln-service'); const {getTransactionRecord} = require('ln-sync'); const {getWalletInfo} = require('ln-service'); const {handleBackupCommand} = require('ln-telegram'); +const {handleBalanceCommand} = require('ln-telegram'); const {handleBlocknotifyCommand} = require('ln-telegram'); const {handleButtonPush} = require('ln-telegram'); const {handleConnectCommand} = require('ln-telegram'); @@ -198,6 +199,21 @@ module.exports = (args, cbk) => { } }); + // Handle lookup of total funds + args.bot.command('balance', async ctx => { + try { + await handleBalanceCommand({ + from: ctx.message.from.id, + id: connectedId, + nodes: (await getLnds(args.logger, names, args.nodes)).nodes, + reply: (n, opt) => ctx.reply(n, opt), + working: () => ctx.replyWithChatAction('typing'), + }); + } catch (err) { + args.logger.error({err}); + } + }); + // Handle command to get notified on the next block args.bot.command('blocknotify', ctx => { handleBlocknotifyCommand({ @@ -528,6 +544,7 @@ module.exports = (args, cbk) => { setCommands: ['validate', async ({}) => { return await args.bot.api.setMyCommands([ {command: 'backup', description: 'Get node backup file'}, + {command: 'balance', description: 'Show funds on the node'}, {command: 'blocknotify', description: 'Get notified on next block'}, {command: 'connect', description: 'Get connect code for the bot'}, {command: 'costs', description: 'Show costs over the week'}, diff --git a/test/balances/test_detailed_balance.js b/test/balances/test_detailed_balance.js deleted file mode 100644 index ca7e87c..0000000 --- a/test/balances/test_detailed_balance.js +++ /dev/null @@ -1,133 +0,0 @@ -const {test} = require('@alexbosworth/tap'); - -const detailedBalances = require('./../../balances/detailed_balances'); - -const tests = [ - { - args: { - channels: [ - { - commit_transaction_fee: 1, - is_partner_initiated: true, - local_balance: 2, - pending_payments: [{is_outgoing: true, tokens: 3}], - }, - { - commit_transaction_fee: 4, - is_partner_initiated: false, - local_balance: 5, - pending_payments: [{is_outgoing: false, tokens: 6}], - }, - ], - locked: [{ - tokens: 1, - }], - pending: [ - { - is_closing: true, - local_balance: 2, - recovered_tokens: 1, - }, - { - is_opening: true, - is_partner_initiated: true, - local_balance: 0, - transaction_fee: 1, - }, - { - is_opening: true, - is_partner_initiated: true, - local_balance: 2, - pending_payments: [{is_outgoing: true, tokens: 3}], - transaction_fee: 1, - }, - { - is_opening: false, - is_partner_initiated: false, - local_balance: 2, - pending_payments: [{is_outgoing: true, tokens: 3}], - transaction_fee: 1, - }, - { - is_opening: true, - is_partner_initiated: false, - local_balance: 5, - pending_payments: [{is_outgoing: false, tokens: 6}], - }, - { - is_opening: true, - is_partner_initiated: false, - local_balance: 7, - pending_payments: [{is_outgoing: true, tokens: 8}], - transaction_fee: 9, - }, - ], - transactions: [ - { - is_confirmed: false, - is_outgoing: true, - output_addresses: ['change-address'], - }, - ], - utxos: [ - { - address: 'address', - address_format: 'np2wpkh', - confirmation_count: 1, - tokens: 1, - }, - { - address: 'change-address', - address_format: 'p2wpkh', - confirmation_count: 0, - tokens: 2, - }, - { - address: 'address2', - address_format: 'p2wpkh', - confirmation_count: 0, - tokens: 2, - }, - ], - }, - description: 'Balance totals are calculated', - expected: { - closing_balance: 1, - conflicted_pending: 0, - invalid_pending: 0, - offchain_balance: 14, - offchain_pending: 35, - onchain_balance: 4, - onchain_vbytes: 211, - }, - }, - { - args: {channels: [], locked: [], pending: [], transactions: [], utxos: []}, - description: 'Balance totals are calculated when there are no funds', - expected: { - closing_balance: 0, - conflicted_pending: 0, - invalid_pending: 0, - offchain_balance: 0, - offchain_pending: 0, - onchain_balance: 0, - onchain_vbytes: 0, - }, - }, -]; - -tests.forEach(({args, description, error, expected}) => { - return test(description, ({end, equal, strictSame, throws}) => { - if (!!error) { - throws(() => detailedBalances(args), new Error(error)); - - return end(); - } - - const balances = detailedBalances(args); - - strictSame(balances, expected, 'Got expected balances'); - - return end(); - }); -}); diff --git a/test/balances/test_get_detailed_balance.js b/test/balances/test_get_detailed_balance.js deleted file mode 100644 index 3403215..0000000 --- a/test/balances/test_get_detailed_balance.js +++ /dev/null @@ -1,44 +0,0 @@ -const {test} = require('@alexbosworth/tap'); -const {makeLnd} = require('mock-lnd'); - -const method = require('./../../balances/get_detailed_balance'); -const {listChannelsResponse} = require('./../fixtures'); - -const tests = [ - { - args: {}, - description: 'LND is required', - error: [400, 'ExpectedAuthenticatedLndToGetDetailedBalance'], - }, - { - args: {lnd: makeLnd({})}, - description: 'Detailed balance is returned', - expected: '7b226f6666636861696e5f62616c616e6365223a225c75303031625b326d302e30303030303030325c75303031625b32326d222c226f6e636861696e5f636f6e6669726d6564223a225c75303031625b326d302e30303030303030315c75303031625b32326d222c226f6e636861696e5f766279746573223a3134342c227574786f735f636f756e74223a317d', - }, - { - args: { - lnd: makeLnd({ - getChannels: ({}, cbk) => cbk(null, {channels: []}), - getUtxos: ({}, cbk) => cbk(null, {utxos: []}), - }), - }, - description: 'No balance is returned', - expected: '7b7d', - }, -]; - -tests.forEach(({args, description, error, expected}) => { - return test(description, async ({end, equal, rejects}) => { - if (!!error) { - await rejects(method(args), error, 'Got expected error'); - } else { - const res = await method(args); - - const encoded = Buffer.from(JSON.stringify(res)).toString('hex'); - - equal(encoded, expected, 'Got expected result'); - } - - return end(); - }); -});