Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
238 changes: 236 additions & 2 deletions .github/workflows/build.yml

Large diffs are not rendered by default.

608 changes: 304 additions & 304 deletions c_sharp/bindings.c

Large diffs are not rendered by default.

608 changes: 304 additions & 304 deletions c_sharp/bindings.c.body

Large diffs are not rendered by default.

9 changes: 6 additions & 3 deletions c_sharp/src/org/ldk/structs/Bolt11Invoice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,10 @@ public org.ldk.structs.Bolt11InvoiceFeatures features() {
}

/**
* Recover the payee's public key (only to be used if none was included in the invoice)
* Get the invoice's payee public key.
*
* This uses the explicitly included payee public key, if present, otherwise it recovers the
* payee public key from the signature. Prefer [`Self::get_payee_pub_key`] for clarity.
*/
public byte[] recover_payee_pub_key() {
long ret = bindings.Bolt11Invoice_recover_payee_pub_key(this.ptr);
Expand All @@ -225,8 +228,8 @@ public byte[] recover_payee_pub_key() {
}

/**
* Recover the payee's public key if one was included in the invoice, otherwise return the
* recovered public key from the signature
* Get the invoice's payee public key, preferring an explicitly included payee public key and
* falling back to recovering the key from the signature.
*/
public byte[] get_payee_pub_key() {
long ret = bindings.Bolt11Invoice_get_payee_pub_key(this.ptr);
Expand Down
19 changes: 13 additions & 6 deletions c_sharp/src/org/ldk/structs/ChannelManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,7 @@ namespace org { namespace ldk { namespace structs {
* [`get_event_or_persistence_needed_future`]: Self::get_event_or_persistence_needed_future
* [`lightning-block-sync`]: https://docs.rs/lightning_block_sync/latest/lightning_block_sync
* [`lightning-transaction-sync`]: https://docs.rs/lightning_transaction_sync/latest/lightning_transaction_sync
* [`lightning-background-processor`]: https://docs.rs/lightning_background_processor/lightning_background_processor
* [`lightning-background-processor`]: https://docs.rs/lightning-background-processor/latest/lightning_background_processor
* [`list_channels`]: Self::list_channels
* [`list_usable_channels`]: Self::list_usable_channels
* [`create_channel`]: Self::create_channel
Expand Down Expand Up @@ -1014,7 +1014,7 @@ public org.ldk.structs.Result_NoneAPIErrorZ close_channel(org.ldk.structs.Channe
*
* The `shutdown_script` provided will be used as the `scriptPubKey` for the closing transaction.
* Will fail if a shutdown script has already been set for this channel by
* ['ChannelHandshakeConfig::commit_upfront_shutdown_pubkey`]. The given shutdown script must
* [`ChannelHandshakeConfig::commit_upfront_shutdown_pubkey`]. The given shutdown script must
* also be compatible with our and the counterparty's features.
*
* May generate a [`SendShutdown`] message event on success, which should be relayed.
Expand All @@ -1026,6 +1026,7 @@ public org.ldk.structs.Result_NoneAPIErrorZ close_channel(org.ldk.structs.Channe
*
* [`ChannelConfig::force_close_avoidance_max_fee_satoshis`]: crate::util::config::ChannelConfig::force_close_avoidance_max_fee_satoshis
* [`NonAnchorChannelFee`]: crate::chain::chaininterface::ConfirmationTarget::NonAnchorChannelFee
* [`ChannelHandshakeConfig::commit_upfront_shutdown_pubkey`]: crate::util::config::ChannelHandshakeConfig::commit_upfront_shutdown_pubkey
* [`SendShutdown`]: crate::events::MessageSendEvent::SendShutdown
*
* Note that shutdown_script (or a relevant inner pointer) may be NULL or all-0s to represent None
Expand Down Expand Up @@ -2011,7 +2012,7 @@ public org.ldk.structs.Result_Bolt12InvoiceBolt12SemanticErrorZ request_refund_p

/**
* Pays for an [`Offer`] looked up using [BIP 353] Human Readable Names resolved by the DNS
* resolver(s) at `dns_resolvers` which resolve names according to bLIP 32.
* resolver(s) at `dns_resolvers` which resolve names according to [bLIP 32].
*
* If the wallet supports paying on-chain schemes, you should instead use
* [`OMNameResolver::resolve_name`] and [`OMNameResolver::handle_dnssec_proof_for_uri`] (by
Expand All @@ -2029,27 +2030,33 @@ public org.ldk.structs.Result_Bolt12InvoiceBolt12SemanticErrorZ request_refund_p
*
* To revoke the request, use [`ChannelManager::abandon_payment`] prior to receiving the
* invoice. If abandoned, or an invoice isn't received in a reasonable amount of time, the
* payment will fail with an [`Event::InvoiceRequestFailed`].
* payment will fail with an [`PaymentFailureReason::UserAbandoned`] or
* [`PaymentFailureReason::InvoiceRequestExpired`], respectively.
*
* # Privacy
*
* For payer privacy, uses a derived payer id and uses [`MessageRouter::create_blinded_paths`]
* to construct a [`BlindedPath`] for the reply path. For further privacy implications, see the
* to construct a [`BlindedMessagePath`] for the reply path. For further privacy implications, see the
* docs of the parameterized [`Router`], which implements [`MessageRouter`].
*
* # Limitations
*
* Requires a direct connection to the given [`Destination`] as well as an introduction node in
* [`Offer::paths`] or to [`Offer::signing_pubkey`], if empty. A similar restriction applies to
* [`Offer::paths`] or to [`Offer::issuer_signing_pubkey`], if empty. A similar restriction applies to
* the responding [`Bolt12Invoice::payment_paths`].
*
* # Errors
*
* Errors if:
* - a duplicate `payment_id` is provided given the caveats in the aforementioned link,
*
* [BIP 353]: https://github.com/bitcoin/bips/blob/master/bip-0353.mediawiki
* [bLIP 32]: https://github.com/lightning/blips/blob/master/blip-0032.md
* [`Bolt12Invoice::payment_paths`]: crate::offers::invoice::Bolt12Invoice::payment_paths
* [Avoiding Duplicate Payments]: #avoiding-duplicate-payments
* [`BlindedMessagePath`]: crate::blinded_path::message::BlindedMessagePath
* [`PaymentFailureReason::UserAbandoned`]: crate::events::PaymentFailureReason::UserAbandoned
* [`PaymentFailureReason::InvoiceRequestRejected`]: crate::events::PaymentFailureReason::InvoiceRequestRejected
*/
public org.ldk.structs.Result_NoneNoneZ pay_for_offer_from_human_readable_name(org.ldk.structs.HumanReadableName name, long amount_msats, byte[] payment_id, org.ldk.structs.Retry retry_strategy, org.ldk.structs.Option_u64Z max_total_routing_fee_msat, Destination[] dns_resolvers) {
long ret = bindings.ChannelManager_pay_for_offer_from_human_readable_name(this.ptr, name.ptr, amount_msats, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_id, 32)), retry_strategy.ptr, max_total_routing_fee_msat.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(dns_resolvers, dns_resolvers_conv_13 => dns_resolvers_conv_13.ptr)));
Expand Down
3 changes: 2 additions & 1 deletion c_sharp/src/org/ldk/structs/Event.cs
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,8 @@ public class Event_PaymentSent : Event {
* If the recipient or an intermediate node misbehaves and gives us free money, this may
* overstate the amount paid, though this is unlikely.
*
* This is only `None` for payments initiated on LDK versions prior to 0.0.103.
* This is only `None` for payments abandoned but ultimately claimed when using LDK versions
* prior to 0.3, 0.2.3, or 0.1.10.
*
* [`Route::get_total_fees`]: crate::routing::router::Route::get_total_fees
*/
Expand Down
2 changes: 2 additions & 0 deletions c_sharp/src/org/ldk/structs/PeerManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,8 @@ public org.ldk.structs.Result_boolPeerHandleErrorZ read_event(org.ldk.structs.So
* [`send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
* [`ChannelManager::process_pending_htlc_forwards`]: crate::ln::channelmanager::ChannelManager::process_pending_htlc_forwards
* [`send_data`]: SocketDescriptor::send_data
* [`lightning-net-tokio`]: https://docs.rs/lightning-net-tokio/latest/lightning_net_tokio
* [`lightning-background-processor`]: https://docs.rs/lightning-background-processor/latest/lightning_background_processor
*/
public void process_events() {
bindings.PeerManager_process_events(this.ptr);
Expand Down
12 changes: 12 additions & 0 deletions c_sharp/src/org/ldk/structs/RapidGossipSync.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ public static org.ldk.structs.RapidGossipSync of(org.ldk.structs.NetworkGraph ne
* Sync gossip data from a file.
* Returns the last sync timestamp to be used the next time rapid sync data is queried.
*
* You should consider the gossip data source as semi-trusted. It is generally the case that it
* can DoS the client either by omitting data which leads to pathfinding failure or by bloating
* the graph such that it leads to eventual OOM on the client.
*
* `network_graph`: The network graph to apply the updates to
*
* `sync_path`: Path to the file where the gossip update data is located
Expand All @@ -55,6 +59,10 @@ public org.ldk.structs.Result_u32GraphSyncErrorZ sync_network_graph_with_file_pa
* Update network graph from binary data.
* Returns the last sync timestamp to be used the next time rapid sync data is queried.
*
* You should consider the gossip data source as semi-trusted. It is generally the case that it
* can DoS the client either by omitting data which leads to pathfinding failure or by bloating
* the graph such that it leads to eventual OOM on the client.
*
* `update_data`: `&[u8]` binary stream that comprises the update data
*/
public org.ldk.structs.Result_u32GraphSyncErrorZ update_network_graph(byte[] update_data) {
Expand All @@ -70,6 +78,10 @@ public org.ldk.structs.Result_u32GraphSyncErrorZ update_network_graph(byte[] upd
* Update network graph from binary data.
* Returns the last sync timestamp to be used the next time rapid sync data is queried.
*
* You should consider the gossip data source as semi-trusted. It is generally the case that it
* can DoS the client either by omitting data which leads to pathfinding failure or by bloating
* the graph such that it leads to eventual OOM on the client.
*
* `update_data`: `&[u8]` binary stream that comprises the update data
* `current_time_unix`: `Option<u64>` optional current timestamp to verify data age
*/
Expand Down
2 changes: 1 addition & 1 deletion c_sharp/src/org/ldk/structs/UtilMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public static org.ldk.util.UInt128 U128_new(byte[] le_bytes) {
}

/**
* Constructs a new COption_NoneZ containing a
* Constructs a new COption_NoneZ containing a
*/
public static COption_NoneZ COption_NoneZ_some() {
COption_NoneZ ret = bindings.COption_NoneZ_some();
Expand Down
9 changes: 6 additions & 3 deletions src/main/java/org/ldk/structs/Bolt11Invoice.java
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,10 @@ public Bolt11InvoiceFeatures features() {
}

/**
* Recover the payee's public key (only to be used if none was included in the invoice)
* Get the invoice's payee public key.
*
* This uses the explicitly included payee public key, if present, otherwise it recovers the
* payee public key from the signature. Prefer [`Self::get_payee_pub_key`] for clarity.
*/
public byte[] recover_payee_pub_key() {
byte[] ret = bindings.Bolt11Invoice_recover_payee_pub_key(this.ptr);
Expand All @@ -222,8 +225,8 @@ public byte[] recover_payee_pub_key() {
}

/**
* Recover the payee's public key if one was included in the invoice, otherwise return the
* recovered public key from the signature
* Get the invoice's payee public key, preferring an explicitly included payee public key and
* falling back to recovering the key from the signature.
*/
public byte[] get_payee_pub_key() {
byte[] ret = bindings.Bolt11Invoice_get_payee_pub_key(this.ptr);
Expand Down
19 changes: 13 additions & 6 deletions src/main/java/org/ldk/structs/ChannelManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,7 @@
* [`get_event_or_persistence_needed_future`]: Self::get_event_or_persistence_needed_future
* [`lightning-block-sync`]: https://docs.rs/lightning_block_sync/latest/lightning_block_sync
* [`lightning-transaction-sync`]: https://docs.rs/lightning_transaction_sync/latest/lightning_transaction_sync
* [`lightning-background-processor`]: https://docs.rs/lightning_background_processor/lightning_background_processor
* [`lightning-background-processor`]: https://docs.rs/lightning-background-processor/latest/lightning_background_processor
* [`list_channels`]: Self::list_channels
* [`list_usable_channels`]: Self::list_usable_channels
* [`create_channel`]: Self::create_channel
Expand Down Expand Up @@ -1011,7 +1011,7 @@ public Result_NoneAPIErrorZ close_channel(org.ldk.structs.ChannelId channel_id,
*
* The `shutdown_script` provided will be used as the `scriptPubKey` for the closing transaction.
* Will fail if a shutdown script has already been set for this channel by
* ['ChannelHandshakeConfig::commit_upfront_shutdown_pubkey`]. The given shutdown script must
* [`ChannelHandshakeConfig::commit_upfront_shutdown_pubkey`]. The given shutdown script must
* also be compatible with our and the counterparty's features.
*
* May generate a [`SendShutdown`] message event on success, which should be relayed.
Expand All @@ -1023,6 +1023,7 @@ public Result_NoneAPIErrorZ close_channel(org.ldk.structs.ChannelId channel_id,
*
* [`ChannelConfig::force_close_avoidance_max_fee_satoshis`]: crate::util::config::ChannelConfig::force_close_avoidance_max_fee_satoshis
* [`NonAnchorChannelFee`]: crate::chain::chaininterface::ConfirmationTarget::NonAnchorChannelFee
* [`ChannelHandshakeConfig::commit_upfront_shutdown_pubkey`]: crate::util::config::ChannelHandshakeConfig::commit_upfront_shutdown_pubkey
* [`SendShutdown`]: crate::events::MessageSendEvent::SendShutdown
*
* Note that shutdown_script (or a relevant inner pointer) may be NULL or all-0s to represent None
Expand Down Expand Up @@ -2006,7 +2007,7 @@ public Result_Bolt12InvoiceBolt12SemanticErrorZ request_refund_payment(org.ldk.s

/**
* Pays for an [`Offer`] looked up using [BIP 353] Human Readable Names resolved by the DNS
* resolver(s) at `dns_resolvers` which resolve names according to bLIP 32.
* resolver(s) at `dns_resolvers` which resolve names according to [bLIP 32].
*
* If the wallet supports paying on-chain schemes, you should instead use
* [`OMNameResolver::resolve_name`] and [`OMNameResolver::handle_dnssec_proof_for_uri`] (by
Expand All @@ -2024,27 +2025,33 @@ public Result_Bolt12InvoiceBolt12SemanticErrorZ request_refund_payment(org.ldk.s
*
* To revoke the request, use [`ChannelManager::abandon_payment`] prior to receiving the
* invoice. If abandoned, or an invoice isn't received in a reasonable amount of time, the
* payment will fail with an [`Event::InvoiceRequestFailed`].
* payment will fail with an [`PaymentFailureReason::UserAbandoned`] or
* [`PaymentFailureReason::InvoiceRequestExpired`], respectively.
*
* # Privacy
*
* For payer privacy, uses a derived payer id and uses [`MessageRouter::create_blinded_paths`]
* to construct a [`BlindedPath`] for the reply path. For further privacy implications, see the
* to construct a [`BlindedMessagePath`] for the reply path. For further privacy implications, see the
* docs of the parameterized [`Router`], which implements [`MessageRouter`].
*
* # Limitations
*
* Requires a direct connection to the given [`Destination`] as well as an introduction node in
* [`Offer::paths`] or to [`Offer::signing_pubkey`], if empty. A similar restriction applies to
* [`Offer::paths`] or to [`Offer::issuer_signing_pubkey`], if empty. A similar restriction applies to
* the responding [`Bolt12Invoice::payment_paths`].
*
* # Errors
*
* Errors if:
* - a duplicate `payment_id` is provided given the caveats in the aforementioned link,
*
* [BIP 353]: https://github.com/bitcoin/bips/blob/master/bip-0353.mediawiki
* [bLIP 32]: https://github.com/lightning/blips/blob/master/blip-0032.md
* [`Bolt12Invoice::payment_paths`]: crate::offers::invoice::Bolt12Invoice::payment_paths
* [Avoiding Duplicate Payments]: #avoiding-duplicate-payments
* [`BlindedMessagePath`]: crate::blinded_path::message::BlindedMessagePath
* [`PaymentFailureReason::UserAbandoned`]: crate::events::PaymentFailureReason::UserAbandoned
* [`PaymentFailureReason::InvoiceRequestRejected`]: crate::events::PaymentFailureReason::InvoiceRequestRejected
*/
public Result_NoneNoneZ pay_for_offer_from_human_readable_name(org.ldk.structs.HumanReadableName name, long amount_msats, byte[] payment_id, org.ldk.structs.Retry retry_strategy, org.ldk.structs.Option_u64Z max_total_routing_fee_msat, Destination[] dns_resolvers) {
long ret = bindings.ChannelManager_pay_for_offer_from_human_readable_name(this.ptr, name.ptr, amount_msats, InternalUtils.check_arr_len(payment_id, 32), retry_strategy.ptr, max_total_routing_fee_msat.ptr, dns_resolvers != null ? Arrays.stream(dns_resolvers).mapToLong(dns_resolvers_conv_13 -> dns_resolvers_conv_13.ptr).toArray() : null);
Expand Down
6 changes: 4 additions & 2 deletions src/main/java/org/ldk/structs/Event.java
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,8 @@ public final static class PaymentSent extends Event {
* If the recipient or an intermediate node misbehaves and gives us free money, this may
* overstate the amount paid, though this is unlikely.
*
* This is only `None` for payments initiated on LDK versions prior to 0.0.103.
* This is only `None` for payments abandoned but ultimately claimed when using LDK versions
* prior to 0.3, 0.2.3, or 0.1.10.
*
* [`Route::get_total_fees`]: crate::routing::router::Route::get_total_fees
*/
Expand Down Expand Up @@ -1438,7 +1439,7 @@ private DiscardFunding(long ptr, bindings.LDKEvent.DiscardFunding obj) {
* To accept the request (and in the case of a dual-funded channel, not contribute funds),
* call [`ChannelManager::accept_inbound_channel`].
* To reject the request, call [`ChannelManager::force_close_without_broadcasting_txn`].
* Note that a ['ChannelClosed`] event will _not_ be triggered if the channel is rejected.
* Note that a [`ChannelClosed`] event will _not_ be triggered if the channel is rejected.
*
* The event is only triggered when a new open channel request is received and the
* [`UserConfig::manually_accept_inbound_channels`] config flag is set to true.
Expand All @@ -1448,6 +1449,7 @@ private DiscardFunding(long ptr, bindings.LDKEvent.DiscardFunding obj) {
* returning `Err(ReplayEvent ())`) and won't be persisted across restarts.
*
* [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
* [`ChannelClosed`]: Event::ChannelClosed
* [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
* [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
*/
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/org/ldk/structs/PeerManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,8 @@ public Result_boolPeerHandleErrorZ read_event(org.ldk.structs.SocketDescriptor p
* [`send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
* [`ChannelManager::process_pending_htlc_forwards`]: crate::ln::channelmanager::ChannelManager::process_pending_htlc_forwards
* [`send_data`]: SocketDescriptor::send_data
* [`lightning-net-tokio`]: https://docs.rs/lightning-net-tokio/latest/lightning_net_tokio
* [`lightning-background-processor`]: https://docs.rs/lightning-background-processor/latest/lightning_background_processor
*/
public void process_events() {
bindings.PeerManager_process_events(this.ptr);
Expand Down
12 changes: 12 additions & 0 deletions src/main/java/org/ldk/structs/RapidGossipSync.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ public static RapidGossipSync of(org.ldk.structs.NetworkGraph network_graph, org
* Sync gossip data from a file.
* Returns the last sync timestamp to be used the next time rapid sync data is queried.
*
* You should consider the gossip data source as semi-trusted. It is generally the case that it
* can DoS the client either by omitting data which leads to pathfinding failure or by bloating
* the graph such that it leads to eventual OOM on the client.
*
* `network_graph`: The network graph to apply the updates to
*
* `sync_path`: Path to the file where the gossip update data is located
Expand All @@ -60,6 +64,10 @@ public Result_u32GraphSyncErrorZ sync_network_graph_with_file_path(java.lang.Str
* Update network graph from binary data.
* Returns the last sync timestamp to be used the next time rapid sync data is queried.
*
* You should consider the gossip data source as semi-trusted. It is generally the case that it
* can DoS the client either by omitting data which leads to pathfinding failure or by bloating
* the graph such that it leads to eventual OOM on the client.
*
* `update_data`: `&[u8]` binary stream that comprises the update data
*/
public Result_u32GraphSyncErrorZ update_network_graph(byte[] update_data) {
Expand All @@ -75,6 +83,10 @@ public Result_u32GraphSyncErrorZ update_network_graph(byte[] update_data) {
* Update network graph from binary data.
* Returns the last sync timestamp to be used the next time rapid sync data is queried.
*
* You should consider the gossip data source as semi-trusted. It is generally the case that it
* can DoS the client either by omitting data which leads to pathfinding failure or by bloating
* the graph such that it leads to eventual OOM on the client.
*
* `update_data`: `&[u8]` binary stream that comprises the update data
* `current_time_unix`: `Option<u64>` optional current timestamp to verify data age
*/
Expand Down
Loading
Loading