diff --git a/c_sharp/bindings.c b/c_sharp/bindings.c index d2d1634f..2a1efdc6 100644 --- a/c_sharp/bindings.c +++ b/c_sharp/bindings.c @@ -71594,6 +71594,19 @@ int64_t CS_LDK_VerifiedInvoiceRequest_respond_using_derived_keys_no_std(int64_t return tag_ptr(ret_conv, true); } +int64_t CS_LDK_VerifiedInvoiceRequest_fields(int64_t this_arg) { + LDKVerifiedInvoiceRequest 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; + LDKInvoiceRequestFields ret_var = VerifiedInvoiceRequest_fields(&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; +} + uint8_tArray CS_LDK_UnsignedInvoiceRequest_write(int64_t obj) { LDKUnsignedInvoiceRequest obj_conv; obj_conv.inner = untag_ptr(obj); diff --git a/c_sharp/bindings.c.body b/c_sharp/bindings.c.body index 973f3435..bd909e06 100644 --- a/c_sharp/bindings.c.body +++ b/c_sharp/bindings.c.body @@ -71590,6 +71590,19 @@ int64_t CS_LDK_VerifiedInvoiceRequest_respond_using_derived_keys_no_std(int64_t return tag_ptr(ret_conv, true); } +int64_t CS_LDK_VerifiedInvoiceRequest_fields(int64_t this_arg) { + LDKVerifiedInvoiceRequest 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; + LDKInvoiceRequestFields ret_var = VerifiedInvoiceRequest_fields(&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; +} + uint8_tArray CS_LDK_UnsignedInvoiceRequest_write(int64_t obj) { LDKUnsignedInvoiceRequest obj_conv; obj_conv.inner = untag_ptr(obj); diff --git a/c_sharp/src/org/ldk/impl/bindings.cs b/c_sharp/src/org/ldk/impl/bindings.cs index 1194cc52..43e8f5fe 100644 --- a/c_sharp/src/org/ldk/impl/bindings.cs +++ b/c_sharp/src/org/ldk/impl/bindings.cs @@ -12427,6 +12427,8 @@ public static long[] LDKProcessMessagesCallback_new(LDKProcessMessagesCallback i [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); // 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); [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); + // MUST_USE_RES struct LDKInvoiceRequestFields VerifiedInvoiceRequest_fields(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_VerifiedInvoiceRequest_fields")] public static extern long VerifiedInvoiceRequest_fields(long _this_arg); // struct LDKCVec_u8Z UnsignedInvoiceRequest_write(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedInvoiceRequest_write")] public static extern long UnsignedInvoiceRequest_write(long _obj); // struct LDKCVec_u8Z InvoiceRequest_write(const struct LDKInvoiceRequest *NONNULL_PTR obj); diff --git a/c_sharp/src/org/ldk/structs/VerifiedInvoiceRequest.cs b/c_sharp/src/org/ldk/structs/VerifiedInvoiceRequest.cs index ae2be0d3..d8b7ced7 100644 --- a/c_sharp/src/org/ldk/structs/VerifiedInvoiceRequest.cs +++ b/c_sharp/src/org/ldk/structs/VerifiedInvoiceRequest.cs @@ -426,5 +426,23 @@ public org.ldk.structs.Result_InvoiceWithDerivedSigningPubkeyBuilderBolt12Semant return ret_hu_conv; } + /** + * Fetch the [`InvoiceRequestFields`] for this verified invoice. + * + * These are fields which we expect to be useful when receiving a payment for this invoice + * request, and include the returned [`InvoiceRequestFields`] in the + * [`PaymentContext::Bolt12Offer`]. + * + * [`PaymentContext::Bolt12Offer`]: crate::blinded_path::payment::PaymentContext::Bolt12Offer + */ + public org.ldk.structs.InvoiceRequestFields fields() { + long ret = bindings.VerifiedInvoiceRequest_fields(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.InvoiceRequestFields ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InvoiceRequestFields(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + } } } } diff --git a/src/main/java/org/ldk/impl/bindings.java b/src/main/java/org/ldk/impl/bindings.java index a06d8e00..e37e30f1 100644 --- a/src/main/java/org/ldk/impl/bindings.java +++ b/src/main/java/org/ldk/impl/bindings.java @@ -13534,6 +13534,8 @@ public interface LDKProcessMessagesCallback { public static native long VerifiedInvoiceRequest_respond_using_derived_keys(long this_arg, long[] payment_paths, byte[] payment_hash); // 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); public static native long VerifiedInvoiceRequest_respond_using_derived_keys_no_std(long this_arg, long[] payment_paths, byte[] payment_hash, long created_at); + // MUST_USE_RES struct LDKInvoiceRequestFields VerifiedInvoiceRequest_fields(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg); + public static native long VerifiedInvoiceRequest_fields(long this_arg); // struct LDKCVec_u8Z UnsignedInvoiceRequest_write(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR obj); public static native byte[] UnsignedInvoiceRequest_write(long obj); // struct LDKCVec_u8Z InvoiceRequest_write(const struct LDKInvoiceRequest *NONNULL_PTR obj); diff --git a/src/main/java/org/ldk/structs/VerifiedInvoiceRequest.java b/src/main/java/org/ldk/structs/VerifiedInvoiceRequest.java index 86c79267..182e92d7 100644 --- a/src/main/java/org/ldk/structs/VerifiedInvoiceRequest.java +++ b/src/main/java/org/ldk/structs/VerifiedInvoiceRequest.java @@ -417,4 +417,22 @@ public Result_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ respond return ret_hu_conv; } + /** + * Fetch the [`InvoiceRequestFields`] for this verified invoice. + * + * These are fields which we expect to be useful when receiving a payment for this invoice + * request, and include the returned [`InvoiceRequestFields`] in the + * [`PaymentContext::Bolt12Offer`]. + * + * [`PaymentContext::Bolt12Offer`]: crate::blinded_path::payment::PaymentContext::Bolt12Offer + */ + public InvoiceRequestFields fields() { + long ret = bindings.VerifiedInvoiceRequest_fields(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.InvoiceRequestFields ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InvoiceRequestFields(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + } diff --git a/src/main/jni/bindings.c b/src/main/jni/bindings.c index 005e7a94..72dc76c9 100644 --- a/src/main/jni/bindings.c +++ b/src/main/jni/bindings.c @@ -77669,6 +77669,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1res return tag_ptr(ret_conv, true); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1fields(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKVerifiedInvoiceRequest 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; + LDKInvoiceRequestFields ret_var = VerifiedInvoiceRequest_fields(&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; +} + JNIEXPORT uint8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1write(JNIEnv *env, jclass clz, int64_t obj) { LDKUnsignedInvoiceRequest obj_conv; obj_conv.inner = untag_ptr(obj); diff --git a/src/main/jni/bindings.c.body b/src/main/jni/bindings.c.body index 6513bf20..fea535c0 100644 --- a/src/main/jni/bindings.c.body +++ b/src/main/jni/bindings.c.body @@ -77665,6 +77665,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1res return tag_ptr(ret_conv, true); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1fields(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKVerifiedInvoiceRequest 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; + LDKInvoiceRequestFields ret_var = VerifiedInvoiceRequest_fields(&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; +} + JNIEXPORT uint8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1write(JNIEnv *env, jclass clz, int64_t obj) { LDKUnsignedInvoiceRequest obj_conv; obj_conv.inner = untag_ptr(obj); diff --git a/src/main/jni/org_ldk_impl_bindings.h b/src/main/jni/org_ldk_impl_bindings.h index d93beffb..348d8689 100644 --- a/src/main/jni/org_ldk_impl_bindings.h +++ b/src/main/jni/org_ldk_impl_bindings.h @@ -44063,6 +44063,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1respo JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1respond_1using_1derived_1keys_1no_1std (JNIEnv *, jclass, jlong, jlongArray, jbyteArray, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: VerifiedInvoiceRequest_fields + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_VerifiedInvoiceRequest_1fields + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: UnsignedInvoiceRequest_write diff --git a/ts/bindings.c b/ts/bindings.c index 8d4cb335..4f8c4236 100644 --- a/ts/bindings.c +++ b/ts/bindings.c @@ -71047,6 +71047,19 @@ uint64_t __attribute__((export_name("TS_VerifiedInvoiceRequest_respond_using_de return tag_ptr(ret_conv, true); } +uint64_t __attribute__((export_name("TS_VerifiedInvoiceRequest_fields"))) TS_VerifiedInvoiceRequest_fields(uint64_t this_arg) { + LDKVerifiedInvoiceRequest 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; + LDKInvoiceRequestFields ret_var = VerifiedInvoiceRequest_fields(&this_arg_conv); + uint64_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; +} + uint8_tArray __attribute__((export_name("TS_UnsignedInvoiceRequest_write"))) TS_UnsignedInvoiceRequest_write(uint64_t obj) { LDKUnsignedInvoiceRequest obj_conv; obj_conv.inner = untag_ptr(obj); diff --git a/ts/bindings.c.body b/ts/bindings.c.body index 926f97bd..c9796847 100644 --- a/ts/bindings.c.body +++ b/ts/bindings.c.body @@ -71045,6 +71045,19 @@ uint64_t __attribute__((export_name("TS_VerifiedInvoiceRequest_respond_using_de return tag_ptr(ret_conv, true); } +uint64_t __attribute__((export_name("TS_VerifiedInvoiceRequest_fields"))) TS_VerifiedInvoiceRequest_fields(uint64_t this_arg) { + LDKVerifiedInvoiceRequest 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; + LDKInvoiceRequestFields ret_var = VerifiedInvoiceRequest_fields(&this_arg_conv); + uint64_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; +} + uint8_tArray __attribute__((export_name("TS_UnsignedInvoiceRequest_write"))) TS_UnsignedInvoiceRequest_write(uint64_t obj) { LDKUnsignedInvoiceRequest obj_conv; obj_conv.inner = untag_ptr(obj); diff --git a/ts/bindings.mts b/ts/bindings.mts index 3a305a70..ef660ba3 100644 --- a/ts/bindings.mts +++ b/ts/bindings.mts @@ -55818,6 +55818,15 @@ export function VerifiedInvoiceRequest_respond_using_derived_keys_no_std(this_ar } const nativeResponseValue = wasm.TS_VerifiedInvoiceRequest_respond_using_derived_keys_no_std(this_arg, payment_paths, payment_hash, created_at); return nativeResponseValue; +} + // MUST_USE_RES struct LDKInvoiceRequestFields VerifiedInvoiceRequest_fields(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg); +/* @internal */ +export function VerifiedInvoiceRequest_fields(this_arg: bigint): bigint { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.TS_VerifiedInvoiceRequest_fields(this_arg); + return nativeResponseValue; } // struct LDKCVec_u8Z UnsignedInvoiceRequest_write(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR obj); /* @internal */ diff --git a/ts/structs/VerifiedInvoiceRequest.mts b/ts/structs/VerifiedInvoiceRequest.mts index 3c360414..7946000f 100644 --- a/ts/structs/VerifiedInvoiceRequest.mts +++ b/ts/structs/VerifiedInvoiceRequest.mts @@ -1126,4 +1126,20 @@ export class VerifiedInvoiceRequest extends CommonBase { return ret_hu_conv; } + /** + * Fetch the [`InvoiceRequestFields`] for this verified invoice. + * + * These are fields which we expect to be useful when receiving a payment for this invoice + * request, and include the returned [`InvoiceRequestFields`] in the + * [`PaymentContext::Bolt12Offer`]. + * + * [`PaymentContext::Bolt12Offer`]: crate::blinded_path::payment::PaymentContext::Bolt12Offer + */ + public fields(): InvoiceRequestFields { + const ret: bigint = bindings.VerifiedInvoiceRequest_fields(this.ptr); + const ret_hu_conv: InvoiceRequestFields = new InvoiceRequestFields(null, ret); + CommonBase.add_ref_from(ret_hu_conv, this); + return ret_hu_conv; + } + }