Skip to content

Commit 22d8b9b

Browse files
authored
Merge pull request #170 from TheBlueMatt/main
Update to LDK 0.1.1
2 parents 36c0c41 + 8dc15bd commit 22d8b9b

25 files changed

+489
-49
lines changed

.github/workflows/build.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ jobs:
222222
run: |
223223
cd c_sharp
224224
./build-release-nupkg.sh
225-
- uses: actions/upload-artifact@v3
225+
- uses: actions/upload-artifact@v4
226226
with:
227227
name: org.ldk.nupkg
228228
path: c_sharp/org.ldk.nupkg
@@ -456,11 +456,11 @@ jobs:
456456
./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
457457
- name: Build deterministic release jar
458458
run: ./build-release-jar.sh
459-
- uses: actions/upload-artifact@v3
459+
- uses: actions/upload-artifact@v4
460460
with:
461461
name: ldk-java.jar
462462
path: ldk-java.jar
463-
- uses: actions/upload-artifact@v3
463+
- uses: actions/upload-artifact@v4
464464
with:
465465
name: ldk-java-leaktracking.jar
466466
path: ldk-java-leaktracking.jar
@@ -702,7 +702,7 @@ jobs:
702702
export ANDROID_TOOLCHAIN="$(pwd)/android-ndk-r22b/toolchains/llvm/prebuilt/linux-x86_64"
703703
export PATH="$PATH:$ANDROID_TOOLCHAIN/bin"
704704
./android-build.sh ./rust-lightning ./ldk-c-bindings/ ./ldk-java-bins/android-artifacts
705-
- uses: actions/upload-artifact@v3
705+
- uses: actions/upload-artifact@v4
706706
with:
707707
name: LDK-release.aar
708708
path: LDK-release.aar

c_sharp/bindings.c

+48-2
Original file line numberDiff line numberDiff line change
@@ -7153,6 +7153,12 @@ int64_t CS_LDK_LDKPendingHTLCRouting_Forward_get_blinded(int64_t ptr) {
71537153
blinded_ref = tag_ptr(blinded_var.inner, false);
71547154
return blinded_ref;
71557155
}
7156+
int64_t CS_LDK_LDKPendingHTLCRouting_Forward_get_incoming_cltv_expiry(int64_t ptr) {
7157+
LDKPendingHTLCRouting *obj = (LDKPendingHTLCRouting*)untag_ptr(ptr);
7158+
CHECK(obj->tag == LDKPendingHTLCRouting_Forward);
7159+
int64_t incoming_cltv_expiry_ref = tag_ptr(&obj->forward.incoming_cltv_expiry, false);
7160+
return incoming_cltv_expiry_ref;
7161+
}
71567162
int64_t CS_LDK_LDKPendingHTLCRouting_Receive_get_payment_data(int64_t ptr) {
71577163
LDKPendingHTLCRouting *obj = (LDKPendingHTLCRouting*)untag_ptr(ptr);
71587164
CHECK(obj->tag == LDKPendingHTLCRouting_Receive);
@@ -44632,7 +44638,7 @@ int64_t CS_LDK_PendingHTLCRouting_clone(int64_t orig) {
4463244638
return ret_ref;
4463344639
}
4463444640

44635-
int64_t CS_LDK_PendingHTLCRouting_forward(int64_t onion_packet, int64_t short_channel_id, int64_t blinded) {
44641+
int64_t CS_LDK_PendingHTLCRouting_forward(int64_t onion_packet, int64_t short_channel_id, int64_t blinded, int64_t incoming_cltv_expiry) {
4463644642
LDKOnionPacket onion_packet_conv;
4463744643
onion_packet_conv.inner = untag_ptr(onion_packet);
4463844644
onion_packet_conv.is_owned = ptr_is_owned(onion_packet);
@@ -44643,8 +44649,12 @@ int64_t CS_LDK_PendingHTLCRouting_forward(int64_t onion_packet, int64_t short_c
4464344649
blinded_conv.is_owned = ptr_is_owned(blinded);
4464444650
CHECK_INNER_FIELD_ACCESS_OR_NULL(blinded_conv);
4464544651
blinded_conv = BlindedForward_clone(&blinded_conv);
44652+
void* incoming_cltv_expiry_ptr = untag_ptr(incoming_cltv_expiry);
44653+
CHECK_ACCESS(incoming_cltv_expiry_ptr);
44654+
LDKCOption_u32Z incoming_cltv_expiry_conv = *(LDKCOption_u32Z*)(incoming_cltv_expiry_ptr);
44655+
incoming_cltv_expiry_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(incoming_cltv_expiry));
4464644656
LDKPendingHTLCRouting *ret_copy = MALLOC(sizeof(LDKPendingHTLCRouting), "LDKPendingHTLCRouting");
44647-
*ret_copy = PendingHTLCRouting_forward(onion_packet_conv, short_channel_id, blinded_conv);
44657+
*ret_copy = PendingHTLCRouting_forward(onion_packet_conv, short_channel_id, blinded_conv, incoming_cltv_expiry_conv);
4464844658
int64_t ret_ref = tag_ptr(ret_copy, true);
4464944659
return ret_ref;
4465044660
}
@@ -45860,6 +45870,33 @@ void CS_LDK_ChannelManager_force_close_all_channels_without_broadcasting_txn(in
4586045870
ChannelManager_force_close_all_channels_without_broadcasting_txn(&this_arg_conv, error_message_conv);
4586145871
}
4586245872

45873+
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) {
45874+
LDKChannelManager this_arg_conv;
45875+
this_arg_conv.inner = untag_ptr(this_arg);
45876+
this_arg_conv.is_owned = ptr_is_owned(this_arg);
45877+
CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45878+
this_arg_conv.is_owned = false;
45879+
LDKRoute route_conv;
45880+
route_conv.inner = untag_ptr(route);
45881+
route_conv.is_owned = ptr_is_owned(route);
45882+
CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv);
45883+
route_conv = Route_clone(&route_conv);
45884+
LDKThirtyTwoBytes payment_hash_ref;
45885+
CHECK(payment_hash->arr_len == 32);
45886+
memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
45887+
LDKRecipientOnionFields recipient_onion_conv;
45888+
recipient_onion_conv.inner = untag_ptr(recipient_onion);
45889+
recipient_onion_conv.is_owned = ptr_is_owned(recipient_onion);
45890+
CHECK_INNER_FIELD_ACCESS_OR_NULL(recipient_onion_conv);
45891+
recipient_onion_conv = RecipientOnionFields_clone(&recipient_onion_conv);
45892+
LDKThirtyTwoBytes payment_id_ref;
45893+
CHECK(payment_id->arr_len == 32);
45894+
memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id);
45895+
LDKCResult_NoneRetryableSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneRetryableSendFailureZ), "LDKCResult_NoneRetryableSendFailureZ");
45896+
*ret_conv = ChannelManager_send_payment_with_route(&this_arg_conv, route_conv, payment_hash_ref, recipient_onion_conv, payment_id_ref);
45897+
return tag_ptr(ret_conv, true);
45898+
}
45899+
4586345900
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) {
4586445901
LDKChannelManager this_arg_conv;
4586545902
this_arg_conv.inner = untag_ptr(this_arg);
@@ -77340,6 +77377,15 @@ int64_t CS_LDK_SpendableOutputDescriptor_create_spendable_outputs_psbt(int64_tA
7734077377
return tag_ptr(ret_conv, true);
7734177378
}
7734277379

77380+
int64_t CS_LDK_SpendableOutputDescriptor_spendable_outpoint(int64_t this_arg) {
77381+
LDKSpendableOutputDescriptor* this_arg_conv = (LDKSpendableOutputDescriptor*)untag_ptr(this_arg);
77382+
LDKOutPoint ret_var = SpendableOutputDescriptor_spendable_outpoint(this_arg_conv);
77383+
int64_t ret_ref = 0;
77384+
CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
77385+
ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
77386+
return ret_ref;
77387+
}
77388+
7734377389
void CS_LDK_ChannelDerivationParameters_free(int64_t this_obj) {
7734477390
LDKChannelDerivationParameters this_obj_conv;
7734577391
this_obj_conv.inner = untag_ptr(this_obj);

c_sharp/bindings.c.body

+48-2
Original file line numberDiff line numberDiff line change
@@ -7149,6 +7149,12 @@ int64_t CS_LDK_LDKPendingHTLCRouting_Forward_get_blinded(int64_t ptr) {
71497149
blinded_ref = tag_ptr(blinded_var.inner, false);
71507150
return blinded_ref;
71517151
}
7152+
int64_t CS_LDK_LDKPendingHTLCRouting_Forward_get_incoming_cltv_expiry(int64_t ptr) {
7153+
LDKPendingHTLCRouting *obj = (LDKPendingHTLCRouting*)untag_ptr(ptr);
7154+
CHECK(obj->tag == LDKPendingHTLCRouting_Forward);
7155+
int64_t incoming_cltv_expiry_ref = tag_ptr(&obj->forward.incoming_cltv_expiry, false);
7156+
return incoming_cltv_expiry_ref;
7157+
}
71527158
int64_t CS_LDK_LDKPendingHTLCRouting_Receive_get_payment_data(int64_t ptr) {
71537159
LDKPendingHTLCRouting *obj = (LDKPendingHTLCRouting*)untag_ptr(ptr);
71547160
CHECK(obj->tag == LDKPendingHTLCRouting_Receive);
@@ -44628,7 +44634,7 @@ int64_t CS_LDK_PendingHTLCRouting_clone(int64_t orig) {
4462844634
return ret_ref;
4462944635
}
4463044636

44631-
int64_t CS_LDK_PendingHTLCRouting_forward(int64_t onion_packet, int64_t short_channel_id, int64_t blinded) {
44637+
int64_t CS_LDK_PendingHTLCRouting_forward(int64_t onion_packet, int64_t short_channel_id, int64_t blinded, int64_t incoming_cltv_expiry) {
4463244638
LDKOnionPacket onion_packet_conv;
4463344639
onion_packet_conv.inner = untag_ptr(onion_packet);
4463444640
onion_packet_conv.is_owned = ptr_is_owned(onion_packet);
@@ -44639,8 +44645,12 @@ int64_t CS_LDK_PendingHTLCRouting_forward(int64_t onion_packet, int64_t short_c
4463944645
blinded_conv.is_owned = ptr_is_owned(blinded);
4464044646
CHECK_INNER_FIELD_ACCESS_OR_NULL(blinded_conv);
4464144647
blinded_conv = BlindedForward_clone(&blinded_conv);
44648+
void* incoming_cltv_expiry_ptr = untag_ptr(incoming_cltv_expiry);
44649+
CHECK_ACCESS(incoming_cltv_expiry_ptr);
44650+
LDKCOption_u32Z incoming_cltv_expiry_conv = *(LDKCOption_u32Z*)(incoming_cltv_expiry_ptr);
44651+
incoming_cltv_expiry_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(incoming_cltv_expiry));
4464244652
LDKPendingHTLCRouting *ret_copy = MALLOC(sizeof(LDKPendingHTLCRouting), "LDKPendingHTLCRouting");
44643-
*ret_copy = PendingHTLCRouting_forward(onion_packet_conv, short_channel_id, blinded_conv);
44653+
*ret_copy = PendingHTLCRouting_forward(onion_packet_conv, short_channel_id, blinded_conv, incoming_cltv_expiry_conv);
4464444654
int64_t ret_ref = tag_ptr(ret_copy, true);
4464544655
return ret_ref;
4464644656
}
@@ -45856,6 +45866,33 @@ void CS_LDK_ChannelManager_force_close_all_channels_without_broadcasting_txn(in
4585645866
ChannelManager_force_close_all_channels_without_broadcasting_txn(&this_arg_conv, error_message_conv);
4585745867
}
4585845868

45869+
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) {
45870+
LDKChannelManager this_arg_conv;
45871+
this_arg_conv.inner = untag_ptr(this_arg);
45872+
this_arg_conv.is_owned = ptr_is_owned(this_arg);
45873+
CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45874+
this_arg_conv.is_owned = false;
45875+
LDKRoute route_conv;
45876+
route_conv.inner = untag_ptr(route);
45877+
route_conv.is_owned = ptr_is_owned(route);
45878+
CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv);
45879+
route_conv = Route_clone(&route_conv);
45880+
LDKThirtyTwoBytes payment_hash_ref;
45881+
CHECK(payment_hash->arr_len == 32);
45882+
memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
45883+
LDKRecipientOnionFields recipient_onion_conv;
45884+
recipient_onion_conv.inner = untag_ptr(recipient_onion);
45885+
recipient_onion_conv.is_owned = ptr_is_owned(recipient_onion);
45886+
CHECK_INNER_FIELD_ACCESS_OR_NULL(recipient_onion_conv);
45887+
recipient_onion_conv = RecipientOnionFields_clone(&recipient_onion_conv);
45888+
LDKThirtyTwoBytes payment_id_ref;
45889+
CHECK(payment_id->arr_len == 32);
45890+
memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id);
45891+
LDKCResult_NoneRetryableSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneRetryableSendFailureZ), "LDKCResult_NoneRetryableSendFailureZ");
45892+
*ret_conv = ChannelManager_send_payment_with_route(&this_arg_conv, route_conv, payment_hash_ref, recipient_onion_conv, payment_id_ref);
45893+
return tag_ptr(ret_conv, true);
45894+
}
45895+
4585945896
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) {
4586045897
LDKChannelManager this_arg_conv;
4586145898
this_arg_conv.inner = untag_ptr(this_arg);
@@ -77336,6 +77373,15 @@ int64_t CS_LDK_SpendableOutputDescriptor_create_spendable_outputs_psbt(int64_tA
7733677373
return tag_ptr(ret_conv, true);
7733777374
}
7733877375

77376+
int64_t CS_LDK_SpendableOutputDescriptor_spendable_outpoint(int64_t this_arg) {
77377+
LDKSpendableOutputDescriptor* this_arg_conv = (LDKSpendableOutputDescriptor*)untag_ptr(this_arg);
77378+
LDKOutPoint ret_var = SpendableOutputDescriptor_spendable_outpoint(this_arg_conv);
77379+
int64_t ret_ref = 0;
77380+
CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
77381+
ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
77382+
return ret_ref;
77383+
}
77384+
7733977385
void CS_LDK_ChannelDerivationParameters_free(int64_t this_obj) {
7734077386
LDKChannelDerivationParameters this_obj_conv;
7734177387
this_obj_conv.inner = untag_ptr(this_obj);

c_sharp/src/org/ldk/impl/bindings.cs

+7-2
Original file line numberDiff line numberDiff line change
@@ -978,6 +978,7 @@ public static long[] LDKUtxoLookup_new(LDKUtxoLookup impl) {
978978
[DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKPendingHTLCRouting_Forward_get_onion_packet")] public static extern long LDKPendingHTLCRouting_Forward_get_onion_packet(long ptr);
979979
[DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKPendingHTLCRouting_Forward_get_short_channel_id")] public static extern long LDKPendingHTLCRouting_Forward_get_short_channel_id(long ptr);
980980
[DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKPendingHTLCRouting_Forward_get_blinded")] public static extern long LDKPendingHTLCRouting_Forward_get_blinded(long ptr);
981+
[DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKPendingHTLCRouting_Forward_get_incoming_cltv_expiry")] public static extern long LDKPendingHTLCRouting_Forward_get_incoming_cltv_expiry(long ptr);
981982
[DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKPendingHTLCRouting_Receive_get_payment_data")] public static extern long LDKPendingHTLCRouting_Receive_get_payment_data(long ptr);
982983
[DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKPendingHTLCRouting_Receive_get_payment_metadata")] public static extern long LDKPendingHTLCRouting_Receive_get_payment_metadata(long ptr);
983984
[DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKPendingHTLCRouting_Receive_get_payment_context")] public static extern long LDKPendingHTLCRouting_Receive_get_payment_context(long ptr);
@@ -8241,8 +8242,8 @@ public static long[] LDKWalletSource_new(LDKWalletSource impl) {
82418242
[DllImport ("ldkcsharp", EntryPoint="CS_LDK_PendingHTLCRouting_clone_ptr")] public static extern long PendingHTLCRouting_clone_ptr(long _arg);
82428243
// struct LDKPendingHTLCRouting PendingHTLCRouting_clone(const struct LDKPendingHTLCRouting *NONNULL_PTR orig);
82438244
[DllImport ("ldkcsharp", EntryPoint="CS_LDK_PendingHTLCRouting_clone")] public static extern long PendingHTLCRouting_clone(long _orig);
8244-
// struct LDKPendingHTLCRouting PendingHTLCRouting_forward(struct LDKOnionPacket onion_packet, uint64_t short_channel_id, struct LDKBlindedForward blinded);
8245-
[DllImport ("ldkcsharp", EntryPoint="CS_LDK_PendingHTLCRouting_forward")] public static extern long PendingHTLCRouting_forward(long _onion_packet, long _short_channel_id, long _blinded);
8245+
// struct LDKPendingHTLCRouting PendingHTLCRouting_forward(struct LDKOnionPacket onion_packet, uint64_t short_channel_id, struct LDKBlindedForward blinded, struct LDKCOption_u32Z incoming_cltv_expiry);
8246+
[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);
82468247
// 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);
82478248
[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);
82488249
// 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);
@@ -8413,6 +8414,8 @@ public static long[] LDKWalletSource_new(LDKWalletSource impl) {
84138414
[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);
84148415
// void ChannelManager_force_close_all_channels_without_broadcasting_txn(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKStr error_message);
84158416
[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);
8417+
// 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);
8418+
[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);
84168419
// 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);
84178420
[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);
84188421
// 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);
@@ -13423,6 +13426,8 @@ public static long[] LDKWalletSource_new(LDKWalletSource impl) {
1342313426
[DllImport ("ldkcsharp", EntryPoint="CS_LDK_SpendableOutputDescriptor_read")] public static extern long SpendableOutputDescriptor_read(long _ser);
1342413427
// 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);
1342513428
[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);
13429+
// MUST_USE_RES struct LDKOutPoint SpendableOutputDescriptor_spendable_outpoint(const struct LDKSpendableOutputDescriptor *NONNULL_PTR this_arg);
13430+
[DllImport ("ldkcsharp", EntryPoint="CS_LDK_SpendableOutputDescriptor_spendable_outpoint")] public static extern long SpendableOutputDescriptor_spendable_outpoint(long _this_arg);
1342613431
// void ChannelDerivationParameters_free(struct LDKChannelDerivationParameters this_obj);
1342713432
[DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDerivationParameters_free")] public static extern void ChannelDerivationParameters_free(long _this_obj);
1342813433
// uint64_t ChannelDerivationParameters_get_value_satoshis(const struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr);

c_sharp/src/org/ldk/structs/ChannelManager.cs

+20-1
Original file line numberDiff line numberDiff line change
@@ -1115,6 +1115,24 @@ public void force_close_all_channels_without_broadcasting_txn(string error_messa
11151115
GC.KeepAlive(error_message);
11161116
}
11171117

1118+
/**
1119+
* Sends a payment along a given route. See [`Self::send_payment`] for more info.
1120+
*
1121+
* LDK will not automatically retry this payment, though it may be manually re-sent after an
1122+
* [`Event::PaymentFailed`] is generated.
1123+
*/
1124+
public Result_NoneRetryableSendFailureZ send_payment_with_route(org.ldk.structs.Route route, byte[] payment_hash, org.ldk.structs.RecipientOnionFields recipient_onion, byte[] payment_id) {
1125+
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)));
1126+
GC.KeepAlive(this);
1127+
GC.KeepAlive(route);
1128+
GC.KeepAlive(payment_hash);
1129+
GC.KeepAlive(recipient_onion);
1130+
GC.KeepAlive(payment_id);
1131+
if (ret >= 0 && ret <= 4096) { return null; }
1132+
Result_NoneRetryableSendFailureZ ret_hu_conv = Result_NoneRetryableSendFailureZ.constr_from_ptr(ret);
1133+
return ret_hu_conv;
1134+
}
1135+
11181136
/**
11191137
* Sends a payment to the route found using the provided [`RouteParameters`], retrying failed
11201138
* payment paths based on the provided `Retry`.
@@ -1142,7 +1160,8 @@ public void force_close_all_channels_without_broadcasting_txn(string error_messa
11421160
* [`ChannelManager::list_recent_payments`] for more information.
11431161
*
11441162
* Routes are automatically found using the [`Router] provided on startup. To fix a route for a
1145-
* particular payment, match the [`PaymentId`] passed to [`Router::find_route_with_id`].
1163+
* particular payment, use [`Self::send_payment_with_route`] or match the [`PaymentId`] passed to
1164+
* [`Router::find_route_with_id`].
11461165
*
11471166
* [`Event::PaymentSent`]: events::Event::PaymentSent
11481167
* [`Event::PaymentFailed`]: events::Event::PaymentFailed

0 commit comments

Comments
 (0)