ln-service 59.5.0 → 59.7.0

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.
Files changed (168) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +93 -9
  3. package/package.json +7 -2
  4. package/.gitattributes +0 -1
  5. package/.tm_properties +0 -1
  6. package/test/autopilotrpc-integration/test_autopilot.js +0 -87
  7. package/test/chainrpc-integration/test_get_block.js +0 -58
  8. package/test/chainrpc-integration/test_get_block_header.js +0 -62
  9. package/test/chainrpc-integration/test_get_height.js +0 -42
  10. package/test/chainrpc-integration/test_subscribe_to_blocks.js +0 -97
  11. package/test/chainrpc-integration/test_subscribe_to_chain_address.js +0 -119
  12. package/test/chainrpc-integration/test_subscribe_to_chain_spend.js +0 -116
  13. package/test/integration/test_add_peer.js +0 -59
  14. package/test/integration/test_cancel_pending_channel.js +0 -46
  15. package/test/integration/test_close_channel.js +0 -60
  16. package/test/integration/test_close_wait_pending.js +0 -121
  17. package/test/integration/test_create_chain_address.js +0 -63
  18. package/test/integration/test_create_invoice.js +0 -49
  19. package/test/integration/test_decode_payment_request.js +0 -75
  20. package/test/integration/test_delete_payment.js +0 -38
  21. package/test/integration/test_delete_payments.js +0 -42
  22. package/test/integration/test_delete_pending_channel.js +0 -202
  23. package/test/integration/test_encrypted_routes.js +0 -162
  24. package/test/integration/test_get_access_ids.js +0 -27
  25. package/test/integration/test_get_backup.js +0 -40
  26. package/test/integration/test_get_backups.js +0 -38
  27. package/test/integration/test_get_chain_balance.js +0 -36
  28. package/test/integration/test_get_chain_fee_estimate.js +0 -63
  29. package/test/integration/test_get_chain_transactions.js +0 -83
  30. package/test/integration/test_get_channel.js +0 -64
  31. package/test/integration/test_get_channel_balance.js +0 -23
  32. package/test/integration/test_get_channels.js +0 -84
  33. package/test/integration/test_get_closed_channels.js +0 -275
  34. package/test/integration/test_get_configuration.js +0 -35
  35. package/test/integration/test_get_failed_payments.js +0 -164
  36. package/test/integration/test_get_fee_rates.js +0 -40
  37. package/test/integration/test_get_forwards.js +0 -144
  38. package/test/integration/test_get_invoice.js +0 -67
  39. package/test/integration/test_get_invoices.js +0 -88
  40. package/test/integration/test_get_methods.js +0 -30
  41. package/test/integration/test_get_network_centrality.js +0 -72
  42. package/test/integration/test_get_network_graph.js +0 -87
  43. package/test/integration/test_get_network_info.js +0 -33
  44. package/test/integration/test_get_node.js +0 -117
  45. package/test/integration/test_get_payments.js +0 -69
  46. package/test/integration/test_get_peers.js +0 -58
  47. package/test/integration/test_get_pending_coop.js +0 -122
  48. package/test/integration/test_get_pending_force.js +0 -172
  49. package/test/integration/test_get_pending_payments.js +0 -86
  50. package/test/integration/test_get_route_to_destination.js +0 -153
  51. package/test/integration/test_get_settlement_status.js +0 -78
  52. package/test/integration/test_get_utxos.js +0 -49
  53. package/test/integration/test_get_wallet_info.js +0 -55
  54. package/test/integration/test_grant_access.js +0 -69
  55. package/test/integration/test_open_channel.js +0 -93
  56. package/test/integration/test_open_channel_max.js +0 -92
  57. package/test/integration/test_open_channels.js +0 -164
  58. package/test/integration/test_open_low_reserve.js +0 -92
  59. package/test/integration/test_open_simplified_taproot.js +0 -174
  60. package/test/integration/test_open_standard_taproot.js +0 -94
  61. package/test/integration/test_pay.js +0 -149
  62. package/test/integration/test_pay_private_invoice.js +0 -120
  63. package/test/integration/test_payment_errors.js +0 -102
  64. package/test/integration/test_propose_channel.js +0 -474
  65. package/test/integration/test_push_funds.js +0 -82
  66. package/test/integration/test_rebalance.js +0 -70
  67. package/test/integration/test_recover_funds_from_channel.js +0 -207
  68. package/test/integration/test_recover_funds_from_channels.js +0 -203
  69. package/test/integration/test_remove_peer.js +0 -52
  70. package/test/integration/test_restrict_macaroon.js +0 -96
  71. package/test/integration/test_revoke_access.js +0 -41
  72. package/test/integration/test_send_message_to_peer.js +0 -91
  73. package/test/integration/test_send_to_chain_address.js +0 -109
  74. package/test/integration/test_send_to_chain_addresses.js +0 -71
  75. package/test/integration/test_sign_message.js +0 -22
  76. package/test/integration/test_stop_daemon.js +0 -33
  77. package/test/integration/test_subscribe_to_backups.js +0 -94
  78. package/test/integration/test_subscribe_to_channels.js +0 -186
  79. package/test/integration/test_subscribe_to_graph.js +0 -176
  80. package/test/integration/test_subscribe_to_invoices.js +0 -147
  81. package/test/integration/test_subscribe_to_messages.js +0 -180
  82. package/test/integration/test_subscribe_to_open_requests.js +0 -167
  83. package/test/integration/test_subscribe_to_peer_messages.js +0 -130
  84. package/test/integration/test_subscribe_to_peers.js +0 -61
  85. package/test/integration/test_subscribe_to_rpc_requests.js +0 -309
  86. package/test/integration/test_subscribe_to_transactions.js +0 -93
  87. package/test/integration/test_trusted_funding.js +0 -302
  88. package/test/integration/test_trusted_open.js +0 -94
  89. package/test/integration/test_update_routing_fees.js +0 -108
  90. package/test/integration/test_verify_access.js +0 -38
  91. package/test/integration/test_verify_backup.js +0 -53
  92. package/test/integration/test_verify_backups.js +0 -54
  93. package/test/integration/test_verify_message.js +0 -24
  94. package/test/invoicesrpc-integration/test_cancel_invoice.js +0 -91
  95. package/test/invoicesrpc-integration/test_create_hinted_invoice.js +0 -95
  96. package/test/invoicesrpc-integration/test_get_sweep_transactions.js +0 -124
  97. package/test/invoicesrpc-integration/test_push_payment.js +0 -92
  98. package/test/invoicesrpc-integration/test_settle_invoice.js +0 -136
  99. package/test/invoicesrpc-integration/test_subscribe_cancel_invoice.js +0 -124
  100. package/test/invoicesrpc-integration/test_subscribe_settle_invoice.js +0 -123
  101. package/test/macros/index.js +0 -19
  102. package/test/macros/setup_channel.js +0 -101
  103. package/test/macros/wait_for_channel.js +0 -99
  104. package/test/macros/wait_for_pending_channel.js +0 -52
  105. package/test/macros/wait_for_route.js +0 -76
  106. package/test/macros/wait_for_termination.js +0 -29
  107. package/test/macros/wait_for_utxo.js +0 -56
  108. package/test/peersrpc-integration/test_add_advertised_feature.js +0 -43
  109. package/test/peersrpc-integration/test_add_external_socket.js +0 -36
  110. package/test/peersrpc-integration/test_remove_advertised_feature.js +0 -37
  111. package/test/peersrpc-integration/test_remove_external_socket.js +0 -34
  112. package/test/peersrpc-integration/test_update_alias.js +0 -33
  113. package/test/peersrpc-integration/test_update_color.js +0 -33
  114. package/test/routerrpc-integration/test_delete_forwarding_reputations.js +0 -101
  115. package/test/routerrpc-integration/test_disable_channel.js +0 -41
  116. package/test/routerrpc-integration/test_get_forwarding_confidence.js +0 -90
  117. package/test/routerrpc-integration/test_get_forwarding_reputations.js +0 -128
  118. package/test/routerrpc-integration/test_get_pathfinding_settings.js +0 -40
  119. package/test/routerrpc-integration/test_get_payment.js +0 -130
  120. package/test/routerrpc-integration/test_get_route_confidence.js +0 -77
  121. package/test/routerrpc-integration/test_get_route_through_hops.js +0 -148
  122. package/test/routerrpc-integration/test_get_routing_fee_estimate.js +0 -76
  123. package/test/routerrpc-integration/test_is_destination_payable.js +0 -53
  124. package/test/routerrpc-integration/test_multipath_payment.js +0 -178
  125. package/test/routerrpc-integration/test_pay_via_payment_details.js +0 -175
  126. package/test/routerrpc-integration/test_pay_via_payment_request.js +0 -151
  127. package/test/routerrpc-integration/test_pay_via_routes.js +0 -224
  128. package/test/routerrpc-integration/test_probe_for_route.js +0 -153
  129. package/test/routerrpc-integration/test_route_from_channels_complex.js +0 -327
  130. package/test/routerrpc-integration/test_route_from_channels_simple.js +0 -151
  131. package/test/routerrpc-integration/test_subscribe_to_forward_requests.js +0 -225
  132. package/test/routerrpc-integration/test_subscribe_to_forwards.js +0 -552
  133. package/test/routerrpc-integration/test_subscribe_to_past_payments.js +0 -81
  134. package/test/routerrpc-integration/test_subscribe_to_payments.js +0 -115
  135. package/test/routerrpc-integration/test_update_pathfinding_settings.js +0 -71
  136. package/test/runner.js +0 -30
  137. package/test/signerrpc-integration/test_begin_group_signing_session.js +0 -505
  138. package/test/signerrpc-integration/test_diffie_hellman_compute_secret.js +0 -37
  139. package/test/signerrpc-integration/test_sign_bytes.js +0 -76
  140. package/test/signerrpc-integration/test_sign_taproot.js +0 -436
  141. package/test/signerrpc-integration/test_sign_transaction.js +0 -35
  142. package/test/signerrpc-integration/test_verify_bytes_signature.js +0 -103
  143. package/test/tower_clientrpc-integration/test_connect_watchtower.js +0 -60
  144. package/test/tower_clientrpc-integration/test_get_connected_watchtowers.js +0 -70
  145. package/test/tower_serverrpc-integration/test_get_tower_server_info.js +0 -34
  146. package/test/versionrpc-integration/test_get_wallet_version.js +0 -38
  147. package/test/walletrpc-integration/test_broadcast_chain_transaction.js +0 -62
  148. package/test/walletrpc-integration/test_create_funded_psbt.js +0 -141
  149. package/test/walletrpc-integration/test_delete_chain_transaction.js +0 -82
  150. package/test/walletrpc-integration/test_fund_psbt.js +0 -489
  151. package/test/walletrpc-integration/test_get_chain_addresses.js +0 -60
  152. package/test/walletrpc-integration/test_get_chain_fee_rate.js +0 -24
  153. package/test/walletrpc-integration/test_get_chain_transaction.js +0 -70
  154. package/test/walletrpc-integration/test_get_locked_utxos.js +0 -67
  155. package/test/walletrpc-integration/test_get_master_public_keys.js +0 -84
  156. package/test/walletrpc-integration/test_get_minimum_relay_fee.js +0 -26
  157. package/test/walletrpc-integration/test_get_pending_sweeps.js +0 -83
  158. package/test/walletrpc-integration/test_get_public_key.js +0 -28
  159. package/test/walletrpc-integration/test_lock_utxo.js +0 -80
  160. package/test/walletrpc-integration/test_partially_sign_psbt.js +0 -224
  161. package/test/walletrpc-integration/test_request_batched_fee_increase.js +0 -60
  162. package/test/walletrpc-integration/test_request_chain_fee_increase.js +0 -63
  163. package/test/walletrpc-integration/test_send_to_chain_output_scripts.js +0 -69
  164. package/test/walletrpc-integration/test_sign_chain_address_message.js +0 -32
  165. package/test/walletrpc-integration/test_sign_psbt.js +0 -108
  166. package/test/walletrpc-integration/test_unlock_utxo.js +0 -72
  167. package/test/walletrpc-integration/test_update_chain_transaction.js +0 -43
  168. package/test/walletrpc-integration/test_verify_chain_address_message.js +0 -60
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # Versions
2
2
 
3
+ ## 59.7.0
4
+
5
+ - `signBytes`: Add `tag` to sign a BIP-340 tagged hash of the bytes with a
6
+ `schnorr` signature
7
+ - `verifyBytesSignature`: Add `tag` to verify a `schnorr` signature over a
8
+ BIP-340 tagged hash of the bytes
9
+
10
+ ## 59.6.0
11
+
12
+ - `payViaRoutes`, `subscribeToPayViaRoutes`: Add support for routes into
13
+ blinded paths: `encrypted_data` on blinded path hops and `path_key` on the
14
+ introduction node hop
15
+ - `probeForRoute`, `subscribeToProbeForRoute`: Add `paths` to probe to blinded
16
+ paths: find a route to a path introduction node and return a route that
17
+ continues into the blinded path
18
+
3
19
  ## 59.5.0
4
20
 
5
21
  - `createSignedRequest`: Add support for signing BLIP39 path payment requests
package/README.md CHANGED
@@ -4576,6 +4576,7 @@ Requires `offchain:write` permission
4576
4576
  fee_mtokens: <Total Fee Millitokens To Pay String>
4577
4577
  hops: [{
4578
4578
  channel: <Standard Format Channel Id String>
4579
+ [encrypted_data]: <Blinded Path Encrypted Data Hex String>
4579
4580
  fee: <Fee Number>
4580
4581
  fee_mtokens: <Fee Millitokens String>
4581
4582
  forward: <Forward Tokens Number>
@@ -4584,6 +4585,7 @@ Requires `offchain:write` permission
4584
4585
  type: <Message Type Number String>
4585
4586
  value: <Message Raw Value Hex Encoded String>
4586
4587
  }]
4588
+ [path_key]: <Blinded Path Key Hex String>
4587
4589
  [public_key]: <Public Key Hex String>
4588
4590
  timeout: <Timeout Block Height Number>
4589
4591
  }]
@@ -4592,19 +4594,21 @@ Requires `offchain:write` permission
4592
4594
  value: <Message Raw Value Hex Encoded String>
4593
4595
  }]
4594
4596
  mtokens: <Total Millitokens To Pay String>
4597
+ [payment]: <Payment Identifier Hex String>
4595
4598
  timeout: <Expiration Block Height Number>
4596
4599
  tokens: <Total Tokens To Pay Number>
4600
+ [total_mtokens]: <Total Millitokens String>
4597
4601
  }]
4598
4602
  }
4599
4603
 
4600
4604
  @returns via cbk or Promise
4601
4605
  {
4606
+ confirmed_at: <Payment Confirmed At ISO 8601 Date String>
4602
4607
  failures: [[
4603
4608
  <Failure Code Number>
4604
4609
  <Failure Code Message String>
4605
4610
  <Failure Code Details Object>
4606
4611
  ]]
4607
- confirmed_at: <Payment Confirmed At ISO 8601 Date String>
4608
4612
  fee: <Fee Paid Tokens Number>
4609
4613
  fee_mtokens: <Fee Paid Millitokens String>
4610
4614
  hops: [{
@@ -4697,10 +4701,12 @@ Requires `offchain:write` permission
4697
4701
 
4698
4702
  Preferred `confidence` is not supported on LND 0.14.5 and below
4699
4703
 
4704
+ `paths` are blinded paths. If using, `destination` is not required.
4705
+
4700
4706
  {
4701
4707
  [cltv_delta]: <Final CLTV Delta Number>
4702
4708
  [confidence]: <Preferred Route Confidence Number Out of One Million Number>
4703
- destination: <Destination Public Key Hex String>
4709
+ [destination]: <Destination Public Key Hex String>
4704
4710
  [features]: [{
4705
4711
  bit: <Feature Bit Number>
4706
4712
  }]
@@ -4722,10 +4728,23 @@ Preferred `confidence` is not supported on LND 0.14.5 and below
4722
4728
  [mtokens]: <Millitokens to Pay String>
4723
4729
  [outgoing_channel]: <Outgoing Channel Id String>
4724
4730
  [path_timeout_ms]: <Time to Spend On A Path Milliseconds Number>
4731
+ [paths]: [{
4732
+ base_fee_mtokens: <Accumulated Base Fee Millitokens String>
4733
+ cltv_delta: <Accumulated CLTV Expiry Delta Number>
4734
+ fee_rate: <Accumulated Fee Rate Millitokens Per Million Number>
4735
+ hops: [{
4736
+ encrypted_data: <Encrypted Recipient Data Hex String>
4737
+ relay_key: <Relaying Node Public Key Hex String>
4738
+ }]
4739
+ [introduction_node]: <Introduction Node Public Key Hex String>
4740
+ key: <First Hop Path Key Public Key Hex String>
4741
+ [max_htlc_mtokens]: <Maximum HTLC Millitokens String>
4742
+ [min_htlc_mtokens]: <Minimum HTLC Millitokens String>
4743
+ }]
4725
4744
  [payment]: <Payment Identifier Hex String>
4726
4745
  [probe_timeout_ms]: <Probe Timeout Milliseconds Number>
4727
4746
  [routes]: [[{
4728
- [base_fee_mtokens]: <Base Routing Fee In Millitokens Number String>
4747
+ [base_fee_mtokens]: <Base Routing Fee In Millitokens String>
4729
4748
  [channel]: <Standard Format Channel Id String>
4730
4749
  [cltv_delta]: <CLTV Blocks Delta Number>
4731
4750
  [fee_rate]: <Fee Rate In Millitokens Per Million Number>
@@ -4743,10 +4762,12 @@ Preferred `confidence` is not supported on LND 0.14.5 and below
4743
4762
  fee_mtokens: <Route Fee Millitokens String>
4744
4763
  hops: [{
4745
4764
  channel: <Standard Format Channel Id String>
4765
+ [encrypted_data]: <Blinded Path Encrypted Data Hex String>
4746
4766
  fee: <Fee Number>
4747
4767
  fee_mtokens: <Fee Millitokens String>
4748
4768
  forward: <Forward Tokens Number>
4749
4769
  forward_mtokens: <Forward Millitokens String>
4770
+ [path_key]: <Blinded Path Key Hex String>
4750
4771
  public_key: <Forward Edge Public Key Hex String>
4751
4772
  timeout: <Timeout Block Height Number>
4752
4773
  }]
@@ -5420,11 +5441,14 @@ Requires `signer:generate` permission
5420
5441
 
5421
5442
  `schnorr` signature type is not supported on LND 0.15.0 and below
5422
5443
 
5444
+ `tag` is not supported on LND 0.17.5 and below and requires `schnorr` type
5445
+
5423
5446
  {
5424
5447
  key_family: <Key Family Number>
5425
5448
  key_index: <Key Index Number>
5426
- lnd: <Authenticated LND gRPC API Object>
5449
+ lnd: <Authenticated LND API Object>
5427
5450
  preimage: <Bytes To Hash and Sign Hex Encoded String>
5451
+ [tag]: <BIP-340 Tagged Hash Tag UTF8 String>
5428
5452
  [type]: <Signature Type String>
5429
5453
  }
5430
5454
 
@@ -5445,6 +5469,16 @@ const {signature} = await signBytes({
5445
5469
  key_index: 0,
5446
5470
  preimage: '00',
5447
5471
  });
5472
+
5473
+ // Get a schnorr signature over a BIP-340 tagged hash of the preimage
5474
+ const tagged = await signBytes({
5475
+ lnd,
5476
+ key_family: 6,
5477
+ key_index: 0,
5478
+ preimage: '00',
5479
+ tag: 'BIP0322-signed-message',
5480
+ type: 'schnorr',
5481
+ });
5448
5482
  ```
5449
5483
 
5450
5484
  ### signChainAddressMessage
@@ -6835,13 +6869,14 @@ Requires `offchain:write` permission
6835
6869
 
6836
6870
  {
6837
6871
  [id]: <Payment Hash Hex String>
6838
- lnd: <Authenticated LND gRPC API Object>
6872
+ lnd: <Authenticated LND API Object>
6839
6873
  [pathfinding_timeout]: <Time to Spend Finding a Route Milliseconds Number>
6840
6874
  routes: [{
6841
6875
  fee: <Total Fee Tokens To Pay Number>
6842
6876
  fee_mtokens: <Total Fee Millitokens To Pay String>
6843
6877
  hops: [{
6844
6878
  channel: <Standard Format Channel Id String>
6879
+ [encrypted_data]: <Blinded Path Encrypted Data Hex String>
6845
6880
  fee: <Fee Number>
6846
6881
  fee_mtokens: <Fee Millitokens String>
6847
6882
  forward: <Forward Tokens Number>
@@ -6850,6 +6885,7 @@ Requires `offchain:write` permission
6850
6885
  type: <Message Type Number String>
6851
6886
  value: <Message Raw Value Hex Encoded String>
6852
6887
  }]
6888
+ [path_key]: <Blinded Path Key Hex String>
6853
6889
  public_key: <Public Key Hex String>
6854
6890
  timeout: <Timeout Block Height Number>
6855
6891
  }]
@@ -6858,8 +6894,10 @@ Requires `offchain:write` permission
6858
6894
  value: <Message Raw Value Hex Encoded String>
6859
6895
  }]
6860
6896
  mtokens: <Total Millitokens To Pay String>
6897
+ [payment]: <Payment Identifier Hex String>
6861
6898
  timeout: <Expiration Block Height Number>
6862
6899
  tokens: <Total Tokens To Pay Number>
6900
+ [total_mtokens]: <Total Millitokens String>
6863
6901
  }]
6864
6902
  }
6865
6903
 
@@ -6876,6 +6914,7 @@ Requires `offchain:write` permission
6876
6914
  <Failure Message String>
6877
6915
  {
6878
6916
  channel: <Standard Format Channel Id String>
6917
+ [index]: <Failure Hop Index Number>
6879
6918
  [mtokens]: <Millitokens String>
6880
6919
  [policy]: {
6881
6920
  base_fee_mtokens: <Base Fee Millitokens String>
@@ -6920,6 +6959,7 @@ Requires `offchain:write` permission
6920
6959
  @event 'routing_failure'
6921
6960
  {
6922
6961
  [channel]: <Standard Format Channel Id String>
6962
+ [height]: <Failure Height Context Number>
6923
6963
  [index]: <Failure Hop Index Number>
6924
6964
  [mtokens]: <Failure Related Millitokens String>
6925
6965
  [policy]: {
@@ -6945,11 +6985,11 @@ Requires `offchain:write` permission
6945
6985
  timeout: <Timeout Block Height Number>
6946
6986
  }]
6947
6987
  mtokens: <Total Millitokens To Pay String>
6988
+ safe_fee: <Payment Forwarding Fee Rounded Up Tokens Number>
6989
+ safe_tokens: <Payment Tokens Rounded Up Number>
6948
6990
  timeout: <Expiration Block Height Number>
6949
6991
  tokens: <Total Tokens To Pay Number>
6950
6992
  }
6951
- safe_fee: <Payment Forwarding Fee Rounded Up Tokens Number>
6952
- safe_tokens: <Payment Tokens Rounded Up Number>
6953
6993
  [timeout_height]: <Failure Related CLTV Timeout Height Number>
6954
6994
  [update]: {
6955
6995
  chain: <Chain Id Hex String>
@@ -6988,6 +7028,8 @@ Requires `offchain:write` permission
6988
7028
  timeout: <Timeout Block Height Number>
6989
7029
  }]
6990
7030
  mtokens: <Total Millitokens To Pay String>
7031
+ safe_fee: <Payment Forwarding Fee Rounded Up Tokens Number>
7032
+ safe_tokens: <Payment Tokens Rounded Up Number>
6991
7033
  timeout: <Expiration Block Height Number>
6992
7034
  tokens: <Total Tokens To Pay Number>
6993
7035
  }
@@ -7195,10 +7237,12 @@ Requires `offchain:write` permission
7195
7237
 
7196
7238
  Preferred `confidence` is not supported on LND 0.14.5 and below
7197
7239
 
7240
+ `paths` are blinded paths. If using, `destination` is not required.
7241
+
7198
7242
  {
7199
7243
  [cltv_delta]: <Final CLTV Delta Number>
7200
7244
  [confidence]: <Preferred Route Confidence Number Out of One Million Number>
7201
- destination: <Destination Public Key Hex String>
7245
+ [destination]: <Destination Public Key Hex String>
7202
7246
  [features]: [{
7203
7247
  bit: <Feature Bit Number>
7204
7248
  }]
@@ -7218,6 +7262,19 @@ Preferred `confidence` is not supported on LND 0.14.5 and below
7218
7262
  [mtokens]: <Millitokens to Probe String>
7219
7263
  [outgoing_channel]: <Outgoing Channel Id String>
7220
7264
  [path_timeout_ms]: <Skip Individual Path Attempt After Milliseconds Number>
7265
+ [paths]: [{
7266
+ base_fee_mtokens: <Accumulated Base Fee Millitokens String>
7267
+ cltv_delta: <Accumulated CLTV Expiry Delta Number>
7268
+ fee_rate: <Accumulated Fee Rate Millitokens Per Million Number>
7269
+ hops: [{
7270
+ encrypted_data: <Encrypted Recipient Data Hex String>
7271
+ relay_key: <Relaying Node Public Key Hex String>
7272
+ }]
7273
+ [introduction_node]: <Introduction Node Public Key Hex String>
7274
+ key: <First Hop Path Key Public Key Hex String>
7275
+ [max_htlc_mtokens]: <Maximum HTLC Millitokens String>
7276
+ [min_htlc_mtokens]: <Minimum HTLC Millitokens String>
7277
+ }]
7221
7278
  [payment]: <Payment Identifier Hex String>
7222
7279
  [probe_timeout_ms]: <Fail Entire Probe After Milliseconds Number>
7223
7280
  [routes]: [[{
@@ -7245,10 +7302,12 @@ Preferred `confidence` is not supported on LND 0.14.5 and below
7245
7302
  fee_mtokens: <Total Fee Millitokens To Pay String>
7246
7303
  hops: [{
7247
7304
  channel: <Standard Format Channel Id String>
7305
+ [encrypted_data]: <Blinded Path Encrypted Data Hex String>
7248
7306
  fee: <Fee Number>
7249
7307
  fee_mtokens: <Fee Millitokens String>
7250
7308
  forward: <Forward Tokens Number>
7251
7309
  forward_mtokens: <Forward Millitokens String>
7310
+ [path_key]: <Blinded Path Key Hex String>
7252
7311
  public_key: <Public Key Hex String>
7253
7312
  timeout: <Timeout Block Height Number>
7254
7313
  }]
@@ -7298,6 +7357,7 @@ Preferred `confidence` is not supported on LND 0.14.5 and below
7298
7357
  @event 'routing_failure'
7299
7358
  {
7300
7359
  [channel]: <Standard Format Channel Id String>
7360
+ index: <Failure Index Number>
7301
7361
  [mtokens]: <Millitokens String>
7302
7362
  [policy]: {
7303
7363
  base_fee_mtokens: <Base Fee Millitokens String>
@@ -7306,8 +7366,10 @@ Preferred `confidence` is not supported on LND 0.14.5 and below
7306
7366
  [is_disabled]: <Channel is Disabled Bool>
7307
7367
  max_htlc_mtokens: <Maximum HLTC Millitokens Value String>
7308
7368
  min_htlc_mtokens: <Minimum HTLC Millitokens Value String>
7369
+ [public_key]: <Public Key Hex String>
7370
+ [updated_at]: <Updated At ISO 8601 Date String>
7309
7371
  }
7310
- public_key: <Public Key Hex String>
7372
+ [public_key]: <Public Key Hex String>
7311
7373
  reason: <Failure Reason String>
7312
7374
  route: {
7313
7375
  [confidence]: <Route Confidence Score Out Of One Million Number>
@@ -8005,11 +8067,14 @@ Requires `signer:read` permission
8005
8067
 
8006
8068
  Validating `schnorr` signatures is unsupported in LND 0.15.0 and below
8007
8069
 
8070
+ `tag` is not supported on LND 0.17.5 and below
8071
+
8008
8072
  {
8009
8073
  lnd: <Authenticated LND API Object>
8010
8074
  preimage: <Message Preimage Bytes Hex Encoded String>
8011
8075
  public_key: <Signature Valid For Public Key Hex String>
8012
8076
  signature: <Signature Hex String>
8077
+ [tag]: <BIP-340 Tagged Hash Tag UTF8 String>
8013
8078
  }
8014
8079
 
8015
8080
  @returns via cbk or Promise
@@ -8034,6 +8099,25 @@ const validity = await verifyBytesSignature({
8034
8099
  signature,
8035
8100
  public_key: (await getIdentity({lnd})).public_key,
8036
8101
  });
8102
+
8103
+ // Sign a BIP-340 tagged hash of the preimage with a schnorr signature
8104
+ const tagged = await signBytes({
8105
+ lnd,
8106
+ preimage,
8107
+ key_family: 6,
8108
+ key_index: 0,
8109
+ tag: 'BIP0322-signed-message',
8110
+ type: 'schnorr',
8111
+ });
8112
+
8113
+ // Verify the tagged hash signature using the x-only public key
8114
+ const taggedValidity = await verifyBytesSignature({
8115
+ lnd,
8116
+ preimage,
8117
+ public_key: (await getIdentity({lnd})).public_key.slice(2),
8118
+ signature: tagged.signature,
8119
+ tag: 'BIP0322-signed-message',
8120
+ });
8037
8121
  ```
8038
8122
 
8039
8123
  ### verifyChainAddressMessage
package/package.json CHANGED
@@ -14,7 +14,7 @@
14
14
  "dependencies": {
15
15
  "bolt07": "2.0.0",
16
16
  "invoices": "6.2.0",
17
- "lightning": "12.3.1",
17
+ "lightning": "12.5.0",
18
18
  "macaroon": "3.0.4"
19
19
  },
20
20
  "description": "Interaction helper for your Lightning Network daemon",
@@ -35,6 +35,11 @@
35
35
  "engines": {
36
36
  "node": ">=22"
37
37
  },
38
+ "files": [
39
+ "CHANGELOG.md",
40
+ "index.js",
41
+ "macaroons"
42
+ ],
38
43
  "keywords": [
39
44
  "bitcoin",
40
45
  "grpc",
@@ -61,5 +66,5 @@
61
66
  "integration-test-0.20.0": "DOCKER_LND_VERSION=v0.20.0-beta npm run test",
62
67
  "test": "echo $DOCKER_LND_VERSION && node test/runner"
63
68
  },
64
- "version": "59.5.0"
69
+ "version": "59.7.0"
65
70
  }
package/.gitattributes DELETED
@@ -1 +0,0 @@
1
- package-lock.json binary
package/.tm_properties DELETED
@@ -1 +0,0 @@
1
- exclude = '{$exclude,node_modules}'
@@ -1,87 +0,0 @@
1
- const {strictEqual} = require('node:assert').strict;
2
- const test = require('node:test');
3
-
4
- const {setupChannel} = require('ln-docker-daemons');
5
- const {spawnLightningCluster} = require('ln-docker-daemons');
6
-
7
- const {addPeer} = require('./../../');
8
- const {getAutopilot} = require('./../../');
9
- const {setAutopilot} = require('./../../');
10
-
11
- const avg = array => array.reduce((a, b) => a + b) / array.length;
12
- const confirmationCount = 6;
13
- const delay = ms => new Promise(resolve => setTimeout(resolve, ms));
14
- const maxScore = 1e8;
15
- const score = 50000000;
16
- const size = 2;
17
-
18
- // Adjusting autopilot should result in changed autopilot status
19
- test(`Autopilot`, async () => {
20
- const {kill, nodes} = await spawnLightningCluster({size});
21
-
22
- const [control, target] = nodes;
23
-
24
- const cluster = {control, target};
25
-
26
- const {lnd} = cluster.control;
27
-
28
- await setupChannel({lnd, generate: control.generate, to: cluster.target});
29
-
30
- strictEqual(
31
- (await getAutopilot({lnd})).is_enabled,
32
- false,
33
- 'Autopilot starts off'
34
- );
35
-
36
- await Promise.all([
37
- cluster.control.generate({count: confirmationCount}),
38
- delay(3000),
39
- setAutopilot({lnd, is_enabled: true}),
40
- ]);
41
-
42
- await addPeer({
43
- lnd,
44
- public_key: cluster.target.id,
45
- socket: cluster.target.socket,
46
- });
47
-
48
- strictEqual(
49
- (await getAutopilot({lnd})).is_enabled,
50
- true,
51
- 'Autopilot turned on'
52
- );
53
-
54
- await setAutopilot({lnd, is_enabled: false});
55
-
56
- strictEqual(
57
- (await getAutopilot({lnd})).is_enabled,
58
- false,
59
- 'Autopilot turned off'
60
- );
61
-
62
- const pubKey = cluster.control.id;
63
-
64
- await setAutopilot({
65
- lnd,
66
- candidate_nodes: [{public_key: pubKey, score}],
67
- is_enabled: true,
68
- });
69
-
70
- const autopilot = await getAutopilot({lnd, node_scores: [pubKey]});
71
-
72
- strictEqual(autopilot.is_enabled, true, 'Autopilot was enable');
73
-
74
- const [node] = autopilot.nodes;
75
-
76
- strictEqual(node.local_preferential_score, maxScore, 'Local score');
77
- strictEqual(node.local_score, score, 'Local score is represented');
78
- strictEqual(node.preferential_score, maxScore, 'Global preferential score');
79
- strictEqual(node.public_key, pubKey, 'Candidate node public key');
80
- strictEqual(node.score, score, 'External score is represented');
81
- strictEqual(node.weighted_local_score, avg([maxScore, score]), 'Weight avg');
82
- strictEqual(node.weighted_score, avg([maxScore, score]), 'Norm Weight avg');
83
-
84
- await kill({});
85
-
86
- return;
87
- });
@@ -1,58 +0,0 @@
1
- const {strictEqual} = require('node:assert').strict;
2
- const test = require('node:test');
3
-
4
- const {idForBlock} = require('@alexbosworth/blockchain');
5
- const {spawnLightningCluster} = require('ln-docker-daemons');
6
-
7
- const {getBlock} = require('./../../');
8
- const {getHeight} = require('./../../');
9
-
10
- // Get height should return height
11
- test(`Get height`, async () => {
12
- const {nodes} = await spawnLightningCluster({});
13
-
14
- const [{chain, generate, kill, lnd}] = nodes;
15
-
16
- const blockchain = await getHeight({lnd});
17
-
18
- const hash = blockchain.current_block_hash;
19
- const height = blockchain.current_block_height;
20
-
21
- // Try getting a block by the hash
22
- try {
23
- const {block} = await getBlock({lnd, id: blockchain.current_block_hash});
24
-
25
- strictEqual(idForBlock({block}).id, hash, 'Got block');
26
- } catch (err) {
27
- const [code, message] = err;
28
-
29
- strictEqual(code, 501, 'Got expected code');
30
- strictEqual(message, 'GetBlockMethodNotSupported', 'Got expected message');
31
-
32
- await kill({});
33
-
34
- return;
35
- }
36
-
37
- // Try getting a block by the height
38
- try {
39
- const {block} = await getBlock({height, lnd});
40
-
41
- strictEqual(idForBlock({block}).id, hash, 'Got block for height');
42
- } catch (err) {
43
- strictEqual(err, null, 'Expected no error');
44
- }
45
-
46
- // Try getting the chain tip block
47
- try {
48
- const {block} = await getBlock({lnd});
49
-
50
- strictEqual(idForBlock({block}).id, hash, 'Got chain tip block');
51
- } catch (err) {
52
- strictEqual(err, null, 'Expected no error');
53
- }
54
-
55
- await kill({});
56
-
57
- return;
58
- });
@@ -1,62 +0,0 @@
1
- const {strictEqual} = require('node:assert').strict;
2
- const test = require('node:test');
3
-
4
- const {spawnLightningCluster} = require('ln-docker-daemons');
5
-
6
- const {getBlockHeader} = require('./../../');
7
- const {getHeight} = require('./../../');
8
-
9
- const headerHexLength = 80 * 2;
10
-
11
- // Get block header should return the block header
12
- test(`Get block header`, async () => {
13
- const {nodes} = await spawnLightningCluster({});
14
-
15
- const [{chain, generate, kill, lnd}] = nodes;
16
-
17
- const blockchain = await getHeight({lnd});
18
-
19
- const hash = blockchain.current_block_hash;
20
- const height = blockchain.current_block_height;
21
-
22
- // Try getting a block header by the hash
23
- try {
24
- const {header} = await getBlockHeader({
25
- lnd,
26
- id: blockchain.current_block_hash,
27
- });
28
-
29
- strictEqual(header.length, headerHexLength, 'Got header');
30
- } catch (err) {
31
- const [code, message] = err;
32
-
33
- strictEqual(code, 501, 'Got expected code');
34
- strictEqual(message, 'GetBlockHeaderMethodNotSupported', 'Got error');
35
-
36
- await kill({});
37
-
38
- return;
39
- }
40
-
41
- // Try getting a block header by the height
42
- try {
43
- const {header} = await getBlockHeader({height, lnd});
44
-
45
- strictEqual(header.length, headerHexLength, 'Got header');
46
- } catch (err) {
47
- strictEqual(err, null, 'Expected no error');
48
- }
49
-
50
- // Try getting the chain tip block header
51
- try {
52
- const {header} = await getBlockHeader({lnd});
53
-
54
- strictEqual(header.length, headerHexLength, 'Got header');
55
- } catch (err) {
56
- strictEqual(err, null, 'Expected no error');
57
- }
58
-
59
- await kill({});
60
-
61
- return;
62
- });
@@ -1,42 +0,0 @@
1
- const {strictEqual} = require('node:assert').strict;
2
- const test = require('node:test');
3
-
4
- const asyncRetry = require('async/retry');
5
- const {spawnLightningCluster} = require('ln-docker-daemons');
6
-
7
- const {getHeight} = require('./../../');
8
-
9
- const confirmationCount = 6;
10
- const interval = 100;
11
- const times = 100;
12
-
13
- // Get height should return height
14
- test(`Get height`, async () => {
15
- const {nodes} = await spawnLightningCluster({});
16
-
17
- const [{chain, generate, kill, lnd}] = nodes;
18
-
19
- const startHeight = (await getHeight({lnd})).current_block_height;
20
-
21
- await asyncRetry({interval, times}, async () => {
22
- await generate({});
23
-
24
- const endHeight = (await getHeight({lnd})).current_block_height;
25
-
26
- if (endHeight - startHeight < confirmationCount) {
27
- throw new Error('ExpectedHeightIncreaseReflected');
28
- }
29
-
30
- strictEqual(
31
- endHeight - startHeight >= confirmationCount,
32
- true,
33
- 'Got height'
34
- );
35
-
36
- return;
37
- });
38
-
39
- await kill({});
40
-
41
- return;
42
- });