Skip to content
Merged
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
66 changes: 64 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,20 @@ jobs:
git clone https://github.com/lightningdevkit/rust-lightning
cd rust-lightning
git checkout origin/0.1-bindings
cargo update -p syn --precise "2.0.106" --verbose
cargo update -p quote --precise "1.0.41" --verbose
cd ..
git clone https://github.com/lightningdevkit/ldk-c-bindings
cd ldk-c-bindings
git checkout 0.1
cd lightning-c-bindings
cargo update -p syn --precise "2.0.106" --verbose
cargo update -p quote --precise "1.0.41" --verbose
- name: Pin proc-macro and quote to meet MSRV
run: |
cd ldk-c-bindings/c-bindings-gen
cargo update -p quote --precise "1.0.30" --verbose
cargo update -p proc-macro2 --precise "1.0.65" --verbose
- name: Rebuild C bindings without STD
run: |
cd ldk-c-bindings
Expand Down Expand Up @@ -137,10 +147,20 @@ jobs:
git clone https://github.com/lightningdevkit/rust-lightning
cd rust-lightning
git checkout origin/0.1-bindings
cargo update -p syn --precise "2.0.106" --verbose
cargo update -p quote --precise "1.0.41" --verbose
cd ..
git clone https://github.com/lightningdevkit/ldk-c-bindings
cd ldk-c-bindings
git checkout 0.1
cd lightning-c-bindings
cargo update -p syn --precise "2.0.106" --verbose
cargo update -p quote --precise "1.0.41" --verbose
- name: Pin proc-macro and quote to meet MSRV
run: |
cd ldk-c-bindings/c-bindings-gen
cargo update -p quote --precise "1.0.30" --verbose
cargo update -p proc-macro2 --precise "1.0.65" --verbose
- name: Rebuild C bindings with STD
run: |
cd ldk-c-bindings
Expand Down Expand Up @@ -172,7 +192,11 @@ jobs:
fetch-depth: 0
- name: Install cbindgen
run: |
cargo install cbindgen
git clone https://github.com/eqrion/cbindgen
cd cbindgen/
git checkout v0.20.0
cargo update -p indexmap --precise "1.6.2" --verbose
cargo install --locked --path .
- name: Checkout Rust-Lightning and LDK-C-Bindings git
run: |
git config --global safe.directory '*'
Expand All @@ -182,10 +206,15 @@ jobs:
git clone https://github.com/lightningdevkit/rust-lightning
cd rust-lightning
git checkout origin/0.1-bindings
cargo update -p syn --precise "2.0.106" --verbose
cargo update -p quote --precise "1.0.41" --verbose
cd ..
git clone https://github.com/lightningdevkit/ldk-c-bindings
cd ldk-c-bindings
git checkout 0.1
cd lightning-c-bindings
cargo update -p syn --precise "2.0.106" --verbose
cargo update -p quote --precise "1.0.41" --verbose
- name: Fetch MacOS SDK
run: |
curl -o Xcode-12.2-12B45b-extracted-SDK-with-libcxx-headers.tar.gz https://bitcoincore.org/depends-sources/sdks/Xcode-12.2-12B45b-extracted-SDK-with-libcxx-headers.tar.gz
Expand Down Expand Up @@ -233,7 +262,10 @@ jobs:
cd ldk-c-bindings
git clean -f -x -d
git reset --hard
cd ..
cd lightning-c-bindings
cargo update -p syn --precise "2.0.106" --verbose
cargo update -p quote --precise "1.0.41" --verbose
cd ../..
export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(git describe --tag HEAD)"
export ANDROID_TOOLCHAIN="$(pwd)/android-ndk-r27c/toolchains/llvm/prebuilt/linux-x86_64"
export PATH="$PATH:$ANDROID_TOOLCHAIN/bin"
Expand Down Expand Up @@ -363,10 +395,15 @@ jobs:
git clone https://github.com/lightningdevkit/rust-lightning
cd rust-lightning
git checkout origin/0.1-bindings
cargo update -p syn --precise "2.0.106" --verbose
cargo update -p quote --precise "1.0.41" --verbose
cd ..
git clone https://github.com/lightningdevkit/ldk-c-bindings
cd ldk-c-bindings
git checkout 0.1
cd lightning-c-bindings
cargo update -p syn --precise "2.0.106" --verbose
cargo update -p quote --precise "1.0.41" --verbose
- name: Pin proc-macro and quote to meet MSRV
run: |
cd ldk-c-bindings/c-bindings-gen
Expand Down Expand Up @@ -424,10 +461,15 @@ jobs:
git clone https://github.com/lightningdevkit/rust-lightning
cd rust-lightning
git checkout origin/0.1-bindings
cargo update -p syn --precise "2.0.106" --verbose
cargo update -p quote --precise "1.0.41" --verbose
cd ..
git clone https://github.com/lightningdevkit/ldk-c-bindings
cd ldk-c-bindings
git checkout 0.1
cd lightning-c-bindings
cargo update -p syn --precise "2.0.106" --verbose
cargo update -p quote --precise "1.0.41" --verbose
- name: Pin proc-macro and quote to meet MSRV
run: |
cd ldk-c-bindings/c-bindings-gen
Expand Down Expand Up @@ -551,10 +593,20 @@ jobs:
git clone https://github.com/lightningdevkit/rust-lightning
cd rust-lightning
git checkout origin/0.1-bindings
cargo update -p syn --precise "2.0.106" --verbose
cargo update -p quote --precise "1.0.41" --verbose
cd ..
git clone https://github.com/lightningdevkit/ldk-c-bindings
cd ldk-c-bindings
git checkout 0.1
cd lightning-c-bindings
cargo update -p syn --precise "2.0.106" --verbose
cargo update -p quote --precise "1.0.41" --verbose
- name: Pin proc-macro and quote to meet MSRV
run: |
cd ldk-c-bindings/c-bindings-gen
cargo update -p quote --precise "1.0.30" --verbose
cargo update -p proc-macro2 --precise "1.0.65" --verbose
- name: Fetch MacOS SDK
run: |
curl -o Xcode-12.2-12B45b-extracted-SDK-with-libcxx-headers.tar.gz https://bitcoincore.org/depends-sources/sdks/Xcode-12.2-12B45b-extracted-SDK-with-libcxx-headers.tar.gz
Expand Down Expand Up @@ -683,10 +735,20 @@ jobs:
git clone https://github.com/lightningdevkit/rust-lightning
cd rust-lightning
git checkout origin/0.1-bindings
cargo update -p syn --precise "2.0.106" --verbose
cargo update -p quote --precise "1.0.41" --verbose
cd ..
git clone https://github.com/lightningdevkit/ldk-c-bindings
cd ldk-c-bindings
git checkout 0.1
cd lightning-c-bindings
cargo update -p syn --precise "2.0.106" --verbose
cargo update -p quote --precise "1.0.41" --verbose
- name: Pin proc-macro and quote to meet MSRV
run: |
cd ldk-c-bindings/c-bindings-gen
cargo update -p quote --precise "1.0.30" --verbose
cargo update -p proc-macro2 --precise "1.0.65" --verbose
- name: Checkout Android AAR binaries and artifacts
run: |
# Gitweb only allows snapshots of folders by providing the object hash, which we have to extract:
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
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
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
3 changes: 2 additions & 1 deletion src/main/java/org/ldk/structs/Event.java
Original file line number Diff line number Diff line change
Expand Up @@ -1438,7 +1438,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 +1448,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
Loading
Loading