ln-service
Advanced tools
Comparing version 56.4.0 to 56.5.0
# Versions | ||
## 56.5.0 | ||
- `getWalletInfo`: Add support for LND 0.16.3 | ||
## 56.4.0 | ||
@@ -4,0 +8,0 @@ |
@@ -14,3 +14,3 @@ { | ||
"invoices": "2.2.3", | ||
"lightning": "9.4.0", | ||
"lightning": "9.5.0", | ||
"macaroon": "3.0.4", | ||
@@ -22,3 +22,3 @@ "morgan": "1.10.0", | ||
"devDependencies": { | ||
"@alexbosworth/blockchain": "1.3.0", | ||
"@alexbosworth/blockchain": "1.4.0", | ||
"@alexbosworth/tap": "15.0.12", | ||
@@ -30,7 +30,7 @@ "@alexbosworth/node-fetch": "2.6.2", | ||
"bip66": "1.1.5", | ||
"bitcoinjs-lib": "6.1.0", | ||
"bitcoinjs-lib": "6.1.2", | ||
"bn.js": "5.2.1", | ||
"bs58check": "3.0.1", | ||
"ecpair": "2.1.0", | ||
"ln-docker-daemons": "5.0.4", | ||
"ln-docker-daemons": "5.0.5", | ||
"p2tr": "1.3.3", | ||
@@ -41,3 +41,3 @@ "portfinder": "1.0.32", | ||
"secp256k1": "5.0.0", | ||
"tiny-secp256k1": "2.2.1", | ||
"tiny-secp256k1": "2.2.2", | ||
"uuid": "9.0.0", | ||
@@ -64,2 +64,3 @@ "varuint-bitcoin": "1.1.2" | ||
"scripts": { | ||
"integration-test-0.16.3": "DOCKER_LND_VERSION=v0.16.3-beta npm run test", | ||
"integration-test-0.16.2": "DOCKER_LND_VERSION=v0.16.2-beta npm run test", | ||
@@ -76,3 +77,3 @@ "integration-test-0.16.1": "DOCKER_LND_VERSION=v0.16.1-beta npm run test", | ||
}, | ||
"version": "56.4.0" | ||
"version": "56.5.0" | ||
} |
@@ -5,2 +5,3 @@ const {once} = require('events'); | ||
const asyncRetry = require('async/retry'); | ||
const asyncTimeout = require('async/timeout'); | ||
const {extractTransaction} = require('psbt'); | ||
@@ -67,7 +68,9 @@ const {spawnLightningCluster} = require('ln-docker-daemons'); | ||
// Propose a channel to target | ||
const proposeToTarget = await asyncRetry({interval, times}, async () => { | ||
return await race([ | ||
delay(timeout), | ||
openChannels({channels, lnd, is_avoiding_broadcast: true}), | ||
]); | ||
const proposeToTarget = await asyncRetry({interval, times}, cbk => { | ||
return asyncTimeout(openChannels, 1000 * 10)({ | ||
channels, | ||
lnd, | ||
is_avoiding_broadcast: true, | ||
}, | ||
cbk); | ||
}); | ||
@@ -98,10 +101,9 @@ | ||
// Propose a channel to remote | ||
const proposeToRemote = await asyncRetry({interval, times}, async () => { | ||
return await race([ | ||
delay(timeout), | ||
openChannels({lnd, | ||
channels: [{capacity, partner_public_key: remote.id}], | ||
is_avoiding_broadcast: true, | ||
}), | ||
]); | ||
const proposeToRemote = await asyncRetry({interval, times}, cbk => { | ||
return asyncTimeout(openChannels, 1000 * 10)({ | ||
lnd, | ||
channels: [{capacity, partner_public_key: remote.id}], | ||
is_avoiding_broadcast: true, | ||
}, | ||
cbk); | ||
}); | ||
@@ -108,0 +110,0 @@ |
const asyncRetry = require('async/retry'); | ||
const {address} = require('bitcoinjs-lib'); | ||
const {spawnLightningCluster} = require('ln-docker-daemons'); | ||
@@ -4,0 +3,0 @@ const {test} = require('@alexbosworth/tap'); |
const asyncRetry = require('async/retry'); | ||
const {Transaction} = require('bitcoinjs-lib'); | ||
@@ -13,5 +12,4 @@ const {getUtxos} = require('./../../'); | ||
[confirmations]: <Confirmations Count Number> | ||
[id]: <Transaction Id Hex String> | ||
id: <Transaction Id Hex String> | ||
lnd: <Authenticated LND gRPC API Object> | ||
[transaction]: <Raw Transaction Hex String> | ||
} | ||
@@ -30,3 +28,3 @@ | ||
*/ | ||
module.exports = ({confirmations, id, lnd, transaction}, cbk) => { | ||
module.exports = ({confirmations, id, lnd}, cbk) => { | ||
if (!lnd || !lnd.default) { | ||
@@ -36,8 +34,6 @@ return cbk([400, 'ExpectedAuthenticatedLndToWaitForUtxo']); | ||
if (!transaction && !id) { | ||
if (!id) { | ||
return cbk([400, 'ExpectedTransactionOrIdToWaitForUtxo']); | ||
} | ||
const txId = id || Transaction.fromHex(transaction).getId(); | ||
return asyncRetry({interval, times}, cbk => { | ||
@@ -49,3 +45,3 @@ return getUtxos({lnd}, (err, res) => { | ||
const utxo = res.utxos.find(n => n.transaction_id === txId); | ||
const utxo = res.utxos.find(n => n.transaction_id === id); | ||
@@ -52,0 +48,0 @@ if (!utxo) { |
@@ -8,3 +8,3 @@ const asyncRetry = require('async/retry'); | ||
const {networks} = require('bitcoinjs-lib'); | ||
const {script} = require('bitcoinjs-lib'); | ||
const {scriptElementsAsScript} = require('@alexbosworth/blockchain'); | ||
const {spawnLightningCluster} = require('ln-docker-daemons'); | ||
@@ -25,3 +25,3 @@ const {test} = require('@alexbosworth/tap'); | ||
const {compile} = script; | ||
const compile = elements => scriptElementsAsScript({elements}).script; | ||
const count = 100; | ||
@@ -194,3 +194,3 @@ const defaultInternalKey = '0350929b74c1a04954b78b4b6035e97a5e078a5a0f28ec96d547bfee9ace803ac0'; | ||
const branches = [{script: witnessScript.toString('hex')}]; | ||
const branches = [{script: witnessScript}]; | ||
@@ -335,3 +335,3 @@ const {hash} = hashForTree({branches}); | ||
const branches = [{script: witnessScript.toString('hex')}]; | ||
const branches = [{script: witnessScript}]; | ||
@@ -383,3 +383,3 @@ const {hash} = hashForTree({branches}); | ||
Transaction.SIGHASH_DEFAULT, | ||
hexAsBuffer(leafHash({script: witnessScript.toString('hex')}).hash), | ||
hexAsBuffer(leafHash({script: witnessScript}).hash), | ||
); | ||
@@ -412,3 +412,3 @@ }); | ||
external_key: output.external_key, | ||
leaf_script: witnessScript.toString('hex'), | ||
leaf_script: witnessScript, | ||
script_branches: branches, | ||
@@ -421,3 +421,3 @@ }); | ||
hexAsBuffer(signature), | ||
witnessScript, | ||
hexAsBuffer(witnessScript), | ||
hexAsBuffer(block), | ||
@@ -424,0 +424,0 @@ ]); |
@@ -8,2 +8,3 @@ const asyncRetry = require('async/retry'); | ||
const {script} = require('bitcoinjs-lib'); | ||
const {scriptElementsAsScript} = require('@alexbosworth/blockchain'); | ||
const {spawnLightningCluster} = require('ln-docker-daemons'); | ||
@@ -24,3 +25,3 @@ const {test} = require('@alexbosworth/tap'); | ||
const {compile} = script; | ||
const compile = elements => scriptElementsAsScript({elements}).script; | ||
const count = 100; | ||
@@ -98,3 +99,3 @@ const defaultInternalKey = '0350929b74c1a04954b78b4b6035e97a5e078a5a0f28ec96d547bfee9ace803ac0'; | ||
const branches = [{script: witnessScript.toString('hex')}]; | ||
const branches = [{script: witnessScript}]; | ||
@@ -150,3 +151,3 @@ const {hash} = hashForTree({branches}); | ||
vin: 0, | ||
witness_script: witnessScript.toString('hex'), | ||
witness_script: witnessScript, | ||
}], | ||
@@ -160,3 +161,3 @@ transaction: tx.toHex(), | ||
external_key: output.external_key, | ||
leaf_script: witnessScript.toString('hex'), | ||
leaf_script: witnessScript, | ||
script_branches: branches, | ||
@@ -169,3 +170,3 @@ }); | ||
signature, | ||
witnessScript, | ||
hexAsBuffer(witnessScript), | ||
hexAsBuffer(block), | ||
@@ -202,3 +203,3 @@ ]); | ||
const branches = [{script: witnessScript.toString('hex')}]; | ||
const branches = [{script: witnessScript}]; | ||
@@ -205,0 +206,0 @@ const {hash} = hashForTree({branches}); |
@@ -11,3 +11,3 @@ const asyncRetry = require('async/retry'); | ||
const {privateAdd} = require('tiny-secp256k1'); | ||
const {script} = require('bitcoinjs-lib'); | ||
const {scriptElementsAsScript} = require('@alexbosworth/blockchain'); | ||
const {signHash} = require('p2tr'); | ||
@@ -31,3 +31,3 @@ const {signSchnorr} = require('tiny-secp256k1'); | ||
const chainAddressRowType = 'chain_address'; | ||
const {compile} = script; | ||
const compile = elements => scriptElementsAsScript({elements}).script; | ||
const confirmationCount = 6; | ||
@@ -140,3 +140,3 @@ const count = 100; | ||
const branches = [{script: witnessScript.toString('hex')}]; | ||
const branches = [{script: witnessScript}]; | ||
@@ -237,3 +237,3 @@ const {hash} = hashForTree({branches}); | ||
const branches = [{script: witnessScript.toString('hex')}]; | ||
const branches = [{script: witnessScript}]; | ||
@@ -285,3 +285,3 @@ const {hash} = hashForTree({branches}); | ||
Transaction.SIGHASH_DEFAULT, | ||
hexAsBuffer(leafHash({script: witnessScript.toString('hex')}).hash), | ||
hexAsBuffer(leafHash({script: witnessScript}).hash), | ||
); | ||
@@ -294,3 +294,3 @@ }); | ||
external_key: output.external_key, | ||
leaf_script: witnessScript.toString('hex'), | ||
leaf_script: witnessScript, | ||
script_branches: branches, | ||
@@ -303,3 +303,3 @@ }); | ||
signature, | ||
witnessScript, | ||
hexAsBuffer(witnessScript), | ||
hexAsBuffer(block), | ||
@@ -306,0 +306,0 @@ ]); |
const asyncRetry = require('async/retry'); | ||
const {componentsOfTransaction} = require('@alexbosworth/blockchain'); | ||
const {script} = require('bitcoinjs-lib'); | ||
const {scriptElementsAsScript} = require('@alexbosworth/blockchain'); | ||
const {spawnLightningCluster} = require('ln-docker-daemons'); | ||
@@ -12,3 +12,2 @@ const {test} = require('@alexbosworth/tap'); | ||
const asHex = buffer => buffer.toString('hex'); | ||
const {compile} = script; | ||
const confirmationCount = 6; | ||
@@ -30,6 +29,8 @@ const count = 100; | ||
const script = [].concat(OP_RETURN).concat(asBuf(target.id)); | ||
const elements = [].concat(OP_RETURN).concat(asBuf(target.id)); | ||
const sendTo = [{tokens, script: asHex(compile(script))}]; | ||
const {script} = scriptElementsAsScript({elements}); | ||
const sendTo = [{script, tokens}]; | ||
const sent = await sendToChainOutputScripts({lnd, send_to: sendTo}); | ||
@@ -36,0 +37,0 @@ |
const asyncRetry = require('async/retry'); | ||
const {componentsOfTransaction} = require('@alexbosworth/blockchain'); | ||
const {decodePsbt} = require('psbt'); | ||
@@ -6,3 +7,2 @@ const {spawnLightningCluster} = require('ln-docker-daemons'); | ||
const tinysecp = require('tiny-secp256k1'); | ||
const {Transaction} = require('bitcoinjs-lib'); | ||
@@ -74,3 +74,3 @@ const {broadcastChainTransaction} = require('./../../'); | ||
const tx = Transaction.fromHex(finalized.transaction); | ||
const tx = componentsOfTransaction({transaction: finalized.transaction}); | ||
@@ -77,0 +77,0 @@ const decoded = decodePsbt({ecp, psbt: finalized.psbt}); |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
783012
13355
+ Added@grpc/grpc-js@1.8.15(transitive)
+ Added@noble/hashes@1.6.1(transitive)
+ Added@types/node@20.2.5(transitive)
+ Addedbase-x@4.0.0(transitive)
+ Addedbitcoinjs-lib@6.1.2(transitive)
+ Addedbs58@5.0.0(transitive)
+ Addedbs58check@3.0.1(transitive)
+ Addedlightning@9.5.0(transitive)
+ Addedtiny-secp256k1@2.2.2(transitive)
+ Addedtype-fest@3.11.1(transitive)
- Removed@grpc/grpc-js@1.8.14(transitive)
- Removed@types/node@20.2.3(transitive)
- Removedlightning@9.4.0(transitive)
- Removedtype-fest@3.11.0(transitive)
Updatedlightning@9.5.0