Skip to content

Commit 58a0e01

Browse files
authored
Merge pull request #173 from TheBlueMatt/main
Update to LDK 0.1.3
2 parents 92188e7 + 5383e9c commit 58a0e01

File tree

13 files changed

+151
-0
lines changed

13 files changed

+151
-0
lines changed

c_sharp/bindings.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71594,6 +71594,19 @@ int64_t CS_LDK_VerifiedInvoiceRequest_respond_using_derived_keys_no_std(int64_t
7159471594
return tag_ptr(ret_conv, true);
7159571595
}
7159671596

71597+
int64_t CS_LDK_VerifiedInvoiceRequest_fields(int64_t this_arg) {
71598+
LDKVerifiedInvoiceRequest this_arg_conv;
71599+
this_arg_conv.inner = untag_ptr(this_arg);
71600+
this_arg_conv.is_owned = ptr_is_owned(this_arg);
71601+
CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
71602+
this_arg_conv.is_owned = false;
71603+
LDKInvoiceRequestFields ret_var = VerifiedInvoiceRequest_fields(&this_arg_conv);
71604+
int64_t ret_ref = 0;
71605+
CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
71606+
ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
71607+
return ret_ref;
71608+
}
71609+
7159771610
uint8_tArray CS_LDK_UnsignedInvoiceRequest_write(int64_t obj) {
7159871611
LDKUnsignedInvoiceRequest obj_conv;
7159971612
obj_conv.inner = untag_ptr(obj);

c_sharp/bindings.c.body

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71590,6 +71590,19 @@ int64_t CS_LDK_VerifiedInvoiceRequest_respond_using_derived_keys_no_std(int64_t
7159071590
return tag_ptr(ret_conv, true);
7159171591
}
7159271592

71593+
int64_t CS_LDK_VerifiedInvoiceRequest_fields(int64_t this_arg) {
71594+
LDKVerifiedInvoiceRequest this_arg_conv;
71595+
this_arg_conv.inner = untag_ptr(this_arg);
71596+
this_arg_conv.is_owned = ptr_is_owned(this_arg);
71597+
CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
71598+
this_arg_conv.is_owned = false;
71599+
LDKInvoiceRequestFields ret_var = VerifiedInvoiceRequest_fields(&this_arg_conv);
71600+
int64_t ret_ref = 0;
71601+
CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
71602+
ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
71603+
return ret_ref;
71604+
}
71605+
7159371606
uint8_tArray CS_LDK_UnsignedInvoiceRequest_write(int64_t obj) {
7159471607
LDKUnsignedInvoiceRequest obj_conv;
7159571608
obj_conv.inner = untag_ptr(obj);

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12427,6 +12427,8 @@ public static long[] LDKProcessMessagesCallback_new(LDKProcessMessagesCallback i
1242712427
[DllImport ("ldkcsharp", EntryPoint="CS_LDK_VerifiedInvoiceRequest_respond_using_derived_keys")] public static extern long VerifiedInvoiceRequest_respond_using_derived_keys(long _this_arg, long _payment_paths, long _payment_hash);
1242812428
// MUST_USE_RES struct LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ VerifiedInvoiceRequest_respond_using_derived_keys_no_std(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg, struct LDKCVec_BlindedPaymentPathZ payment_paths, struct LDKThirtyTwoBytes payment_hash, uint64_t created_at);
1242912429
[DllImport ("ldkcsharp", EntryPoint="CS_LDK_VerifiedInvoiceRequest_respond_using_derived_keys_no_std")] public static extern long VerifiedInvoiceRequest_respond_using_derived_keys_no_std(long _this_arg, long _payment_paths, long _payment_hash, long _created_at);
12430+
// MUST_USE_RES struct LDKInvoiceRequestFields VerifiedInvoiceRequest_fields(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
12431+
[DllImport ("ldkcsharp", EntryPoint="CS_LDK_VerifiedInvoiceRequest_fields")] public static extern long VerifiedInvoiceRequest_fields(long _this_arg);
1243012432
// struct LDKCVec_u8Z UnsignedInvoiceRequest_write(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR obj);
1243112433
[DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedInvoiceRequest_write")] public static extern long UnsignedInvoiceRequest_write(long _obj);
1243212434
// struct LDKCVec_u8Z InvoiceRequest_write(const struct LDKInvoiceRequest *NONNULL_PTR obj);

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,5 +426,23 @@ public org.ldk.structs.Result_InvoiceWithDerivedSigningPubkeyBuilderBolt12Semant
426426
return ret_hu_conv;
427427
}
428428

429+
/**
430+
* Fetch the [`InvoiceRequestFields`] for this verified invoice.
431+
*
432+
* These are fields which we expect to be useful when receiving a payment for this invoice
433+
* request, and include the returned [`InvoiceRequestFields`] in the
434+
* [`PaymentContext::Bolt12Offer`].
435+
*
436+
* [`PaymentContext::Bolt12Offer`]: crate::blinded_path::payment::PaymentContext::Bolt12Offer
437+
*/
438+
public org.ldk.structs.InvoiceRequestFields fields() {
439+
long ret = bindings.VerifiedInvoiceRequest_fields(this.ptr);
440+
GC.KeepAlive(this);
441+
if (ret >= 0 && ret <= 4096) { return null; }
442+
org.ldk.structs.InvoiceRequestFields ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InvoiceRequestFields(null, ret); }
443+
if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
444+
return ret_hu_conv;
445+
}
446+
429447
}
430448
} } }

src/main/java/org/ldk/impl/bindings.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13534,6 +13534,8 @@ public interface LDKProcessMessagesCallback {
1353413534
public static native long VerifiedInvoiceRequest_respond_using_derived_keys(long this_arg, long[] payment_paths, byte[] payment_hash);
1353513535
// MUST_USE_RES struct LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ VerifiedInvoiceRequest_respond_using_derived_keys_no_std(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg, struct LDKCVec_BlindedPaymentPathZ payment_paths, struct LDKThirtyTwoBytes payment_hash, uint64_t created_at);
1353613536
public static native long VerifiedInvoiceRequest_respond_using_derived_keys_no_std(long this_arg, long[] payment_paths, byte[] payment_hash, long created_at);
13537+
// MUST_USE_RES struct LDKInvoiceRequestFields VerifiedInvoiceRequest_fields(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
13538+
public static native long VerifiedInvoiceRequest_fields(long this_arg);
1353713539
// struct LDKCVec_u8Z UnsignedInvoiceRequest_write(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR obj);
1353813540
public static native byte[] UnsignedInvoiceRequest_write(long obj);
1353913541
// struct LDKCVec_u8Z InvoiceRequest_write(const struct LDKInvoiceRequest *NONNULL_PTR obj);

src/main/java/org/ldk/structs/VerifiedInvoiceRequest.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,4 +417,22 @@ public Result_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ respond
417417
return ret_hu_conv;
418418
}
419419

420+
/**
421+
* Fetch the [`InvoiceRequestFields`] for this verified invoice.
422+
*
423+
* These are fields which we expect to be useful when receiving a payment for this invoice
424+
* request, and include the returned [`InvoiceRequestFields`] in the
425+
* [`PaymentContext::Bolt12Offer`].
426+
*
427+
* [`PaymentContext::Bolt12Offer`]: crate::blinded_path::payment::PaymentContext::Bolt12Offer
428+
*/
429+
public InvoiceRequestFields fields() {
430+
long ret = bindings.VerifiedInvoiceRequest_fields(this.ptr);
431+
Reference.reachabilityFence(this);
432+
if (ret >= 0 && ret <= 4096) { return null; }
433+
org.ldk.structs.InvoiceRequestFields ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InvoiceRequestFields(null, ret); }
434+
if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
435+
return ret_hu_conv;
436+
}
437+
420438
}

src/main/jni/bindings.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77669,6 +77669,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1res
7766977669
return tag_ptr(ret_conv, true);
7767077670
}
7767177671

77672+
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1fields(JNIEnv *env, jclass clz, int64_t this_arg) {
77673+
LDKVerifiedInvoiceRequest this_arg_conv;
77674+
this_arg_conv.inner = untag_ptr(this_arg);
77675+
this_arg_conv.is_owned = ptr_is_owned(this_arg);
77676+
CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
77677+
this_arg_conv.is_owned = false;
77678+
LDKInvoiceRequestFields ret_var = VerifiedInvoiceRequest_fields(&this_arg_conv);
77679+
int64_t ret_ref = 0;
77680+
CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
77681+
ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
77682+
return ret_ref;
77683+
}
77684+
7767277685
JNIEXPORT uint8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1write(JNIEnv *env, jclass clz, int64_t obj) {
7767377686
LDKUnsignedInvoiceRequest obj_conv;
7767477687
obj_conv.inner = untag_ptr(obj);

src/main/jni/bindings.c.body

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77665,6 +77665,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1res
7766577665
return tag_ptr(ret_conv, true);
7766677666
}
7766777667

77668+
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1fields(JNIEnv *env, jclass clz, int64_t this_arg) {
77669+
LDKVerifiedInvoiceRequest this_arg_conv;
77670+
this_arg_conv.inner = untag_ptr(this_arg);
77671+
this_arg_conv.is_owned = ptr_is_owned(this_arg);
77672+
CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
77673+
this_arg_conv.is_owned = false;
77674+
LDKInvoiceRequestFields ret_var = VerifiedInvoiceRequest_fields(&this_arg_conv);
77675+
int64_t ret_ref = 0;
77676+
CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
77677+
ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
77678+
return ret_ref;
77679+
}
77680+
7766877681
JNIEXPORT uint8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1write(JNIEnv *env, jclass clz, int64_t obj) {
7766977682
LDKUnsignedInvoiceRequest obj_conv;
7767077683
obj_conv.inner = untag_ptr(obj);

src/main/jni/org_ldk_impl_bindings.h

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ts/bindings.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71047,6 +71047,19 @@ uint64_t __attribute__((export_name("TS_VerifiedInvoiceRequest_respond_using_de
7104771047
return tag_ptr(ret_conv, true);
7104871048
}
7104971049

71050+
uint64_t __attribute__((export_name("TS_VerifiedInvoiceRequest_fields"))) TS_VerifiedInvoiceRequest_fields(uint64_t this_arg) {
71051+
LDKVerifiedInvoiceRequest this_arg_conv;
71052+
this_arg_conv.inner = untag_ptr(this_arg);
71053+
this_arg_conv.is_owned = ptr_is_owned(this_arg);
71054+
CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
71055+
this_arg_conv.is_owned = false;
71056+
LDKInvoiceRequestFields ret_var = VerifiedInvoiceRequest_fields(&this_arg_conv);
71057+
uint64_t ret_ref = 0;
71058+
CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
71059+
ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
71060+
return ret_ref;
71061+
}
71062+
7105071063
uint8_tArray __attribute__((export_name("TS_UnsignedInvoiceRequest_write"))) TS_UnsignedInvoiceRequest_write(uint64_t obj) {
7105171064
LDKUnsignedInvoiceRequest obj_conv;
7105271065
obj_conv.inner = untag_ptr(obj);

0 commit comments

Comments
 (0)