lightning 10.27.3 → 10.27.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1 -1
- package/lnd_methods/onchain/fund_psbt.js +7 -9
- package/package.json +5 -7
- /package/{test → test-typescript}/typescript/add_external_socket.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/add_peer.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/attempt_route.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/authenticated_lightning_method.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/authenticated_lnd_grpc.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/begin_group_signing_session.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/broadcast_chain_transaction.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/cancel_hodl_invoice.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/cancel_pending_channel.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/change_password.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/close_channel.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/confirmed_from_payment.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/connect_watchtower.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/create_chain_address.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/create_hodl_invoice.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/create_invoice.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/create_seed.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/create_wallet.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/decode_payment_request.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/delete_failed_pay_attempts.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/delete_failed_payments.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/delete_forwarding_reputations.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/delete_payment.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/delete_payments.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/delete_pending_channel.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/diffie_hellman_compute_secret.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/disable_channel.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/disconnect_watchtower.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/emit_payment.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/enable_channel.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/end_group_signing_session.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/failure_from_payment.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/finished_payment.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/fund_pending_channels.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/fund_psbt.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/get_access_ids.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/get_autopilot.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/get_backup.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/get_backups.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/get_block.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/get_block_header.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/get_chain_addresses.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/get_chain_balance.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/get_chain_fee_estimate.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/get_chain_fee_rate.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/get_chain_transactions.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/get_channel.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/get_channel_balance.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/get_channels.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/get_closed_channels.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/get_connected_watchtowers.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/get_failed_payments.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/get_fee_rates.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/get_forwarding_confidence.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/get_forwarding_reputations.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/get_forwards.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/get_height.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/get_identity.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/get_invoice.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/get_invoices.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/get_locked_utxos.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/get_master_public_keys.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/get_methods.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/get_network_centrality.ts +0 -0
- /package/{test → test-typescript}/typescript/get_network_graph.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/get_network_info.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/get_node.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/get_pathfinding_settings.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/get_payment.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/get_payments.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/get_peers.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/get_pending_chain_balance.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/get_pending_channels.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/get_pending_payments.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/get_public_key.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/get_route_confidence.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/get_route_through_hops.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/get_route_to_destination.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/get_settlement_status.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/get_sweep_transactions.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/get_tower_server_info.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/get_utxos.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/get_wallet_info.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/get_wallet_status.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/get_wallet_version.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/grant_access.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/is_destination_payable.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/lock_utxo.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/open_channel.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/open_channels.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/partially_sign_psbt.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/pay.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/pay_via_payment_details.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/pay_via_payment_request.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/pay_via_routes.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/prepare_for_channel_proposal.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/probe_for_route.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/propose_channel.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/recover_funds_from_channel.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/recover_funds_from_channels.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/remove_external_socket.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/remove_peer.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/request_chain_fee_increase.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/revoke_access.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/route_failure_keys.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/script_from_chain_address.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/send_message_to_peer.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/send_to_chain_address.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/send_to_chain_addresses.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/send_to_chain_output_scripts.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/set_autopilot.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/settle_hodl_invoice.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/sign_bytes.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/sign_chain_address_message.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/sign_message.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/sign_psbt.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/sign_transaction.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/stop_daemon.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/subscribe_to_backups.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/subscribe_to_blocks.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/subscribe_to_chain_address.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/subscribe_to_chain_spend.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/subscribe_to_channels.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/subscribe_to_forward_requests.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/subscribe_to_forwards.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/subscribe_to_graph.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/subscribe_to_invoice.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/subscribe_to_invoices.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/subscribe_to_open_requests.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/subscribe_to_past_payment.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/subscribe_to_past_payments.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/subscribe_to_pay.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/subscribe_to_pay_via_details.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/subscribe_to_pay_via_request.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/subscribe_to_pay_via_routes.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/subscribe_to_peer_messages.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/subscribe_to_peers.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/subscribe_to_probe_for_route.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/subscribe_to_rpc_requests.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/subscribe_to_transactions.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/subscribe_to_wallet_status.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/unauthenticated_lnd_grpc.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/unlock_utxo.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/unlock_wallet.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/update_alias.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/update_chain_transaction.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/update_color.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/update_connected_watchtower.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/update_group_signing_session.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/update_pathfinding_settings.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/update_routing_fees.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/verify_access.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/verify_backup.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/verify_backups.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/verify_bytes_signature.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/verify_chain_address_message.test-d.ts +0 -0
- /package/{test → test-typescript}/typescript/verify_message.test-d.ts +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
const asyncAuto = require('async/auto');
|
|
2
|
-
const {decodePsbt} = require('psbt');
|
|
3
2
|
const {returnResult} = require('asyncjs-util');
|
|
4
|
-
const
|
|
3
|
+
const {Psbt} = require('bitcoinjs-lib');
|
|
5
4
|
const {Transaction} = require('bitcoinjs-lib');
|
|
6
5
|
|
|
7
6
|
const {isLnd} = require('./../../lnd_requests');
|
|
@@ -10,13 +9,14 @@ const asOutpoint = n => `${n.transaction_id}:${n.transaction_vout}`;
|
|
|
10
9
|
const defaultChangeType = () => 'CHANGE_ADDRESS_TYPE_P2TR';
|
|
11
10
|
const defaultConfirmationTarget = 6;
|
|
12
11
|
const expirationAsDate = epoch => new Date(Number(epoch) * 1e3).toISOString();
|
|
13
|
-
const {
|
|
12
|
+
const {fromBuffer} = Transaction;
|
|
14
13
|
const hexFromBuffer = buffer => buffer.toString('hex');
|
|
15
14
|
const {isArray} = Array;
|
|
16
15
|
const {isBuffer} = Buffer;
|
|
17
16
|
const isKnownChangeFormat = format => !format || format === 'p2tr';
|
|
18
17
|
const method = 'fundPsbt';
|
|
19
18
|
const notSupported = /unknown.*walletrpc.WalletKit/;
|
|
19
|
+
const psbtFromHex = hex => Psbt.fromBuffer(Buffer.from(hex, 'hex'));
|
|
20
20
|
const strategy = type => !type ? undefined : `STRATEGY_${type.toUpperCase()}`;
|
|
21
21
|
const type = 'wallet';
|
|
22
22
|
const txIdFromBuffer = buffer => buffer.slice().reverse().toString('hex');
|
|
@@ -79,9 +79,6 @@ const txIdFromHash = hash => hash.reverse().toString('hex');
|
|
|
79
79
|
module.exports = (args, cbk) => {
|
|
80
80
|
return new Promise((resolve, reject) => {
|
|
81
81
|
return asyncAuto({
|
|
82
|
-
// Import ECPair library
|
|
83
|
-
ecp: async () => (await import('ecpair')).ECPairFactory(tinysecp),
|
|
84
|
-
|
|
85
82
|
// Check arguments
|
|
86
83
|
validate: cbk => {
|
|
87
84
|
if (!isKnownChangeFormat(args.change_format)) {
|
|
@@ -222,14 +219,15 @@ module.exports = (args, cbk) => {
|
|
|
222
219
|
}],
|
|
223
220
|
|
|
224
221
|
// Derive the raw transaction from the funded PSBT
|
|
225
|
-
tx: ['
|
|
222
|
+
tx: ['fund', ({fund}, cbk) => {
|
|
226
223
|
const {psbt} = fund;
|
|
227
224
|
|
|
228
225
|
try {
|
|
229
|
-
const tx =
|
|
226
|
+
const tx = psbtFromHex(psbt).data.globalMap.unsignedTx.toBuffer();
|
|
230
227
|
|
|
231
|
-
return cbk(null, tx);
|
|
228
|
+
return cbk(null, fromBuffer(tx));
|
|
232
229
|
} catch (err) {
|
|
230
|
+
|
|
233
231
|
return cbk([503, 'FailedToDecodePsbtInFundPsbtResponse', {err}]);
|
|
234
232
|
}
|
|
235
233
|
}],
|
package/package.json
CHANGED
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
"url": "https://github.com/alexbosworth/lightning/issues"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@grpc/grpc-js": "1.14.
|
|
10
|
+
"@grpc/grpc-js": "1.14.3",
|
|
11
11
|
"@grpc/proto-loader": "0.8.0",
|
|
12
|
-
"@types/node": "
|
|
12
|
+
"@types/node": "25.0.0",
|
|
13
13
|
"@types/request": "2.48.13",
|
|
14
14
|
"@types/ws": "8.18.1",
|
|
15
15
|
"async": "3.2.6",
|
|
@@ -18,11 +18,9 @@
|
|
|
18
18
|
"bn.js": "5.2.2",
|
|
19
19
|
"bolt07": "1.9.4",
|
|
20
20
|
"bolt09": "2.2.0",
|
|
21
|
-
"ecpair": "3.0.0",
|
|
22
21
|
"invoices": "4.0.0",
|
|
23
22
|
"psbt": "4.0.0",
|
|
24
|
-
"
|
|
25
|
-
"type-fest": "5.2.0"
|
|
23
|
+
"type-fest": "5.3.1"
|
|
26
24
|
},
|
|
27
25
|
"description": "Lightning Network client library",
|
|
28
26
|
"devDependencies": {
|
|
@@ -50,8 +48,8 @@
|
|
|
50
48
|
"unit-tests": "node --test && npm run test:types"
|
|
51
49
|
},
|
|
52
50
|
"tsd": {
|
|
53
|
-
"directory": "test/typescript"
|
|
51
|
+
"directory": "test-typescript/typescript"
|
|
54
52
|
},
|
|
55
53
|
"types": "index.d.ts",
|
|
56
|
-
"version": "10.27.
|
|
54
|
+
"version": "10.27.4"
|
|
57
55
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|