Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to LDK 0.1.1 #170

Merged
merged 5 commits into from
Mar 4, 2025
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
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ jobs:
run: |
cd c_sharp
./build-release-nupkg.sh
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: org.ldk.nupkg
path: c_sharp/org.ldk.nupkg
Expand Down Expand Up @@ -456,11 +456,11 @@ jobs:
./genbindings.sh ./ldk-c-bindings/ "-I/usr/lib/jvm/java-17-openjdk-amd64/include/ -I/usr/lib/jvm/java-17-openjdk-amd64/include/linux/" false false
- name: Build deterministic release jar
run: ./build-release-jar.sh
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: ldk-java.jar
path: ldk-java.jar
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: ldk-java-leaktracking.jar
path: ldk-java-leaktracking.jar
Expand Down Expand Up @@ -702,7 +702,7 @@ jobs:
export ANDROID_TOOLCHAIN="$(pwd)/android-ndk-r22b/toolchains/llvm/prebuilt/linux-x86_64"
export PATH="$PATH:$ANDROID_TOOLCHAIN/bin"
./android-build.sh ./rust-lightning ./ldk-c-bindings/ ./ldk-java-bins/android-artifacts
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: LDK-release.aar
path: LDK-release.aar
Expand Down
50 changes: 48 additions & 2 deletions c_sharp/bindings.c
Original file line number Diff line number Diff line change
Expand Up @@ -7153,6 +7153,12 @@ int64_t CS_LDK_LDKPendingHTLCRouting_Forward_get_blinded(int64_t ptr) {
blinded_ref = tag_ptr(blinded_var.inner, false);
return blinded_ref;
}
int64_t CS_LDK_LDKPendingHTLCRouting_Forward_get_incoming_cltv_expiry(int64_t ptr) {
LDKPendingHTLCRouting *obj = (LDKPendingHTLCRouting*)untag_ptr(ptr);
CHECK(obj->tag == LDKPendingHTLCRouting_Forward);
int64_t incoming_cltv_expiry_ref = tag_ptr(&obj->forward.incoming_cltv_expiry, false);
return incoming_cltv_expiry_ref;
}
int64_t CS_LDK_LDKPendingHTLCRouting_Receive_get_payment_data(int64_t ptr) {
LDKPendingHTLCRouting *obj = (LDKPendingHTLCRouting*)untag_ptr(ptr);
CHECK(obj->tag == LDKPendingHTLCRouting_Receive);
Expand Down Expand Up @@ -44632,7 +44638,7 @@ int64_t CS_LDK_PendingHTLCRouting_clone(int64_t orig) {
return ret_ref;
}

int64_t CS_LDK_PendingHTLCRouting_forward(int64_t onion_packet, int64_t short_channel_id, int64_t blinded) {
int64_t CS_LDK_PendingHTLCRouting_forward(int64_t onion_packet, int64_t short_channel_id, int64_t blinded, int64_t incoming_cltv_expiry) {
LDKOnionPacket onion_packet_conv;
onion_packet_conv.inner = untag_ptr(onion_packet);
onion_packet_conv.is_owned = ptr_is_owned(onion_packet);
Expand All @@ -44643,8 +44649,12 @@ int64_t CS_LDK_PendingHTLCRouting_forward(int64_t onion_packet, int64_t short_c
blinded_conv.is_owned = ptr_is_owned(blinded);
CHECK_INNER_FIELD_ACCESS_OR_NULL(blinded_conv);
blinded_conv = BlindedForward_clone(&blinded_conv);
void* incoming_cltv_expiry_ptr = untag_ptr(incoming_cltv_expiry);
CHECK_ACCESS(incoming_cltv_expiry_ptr);
LDKCOption_u32Z incoming_cltv_expiry_conv = *(LDKCOption_u32Z*)(incoming_cltv_expiry_ptr);
incoming_cltv_expiry_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(incoming_cltv_expiry));
LDKPendingHTLCRouting *ret_copy = MALLOC(sizeof(LDKPendingHTLCRouting), "LDKPendingHTLCRouting");
*ret_copy = PendingHTLCRouting_forward(onion_packet_conv, short_channel_id, blinded_conv);
*ret_copy = PendingHTLCRouting_forward(onion_packet_conv, short_channel_id, blinded_conv, incoming_cltv_expiry_conv);
int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
Expand Down Expand Up @@ -45860,6 +45870,33 @@ void CS_LDK_ChannelManager_force_close_all_channels_without_broadcasting_txn(in
ChannelManager_force_close_all_channels_without_broadcasting_txn(&this_arg_conv, error_message_conv);
}

int64_t CS_LDK_ChannelManager_send_payment_with_route(int64_t this_arg, int64_t route, int8_tArray payment_hash, int64_t recipient_onion, int8_tArray payment_id) {
LDKChannelManager this_arg_conv;
this_arg_conv.inner = untag_ptr(this_arg);
this_arg_conv.is_owned = ptr_is_owned(this_arg);
CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
this_arg_conv.is_owned = false;
LDKRoute route_conv;
route_conv.inner = untag_ptr(route);
route_conv.is_owned = ptr_is_owned(route);
CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv);
route_conv = Route_clone(&route_conv);
LDKThirtyTwoBytes payment_hash_ref;
CHECK(payment_hash->arr_len == 32);
memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
LDKRecipientOnionFields recipient_onion_conv;
recipient_onion_conv.inner = untag_ptr(recipient_onion);
recipient_onion_conv.is_owned = ptr_is_owned(recipient_onion);
CHECK_INNER_FIELD_ACCESS_OR_NULL(recipient_onion_conv);
recipient_onion_conv = RecipientOnionFields_clone(&recipient_onion_conv);
LDKThirtyTwoBytes payment_id_ref;
CHECK(payment_id->arr_len == 32);
memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id);
LDKCResult_NoneRetryableSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneRetryableSendFailureZ), "LDKCResult_NoneRetryableSendFailureZ");
*ret_conv = ChannelManager_send_payment_with_route(&this_arg_conv, route_conv, payment_hash_ref, recipient_onion_conv, payment_id_ref);
return tag_ptr(ret_conv, true);
}

int64_t CS_LDK_ChannelManager_send_payment(int64_t this_arg, int8_tArray payment_hash, int64_t recipient_onion, int8_tArray payment_id, int64_t route_params, int64_t retry_strategy) {
LDKChannelManager this_arg_conv;
this_arg_conv.inner = untag_ptr(this_arg);
Expand Down Expand Up @@ -77340,6 +77377,15 @@ int64_t CS_LDK_SpendableOutputDescriptor_create_spendable_outputs_psbt(int64_tA
return tag_ptr(ret_conv, true);
}

int64_t CS_LDK_SpendableOutputDescriptor_spendable_outpoint(int64_t this_arg) {
LDKSpendableOutputDescriptor* this_arg_conv = (LDKSpendableOutputDescriptor*)untag_ptr(this_arg);
LDKOutPoint ret_var = SpendableOutputDescriptor_spendable_outpoint(this_arg_conv);
int64_t ret_ref = 0;
CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
return ret_ref;
}

void CS_LDK_ChannelDerivationParameters_free(int64_t this_obj) {
LDKChannelDerivationParameters this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
Expand Down
50 changes: 48 additions & 2 deletions c_sharp/bindings.c.body
Original file line number Diff line number Diff line change
Expand Up @@ -7149,6 +7149,12 @@ int64_t CS_LDK_LDKPendingHTLCRouting_Forward_get_blinded(int64_t ptr) {
blinded_ref = tag_ptr(blinded_var.inner, false);
return blinded_ref;
}
int64_t CS_LDK_LDKPendingHTLCRouting_Forward_get_incoming_cltv_expiry(int64_t ptr) {
LDKPendingHTLCRouting *obj = (LDKPendingHTLCRouting*)untag_ptr(ptr);
CHECK(obj->tag == LDKPendingHTLCRouting_Forward);
int64_t incoming_cltv_expiry_ref = tag_ptr(&obj->forward.incoming_cltv_expiry, false);
return incoming_cltv_expiry_ref;
}
int64_t CS_LDK_LDKPendingHTLCRouting_Receive_get_payment_data(int64_t ptr) {
LDKPendingHTLCRouting *obj = (LDKPendingHTLCRouting*)untag_ptr(ptr);
CHECK(obj->tag == LDKPendingHTLCRouting_Receive);
Expand Down Expand Up @@ -44628,7 +44634,7 @@ int64_t CS_LDK_PendingHTLCRouting_clone(int64_t orig) {
return ret_ref;
}

int64_t CS_LDK_PendingHTLCRouting_forward(int64_t onion_packet, int64_t short_channel_id, int64_t blinded) {
int64_t CS_LDK_PendingHTLCRouting_forward(int64_t onion_packet, int64_t short_channel_id, int64_t blinded, int64_t incoming_cltv_expiry) {
LDKOnionPacket onion_packet_conv;
onion_packet_conv.inner = untag_ptr(onion_packet);
onion_packet_conv.is_owned = ptr_is_owned(onion_packet);
Expand All @@ -44639,8 +44645,12 @@ int64_t CS_LDK_PendingHTLCRouting_forward(int64_t onion_packet, int64_t short_c
blinded_conv.is_owned = ptr_is_owned(blinded);
CHECK_INNER_FIELD_ACCESS_OR_NULL(blinded_conv);
blinded_conv = BlindedForward_clone(&blinded_conv);
void* incoming_cltv_expiry_ptr = untag_ptr(incoming_cltv_expiry);
CHECK_ACCESS(incoming_cltv_expiry_ptr);
LDKCOption_u32Z incoming_cltv_expiry_conv = *(LDKCOption_u32Z*)(incoming_cltv_expiry_ptr);
incoming_cltv_expiry_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(incoming_cltv_expiry));
LDKPendingHTLCRouting *ret_copy = MALLOC(sizeof(LDKPendingHTLCRouting), "LDKPendingHTLCRouting");
*ret_copy = PendingHTLCRouting_forward(onion_packet_conv, short_channel_id, blinded_conv);
*ret_copy = PendingHTLCRouting_forward(onion_packet_conv, short_channel_id, blinded_conv, incoming_cltv_expiry_conv);
int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
Expand Down Expand Up @@ -45856,6 +45866,33 @@ void CS_LDK_ChannelManager_force_close_all_channels_without_broadcasting_txn(in
ChannelManager_force_close_all_channels_without_broadcasting_txn(&this_arg_conv, error_message_conv);
}

int64_t CS_LDK_ChannelManager_send_payment_with_route(int64_t this_arg, int64_t route, int8_tArray payment_hash, int64_t recipient_onion, int8_tArray payment_id) {
LDKChannelManager this_arg_conv;
this_arg_conv.inner = untag_ptr(this_arg);
this_arg_conv.is_owned = ptr_is_owned(this_arg);
CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
this_arg_conv.is_owned = false;
LDKRoute route_conv;
route_conv.inner = untag_ptr(route);
route_conv.is_owned = ptr_is_owned(route);
CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv);
route_conv = Route_clone(&route_conv);
LDKThirtyTwoBytes payment_hash_ref;
CHECK(payment_hash->arr_len == 32);
memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
LDKRecipientOnionFields recipient_onion_conv;
recipient_onion_conv.inner = untag_ptr(recipient_onion);
recipient_onion_conv.is_owned = ptr_is_owned(recipient_onion);
CHECK_INNER_FIELD_ACCESS_OR_NULL(recipient_onion_conv);
recipient_onion_conv = RecipientOnionFields_clone(&recipient_onion_conv);
LDKThirtyTwoBytes payment_id_ref;
CHECK(payment_id->arr_len == 32);
memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id);
LDKCResult_NoneRetryableSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneRetryableSendFailureZ), "LDKCResult_NoneRetryableSendFailureZ");
*ret_conv = ChannelManager_send_payment_with_route(&this_arg_conv, route_conv, payment_hash_ref, recipient_onion_conv, payment_id_ref);
return tag_ptr(ret_conv, true);
}

int64_t CS_LDK_ChannelManager_send_payment(int64_t this_arg, int8_tArray payment_hash, int64_t recipient_onion, int8_tArray payment_id, int64_t route_params, int64_t retry_strategy) {
LDKChannelManager this_arg_conv;
this_arg_conv.inner = untag_ptr(this_arg);
Expand Down Expand Up @@ -77336,6 +77373,15 @@ int64_t CS_LDK_SpendableOutputDescriptor_create_spendable_outputs_psbt(int64_tA
return tag_ptr(ret_conv, true);
}

int64_t CS_LDK_SpendableOutputDescriptor_spendable_outpoint(int64_t this_arg) {
LDKSpendableOutputDescriptor* this_arg_conv = (LDKSpendableOutputDescriptor*)untag_ptr(this_arg);
LDKOutPoint ret_var = SpendableOutputDescriptor_spendable_outpoint(this_arg_conv);
int64_t ret_ref = 0;
CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
return ret_ref;
}

void CS_LDK_ChannelDerivationParameters_free(int64_t this_obj) {
LDKChannelDerivationParameters this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
Expand Down
9 changes: 7 additions & 2 deletions c_sharp/src/org/ldk/impl/bindings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -978,6 +978,7 @@ public static long[] LDKUtxoLookup_new(LDKUtxoLookup impl) {
[DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKPendingHTLCRouting_Forward_get_onion_packet")] public static extern long LDKPendingHTLCRouting_Forward_get_onion_packet(long ptr);
[DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKPendingHTLCRouting_Forward_get_short_channel_id")] public static extern long LDKPendingHTLCRouting_Forward_get_short_channel_id(long ptr);
[DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKPendingHTLCRouting_Forward_get_blinded")] public static extern long LDKPendingHTLCRouting_Forward_get_blinded(long ptr);
[DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKPendingHTLCRouting_Forward_get_incoming_cltv_expiry")] public static extern long LDKPendingHTLCRouting_Forward_get_incoming_cltv_expiry(long ptr);
[DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKPendingHTLCRouting_Receive_get_payment_data")] public static extern long LDKPendingHTLCRouting_Receive_get_payment_data(long ptr);
[DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKPendingHTLCRouting_Receive_get_payment_metadata")] public static extern long LDKPendingHTLCRouting_Receive_get_payment_metadata(long ptr);
[DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKPendingHTLCRouting_Receive_get_payment_context")] public static extern long LDKPendingHTLCRouting_Receive_get_payment_context(long ptr);
Expand Down Expand Up @@ -8241,8 +8242,8 @@ public static long[] LDKWalletSource_new(LDKWalletSource impl) {
[DllImport ("ldkcsharp", EntryPoint="CS_LDK_PendingHTLCRouting_clone_ptr")] public static extern long PendingHTLCRouting_clone_ptr(long _arg);
// struct LDKPendingHTLCRouting PendingHTLCRouting_clone(const struct LDKPendingHTLCRouting *NONNULL_PTR orig);
[DllImport ("ldkcsharp", EntryPoint="CS_LDK_PendingHTLCRouting_clone")] public static extern long PendingHTLCRouting_clone(long _orig);
// struct LDKPendingHTLCRouting PendingHTLCRouting_forward(struct LDKOnionPacket onion_packet, uint64_t short_channel_id, struct LDKBlindedForward blinded);
[DllImport ("ldkcsharp", EntryPoint="CS_LDK_PendingHTLCRouting_forward")] public static extern long PendingHTLCRouting_forward(long _onion_packet, long _short_channel_id, long _blinded);
// struct LDKPendingHTLCRouting PendingHTLCRouting_forward(struct LDKOnionPacket onion_packet, uint64_t short_channel_id, struct LDKBlindedForward blinded, struct LDKCOption_u32Z incoming_cltv_expiry);
[DllImport ("ldkcsharp", EntryPoint="CS_LDK_PendingHTLCRouting_forward")] public static extern long PendingHTLCRouting_forward(long _onion_packet, long _short_channel_id, long _blinded, long _incoming_cltv_expiry);
// struct LDKPendingHTLCRouting PendingHTLCRouting_receive(struct LDKFinalOnionHopData payment_data, struct LDKCOption_CVec_u8ZZ payment_metadata, struct LDKCOption_PaymentContextZ payment_context, uint32_t incoming_cltv_expiry, struct LDKThirtyTwoBytes phantom_shared_secret, struct LDKCVec_C2Tuple_u64CVec_u8ZZZ custom_tlvs, bool requires_blinded_error);
[DllImport ("ldkcsharp", EntryPoint="CS_LDK_PendingHTLCRouting_receive")] public static extern long PendingHTLCRouting_receive(long _payment_data, long _payment_metadata, long _payment_context, int _incoming_cltv_expiry, long _phantom_shared_secret, long _custom_tlvs, bool _requires_blinded_error);
// struct LDKPendingHTLCRouting PendingHTLCRouting_receive_keysend(struct LDKFinalOnionHopData payment_data, struct LDKThirtyTwoBytes payment_preimage, struct LDKCOption_CVec_u8ZZ payment_metadata, uint32_t incoming_cltv_expiry, struct LDKCVec_C2Tuple_u64CVec_u8ZZZ custom_tlvs, bool requires_blinded_error, bool has_recipient_created_payment_secret);
Expand Down Expand Up @@ -8413,6 +8414,8 @@ public static long[] LDKWalletSource_new(LDKWalletSource impl) {
[DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_force_close_all_channels_broadcasting_latest_txn")] public static extern void ChannelManager_force_close_all_channels_broadcasting_latest_txn(long _this_arg, long _error_message);
// void ChannelManager_force_close_all_channels_without_broadcasting_txn(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKStr error_message);
[DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_force_close_all_channels_without_broadcasting_txn")] public static extern void ChannelManager_force_close_all_channels_without_broadcasting_txn(long _this_arg, long _error_message);
// MUST_USE_RES struct LDKCResult_NoneRetryableSendFailureZ ChannelManager_send_payment_with_route(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKRoute route, struct LDKThirtyTwoBytes payment_hash, struct LDKRecipientOnionFields recipient_onion, struct LDKThirtyTwoBytes payment_id);
[DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_send_payment_with_route")] public static extern long ChannelManager_send_payment_with_route(long _this_arg, long _route, long _payment_hash, long _recipient_onion, long _payment_id);
// MUST_USE_RES struct LDKCResult_NoneRetryableSendFailureZ ChannelManager_send_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_hash, struct LDKRecipientOnionFields recipient_onion, struct LDKThirtyTwoBytes payment_id, struct LDKRouteParameters route_params, struct LDKRetry retry_strategy);
[DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_send_payment")] public static extern long ChannelManager_send_payment(long _this_arg, long _payment_hash, long _recipient_onion, long _payment_id, long _route_params, long _retry_strategy);
// MUST_USE_RES struct LDKCResult_NoneBolt12PaymentErrorZ ChannelManager_send_payment_for_bolt12_invoice(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKBolt12Invoice *NONNULL_PTR invoice, struct LDKCOption_OffersContextZ context);
Expand Down Expand Up @@ -13423,6 +13426,8 @@ public static long[] LDKWalletSource_new(LDKWalletSource impl) {
[DllImport ("ldkcsharp", EntryPoint="CS_LDK_SpendableOutputDescriptor_read")] public static extern long SpendableOutputDescriptor_read(long _ser);
// MUST_USE_RES struct LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ SpendableOutputDescriptor_create_spendable_outputs_psbt(struct LDKCVec_SpendableOutputDescriptorZ descriptors, struct LDKCVec_TxOutZ outputs, struct LDKCVec_u8Z change_destination_script, uint32_t feerate_sat_per_1000_weight, struct LDKCOption_u32Z locktime);
[DllImport ("ldkcsharp", EntryPoint="CS_LDK_SpendableOutputDescriptor_create_spendable_outputs_psbt")] public static extern long SpendableOutputDescriptor_create_spendable_outputs_psbt(long _descriptors, long _outputs, long _change_destination_script, int _feerate_sat_per_1000_weight, long _locktime);
// MUST_USE_RES struct LDKOutPoint SpendableOutputDescriptor_spendable_outpoint(const struct LDKSpendableOutputDescriptor *NONNULL_PTR this_arg);
[DllImport ("ldkcsharp", EntryPoint="CS_LDK_SpendableOutputDescriptor_spendable_outpoint")] public static extern long SpendableOutputDescriptor_spendable_outpoint(long _this_arg);
// void ChannelDerivationParameters_free(struct LDKChannelDerivationParameters this_obj);
[DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDerivationParameters_free")] public static extern void ChannelDerivationParameters_free(long _this_obj);
// uint64_t ChannelDerivationParameters_get_value_satoshis(const struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr);
Expand Down
21 changes: 20 additions & 1 deletion c_sharp/src/org/ldk/structs/ChannelManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1115,6 +1115,24 @@ public void force_close_all_channels_without_broadcasting_txn(string error_messa
GC.KeepAlive(error_message);
}

/**
* Sends a payment along a given route. See [`Self::send_payment`] for more info.
*
* LDK will not automatically retry this payment, though it may be manually re-sent after an
* [`Event::PaymentFailed`] is generated.
*/
public Result_NoneRetryableSendFailureZ send_payment_with_route(org.ldk.structs.Route route, byte[] payment_hash, org.ldk.structs.RecipientOnionFields recipient_onion, byte[] payment_id) {
long ret = bindings.ChannelManager_send_payment_with_route(this.ptr, route.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_hash, 32)), recipient_onion.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_id, 32)));
GC.KeepAlive(this);
GC.KeepAlive(route);
GC.KeepAlive(payment_hash);
GC.KeepAlive(recipient_onion);
GC.KeepAlive(payment_id);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NoneRetryableSendFailureZ ret_hu_conv = Result_NoneRetryableSendFailureZ.constr_from_ptr(ret);
return ret_hu_conv;
}

/**
* Sends a payment to the route found using the provided [`RouteParameters`], retrying failed
* payment paths based on the provided `Retry`.
Expand Down Expand Up @@ -1142,7 +1160,8 @@ public void force_close_all_channels_without_broadcasting_txn(string error_messa
* [`ChannelManager::list_recent_payments`] for more information.
*
* Routes are automatically found using the [`Router] provided on startup. To fix a route for a
* particular payment, match the [`PaymentId`] passed to [`Router::find_route_with_id`].
* particular payment, use [`Self::send_payment_with_route`] or match the [`PaymentId`] passed to
* [`Router::find_route_with_id`].
*
* [`Event::PaymentSent`]: events::Event::PaymentSent
* [`Event::PaymentFailed`]: events::Event::PaymentFailed
Expand Down
Loading
Loading