Update auto-generated bindings
[ldk-java] / src / main / jni / bindings.c
index 32c632986f58672536c0ba3b5c0677969908a468..704f9f31f946a695769dcf6f4af19bf291ca8a2e 100644 (file)
@@ -13,6 +13,7 @@
 #define MALLOC(a, _) malloc(a)
 #define FREE(p) if ((uint64_t)(p) > 4096) { free(p); }
 #define CHECK_ACCESS(p)
+#define CHECK_INNER_FIELD_ACCESS_OR_NULL(v)
 #define DO_ASSERT(a) (void)(a)
 #define CHECK(a)
 
@@ -723,21 +724,6 @@ static inline jclass LDKSiPrefix_to_java(JNIEnv *env, LDKSiPrefix val) {
        }
 }
 
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1u8Z_1new(JNIEnv *env, jclass clz, int8_tArray elems) {
-       LDKCVec_u8Z *ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
-       ret->datalen = (*env)->GetArrayLength(env, elems);
-       if (ret->datalen == 0) {
-               ret->data = NULL;
-       } else {
-               ret->data = MALLOC(sizeof(uint8_t) * ret->datalen, "LDKCVec_u8Z Data");
-               int8_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
-               for (size_t i = 0; i < ret->datalen; i++) {
-                       ret->data[i] = java_elems[i];
-               }
-               (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0);
-       }
-       return (uint64_t)ret;
-}
 static inline LDKCVec_u8Z CVec_u8Z_clone(const LDKCVec_u8Z *orig) {
        LDKCVec_u8Z ret = { .data = MALLOC(sizeof(int8_t) * orig->datalen, "LDKCVec_u8Z clone bytes"), .datalen = orig->datalen };
        memcpy(ret.data, orig->data, sizeof(int8_t) * ret.datalen);
@@ -758,9 +744,6 @@ uint64_t TxOut_get_value (struct LDKTxOut* thing) { return thing->value;}JNIEXPO
        return ret_val;
 }
 
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SecretKeyErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_SecretKeyErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SecretKeyErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_SecretKeyErrorZ *val = (LDKCResult_SecretKeyErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -774,9 +757,6 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SecretKeyErrorZ_
        jclass err_conv = LDKSecp256k1Error_to_java(env, (*val->contents.err));
        return err_conv;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PublicKeyErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_PublicKeyErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PublicKeyErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_PublicKeyErrorZ *val = (LDKCResult_PublicKeyErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -790,9 +770,6 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PublicKeyErrorZ_
        jclass err_conv = LDKSecp256k1Error_to_java(env, (*val->contents.err));
        return err_conv;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxCreationKeysDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_TxCreationKeysDecodeErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxCreationKeysDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_TxCreationKeysDecodeErrorZ *val = (LDKCResult_TxCreationKeysDecodeErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -800,6 +777,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxCreationKeysD
        uint64_t res_ref = 0;
        CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
        res_ref = (uint64_t)res_var.inner & ~1;
        return res_ref;
 }
@@ -810,12 +788,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxCreationKeysD
        uint64_t err_ref = 0;
        CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
        err_ref = (uint64_t)err_var.inner & ~1;
        return err_ref;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelPublicKeysDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_ChannelPublicKeysDecodeErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelPublicKeysDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_ChannelPublicKeysDecodeErrorZ *val = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -823,6 +799,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelPublicKe
        uint64_t res_ref = 0;
        CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
        res_ref = (uint64_t)res_var.inner & ~1;
        return res_ref;
 }
@@ -833,12 +810,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelPublicKe
        uint64_t err_ref = 0;
        CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
        err_ref = (uint64_t)err_var.inner & ~1;
        return err_ref;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxCreationKeysErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_TxCreationKeysErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxCreationKeysErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_TxCreationKeysErrorZ *val = (LDKCResult_TxCreationKeysErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -846,6 +821,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxCreationKeysE
        uint64_t res_ref = 0;
        CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
        res_ref = (uint64_t)res_var.inner & ~1;
        return res_ref;
 }
@@ -883,9 +859,6 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1u32Z_1ref_1from
                default: abort();
        }
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1HTLCOutputInCommitmentDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1HTLCOutputInCommitmentDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *val = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -893,6 +866,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1HTLCOutputInCom
        uint64_t res_ref = 0;
        CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
        res_ref = (uint64_t)res_var.inner & ~1;
        return res_ref;
 }
@@ -903,12 +877,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1HTLCOutputInCom
        uint64_t err_ref = 0;
        CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
        err_ref = (uint64_t)err_var.inner & ~1;
        return err_ref;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CounterpartyChannelTransactionParametersDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CounterpartyChannelTransactionParametersDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *val = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -916,6 +888,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CounterpartyCha
        uint64_t res_ref = 0;
        CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
        res_ref = (uint64_t)res_var.inner & ~1;
        return res_ref;
 }
@@ -926,12 +899,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CounterpartyCha
        uint64_t err_ref = 0;
        CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
        err_ref = (uint64_t)err_var.inner & ~1;
        return err_ref;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelTransactionParametersDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_ChannelTransactionParametersDecodeErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelTransactionParametersDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_ChannelTransactionParametersDecodeErrorZ *val = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -939,6 +910,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelTransact
        uint64_t res_ref = 0;
        CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
        res_ref = (uint64_t)res_var.inner & ~1;
        return res_ref;
 }
@@ -949,12 +921,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelTransact
        uint64_t err_ref = 0;
        CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
        err_ref = (uint64_t)err_var.inner & ~1;
        return err_ref;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1HolderCommitmentTransactionDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1HolderCommitmentTransactionDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_HolderCommitmentTransactionDecodeErrorZ *val = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -962,6 +932,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1HolderCommitmen
        uint64_t res_ref = 0;
        CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
        res_ref = (uint64_t)res_var.inner & ~1;
        return res_ref;
 }
@@ -972,12 +943,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1HolderCommitmen
        uint64_t err_ref = 0;
        CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
        err_ref = (uint64_t)err_var.inner & ~1;
        return err_ref;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1BuiltCommitmentTransactionDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1BuiltCommitmentTransactionDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *val = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -985,6 +954,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1BuiltCommitment
        uint64_t res_ref = 0;
        CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
        res_ref = (uint64_t)res_var.inner & ~1;
        return res_ref;
 }
@@ -995,12 +965,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1BuiltCommitment
        uint64_t err_ref = 0;
        CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
        err_ref = (uint64_t)err_var.inner & ~1;
        return err_ref;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TrustedClosingTransactionNoneZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_TrustedClosingTransactionNoneZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TrustedClosingTransactionNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_TrustedClosingTransactionNoneZ *val = (LDKCResult_TrustedClosingTransactionNoneZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -1008,6 +976,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TrustedClosingT
        uint64_t res_ref = 0;
        CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
        res_ref = (uint64_t)res_var.inner & ~1;
        return res_ref;
 }
@@ -1016,9 +985,6 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TrustedClosingTran
        CHECK(!val->result_ok);
        return *val->contents.err;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CommitmentTransactionDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_CommitmentTransactionDecodeErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CommitmentTransactionDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_CommitmentTransactionDecodeErrorZ *val = (LDKCResult_CommitmentTransactionDecodeErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -1026,6 +992,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CommitmentTrans
        uint64_t res_ref = 0;
        CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
        res_ref = (uint64_t)res_var.inner & ~1;
        return res_ref;
 }
@@ -1036,12 +1003,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CommitmentTrans
        uint64_t err_ref = 0;
        CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
        err_ref = (uint64_t)err_var.inner & ~1;
        return err_ref;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TrustedCommitmentTransactionNoneZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_TrustedCommitmentTransactionNoneZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TrustedCommitmentTransactionNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_TrustedCommitmentTransactionNoneZ *val = (LDKCResult_TrustedCommitmentTransactionNoneZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -1049,6 +1014,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TrustedCommitme
        uint64_t res_ref = 0;
        CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
        res_ref = (uint64_t)res_var.inner & ~1;
        return res_ref;
 }
@@ -1057,9 +1023,6 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TrustedCommitmentT
        CHECK(!val->result_ok);
        return *val->contents.err;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1SignatureZNoneZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_CVec_SignatureZNoneZ*)arg)->result_ok;
-}
 JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1SignatureZNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_CVec_SignatureZNoneZ *val = (LDKCResult_CVec_SignatureZNoneZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -1080,9 +1043,6 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1SignatureZNo
        CHECK(!val->result_ok);
        return *val->contents.err;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ShutdownScriptDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_ShutdownScriptDecodeErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ShutdownScriptDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_ShutdownScriptDecodeErrorZ *val = (LDKCResult_ShutdownScriptDecodeErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -1090,6 +1050,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ShutdownScriptD
        uint64_t res_ref = 0;
        CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
        res_ref = (uint64_t)res_var.inner & ~1;
        return res_ref;
 }
@@ -1100,12 +1061,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ShutdownScriptD
        uint64_t err_ref = 0;
        CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
        err_ref = (uint64_t)err_var.inner & ~1;
        return err_ref;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ShutdownScriptInvalidShutdownScriptZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ShutdownScriptInvalidShutdownScriptZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_ShutdownScriptInvalidShutdownScriptZ *val = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -1113,6 +1072,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ShutdownScriptI
        uint64_t res_ref = 0;
        CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
        res_ref = (uint64_t)res_var.inner & ~1;
        return res_ref;
 }
@@ -1123,12 +1083,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ShutdownScriptI
        uint64_t err_ref = 0;
        CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
        err_ref = (uint64_t)err_var.inner & ~1;
        return err_ref;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_NoneErrorZ*)arg)->result_ok;
-}
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_NoneErrorZ *val = (LDKCResult_NoneErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -1140,9 +1098,6 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneErrorZ_1get_
        jclass err_conv = LDKIOError_to_java(env, (*val->contents.err));
        return err_conv;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteHopDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_RouteHopDecodeErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteHopDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_RouteHopDecodeErrorZ *val = (LDKCResult_RouteHopDecodeErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -1150,6 +1105,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteHopDecodeE
        uint64_t res_ref = 0;
        CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
        res_ref = (uint64_t)res_var.inner & ~1;
        return res_ref;
 }
@@ -1160,29 +1116,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteHopDecodeE
        uint64_t err_ref = 0;
        CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
        err_ref = (uint64_t)err_var.inner & ~1;
        return err_ref;
 }
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1RouteHopZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) {
-       LDKCVec_RouteHopZ *ret = MALLOC(sizeof(LDKCVec_RouteHopZ), "LDKCVec_RouteHopZ");
-       ret->datalen = (*env)->GetArrayLength(env, elems);
-       if (ret->datalen == 0) {
-               ret->data = NULL;
-       } else {
-               ret->data = MALLOC(sizeof(LDKRouteHop) * ret->datalen, "LDKCVec_RouteHopZ Data");
-               int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
-               for (size_t i = 0; i < ret->datalen; i++) {
-                       int64_t arr_elem = java_elems[i];
-                       LDKRouteHop arr_elem_conv;
-                       arr_elem_conv.inner = (void*)(arr_elem & (~1));
-                       arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0);
-                       arr_elem_conv = RouteHop_clone(&arr_elem_conv);
-                       ret->data[i] = arr_elem_conv;
-               }
-               (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0);
-       }
-       return (uint64_t)ret;
-}
 static inline LDKCVec_RouteHopZ CVec_RouteHopZ_clone(const LDKCVec_RouteHopZ *orig) {
        LDKCVec_RouteHopZ ret = { .data = MALLOC(sizeof(LDKRouteHop) * orig->datalen, "LDKCVec_RouteHopZ clone bytes"), .datalen = orig->datalen };
        for (size_t i = 0; i < ret.datalen; i++) {
@@ -1197,9 +1134,6 @@ static inline LDKCVec_CVec_RouteHopZZ CVec_CVec_RouteHopZZ_clone(const LDKCVec_C
        }
        return ret;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_RouteDecodeErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_RouteDecodeErrorZ *val = (LDKCResult_RouteDecodeErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -1207,6 +1141,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteDecodeErro
        uint64_t res_ref = 0;
        CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
        res_ref = (uint64_t)res_var.inner & ~1;
        return res_ref;
 }
@@ -1217,12 +1152,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteDecodeErro
        uint64_t err_ref = 0;
        CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
        err_ref = (uint64_t)err_var.inner & ~1;
        return err_ref;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteParametersDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_RouteParametersDecodeErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteParametersDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_RouteParametersDecodeErrorZ *val = (LDKCResult_RouteParametersDecodeErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -1230,6 +1163,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteParameters
        uint64_t res_ref = 0;
        CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
        res_ref = (uint64_t)res_var.inner & ~1;
        return res_ref;
 }
@@ -1240,29 +1174,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteParameters
        uint64_t err_ref = 0;
        CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
        err_ref = (uint64_t)err_var.inner & ~1;
        return err_ref;
 }
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1RouteHintZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) {
-       LDKCVec_RouteHintZ *ret = MALLOC(sizeof(LDKCVec_RouteHintZ), "LDKCVec_RouteHintZ");
-       ret->datalen = (*env)->GetArrayLength(env, elems);
-       if (ret->datalen == 0) {
-               ret->data = NULL;
-       } else {
-               ret->data = MALLOC(sizeof(LDKRouteHint) * ret->datalen, "LDKCVec_RouteHintZ Data");
-               int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
-               for (size_t i = 0; i < ret->datalen; i++) {
-                       int64_t arr_elem = java_elems[i];
-                       LDKRouteHint arr_elem_conv;
-                       arr_elem_conv.inner = (void*)(arr_elem & (~1));
-                       arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0);
-                       arr_elem_conv = RouteHint_clone(&arr_elem_conv);
-                       ret->data[i] = arr_elem_conv;
-               }
-               (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0);
-       }
-       return (uint64_t)ret;
-}
 static inline LDKCVec_RouteHintZ CVec_RouteHintZ_clone(const LDKCVec_RouteHintZ *orig) {
        LDKCVec_RouteHintZ ret = { .data = MALLOC(sizeof(LDKRouteHint) * orig->datalen, "LDKCVec_RouteHintZ clone bytes"), .datalen = orig->datalen };
        for (size_t i = 0; i < ret.datalen; i++) {
@@ -1298,9 +1213,6 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1u64Z_1ref_1from
                default: abort();
        }
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PayeeDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_PayeeDecodeErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PayeeDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_PayeeDecodeErrorZ *val = (LDKCResult_PayeeDecodeErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -1308,6 +1220,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PayeeDecodeErro
        uint64_t res_ref = 0;
        CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
        res_ref = (uint64_t)res_var.inner & ~1;
        return res_ref;
 }
@@ -1318,29 +1231,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PayeeDecodeErro
        uint64_t err_ref = 0;
        CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
        err_ref = (uint64_t)err_var.inner & ~1;
        return err_ref;
 }
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1RouteHintHopZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) {
-       LDKCVec_RouteHintHopZ *ret = MALLOC(sizeof(LDKCVec_RouteHintHopZ), "LDKCVec_RouteHintHopZ");
-       ret->datalen = (*env)->GetArrayLength(env, elems);
-       if (ret->datalen == 0) {
-               ret->data = NULL;
-       } else {
-               ret->data = MALLOC(sizeof(LDKRouteHintHop) * ret->datalen, "LDKCVec_RouteHintHopZ Data");
-               int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
-               for (size_t i = 0; i < ret->datalen; i++) {
-                       int64_t arr_elem = java_elems[i];
-                       LDKRouteHintHop arr_elem_conv;
-                       arr_elem_conv.inner = (void*)(arr_elem & (~1));
-                       arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0);
-                       arr_elem_conv = RouteHintHop_clone(&arr_elem_conv);
-                       ret->data[i] = arr_elem_conv;
-               }
-               (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0);
-       }
-       return (uint64_t)ret;
-}
 static inline LDKCVec_RouteHintHopZ CVec_RouteHintHopZ_clone(const LDKCVec_RouteHintHopZ *orig) {
        LDKCVec_RouteHintHopZ ret = { .data = MALLOC(sizeof(LDKRouteHintHop) * orig->datalen, "LDKCVec_RouteHintHopZ clone bytes"), .datalen = orig->datalen };
        for (size_t i = 0; i < ret.datalen; i++) {
@@ -1348,9 +1242,6 @@ static inline LDKCVec_RouteHintHopZ CVec_RouteHintHopZ_clone(const LDKCVec_Route
        }
        return ret;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteHintDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_RouteHintDecodeErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteHintDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_RouteHintDecodeErrorZ *val = (LDKCResult_RouteHintDecodeErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -1358,6 +1249,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteHintDecode
        uint64_t res_ref = 0;
        CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
        res_ref = (uint64_t)res_var.inner & ~1;
        return res_ref;
 }
@@ -1368,12 +1260,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteHintDecode
        uint64_t err_ref = 0;
        CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
        err_ref = (uint64_t)err_var.inner & ~1;
        return err_ref;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteHintHopDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_RouteHintHopDecodeErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteHintHopDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_RouteHintHopDecodeErrorZ *val = (LDKCResult_RouteHintHopDecodeErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -1381,6 +1271,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteHintHopDec
        uint64_t res_ref = 0;
        CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
        res_ref = (uint64_t)res_var.inner & ~1;
        return res_ref;
 }
@@ -1391,29 +1282,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteHintHopDec
        uint64_t err_ref = 0;
        CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
        err_ref = (uint64_t)err_var.inner & ~1;
        return err_ref;
 }
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1ChannelDetailsZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) {
-       LDKCVec_ChannelDetailsZ *ret = MALLOC(sizeof(LDKCVec_ChannelDetailsZ), "LDKCVec_ChannelDetailsZ");
-       ret->datalen = (*env)->GetArrayLength(env, elems);
-       if (ret->datalen == 0) {
-               ret->data = NULL;
-       } else {
-               ret->data = MALLOC(sizeof(LDKChannelDetails) * ret->datalen, "LDKCVec_ChannelDetailsZ Data");
-               int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
-               for (size_t i = 0; i < ret->datalen; i++) {
-                       int64_t arr_elem = java_elems[i];
-                       LDKChannelDetails arr_elem_conv;
-                       arr_elem_conv.inner = (void*)(arr_elem & (~1));
-                       arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0);
-                       arr_elem_conv = ChannelDetails_clone(&arr_elem_conv);
-                       ret->data[i] = arr_elem_conv;
-               }
-               (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0);
-       }
-       return (uint64_t)ret;
-}
 static inline LDKCVec_ChannelDetailsZ CVec_ChannelDetailsZ_clone(const LDKCVec_ChannelDetailsZ *orig) {
        LDKCVec_ChannelDetailsZ ret = { .data = MALLOC(sizeof(LDKChannelDetails) * orig->datalen, "LDKCVec_ChannelDetailsZ clone bytes"), .datalen = orig->datalen };
        for (size_t i = 0; i < ret.datalen; i++) {
@@ -1421,9 +1293,6 @@ static inline LDKCVec_ChannelDetailsZ CVec_ChannelDetailsZ_clone(const LDKCVec_C
        }
        return ret;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteLightningErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_RouteLightningErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteLightningErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_RouteLightningErrorZ *val = (LDKCResult_RouteLightningErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -1431,6 +1300,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteLightningE
        uint64_t res_ref = 0;
        CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
        res_ref = (uint64_t)res_var.inner & ~1;
        return res_ref;
 }
@@ -1441,12 +1311,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteLightningE
        uint64_t err_ref = 0;
        CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
        err_ref = (uint64_t)err_var.inner & ~1;
        return err_ref;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxOutAccessErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_TxOutAccessErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxOutAccessErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_TxOutAccessErrorZ *val = (LDKCResult_TxOutAccessErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -1480,26 +1348,6 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransacti
        return ret_arr;
 }
 
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1C2Tuple_1usizeTransactionZZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) {
-       LDKCVec_C2Tuple_usizeTransactionZZ *ret = MALLOC(sizeof(LDKCVec_C2Tuple_usizeTransactionZZ), "LDKCVec_C2Tuple_usizeTransactionZZ");
-       ret->datalen = (*env)->GetArrayLength(env, elems);
-       if (ret->datalen == 0) {
-               ret->data = NULL;
-       } else {
-               ret->data = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ) * ret->datalen, "LDKCVec_C2Tuple_usizeTransactionZZ Data");
-               int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
-               for (size_t i = 0; i < ret->datalen; i++) {
-                       int64_t arr_elem = java_elems[i];
-                       void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
-                       CHECK_ACCESS(arr_elem_ptr);
-                       LDKC2Tuple_usizeTransactionZ arr_elem_conv = *(LDKC2Tuple_usizeTransactionZ*)(arr_elem_ptr);
-                       arr_elem_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)(((uint64_t)arr_elem) & ~1));
-                       ret->data[i] = arr_elem_conv;
-               }
-               (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0);
-       }
-       return (uint64_t)ret;
-}
 static inline LDKCVec_C2Tuple_usizeTransactionZZ CVec_C2Tuple_usizeTransactionZZ_clone(const LDKCVec_C2Tuple_usizeTransactionZZ *orig) {
        LDKCVec_C2Tuple_usizeTransactionZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ) * orig->datalen, "LDKCVec_C2Tuple_usizeTransactionZZ clone bytes"), .datalen = orig->datalen };
        for (size_t i = 0; i < ret.datalen; i++) {
@@ -1514,9 +1362,6 @@ static inline LDKCVec_TxidZ CVec_ThirtyTwoBytesZ_clone(const LDKCVec_TxidZ *orig
        }
        return ret;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneChannelMonitorUpdateErrZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_NoneChannelMonitorUpdateErrZ*)arg)->result_ok;
-}
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneChannelMonitorUpdateErrZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_NoneChannelMonitorUpdateErrZ *val = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -1566,6 +1411,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMonitorEvent_1ref_1from_
                        uint64_t htlc_event_ref = 0;
                        CHECK((((uint64_t)htlc_event_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
                        CHECK((((uint64_t)&htlc_event_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+                       CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_event_var);
                        htlc_event_ref = (uint64_t)htlc_event_var.inner & ~1;
                        return (*env)->NewObject(env, LDKMonitorEvent_HTLCEvent_class, LDKMonitorEvent_HTLCEvent_meth, htlc_event_ref);
                }
@@ -1574,6 +1420,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMonitorEvent_1ref_1from_
                        uint64_t commitment_tx_confirmed_ref = 0;
                        CHECK((((uint64_t)commitment_tx_confirmed_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
                        CHECK((((uint64_t)&commitment_tx_confirmed_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+                       CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_confirmed_var);
                        commitment_tx_confirmed_ref = (uint64_t)commitment_tx_confirmed_var.inner & ~1;
                        return (*env)->NewObject(env, LDKMonitorEvent_CommitmentTxConfirmed_class, LDKMonitorEvent_CommitmentTxConfirmed_meth, commitment_tx_confirmed_ref);
                }
@@ -1582,6 +1429,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMonitorEvent_1ref_1from_
                        uint64_t funding_txo_ref = 0;
                        CHECK((((uint64_t)funding_txo_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
                        CHECK((((uint64_t)&funding_txo_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+                       CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_var);
                        funding_txo_ref = (uint64_t)funding_txo_var.inner & ~1;
                        return (*env)->NewObject(env, LDKMonitorEvent_UpdateCompleted_class, LDKMonitorEvent_UpdateCompleted_meth, funding_txo_ref, obj->update_completed.monitor_update_id);
                }
@@ -1590,32 +1438,13 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMonitorEvent_1ref_1from_
                        uint64_t update_failed_ref = 0;
                        CHECK((((uint64_t)update_failed_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
                        CHECK((((uint64_t)&update_failed_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+                       CHECK_INNER_FIELD_ACCESS_OR_NULL(update_failed_var);
                        update_failed_ref = (uint64_t)update_failed_var.inner & ~1;
                        return (*env)->NewObject(env, LDKMonitorEvent_UpdateFailed_class, LDKMonitorEvent_UpdateFailed_meth, update_failed_ref);
                }
                default: abort();
        }
 }
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1MonitorEventZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) {
-       LDKCVec_MonitorEventZ *ret = MALLOC(sizeof(LDKCVec_MonitorEventZ), "LDKCVec_MonitorEventZ");
-       ret->datalen = (*env)->GetArrayLength(env, elems);
-       if (ret->datalen == 0) {
-               ret->data = NULL;
-       } else {
-               ret->data = MALLOC(sizeof(LDKMonitorEvent) * ret->datalen, "LDKCVec_MonitorEventZ Data");
-               int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
-               for (size_t i = 0; i < ret->datalen; i++) {
-                       int64_t arr_elem = java_elems[i];
-                       void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
-                       CHECK_ACCESS(arr_elem_ptr);
-                       LDKMonitorEvent arr_elem_conv = *(LDKMonitorEvent*)(arr_elem_ptr);
-                       arr_elem_conv = MonitorEvent_clone((LDKMonitorEvent*)(((uint64_t)arr_elem) & ~1));
-                       ret->data[i] = arr_elem_conv;
-               }
-               (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0);
-       }
-       return (uint64_t)ret;
-}
 static inline LDKCVec_MonitorEventZ CVec_MonitorEventZ_clone(const LDKCVec_MonitorEventZ *orig) {
        LDKCVec_MonitorEventZ ret = { .data = MALLOC(sizeof(LDKMonitorEvent) * orig->datalen, "LDKCVec_MonitorEventZ clone bytes"), .datalen = orig->datalen };
        for (size_t i = 0; i < ret.datalen; i++) {
@@ -1654,6 +1483,134 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1C2Tuple_1usizeT
                default: abort();
        }
 }
+static jclass LDKClosureReason_CounterpartyForceClosed_class = NULL;
+static jmethodID LDKClosureReason_CounterpartyForceClosed_meth = NULL;
+static jclass LDKClosureReason_HolderForceClosed_class = NULL;
+static jmethodID LDKClosureReason_HolderForceClosed_meth = NULL;
+static jclass LDKClosureReason_CooperativeClosure_class = NULL;
+static jmethodID LDKClosureReason_CooperativeClosure_meth = NULL;
+static jclass LDKClosureReason_CommitmentTxConfirmed_class = NULL;
+static jmethodID LDKClosureReason_CommitmentTxConfirmed_meth = NULL;
+static jclass LDKClosureReason_ProcessingError_class = NULL;
+static jmethodID LDKClosureReason_ProcessingError_meth = NULL;
+static jclass LDKClosureReason_DisconnectedPeer_class = NULL;
+static jmethodID LDKClosureReason_DisconnectedPeer_meth = NULL;
+static jclass LDKClosureReason_OutdatedChannelManager_class = NULL;
+static jmethodID LDKClosureReason_OutdatedChannelManager_meth = NULL;
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKClosureReason_init (JNIEnv *env, jclass clz) {
+       LDKClosureReason_CounterpartyForceClosed_class =
+               (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKClosureReason$CounterpartyForceClosed;"));
+       CHECK(LDKClosureReason_CounterpartyForceClosed_class != NULL);
+       LDKClosureReason_CounterpartyForceClosed_meth = (*env)->GetMethodID(env, LDKClosureReason_CounterpartyForceClosed_class, "<init>", "(Ljava/lang/String;)V");
+       CHECK(LDKClosureReason_CounterpartyForceClosed_meth != NULL);
+       LDKClosureReason_HolderForceClosed_class =
+               (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKClosureReason$HolderForceClosed;"));
+       CHECK(LDKClosureReason_HolderForceClosed_class != NULL);
+       LDKClosureReason_HolderForceClosed_meth = (*env)->GetMethodID(env, LDKClosureReason_HolderForceClosed_class, "<init>", "()V");
+       CHECK(LDKClosureReason_HolderForceClosed_meth != NULL);
+       LDKClosureReason_CooperativeClosure_class =
+               (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKClosureReason$CooperativeClosure;"));
+       CHECK(LDKClosureReason_CooperativeClosure_class != NULL);
+       LDKClosureReason_CooperativeClosure_meth = (*env)->GetMethodID(env, LDKClosureReason_CooperativeClosure_class, "<init>", "()V");
+       CHECK(LDKClosureReason_CooperativeClosure_meth != NULL);
+       LDKClosureReason_CommitmentTxConfirmed_class =
+               (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKClosureReason$CommitmentTxConfirmed;"));
+       CHECK(LDKClosureReason_CommitmentTxConfirmed_class != NULL);
+       LDKClosureReason_CommitmentTxConfirmed_meth = (*env)->GetMethodID(env, LDKClosureReason_CommitmentTxConfirmed_class, "<init>", "()V");
+       CHECK(LDKClosureReason_CommitmentTxConfirmed_meth != NULL);
+       LDKClosureReason_ProcessingError_class =
+               (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKClosureReason$ProcessingError;"));
+       CHECK(LDKClosureReason_ProcessingError_class != NULL);
+       LDKClosureReason_ProcessingError_meth = (*env)->GetMethodID(env, LDKClosureReason_ProcessingError_class, "<init>", "(Ljava/lang/String;)V");
+       CHECK(LDKClosureReason_ProcessingError_meth != NULL);
+       LDKClosureReason_DisconnectedPeer_class =
+               (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKClosureReason$DisconnectedPeer;"));
+       CHECK(LDKClosureReason_DisconnectedPeer_class != NULL);
+       LDKClosureReason_DisconnectedPeer_meth = (*env)->GetMethodID(env, LDKClosureReason_DisconnectedPeer_class, "<init>", "()V");
+       CHECK(LDKClosureReason_DisconnectedPeer_meth != NULL);
+       LDKClosureReason_OutdatedChannelManager_class =
+               (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKClosureReason$OutdatedChannelManager;"));
+       CHECK(LDKClosureReason_OutdatedChannelManager_class != NULL);
+       LDKClosureReason_OutdatedChannelManager_meth = (*env)->GetMethodID(env, LDKClosureReason_OutdatedChannelManager_class, "<init>", "()V");
+       CHECK(LDKClosureReason_OutdatedChannelManager_meth != NULL);
+}
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKClosureReason_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
+       LDKClosureReason *obj = (LDKClosureReason*)(ptr & ~1);
+       switch(obj->tag) {
+               case LDKClosureReason_CounterpartyForceClosed: {
+                       LDKStr peer_msg_str = obj->counterparty_force_closed.peer_msg;
+                       jstring peer_msg_conv = str_ref_to_java(env, peer_msg_str.chars, peer_msg_str.len);
+                       return (*env)->NewObject(env, LDKClosureReason_CounterpartyForceClosed_class, LDKClosureReason_CounterpartyForceClosed_meth, peer_msg_conv);
+               }
+               case LDKClosureReason_HolderForceClosed: {
+                       return (*env)->NewObject(env, LDKClosureReason_HolderForceClosed_class, LDKClosureReason_HolderForceClosed_meth);
+               }
+               case LDKClosureReason_CooperativeClosure: {
+                       return (*env)->NewObject(env, LDKClosureReason_CooperativeClosure_class, LDKClosureReason_CooperativeClosure_meth);
+               }
+               case LDKClosureReason_CommitmentTxConfirmed: {
+                       return (*env)->NewObject(env, LDKClosureReason_CommitmentTxConfirmed_class, LDKClosureReason_CommitmentTxConfirmed_meth);
+               }
+               case LDKClosureReason_ProcessingError: {
+                       LDKStr err_str = obj->processing_error.err;
+                       jstring err_conv = str_ref_to_java(env, err_str.chars, err_str.len);
+                       return (*env)->NewObject(env, LDKClosureReason_ProcessingError_class, LDKClosureReason_ProcessingError_meth, err_conv);
+               }
+               case LDKClosureReason_DisconnectedPeer: {
+                       return (*env)->NewObject(env, LDKClosureReason_DisconnectedPeer_class, LDKClosureReason_DisconnectedPeer_meth);
+               }
+               case LDKClosureReason_OutdatedChannelManager: {
+                       return (*env)->NewObject(env, LDKClosureReason_OutdatedChannelManager_class, LDKClosureReason_OutdatedChannelManager_meth);
+               }
+               default: abort();
+       }
+}
+static jclass LDKCOption_ClosureReasonZ_Some_class = NULL;
+static jmethodID LDKCOption_ClosureReasonZ_Some_meth = NULL;
+static jclass LDKCOption_ClosureReasonZ_None_class = NULL;
+static jmethodID LDKCOption_ClosureReasonZ_None_meth = NULL;
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1ClosureReasonZ_init (JNIEnv *env, jclass clz) {
+       LDKCOption_ClosureReasonZ_Some_class =
+               (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKCOption_ClosureReasonZ$Some;"));
+       CHECK(LDKCOption_ClosureReasonZ_Some_class != NULL);
+       LDKCOption_ClosureReasonZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_ClosureReasonZ_Some_class, "<init>", "(J)V");
+       CHECK(LDKCOption_ClosureReasonZ_Some_meth != NULL);
+       LDKCOption_ClosureReasonZ_None_class =
+               (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKCOption_ClosureReasonZ$None;"));
+       CHECK(LDKCOption_ClosureReasonZ_None_class != NULL);
+       LDKCOption_ClosureReasonZ_None_meth = (*env)->GetMethodID(env, LDKCOption_ClosureReasonZ_None_class, "<init>", "()V");
+       CHECK(LDKCOption_ClosureReasonZ_None_meth != NULL);
+}
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1ClosureReasonZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
+       LDKCOption_ClosureReasonZ *obj = (LDKCOption_ClosureReasonZ*)(ptr & ~1);
+       switch(obj->tag) {
+               case LDKCOption_ClosureReasonZ_Some: {
+                       uint64_t some_ref = ((uint64_t)&obj->some) | 1;
+                       return (*env)->NewObject(env, LDKCOption_ClosureReasonZ_Some_class, LDKCOption_ClosureReasonZ_Some_meth, some_ref);
+               }
+               case LDKCOption_ClosureReasonZ_None: {
+                       return (*env)->NewObject(env, LDKCOption_ClosureReasonZ_None_class, LDKCOption_ClosureReasonZ_None_meth);
+               }
+               default: abort();
+       }
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1COption_1ClosureReasonZDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_COption_ClosureReasonZDecodeErrorZ *val = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)(arg & ~1);
+       CHECK(val->result_ok);
+       uint64_t res_ref = ((uint64_t)&(*val->contents.result)) | 1;
+       return res_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1COption_1ClosureReasonZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_COption_ClosureReasonZDecodeErrorZ *val = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)(arg & ~1);
+       CHECK(!val->result_ok);
+       LDKDecodeError err_var = (*val->contents.err);
+       uint64_t err_ref = 0;
+       CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+       CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
+       err_ref = (uint64_t)err_var.inner & ~1;
+       return err_ref;
+}
 static jclass LDKNetworkUpdate_ChannelUpdateMessage_class = NULL;
 static jmethodID LDKNetworkUpdate_ChannelUpdateMessage_meth = NULL;
 static jclass LDKNetworkUpdate_ChannelClosed_class = NULL;
@@ -1685,6 +1642,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKNetworkUpdate_1ref_1from
                        uint64_t msg_ref = 0;
                        CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
                        CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+                       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
                        msg_ref = (uint64_t)msg_var.inner & ~1;
                        return (*env)->NewObject(env, LDKNetworkUpdate_ChannelUpdateMessage_class, LDKNetworkUpdate_ChannelUpdateMessage_meth, msg_ref);
                }
@@ -1759,6 +1717,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKSpendableOutputDescripto
                        uint64_t outpoint_ref = 0;
                        CHECK((((uint64_t)outpoint_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
                        CHECK((((uint64_t)&outpoint_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+                       CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_var);
                        outpoint_ref = (uint64_t)outpoint_var.inner & ~1;
                        uint64_t output_ref = ((uint64_t)&obj->static_output.output) | 1;
                        return (*env)->NewObject(env, LDKSpendableOutputDescriptor_StaticOutput_class, LDKSpendableOutputDescriptor_StaticOutput_meth, outpoint_ref, (uint64_t)output_ref);
@@ -1768,6 +1727,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKSpendableOutputDescripto
                        uint64_t delayed_payment_output_ref = 0;
                        CHECK((((uint64_t)delayed_payment_output_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
                        CHECK((((uint64_t)&delayed_payment_output_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+                       CHECK_INNER_FIELD_ACCESS_OR_NULL(delayed_payment_output_var);
                        delayed_payment_output_ref = (uint64_t)delayed_payment_output_var.inner & ~1;
                        return (*env)->NewObject(env, LDKSpendableOutputDescriptor_DelayedPaymentOutput_class, LDKSpendableOutputDescriptor_DelayedPaymentOutput_meth, delayed_payment_output_ref);
                }
@@ -1776,32 +1736,13 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKSpendableOutputDescripto
                        uint64_t static_payment_output_ref = 0;
                        CHECK((((uint64_t)static_payment_output_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
                        CHECK((((uint64_t)&static_payment_output_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+                       CHECK_INNER_FIELD_ACCESS_OR_NULL(static_payment_output_var);
                        static_payment_output_ref = (uint64_t)static_payment_output_var.inner & ~1;
                        return (*env)->NewObject(env, LDKSpendableOutputDescriptor_StaticPaymentOutput_class, LDKSpendableOutputDescriptor_StaticPaymentOutput_meth, static_payment_output_ref);
                }
                default: abort();
        }
 }
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1SpendableOutputDescriptorZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) {
-       LDKCVec_SpendableOutputDescriptorZ *ret = MALLOC(sizeof(LDKCVec_SpendableOutputDescriptorZ), "LDKCVec_SpendableOutputDescriptorZ");
-       ret->datalen = (*env)->GetArrayLength(env, elems);
-       if (ret->datalen == 0) {
-               ret->data = NULL;
-       } else {
-               ret->data = MALLOC(sizeof(LDKSpendableOutputDescriptor) * ret->datalen, "LDKCVec_SpendableOutputDescriptorZ Data");
-               int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
-               for (size_t i = 0; i < ret->datalen; i++) {
-                       int64_t arr_elem = java_elems[i];
-                       void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
-                       CHECK_ACCESS(arr_elem_ptr);
-                       LDKSpendableOutputDescriptor arr_elem_conv = *(LDKSpendableOutputDescriptor*)(arr_elem_ptr);
-                       arr_elem_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)(((uint64_t)arr_elem) & ~1));
-                       ret->data[i] = arr_elem_conv;
-               }
-               (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0);
-       }
-       return (uint64_t)ret;
-}
 static inline LDKCVec_SpendableOutputDescriptorZ CVec_SpendableOutputDescriptorZ_clone(const LDKCVec_SpendableOutputDescriptorZ *orig) {
        LDKCVec_SpendableOutputDescriptorZ ret = { .data = MALLOC(sizeof(LDKSpendableOutputDescriptor) * orig->datalen, "LDKCVec_SpendableOutputDescriptorZ clone bytes"), .datalen = orig->datalen };
        for (size_t i = 0; i < ret.datalen; i++) {
@@ -1809,6 +1750,245 @@ static inline LDKCVec_SpendableOutputDescriptorZ CVec_SpendableOutputDescriptorZ
        }
        return ret;
 }
+static jclass LDKPaymentPurpose_InvoicePayment_class = NULL;
+static jmethodID LDKPaymentPurpose_InvoicePayment_meth = NULL;
+static jclass LDKPaymentPurpose_SpontaneousPayment_class = NULL;
+static jmethodID LDKPaymentPurpose_SpontaneousPayment_meth = NULL;
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKPaymentPurpose_init (JNIEnv *env, jclass clz) {
+       LDKPaymentPurpose_InvoicePayment_class =
+               (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKPaymentPurpose$InvoicePayment;"));
+       CHECK(LDKPaymentPurpose_InvoicePayment_class != NULL);
+       LDKPaymentPurpose_InvoicePayment_meth = (*env)->GetMethodID(env, LDKPaymentPurpose_InvoicePayment_class, "<init>", "([B[BJ)V");
+       CHECK(LDKPaymentPurpose_InvoicePayment_meth != NULL);
+       LDKPaymentPurpose_SpontaneousPayment_class =
+               (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKPaymentPurpose$SpontaneousPayment;"));
+       CHECK(LDKPaymentPurpose_SpontaneousPayment_class != NULL);
+       LDKPaymentPurpose_SpontaneousPayment_meth = (*env)->GetMethodID(env, LDKPaymentPurpose_SpontaneousPayment_class, "<init>", "([B)V");
+       CHECK(LDKPaymentPurpose_SpontaneousPayment_meth != NULL);
+}
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPaymentPurpose_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
+       LDKPaymentPurpose *obj = (LDKPaymentPurpose*)(ptr & ~1);
+       switch(obj->tag) {
+               case LDKPaymentPurpose_InvoicePayment: {
+                       int8_tArray payment_preimage_arr = (*env)->NewByteArray(env, 32);
+                       (*env)->SetByteArrayRegion(env, payment_preimage_arr, 0, 32, obj->invoice_payment.payment_preimage.data);
+                       int8_tArray payment_secret_arr = (*env)->NewByteArray(env, 32);
+                       (*env)->SetByteArrayRegion(env, payment_secret_arr, 0, 32, obj->invoice_payment.payment_secret.data);
+                       return (*env)->NewObject(env, LDKPaymentPurpose_InvoicePayment_class, LDKPaymentPurpose_InvoicePayment_meth, payment_preimage_arr, payment_secret_arr, obj->invoice_payment.user_payment_id);
+               }
+               case LDKPaymentPurpose_SpontaneousPayment: {
+                       int8_tArray spontaneous_payment_arr = (*env)->NewByteArray(env, 32);
+                       (*env)->SetByteArrayRegion(env, spontaneous_payment_arr, 0, 32, obj->spontaneous_payment.data);
+                       return (*env)->NewObject(env, LDKPaymentPurpose_SpontaneousPayment_class, LDKPaymentPurpose_SpontaneousPayment_meth, spontaneous_payment_arr);
+               }
+               default: abort();
+       }
+}
+static jclass LDKEvent_FundingGenerationReady_class = NULL;
+static jmethodID LDKEvent_FundingGenerationReady_meth = NULL;
+static jclass LDKEvent_PaymentReceived_class = NULL;
+static jmethodID LDKEvent_PaymentReceived_meth = NULL;
+static jclass LDKEvent_PaymentSent_class = NULL;
+static jmethodID LDKEvent_PaymentSent_meth = NULL;
+static jclass LDKEvent_PaymentPathFailed_class = NULL;
+static jmethodID LDKEvent_PaymentPathFailed_meth = NULL;
+static jclass LDKEvent_PendingHTLCsForwardable_class = NULL;
+static jmethodID LDKEvent_PendingHTLCsForwardable_meth = NULL;
+static jclass LDKEvent_SpendableOutputs_class = NULL;
+static jmethodID LDKEvent_SpendableOutputs_meth = NULL;
+static jclass LDKEvent_PaymentForwarded_class = NULL;
+static jmethodID LDKEvent_PaymentForwarded_meth = NULL;
+static jclass LDKEvent_ChannelClosed_class = NULL;
+static jmethodID LDKEvent_ChannelClosed_meth = NULL;
+static jclass LDKEvent_DiscardFunding_class = NULL;
+static jmethodID LDKEvent_DiscardFunding_meth = NULL;
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKEvent_init (JNIEnv *env, jclass clz) {
+       LDKEvent_FundingGenerationReady_class =
+               (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$FundingGenerationReady;"));
+       CHECK(LDKEvent_FundingGenerationReady_class != NULL);
+       LDKEvent_FundingGenerationReady_meth = (*env)->GetMethodID(env, LDKEvent_FundingGenerationReady_class, "<init>", "([BJ[BJ)V");
+       CHECK(LDKEvent_FundingGenerationReady_meth != NULL);
+       LDKEvent_PaymentReceived_class =
+               (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$PaymentReceived;"));
+       CHECK(LDKEvent_PaymentReceived_class != NULL);
+       LDKEvent_PaymentReceived_meth = (*env)->GetMethodID(env, LDKEvent_PaymentReceived_class, "<init>", "([BJJ)V");
+       CHECK(LDKEvent_PaymentReceived_meth != NULL);
+       LDKEvent_PaymentSent_class =
+               (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$PaymentSent;"));
+       CHECK(LDKEvent_PaymentSent_class != NULL);
+       LDKEvent_PaymentSent_meth = (*env)->GetMethodID(env, LDKEvent_PaymentSent_class, "<init>", "([B[B[BJ)V");
+       CHECK(LDKEvent_PaymentSent_meth != NULL);
+       LDKEvent_PaymentPathFailed_class =
+               (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$PaymentPathFailed;"));
+       CHECK(LDKEvent_PaymentPathFailed_class != NULL);
+       LDKEvent_PaymentPathFailed_meth = (*env)->GetMethodID(env, LDKEvent_PaymentPathFailed_class, "<init>", "([B[BZJZ[JJJ)V");
+       CHECK(LDKEvent_PaymentPathFailed_meth != NULL);
+       LDKEvent_PendingHTLCsForwardable_class =
+               (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$PendingHTLCsForwardable;"));
+       CHECK(LDKEvent_PendingHTLCsForwardable_class != NULL);
+       LDKEvent_PendingHTLCsForwardable_meth = (*env)->GetMethodID(env, LDKEvent_PendingHTLCsForwardable_class, "<init>", "(J)V");
+       CHECK(LDKEvent_PendingHTLCsForwardable_meth != NULL);
+       LDKEvent_SpendableOutputs_class =
+               (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$SpendableOutputs;"));
+       CHECK(LDKEvent_SpendableOutputs_class != NULL);
+       LDKEvent_SpendableOutputs_meth = (*env)->GetMethodID(env, LDKEvent_SpendableOutputs_class, "<init>", "([J)V");
+       CHECK(LDKEvent_SpendableOutputs_meth != NULL);
+       LDKEvent_PaymentForwarded_class =
+               (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$PaymentForwarded;"));
+       CHECK(LDKEvent_PaymentForwarded_class != NULL);
+       LDKEvent_PaymentForwarded_meth = (*env)->GetMethodID(env, LDKEvent_PaymentForwarded_class, "<init>", "(JZ)V");
+       CHECK(LDKEvent_PaymentForwarded_meth != NULL);
+       LDKEvent_ChannelClosed_class =
+               (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$ChannelClosed;"));
+       CHECK(LDKEvent_ChannelClosed_class != NULL);
+       LDKEvent_ChannelClosed_meth = (*env)->GetMethodID(env, LDKEvent_ChannelClosed_class, "<init>", "([BJJ)V");
+       CHECK(LDKEvent_ChannelClosed_meth != NULL);
+       LDKEvent_DiscardFunding_class =
+               (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$DiscardFunding;"));
+       CHECK(LDKEvent_DiscardFunding_class != NULL);
+       LDKEvent_DiscardFunding_meth = (*env)->GetMethodID(env, LDKEvent_DiscardFunding_class, "<init>", "([B[B)V");
+       CHECK(LDKEvent_DiscardFunding_meth != NULL);
+}
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEvent_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
+       LDKEvent *obj = (LDKEvent*)(ptr & ~1);
+       switch(obj->tag) {
+               case LDKEvent_FundingGenerationReady: {
+                       int8_tArray temporary_channel_id_arr = (*env)->NewByteArray(env, 32);
+                       (*env)->SetByteArrayRegion(env, temporary_channel_id_arr, 0, 32, obj->funding_generation_ready.temporary_channel_id.data);
+                       LDKCVec_u8Z output_script_var = obj->funding_generation_ready.output_script;
+                       int8_tArray output_script_arr = (*env)->NewByteArray(env, output_script_var.datalen);
+                       (*env)->SetByteArrayRegion(env, output_script_arr, 0, output_script_var.datalen, output_script_var.data);
+                       return (*env)->NewObject(env, LDKEvent_FundingGenerationReady_class, LDKEvent_FundingGenerationReady_meth, temporary_channel_id_arr, obj->funding_generation_ready.channel_value_satoshis, output_script_arr, obj->funding_generation_ready.user_channel_id);
+               }
+               case LDKEvent_PaymentReceived: {
+                       int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32);
+                       (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->payment_received.payment_hash.data);
+                       uint64_t purpose_ref = ((uint64_t)&obj->payment_received.purpose) | 1;
+                       return (*env)->NewObject(env, LDKEvent_PaymentReceived_class, LDKEvent_PaymentReceived_meth, payment_hash_arr, obj->payment_received.amt, purpose_ref);
+               }
+               case LDKEvent_PaymentSent: {
+                       int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32);
+                       (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, obj->payment_sent.payment_id.data);
+                       int8_tArray payment_preimage_arr = (*env)->NewByteArray(env, 32);
+                       (*env)->SetByteArrayRegion(env, payment_preimage_arr, 0, 32, obj->payment_sent.payment_preimage.data);
+                       int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32);
+                       (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->payment_sent.payment_hash.data);
+                       uint64_t fee_paid_msat_ref = ((uint64_t)&obj->payment_sent.fee_paid_msat) | 1;
+                       return (*env)->NewObject(env, LDKEvent_PaymentSent_class, LDKEvent_PaymentSent_meth, payment_id_arr, payment_preimage_arr, payment_hash_arr, fee_paid_msat_ref);
+               }
+               case LDKEvent_PaymentPathFailed: {
+                       int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32);
+                       (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, obj->payment_path_failed.payment_id.data);
+                       int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32);
+                       (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->payment_path_failed.payment_hash.data);
+                       uint64_t network_update_ref = ((uint64_t)&obj->payment_path_failed.network_update) | 1;
+                       LDKCVec_RouteHopZ path_var = obj->payment_path_failed.path;
+                       int64_tArray path_arr = NULL;
+                       path_arr = (*env)->NewLongArray(env, path_var.datalen);
+                       int64_t *path_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, path_arr, NULL);
+                       for (size_t k = 0; k < path_var.datalen; k++) {
+                               LDKRouteHop path_conv_10_var = path_var.data[k];
+                               uint64_t path_conv_10_ref = 0;
+                               CHECK((((uint64_t)path_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+                               CHECK((((uint64_t)&path_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+                               CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
+                               path_conv_10_ref = (uint64_t)path_conv_10_var.inner & ~1;
+                               path_arr_ptr[k] = path_conv_10_ref;
+                       }
+                       (*env)->ReleasePrimitiveArrayCritical(env, path_arr, path_arr_ptr, 0);
+                       uint64_t short_channel_id_ref = ((uint64_t)&obj->payment_path_failed.short_channel_id) | 1;
+                       LDKRouteParameters retry_var = obj->payment_path_failed.retry;
+                       uint64_t retry_ref = 0;
+                       if ((uint64_t)retry_var.inner > 4096) {
+                               CHECK((((uint64_t)retry_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+                               CHECK((((uint64_t)&retry_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+                       CHECK_INNER_FIELD_ACCESS_OR_NULL(retry_var);
+                               retry_ref = (uint64_t)retry_var.inner & ~1;
+                       }
+                       return (*env)->NewObject(env, LDKEvent_PaymentPathFailed_class, LDKEvent_PaymentPathFailed_meth, payment_id_arr, payment_hash_arr, obj->payment_path_failed.rejected_by_dest, network_update_ref, obj->payment_path_failed.all_paths_failed, path_arr, short_channel_id_ref, retry_ref);
+               }
+               case LDKEvent_PendingHTLCsForwardable: {
+                       return (*env)->NewObject(env, LDKEvent_PendingHTLCsForwardable_class, LDKEvent_PendingHTLCsForwardable_meth, obj->pending_htl_cs_forwardable.time_forwardable);
+               }
+               case LDKEvent_SpendableOutputs: {
+                       LDKCVec_SpendableOutputDescriptorZ outputs_var = obj->spendable_outputs.outputs;
+                       int64_tArray outputs_arr = NULL;
+                       outputs_arr = (*env)->NewLongArray(env, outputs_var.datalen);
+                       int64_t *outputs_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, outputs_arr, NULL);
+                       for (size_t b = 0; b < outputs_var.datalen; b++) {
+                               uint64_t outputs_conv_27_ref = ((uint64_t)&outputs_var.data[b]) | 1;
+                               outputs_arr_ptr[b] = outputs_conv_27_ref;
+                       }
+                       (*env)->ReleasePrimitiveArrayCritical(env, outputs_arr, outputs_arr_ptr, 0);
+                       return (*env)->NewObject(env, LDKEvent_SpendableOutputs_class, LDKEvent_SpendableOutputs_meth, outputs_arr);
+               }
+               case LDKEvent_PaymentForwarded: {
+                       uint64_t fee_earned_msat_ref = ((uint64_t)&obj->payment_forwarded.fee_earned_msat) | 1;
+                       return (*env)->NewObject(env, LDKEvent_PaymentForwarded_class, LDKEvent_PaymentForwarded_meth, fee_earned_msat_ref, obj->payment_forwarded.claim_from_onchain_tx);
+               }
+               case LDKEvent_ChannelClosed: {
+                       int8_tArray channel_id_arr = (*env)->NewByteArray(env, 32);
+                       (*env)->SetByteArrayRegion(env, channel_id_arr, 0, 32, obj->channel_closed.channel_id.data);
+                       uint64_t reason_ref = ((uint64_t)&obj->channel_closed.reason) | 1;
+                       return (*env)->NewObject(env, LDKEvent_ChannelClosed_class, LDKEvent_ChannelClosed_meth, channel_id_arr, obj->channel_closed.user_channel_id, reason_ref);
+               }
+               case LDKEvent_DiscardFunding: {
+                       int8_tArray channel_id_arr = (*env)->NewByteArray(env, 32);
+                       (*env)->SetByteArrayRegion(env, channel_id_arr, 0, 32, obj->discard_funding.channel_id.data);
+                       LDKTransaction transaction_var = obj->discard_funding.transaction;
+                       int8_tArray transaction_arr = (*env)->NewByteArray(env, transaction_var.datalen);
+                       (*env)->SetByteArrayRegion(env, transaction_arr, 0, transaction_var.datalen, transaction_var.data);
+                       return (*env)->NewObject(env, LDKEvent_DiscardFunding_class, LDKEvent_DiscardFunding_meth, channel_id_arr, transaction_arr);
+               }
+               default: abort();
+       }
+}
+static jclass LDKCOption_EventZ_Some_class = NULL;
+static jmethodID LDKCOption_EventZ_Some_meth = NULL;
+static jclass LDKCOption_EventZ_None_class = NULL;
+static jmethodID LDKCOption_EventZ_None_meth = NULL;
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1EventZ_init (JNIEnv *env, jclass clz) {
+       LDKCOption_EventZ_Some_class =
+               (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKCOption_EventZ$Some;"));
+       CHECK(LDKCOption_EventZ_Some_class != NULL);
+       LDKCOption_EventZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_EventZ_Some_class, "<init>", "(J)V");
+       CHECK(LDKCOption_EventZ_Some_meth != NULL);
+       LDKCOption_EventZ_None_class =
+               (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKCOption_EventZ$None;"));
+       CHECK(LDKCOption_EventZ_None_class != NULL);
+       LDKCOption_EventZ_None_meth = (*env)->GetMethodID(env, LDKCOption_EventZ_None_class, "<init>", "()V");
+       CHECK(LDKCOption_EventZ_None_meth != NULL);
+}
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1EventZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
+       LDKCOption_EventZ *obj = (LDKCOption_EventZ*)(ptr & ~1);
+       switch(obj->tag) {
+               case LDKCOption_EventZ_Some: {
+                       uint64_t some_ref = ((uint64_t)&obj->some) | 1;
+                       return (*env)->NewObject(env, LDKCOption_EventZ_Some_class, LDKCOption_EventZ_Some_meth, some_ref);
+               }
+               case LDKCOption_EventZ_None: {
+                       return (*env)->NewObject(env, LDKCOption_EventZ_None_class, LDKCOption_EventZ_None_meth);
+               }
+               default: abort();
+       }
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1COption_1EventZDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_COption_EventZDecodeErrorZ *val = (LDKCResult_COption_EventZDecodeErrorZ*)(arg & ~1);
+       CHECK(val->result_ok);
+       uint64_t res_ref = ((uint64_t)&(*val->contents.result)) | 1;
+       return res_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1COption_1EventZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_COption_EventZDecodeErrorZ *val = (LDKCResult_COption_EventZDecodeErrorZ*)(arg & ~1);
+       CHECK(!val->result_ok);
+       LDKDecodeError err_var = (*val->contents.err);
+       uint64_t err_ref = 0;
+       CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+       CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
+       err_ref = (uint64_t)err_var.inner & ~1;
+       return err_ref;
+}
 static jclass LDKErrorAction_DisconnectPeer_class = NULL;
 static jmethodID LDKErrorAction_DisconnectPeer_meth = NULL;
 static jclass LDKErrorAction_IgnoreError_class = NULL;
@@ -1848,6 +2028,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKErrorAction_1ref_1from_1
                        if ((uint64_t)msg_var.inner > 4096) {
                                CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
                                CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+                       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
                                msg_ref = (uint64_t)msg_var.inner & ~1;
                        }
                        return (*env)->NewObject(env, LDKErrorAction_DisconnectPeer_class, LDKErrorAction_DisconnectPeer_meth, msg_ref);
@@ -1864,6 +2045,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKErrorAction_1ref_1from_1
                        uint64_t msg_ref = 0;
                        CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
                        CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+                       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
                        msg_ref = (uint64_t)msg_var.inner & ~1;
                        return (*env)->NewObject(env, LDKErrorAction_SendErrorMessage_class, LDKErrorAction_SendErrorMessage_meth, msg_ref);
                }
@@ -2015,6 +2197,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1f
                        uint64_t msg_ref = 0;
                        CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
                        CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+                       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
                        msg_ref = (uint64_t)msg_var.inner & ~1;
                        return (*env)->NewObject(env, LDKMessageSendEvent_SendAcceptChannel_class, LDKMessageSendEvent_SendAcceptChannel_meth, node_id_arr, msg_ref);
                }
@@ -2025,6 +2208,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1f
                        uint64_t msg_ref = 0;
                        CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
                        CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+                       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
                        msg_ref = (uint64_t)msg_var.inner & ~1;
                        return (*env)->NewObject(env, LDKMessageSendEvent_SendOpenChannel_class, LDKMessageSendEvent_SendOpenChannel_meth, node_id_arr, msg_ref);
                }
@@ -2035,6 +2219,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1f
                        uint64_t msg_ref = 0;
                        CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
                        CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+                       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
                        msg_ref = (uint64_t)msg_var.inner & ~1;
                        return (*env)->NewObject(env, LDKMessageSendEvent_SendFundingCreated_class, LDKMessageSendEvent_SendFundingCreated_meth, node_id_arr, msg_ref);
                }
@@ -2045,6 +2230,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1f
                        uint64_t msg_ref = 0;
                        CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
                        CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+                       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
                        msg_ref = (uint64_t)msg_var.inner & ~1;
                        return (*env)->NewObject(env, LDKMessageSendEvent_SendFundingSigned_class, LDKMessageSendEvent_SendFundingSigned_meth, node_id_arr, msg_ref);
                }
@@ -2055,6 +2241,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1f
                        uint64_t msg_ref = 0;
                        CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
                        CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+                       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
                        msg_ref = (uint64_t)msg_var.inner & ~1;
                        return (*env)->NewObject(env, LDKMessageSendEvent_SendFundingLocked_class, LDKMessageSendEvent_SendFundingLocked_meth, node_id_arr, msg_ref);
                }
@@ -2065,6 +2252,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1f
                        uint64_t msg_ref = 0;
                        CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
                        CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+                       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
                        msg_ref = (uint64_t)msg_var.inner & ~1;
                        return (*env)->NewObject(env, LDKMessageSendEvent_SendAnnouncementSignatures_class, LDKMessageSendEvent_SendAnnouncementSignatures_meth, node_id_arr, msg_ref);
                }
@@ -2075,6 +2263,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1f
                        uint64_t updates_ref = 0;
                        CHECK((((uint64_t)updates_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
                        CHECK((((uint64_t)&updates_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+                       CHECK_INNER_FIELD_ACCESS_OR_NULL(updates_var);
                        updates_ref = (uint64_t)updates_var.inner & ~1;
                        return (*env)->NewObject(env, LDKMessageSendEvent_UpdateHTLCs_class, LDKMessageSendEvent_UpdateHTLCs_meth, node_id_arr, updates_ref);
                }
@@ -2085,6 +2274,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1f
                        uint64_t msg_ref = 0;
                        CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
                        CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+                       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
                        msg_ref = (uint64_t)msg_var.inner & ~1;
                        return (*env)->NewObject(env, LDKMessageSendEvent_SendRevokeAndACK_class, LDKMessageSendEvent_SendRevokeAndACK_meth, node_id_arr, msg_ref);
                }
@@ -2095,6 +2285,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1f
                        uint64_t msg_ref = 0;
                        CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
                        CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+                       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
                        msg_ref = (uint64_t)msg_var.inner & ~1;
                        return (*env)->NewObject(env, LDKMessageSendEvent_SendClosingSigned_class, LDKMessageSendEvent_SendClosingSigned_meth, node_id_arr, msg_ref);
                }
@@ -2105,6 +2296,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1f
                        uint64_t msg_ref = 0;
                        CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
                        CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+                       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
                        msg_ref = (uint64_t)msg_var.inner & ~1;
                        return (*env)->NewObject(env, LDKMessageSendEvent_SendShutdown_class, LDKMessageSendEvent_SendShutdown_meth, node_id_arr, msg_ref);
                }
@@ -2115,6 +2307,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1f
                        uint64_t msg_ref = 0;
                        CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
                        CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+                       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
                        msg_ref = (uint64_t)msg_var.inner & ~1;
                        return (*env)->NewObject(env, LDKMessageSendEvent_SendChannelReestablish_class, LDKMessageSendEvent_SendChannelReestablish_meth, node_id_arr, msg_ref);
                }
@@ -2123,11 +2316,13 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1f
                        uint64_t msg_ref = 0;
                        CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
                        CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+                       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
                        msg_ref = (uint64_t)msg_var.inner & ~1;
                        LDKChannelUpdate update_msg_var = obj->broadcast_channel_announcement.update_msg;
                        uint64_t update_msg_ref = 0;
                        CHECK((((uint64_t)update_msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
                        CHECK((((uint64_t)&update_msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+                       CHECK_INNER_FIELD_ACCESS_OR_NULL(update_msg_var);
                        update_msg_ref = (uint64_t)update_msg_var.inner & ~1;
                        return (*env)->NewObject(env, LDKMessageSendEvent_BroadcastChannelAnnouncement_class, LDKMessageSendEvent_BroadcastChannelAnnouncement_meth, msg_ref, update_msg_ref);
                }
@@ -2136,6 +2331,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1f
                        uint64_t msg_ref = 0;
                        CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
                        CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+                       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
                        msg_ref = (uint64_t)msg_var.inner & ~1;
                        return (*env)->NewObject(env, LDKMessageSendEvent_BroadcastNodeAnnouncement_class, LDKMessageSendEvent_BroadcastNodeAnnouncement_meth, msg_ref);
                }
@@ -2144,6 +2340,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1f
                        uint64_t msg_ref = 0;
                        CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
                        CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+                       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
                        msg_ref = (uint64_t)msg_var.inner & ~1;
                        return (*env)->NewObject(env, LDKMessageSendEvent_BroadcastChannelUpdate_class, LDKMessageSendEvent_BroadcastChannelUpdate_meth, msg_ref);
                }
@@ -2154,6 +2351,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1f
                        uint64_t msg_ref = 0;
                        CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
                        CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+                       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
                        msg_ref = (uint64_t)msg_var.inner & ~1;
                        return (*env)->NewObject(env, LDKMessageSendEvent_SendChannelUpdate_class, LDKMessageSendEvent_SendChannelUpdate_meth, node_id_arr, msg_ref);
                }
@@ -2170,6 +2368,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1f
                        uint64_t msg_ref = 0;
                        CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
                        CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+                       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
                        msg_ref = (uint64_t)msg_var.inner & ~1;
                        return (*env)->NewObject(env, LDKMessageSendEvent_SendChannelRangeQuery_class, LDKMessageSendEvent_SendChannelRangeQuery_meth, node_id_arr, msg_ref);
                }
@@ -2180,6 +2379,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1f
                        uint64_t msg_ref = 0;
                        CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
                        CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+                       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
                        msg_ref = (uint64_t)msg_var.inner & ~1;
                        return (*env)->NewObject(env, LDKMessageSendEvent_SendShortIdsQuery_class, LDKMessageSendEvent_SendShortIdsQuery_meth, node_id_arr, msg_ref);
                }
@@ -2190,32 +2390,13 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1f
                        uint64_t msg_ref = 0;
                        CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
                        CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+                       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
                        msg_ref = (uint64_t)msg_var.inner & ~1;
                        return (*env)->NewObject(env, LDKMessageSendEvent_SendReplyChannelRange_class, LDKMessageSendEvent_SendReplyChannelRange_meth, node_id_arr, msg_ref);
                }
                default: abort();
        }
 }
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1MessageSendEventZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) {
-       LDKCVec_MessageSendEventZ *ret = MALLOC(sizeof(LDKCVec_MessageSendEventZ), "LDKCVec_MessageSendEventZ");
-       ret->datalen = (*env)->GetArrayLength(env, elems);
-       if (ret->datalen == 0) {
-               ret->data = NULL;
-       } else {
-               ret->data = MALLOC(sizeof(LDKMessageSendEvent) * ret->datalen, "LDKCVec_MessageSendEventZ Data");
-               int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
-               for (size_t i = 0; i < ret->datalen; i++) {
-                       int64_t arr_elem = java_elems[i];
-                       void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
-                       CHECK_ACCESS(arr_elem_ptr);
-                       LDKMessageSendEvent arr_elem_conv = *(LDKMessageSendEvent*)(arr_elem_ptr);
-                       arr_elem_conv = MessageSendEvent_clone((LDKMessageSendEvent*)(((uint64_t)arr_elem) & ~1));
-                       ret->data[i] = arr_elem_conv;
-               }
-               (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0);
-       }
-       return (uint64_t)ret;
-}
 static inline LDKCVec_MessageSendEventZ CVec_MessageSendEventZ_clone(const LDKCVec_MessageSendEventZ *orig) {
        LDKCVec_MessageSendEventZ ret = { .data = MALLOC(sizeof(LDKMessageSendEvent) * orig->datalen, "LDKCVec_MessageSendEventZ clone bytes"), .datalen = orig->datalen };
        for (size_t i = 0; i < ret.datalen; i++) {
@@ -2223,9 +2404,6 @@ static inline LDKCVec_MessageSendEventZ CVec_MessageSendEventZ_clone(const LDKCV
        }
        return ret;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InitFeaturesDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_InitFeaturesDecodeErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InitFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_InitFeaturesDecodeErrorZ *val = (LDKCResult_InitFeaturesDecodeErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -2233,6 +2411,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InitFeaturesDec
        uint64_t res_ref = 0;
        CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
        res_ref = (uint64_t)res_var.inner & ~1;
        return res_ref;
 }
@@ -2243,12 +2422,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InitFeaturesDec
        uint64_t err_ref = 0;
        CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
        err_ref = (uint64_t)err_var.inner & ~1;
        return err_ref;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeFeaturesDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_NodeFeaturesDecodeErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_NodeFeaturesDecodeErrorZ *val = (LDKCResult_NodeFeaturesDecodeErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -2256,6 +2433,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeFeaturesDec
        uint64_t res_ref = 0;
        CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
        res_ref = (uint64_t)res_var.inner & ~1;
        return res_ref;
 }
@@ -2266,12 +2444,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeFeaturesDec
        uint64_t err_ref = 0;
        CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
        err_ref = (uint64_t)err_var.inner & ~1;
        return err_ref;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelFeaturesDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_ChannelFeaturesDecodeErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_ChannelFeaturesDecodeErrorZ *val = (LDKCResult_ChannelFeaturesDecodeErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -2279,6 +2455,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelFeatures
        uint64_t res_ref = 0;
        CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
        res_ref = (uint64_t)res_var.inner & ~1;
        return res_ref;
 }
@@ -2289,12 +2466,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelFeatures
        uint64_t err_ref = 0;
        CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
        err_ref = (uint64_t)err_var.inner & ~1;
        return err_ref;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceFeaturesDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_InvoiceFeaturesDecodeErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_InvoiceFeaturesDecodeErrorZ *val = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -2302,6 +2477,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceFeatures
        uint64_t res_ref = 0;
        CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
        res_ref = (uint64_t)res_var.inner & ~1;
        return res_ref;
 }
@@ -2312,12 +2488,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceFeatures
        uint64_t err_ref = 0;
        CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
        err_ref = (uint64_t)err_var.inner & ~1;
        return err_ref;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ScoringParametersDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_ScoringParametersDecodeErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ScoringParametersDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_ScoringParametersDecodeErrorZ *val = (LDKCResult_ScoringParametersDecodeErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -2325,6 +2499,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ScoringParamete
        uint64_t res_ref = 0;
        CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
        res_ref = (uint64_t)res_var.inner & ~1;
        return res_ref;
 }
@@ -2335,12 +2510,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ScoringParamete
        uint64_t err_ref = 0;
        CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
        err_ref = (uint64_t)err_var.inner & ~1;
        return err_ref;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ScorerDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_ScorerDecodeErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ScorerDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_ScorerDecodeErrorZ *val = (LDKCResult_ScorerDecodeErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -2348,6 +2521,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ScorerDecodeErr
        uint64_t res_ref = 0;
        CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
        res_ref = (uint64_t)res_var.inner & ~1;
        return res_ref;
 }
@@ -2358,12 +2532,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ScorerDecodeErr
        uint64_t err_ref = 0;
        CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
        err_ref = (uint64_t)err_var.inner & ~1;
        return err_ref;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *val = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -2371,6 +2543,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1DelayedPaymentO
        uint64_t res_ref = 0;
        CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
        res_ref = (uint64_t)res_var.inner & ~1;
        return res_ref;
 }
@@ -2381,12 +2554,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1DelayedPaymentO
        uint64_t err_ref = 0;
        CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
        err_ref = (uint64_t)err_var.inner & ~1;
        return err_ref;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *val = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -2394,6 +2565,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1StaticPaymentOu
        uint64_t res_ref = 0;
        CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
        res_ref = (uint64_t)res_var.inner & ~1;
        return res_ref;
 }
@@ -2404,12 +2576,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1StaticPaymentOu
        uint64_t err_ref = 0;
        CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
        err_ref = (uint64_t)err_var.inner & ~1;
        return err_ref;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SpendableOutputDescriptorDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SpendableOutputDescriptorDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_SpendableOutputDescriptorDecodeErrorZ *val = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -2423,12 +2593,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SpendableOutput
        uint64_t err_ref = 0;
        CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
        err_ref = (uint64_t)err_var.inner & ~1;
        return err_ref;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneNoneZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_NoneNoneZ*)arg)->result_ok;
-}
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_NoneNoneZ *val = (LDKCResult_NoneNoneZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -2468,9 +2636,6 @@ JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec
        return ret_arr;
 }
 
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *val = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -2484,9 +2649,6 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1Signature
        CHECK(!val->result_ok);
        return *val->contents.err;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SignatureNoneZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_SignatureNoneZ*)arg)->result_ok;
-}
 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SignatureNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_SignatureNoneZ *val = (LDKCResult_SignatureNoneZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -2596,6 +2758,7 @@ LDKCResult_NoneNoneZ validate_holder_commitment_LDKBaseSign_jcall(const void* th
        holder_tx_var = HolderCommitmentTransaction_clone(holder_tx);
        CHECK((((uint64_t)holder_tx_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&holder_tx_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(holder_tx_var);
        holder_tx_ref = (uint64_t)holder_tx_var.inner;
        if (holder_tx_var.is_owned) {
                holder_tx_ref |= 1;
@@ -2610,7 +2773,7 @@ LDKCResult_NoneNoneZ validate_holder_commitment_LDKBaseSign_jcall(const void* th
        void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
        CHECK_ACCESS(ret_ptr);
        LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr);
-       ret_conv = CResult_NoneNoneZ_clone((LDKCResult_NoneNoneZ*)(((uint64_t)ret) & ~1));
+       FREE((void*)ret);
        if (get_jenv_res == JNI_EDETACHED) {
                DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
        }
@@ -2654,6 +2817,7 @@ LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_counterparty_commitment_L
        commitment_tx_var = CommitmentTransaction_clone(commitment_tx);
        CHECK((((uint64_t)commitment_tx_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&commitment_tx_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_var);
        commitment_tx_ref = (uint64_t)commitment_tx_var.inner;
        if (commitment_tx_var.is_owned) {
                commitment_tx_ref |= 1;
@@ -2668,7 +2832,7 @@ LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_counterparty_commitment_L
        void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
        CHECK_ACCESS(ret_ptr);
        LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(ret_ptr);
-       ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone((LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(((uint64_t)ret) & ~1));
+       FREE((void*)ret);
        if (get_jenv_res == JNI_EDETACHED) {
                DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
        }
@@ -2695,7 +2859,7 @@ LDKCResult_NoneNoneZ validate_counterparty_revocation_LDKBaseSign_jcall(const vo
        void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
        CHECK_ACCESS(ret_ptr);
        LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr);
-       ret_conv = CResult_NoneNoneZ_clone((LDKCResult_NoneNoneZ*)(((uint64_t)ret) & ~1));
+       FREE((void*)ret);
        if (get_jenv_res == JNI_EDETACHED) {
                DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
        }
@@ -2715,6 +2879,7 @@ LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_holder_commitment_and_htl
        commitment_tx_var = HolderCommitmentTransaction_clone(commitment_tx);
        CHECK((((uint64_t)commitment_tx_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&commitment_tx_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_var);
        commitment_tx_ref = (uint64_t)commitment_tx_var.inner;
        if (commitment_tx_var.is_owned) {
                commitment_tx_ref |= 1;
@@ -2729,7 +2894,7 @@ LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_holder_commitment_and_htl
        void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
        CHECK_ACCESS(ret_ptr);
        LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(ret_ptr);
-       ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone((LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(((uint64_t)ret) & ~1));
+       FREE((void*)ret);
        if (get_jenv_res == JNI_EDETACHED) {
                DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
        }
@@ -2760,7 +2925,7 @@ LDKCResult_SignatureNoneZ sign_justice_revoked_output_LDKBaseSign_jcall(const vo
        void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
        CHECK_ACCESS(ret_ptr);
        LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
-       ret_conv = CResult_SignatureNoneZ_clone((LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1));
+       FREE((void*)ret);
        if (get_jenv_res == JNI_EDETACHED) {
                DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
        }
@@ -2786,6 +2951,7 @@ LDKCResult_SignatureNoneZ sign_justice_revoked_htlc_LDKBaseSign_jcall(const void
        htlc_var = HTLCOutputInCommitment_clone(htlc);
        CHECK((((uint64_t)htlc_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&htlc_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_var);
        htlc_ref = (uint64_t)htlc_var.inner;
        if (htlc_var.is_owned) {
                htlc_ref |= 1;
@@ -2800,7 +2966,7 @@ LDKCResult_SignatureNoneZ sign_justice_revoked_htlc_LDKBaseSign_jcall(const void
        void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
        CHECK_ACCESS(ret_ptr);
        LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
-       ret_conv = CResult_SignatureNoneZ_clone((LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1));
+       FREE((void*)ret);
        if (get_jenv_res == JNI_EDETACHED) {
                DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
        }
@@ -2826,6 +2992,7 @@ LDKCResult_SignatureNoneZ sign_counterparty_htlc_transaction_LDKBaseSign_jcall(c
        htlc_var = HTLCOutputInCommitment_clone(htlc);
        CHECK((((uint64_t)htlc_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&htlc_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_var);
        htlc_ref = (uint64_t)htlc_var.inner;
        if (htlc_var.is_owned) {
                htlc_ref |= 1;
@@ -2840,7 +3007,7 @@ LDKCResult_SignatureNoneZ sign_counterparty_htlc_transaction_LDKBaseSign_jcall(c
        void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
        CHECK_ACCESS(ret_ptr);
        LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
-       ret_conv = CResult_SignatureNoneZ_clone((LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1));
+       FREE((void*)ret);
        if (get_jenv_res == JNI_EDETACHED) {
                DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
        }
@@ -2860,6 +3027,7 @@ LDKCResult_SignatureNoneZ sign_closing_transaction_LDKBaseSign_jcall(const void*
        closing_tx_var = ClosingTransaction_clone(closing_tx);
        CHECK((((uint64_t)closing_tx_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&closing_tx_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(closing_tx_var);
        closing_tx_ref = (uint64_t)closing_tx_var.inner;
        if (closing_tx_var.is_owned) {
                closing_tx_ref |= 1;
@@ -2874,7 +3042,7 @@ LDKCResult_SignatureNoneZ sign_closing_transaction_LDKBaseSign_jcall(const void*
        void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
        CHECK_ACCESS(ret_ptr);
        LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
-       ret_conv = CResult_SignatureNoneZ_clone((LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1));
+       FREE((void*)ret);
        if (get_jenv_res == JNI_EDETACHED) {
                DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
        }
@@ -2894,6 +3062,7 @@ LDKCResult_SignatureNoneZ sign_channel_announcement_LDKBaseSign_jcall(const void
        msg_var = UnsignedChannelAnnouncement_clone(msg);
        CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
        msg_ref = (uint64_t)msg_var.inner;
        if (msg_var.is_owned) {
                msg_ref |= 1;
@@ -2908,7 +3077,7 @@ LDKCResult_SignatureNoneZ sign_channel_announcement_LDKBaseSign_jcall(const void
        void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
        CHECK_ACCESS(ret_ptr);
        LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
-       ret_conv = CResult_SignatureNoneZ_clone((LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1));
+       FREE((void*)ret);
        if (get_jenv_res == JNI_EDETACHED) {
                DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
        }
@@ -2928,6 +3097,7 @@ void ready_channel_LDKBaseSign_jcall(void* this_arg, const LDKChannelTransaction
        channel_parameters_var = ChannelTransactionParameters_clone(channel_parameters);
        CHECK((((uint64_t)channel_parameters_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&channel_parameters_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_parameters_var);
        channel_parameters_ref = (uint64_t)channel_parameters_var.inner;
        if (channel_parameters_var.is_owned) {
                channel_parameters_ref |= 1;
@@ -2980,7 +3150,7 @@ static inline LDKBaseSign LDKBaseSign_init (JNIEnv *env, jclass clz, jobject o,
        LDKChannelPublicKeys pubkeys_conv;
        pubkeys_conv.inner = (void*)(pubkeys & (~1));
        pubkeys_conv.is_owned = (pubkeys & 1) || (pubkeys == 0);
-       pubkeys_conv = ChannelPublicKeys_clone(&pubkeys_conv);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(pubkeys_conv);
 
        LDKBaseSign ret = {
                .this_arg = (void*) calls,
@@ -3033,6 +3203,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BaseSign_1validate_1holder_
        LDKHolderCommitmentTransaction holder_tx_conv;
        holder_tx_conv.inner = (void*)(holder_tx & (~1));
        holder_tx_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(holder_tx_conv);
        LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
        *ret_conv = (this_arg_conv->validate_holder_commitment)(this_arg_conv->this_arg, &holder_tx_conv);
        return (uint64_t)ret_conv;
@@ -3054,6 +3225,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BaseSign_1sign_1counterpart
        LDKCommitmentTransaction commitment_tx_conv;
        commitment_tx_conv.inner = (void*)(commitment_tx & (~1));
        commitment_tx_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_conv);
        LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
        *ret_conv = (this_arg_conv->sign_counterparty_commitment)(this_arg_conv->this_arg, &commitment_tx_conv);
        return (uint64_t)ret_conv;
@@ -3079,6 +3251,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BaseSign_1sign_1holder_1com
        LDKHolderCommitmentTransaction commitment_tx_conv;
        commitment_tx_conv.inner = (void*)(commitment_tx & (~1));
        commitment_tx_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_conv);
        LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
        *ret_conv = (this_arg_conv->sign_holder_commitment_and_htlcs)(this_arg_conv->this_arg, &commitment_tx_conv);
        return (uint64_t)ret_conv;
@@ -3118,6 +3291,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BaseSign_1sign_1justice_1re
        LDKHTLCOutputInCommitment htlc_conv;
        htlc_conv.inner = (void*)(htlc & (~1));
        htlc_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_conv);
        LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
        *ret_conv = (this_arg_conv->sign_justice_revoked_htlc)(this_arg_conv->this_arg, justice_tx_ref, input, amount, per_commitment_key_ref, &htlc_conv);
        return (uint64_t)ret_conv;
@@ -3138,6 +3312,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BaseSign_1sign_1counterpart
        LDKHTLCOutputInCommitment htlc_conv;
        htlc_conv.inner = (void*)(htlc & (~1));
        htlc_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_conv);
        LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
        *ret_conv = (this_arg_conv->sign_counterparty_htlc_transaction)(this_arg_conv->this_arg, htlc_tx_ref, input, amount, per_commitment_point_ref, &htlc_conv);
        return (uint64_t)ret_conv;
@@ -3150,6 +3325,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BaseSign_1sign_1closing_1tr
        LDKClosingTransaction closing_tx_conv;
        closing_tx_conv.inner = (void*)(closing_tx & (~1));
        closing_tx_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(closing_tx_conv);
        LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
        *ret_conv = (this_arg_conv->sign_closing_transaction)(this_arg_conv->this_arg, &closing_tx_conv);
        return (uint64_t)ret_conv;
@@ -3162,6 +3338,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BaseSign_1sign_1channel_1an
        LDKUnsignedChannelAnnouncement msg_conv;
        msg_conv.inner = (void*)(msg & (~1));
        msg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
        LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
        *ret_conv = (this_arg_conv->sign_channel_announcement)(this_arg_conv->this_arg, &msg_conv);
        return (uint64_t)ret_conv;
@@ -3174,6 +3351,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BaseSign_1ready_1channel(JNIEn
        LDKChannelTransactionParameters channel_parameters_conv;
        channel_parameters_conv.inner = (void*)(channel_parameters & (~1));
        channel_parameters_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_parameters_conv);
        (this_arg_conv->ready_channel)(this_arg_conv->this_arg, &channel_parameters_conv);
 }
 
@@ -3190,6 +3368,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BaseSign_1get_1pubkeys(JNIE
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -3264,7 +3443,7 @@ static inline LDKSign LDKSign_init (JNIEnv *env, jclass clz, jobject o, jobject
        LDKChannelPublicKeys pubkeys_conv;
        pubkeys_conv.inner = (void*)(pubkeys & (~1));
        pubkeys_conv.is_owned = (pubkeys & 1) || (pubkeys == 0);
-       pubkeys_conv = ChannelPublicKeys_clone(&pubkeys_conv);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(pubkeys_conv);
 
        LDKSign ret = {
                .this_arg = (void*) calls,
@@ -3298,9 +3477,6 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Sign_1write(JNIEnv *env
        return ret_arr;
 }
 
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SignDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_SignDecodeErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SignDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_SignDecodeErrorZ *val = (LDKCResult_SignDecodeErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -3315,12 +3491,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SignDecodeError
        uint64_t err_ref = 0;
        CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
        err_ref = (uint64_t)err_var.inner & ~1;
        return err_ref;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RecoverableSignatureNoneZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_RecoverableSignatureNoneZ*)arg)->result_ok;
-}
 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RecoverableSignatureNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_RecoverableSignatureNoneZ *val = (LDKCResult_RecoverableSignatureNoneZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -3340,9 +3514,6 @@ static inline LDKCVec_CVec_u8ZZ CVec_CVec_u8ZZ_clone(const LDKCVec_CVec_u8ZZ *or
        }
        return ret;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1CVec_1u8ZZNoneZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_CVec_CVec_u8ZZNoneZ*)arg)->result_ok;
-}
 JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1CVec_1u8ZZNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_CVec_CVec_u8ZZNoneZ *val = (LDKCResult_CVec_CVec_u8ZZNoneZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -3364,9 +3535,6 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1CVec_1u8ZZNo
        CHECK(!val->result_ok);
        return *val->contents.err;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InMemorySignerDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_InMemorySignerDecodeErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InMemorySignerDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_InMemorySignerDecodeErrorZ *val = (LDKCResult_InMemorySignerDecodeErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -3374,6 +3542,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InMemorySignerD
        uint64_t res_ref = 0;
        CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
        res_ref = (uint64_t)res_var.inner & ~1;
        return res_ref;
 }
@@ -3384,29 +3553,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InMemorySignerD
        uint64_t err_ref = 0;
        CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
        err_ref = (uint64_t)err_var.inner & ~1;
        return err_ref;
 }
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1TxOutZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) {
-       LDKCVec_TxOutZ *ret = MALLOC(sizeof(LDKCVec_TxOutZ), "LDKCVec_TxOutZ");
-       ret->datalen = (*env)->GetArrayLength(env, elems);
-       if (ret->datalen == 0) {
-               ret->data = NULL;
-       } else {
-               ret->data = MALLOC(sizeof(LDKTxOut) * ret->datalen, "LDKCVec_TxOutZ Data");
-               int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
-               for (size_t i = 0; i < ret->datalen; i++) {
-                       int64_t arr_elem = java_elems[i];
-                       void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
-                       CHECK_ACCESS(arr_elem_ptr);
-                       LDKTxOut arr_elem_conv = *(LDKTxOut*)(arr_elem_ptr);
-                       arr_elem_conv = TxOut_clone((LDKTxOut*)(((uint64_t)arr_elem) & ~1));
-                       ret->data[i] = arr_elem_conv;
-               }
-               (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0);
-       }
-       return (uint64_t)ret;
-}
 static inline LDKCVec_TxOutZ CVec_TxOutZ_clone(const LDKCVec_TxOutZ *orig) {
        LDKCVec_TxOutZ ret = { .data = MALLOC(sizeof(LDKTxOut) * orig->datalen, "LDKCVec_TxOutZ clone bytes"), .datalen = orig->datalen };
        for (size_t i = 0; i < ret.datalen; i++) {
@@ -3414,9 +3564,6 @@ static inline LDKCVec_TxOutZ CVec_TxOutZ_clone(const LDKCVec_TxOutZ *orig) {
        }
        return ret;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TransactionNoneZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_TransactionNoneZ*)arg)->result_ok;
-}
 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TransactionNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_TransactionNoneZ *val = (LDKCResult_TransactionNoneZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -3449,6 +3596,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMo
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -3456,26 +3604,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMo
        return ret_ref;
 }
 
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1C2Tuple_1BlockHashChannelMonitorZZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) {
-       LDKCVec_C2Tuple_BlockHashChannelMonitorZZ *ret = MALLOC(sizeof(LDKCVec_C2Tuple_BlockHashChannelMonitorZZ), "LDKCVec_C2Tuple_BlockHashChannelMonitorZZ");
-       ret->datalen = (*env)->GetArrayLength(env, elems);
-       if (ret->datalen == 0) {
-               ret->data = NULL;
-       } else {
-               ret->data = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ) * ret->datalen, "LDKCVec_C2Tuple_BlockHashChannelMonitorZZ Data");
-               int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
-               for (size_t i = 0; i < ret->datalen; i++) {
-                       int64_t arr_elem = java_elems[i];
-                       void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
-                       CHECK_ACCESS(arr_elem_ptr);
-                       LDKC2Tuple_BlockHashChannelMonitorZ arr_elem_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(arr_elem_ptr);
-                       arr_elem_conv = C2Tuple_BlockHashChannelMonitorZ_clone((LDKC2Tuple_BlockHashChannelMonitorZ*)(((uint64_t)arr_elem) & ~1));
-                       ret->data[i] = arr_elem_conv;
-               }
-               (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0);
-       }
-       return (uint64_t)ret;
-}
 static inline LDKCVec_C2Tuple_BlockHashChannelMonitorZZ CVec_C2Tuple_BlockHashChannelMonitorZZ_clone(const LDKCVec_C2Tuple_BlockHashChannelMonitorZZ *orig) {
        LDKCVec_C2Tuple_BlockHashChannelMonitorZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ) * orig->datalen, "LDKCVec_C2Tuple_BlockHashChannelMonitorZZ clone bytes"), .datalen = orig->datalen };
        for (size_t i = 0; i < ret.datalen; i++) {
@@ -3483,9 +3611,6 @@ static inline LDKCVec_C2Tuple_BlockHashChannelMonitorZZ CVec_C2Tuple_BlockHashCh
        }
        return ret;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ *val = (LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -3611,15 +3736,13 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKAPIError_1ref_1from_1ptr
                        uint64_t script_ref = 0;
                        CHECK((((uint64_t)script_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
                        CHECK((((uint64_t)&script_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+                       CHECK_INNER_FIELD_ACCESS_OR_NULL(script_var);
                        script_ref = (uint64_t)script_var.inner & ~1;
                        return (*env)->NewObject(env, LDKAPIError_IncompatibleShutdownScript_class, LDKAPIError_IncompatibleShutdownScript_meth, script_ref);
                }
                default: abort();
        }
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneAPIErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_NoneAPIErrorZ*)arg)->result_ok;
-}
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneAPIErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_NoneAPIErrorZ *val = (LDKCResult_NoneAPIErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -3631,26 +3754,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneAPIErrorZ_1
        uint64_t err_ref = ((uint64_t)&(*val->contents.err)) | 1;
        return err_ref;
 }
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1CResult_1NoneAPIErrorZZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) {
-       LDKCVec_CResult_NoneAPIErrorZZ *ret = MALLOC(sizeof(LDKCVec_CResult_NoneAPIErrorZZ), "LDKCVec_CResult_NoneAPIErrorZZ");
-       ret->datalen = (*env)->GetArrayLength(env, elems);
-       if (ret->datalen == 0) {
-               ret->data = NULL;
-       } else {
-               ret->data = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ) * ret->datalen, "LDKCVec_CResult_NoneAPIErrorZZ Data");
-               int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
-               for (size_t i = 0; i < ret->datalen; i++) {
-                       int64_t arr_elem = java_elems[i];
-                       void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
-                       CHECK_ACCESS(arr_elem_ptr);
-                       LDKCResult_NoneAPIErrorZ arr_elem_conv = *(LDKCResult_NoneAPIErrorZ*)(arr_elem_ptr);
-                       arr_elem_conv = CResult_NoneAPIErrorZ_clone((LDKCResult_NoneAPIErrorZ*)(((uint64_t)arr_elem) & ~1));
-                       ret->data[i] = arr_elem_conv;
-               }
-               (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0);
-       }
-       return (uint64_t)ret;
-}
 static inline LDKCVec_CResult_NoneAPIErrorZZ CVec_CResult_NoneAPIErrorZZ_clone(const LDKCVec_CResult_NoneAPIErrorZZ *orig) {
        LDKCVec_CResult_NoneAPIErrorZZ ret = { .data = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ) * orig->datalen, "LDKCVec_CResult_NoneAPIErrorZZ clone bytes"), .datalen = orig->datalen };
        for (size_t i = 0; i < ret.datalen; i++) {
@@ -3658,26 +3761,6 @@ static inline LDKCVec_CResult_NoneAPIErrorZZ CVec_CResult_NoneAPIErrorZZ_clone(c
        }
        return ret;
 }
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1APIErrorZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) {
-       LDKCVec_APIErrorZ *ret = MALLOC(sizeof(LDKCVec_APIErrorZ), "LDKCVec_APIErrorZ");
-       ret->datalen = (*env)->GetArrayLength(env, elems);
-       if (ret->datalen == 0) {
-               ret->data = NULL;
-       } else {
-               ret->data = MALLOC(sizeof(LDKAPIError) * ret->datalen, "LDKCVec_APIErrorZ Data");
-               int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
-               for (size_t i = 0; i < ret->datalen; i++) {
-                       int64_t arr_elem = java_elems[i];
-                       void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
-                       CHECK_ACCESS(arr_elem_ptr);
-                       LDKAPIError arr_elem_conv = *(LDKAPIError*)(arr_elem_ptr);
-                       arr_elem_conv = APIError_clone((LDKAPIError*)(((uint64_t)arr_elem) & ~1));
-                       ret->data[i] = arr_elem_conv;
-               }
-               (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0);
-       }
-       return (uint64_t)ret;
-}
 static inline LDKCVec_APIErrorZ CVec_APIErrorZ_clone(const LDKCVec_APIErrorZ *orig) {
        LDKCVec_APIErrorZ ret = { .data = MALLOC(sizeof(LDKAPIError) * orig->datalen, "LDKCVec_APIErrorZ clone bytes"), .datalen = orig->datalen };
        for (size_t i = 0; i < ret.datalen; i++) {
@@ -3685,9 +3768,6 @@ static inline LDKCVec_APIErrorZ CVec_APIErrorZ_clone(const LDKCVec_APIErrorZ *or
        }
        return ret;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1_1u832APIErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult__u832APIErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1_1u832APIErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult__u832APIErrorZ *val = (LDKCResult__u832APIErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -3781,6 +3861,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPaymentSendFailure_1ref_
                        if ((uint64_t)failed_paths_retry_var.inner > 4096) {
                                CHECK((((uint64_t)failed_paths_retry_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
                                CHECK((((uint64_t)&failed_paths_retry_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+                       CHECK_INNER_FIELD_ACCESS_OR_NULL(failed_paths_retry_var);
                                failed_paths_retry_ref = (uint64_t)failed_paths_retry_var.inner & ~1;
                        }
                        int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32);
@@ -3790,9 +3871,6 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPaymentSendFailure_1ref_
                default: abort();
        }
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentIdPaymentSendFailureZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_PaymentIdPaymentSendFailureZ*)arg)->result_ok;
-}
 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentIdPaymentSendFailureZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_PaymentIdPaymentSendFailureZ *val = (LDKCResult_PaymentIdPaymentSendFailureZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -3806,9 +3884,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentIdPaymen
        uint64_t err_ref = ((uint64_t)&(*val->contents.err)) | 1;
        return err_ref;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePaymentSendFailureZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_NonePaymentSendFailureZ*)arg)->result_ok;
-}
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePaymentSendFailureZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_NonePaymentSendFailureZ *val = (LDKCResult_NonePaymentSendFailureZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -3840,9 +3915,6 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPay
        return ret_arr;
 }
 
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *val = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -3913,26 +3985,6 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKNetAddress_1ref_1from_1p
                default: abort();
        }
 }
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1NetAddressZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) {
-       LDKCVec_NetAddressZ *ret = MALLOC(sizeof(LDKCVec_NetAddressZ), "LDKCVec_NetAddressZ");
-       ret->datalen = (*env)->GetArrayLength(env, elems);
-       if (ret->datalen == 0) {
-               ret->data = NULL;
-       } else {
-               ret->data = MALLOC(sizeof(LDKNetAddress) * ret->datalen, "LDKCVec_NetAddressZ Data");
-               int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
-               for (size_t i = 0; i < ret->datalen; i++) {
-                       int64_t arr_elem = java_elems[i];
-                       void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
-                       CHECK_ACCESS(arr_elem_ptr);
-                       LDKNetAddress arr_elem_conv = *(LDKNetAddress*)(arr_elem_ptr);
-                       arr_elem_conv = NetAddress_clone((LDKNetAddress*)(((uint64_t)arr_elem) & ~1));
-                       ret->data[i] = arr_elem_conv;
-               }
-               (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0);
-       }
-       return (uint64_t)ret;
-}
 static inline LDKCVec_NetAddressZ CVec_NetAddressZ_clone(const LDKCVec_NetAddressZ *orig) {
        LDKCVec_NetAddressZ ret = { .data = MALLOC(sizeof(LDKNetAddress) * orig->datalen, "LDKCVec_NetAddressZ clone bytes"), .datalen = orig->datalen };
        for (size_t i = 0; i < ret.datalen; i++) {
@@ -3960,9 +4012,6 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPay
        return ret_arr;
 }
 
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentSecretAPIErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_PaymentSecretAPIErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentSecretAPIErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_PaymentSecretAPIErrorZ *val = (LDKCResult_PaymentSecretAPIErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -3976,26 +4025,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentSecretAP
        uint64_t err_ref = ((uint64_t)&(*val->contents.err)) | 1;
        return err_ref;
 }
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1ChannelMonitorZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) {
-       LDKCVec_ChannelMonitorZ *ret = MALLOC(sizeof(LDKCVec_ChannelMonitorZ), "LDKCVec_ChannelMonitorZ");
-       ret->datalen = (*env)->GetArrayLength(env, elems);
-       if (ret->datalen == 0) {
-               ret->data = NULL;
-       } else {
-               ret->data = MALLOC(sizeof(LDKChannelMonitor) * ret->datalen, "LDKCVec_ChannelMonitorZ Data");
-               int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
-               for (size_t i = 0; i < ret->datalen; i++) {
-                       int64_t arr_elem = java_elems[i];
-                       LDKChannelMonitor arr_elem_conv;
-                       arr_elem_conv.inner = (void*)(arr_elem & (~1));
-                       arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0);
-                       arr_elem_conv = ChannelMonitor_clone(&arr_elem_conv);
-                       ret->data[i] = arr_elem_conv;
-               }
-               (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0);
-       }
-       return (uint64_t)ret;
-}
 static inline LDKCVec_ChannelMonitorZ CVec_ChannelMonitorZ_clone(const LDKCVec_ChannelMonitorZ *orig) {
        LDKCVec_ChannelMonitorZ ret = { .data = MALLOC(sizeof(LDKChannelMonitor) * orig->datalen, "LDKCVec_ChannelMonitorZ clone bytes"), .datalen = orig->datalen };
        for (size_t i = 0; i < ret.datalen; i++) {
@@ -4041,6 +4070,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ watch_channel_LDKWatch_jcall(const void*
        uint64_t funding_txo_ref = 0;
        CHECK((((uint64_t)funding_txo_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&funding_txo_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_var);
        funding_txo_ref = (uint64_t)funding_txo_var.inner;
        if (funding_txo_var.is_owned) {
                funding_txo_ref |= 1;
@@ -4049,6 +4079,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ watch_channel_LDKWatch_jcall(const void*
        uint64_t monitor_ref = 0;
        CHECK((((uint64_t)monitor_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&monitor_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(monitor_var);
        monitor_ref = (uint64_t)monitor_var.inner;
        if (monitor_var.is_owned) {
                monitor_ref |= 1;
@@ -4063,7 +4094,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ watch_channel_LDKWatch_jcall(const void*
        void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
        CHECK_ACCESS(ret_ptr);
        LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr);
-       ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone((LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1));
+       FREE((void*)ret);
        if (get_jenv_res == JNI_EDETACHED) {
                DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
        }
@@ -4082,6 +4113,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ update_channel_LDKWatch_jcall(const void
        uint64_t funding_txo_ref = 0;
        CHECK((((uint64_t)funding_txo_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&funding_txo_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_var);
        funding_txo_ref = (uint64_t)funding_txo_var.inner;
        if (funding_txo_var.is_owned) {
                funding_txo_ref |= 1;
@@ -4090,6 +4122,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ update_channel_LDKWatch_jcall(const void
        uint64_t update_ref = 0;
        CHECK((((uint64_t)update_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&update_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(update_var);
        update_ref = (uint64_t)update_var.inner;
        if (update_var.is_owned) {
                update_ref |= 1;
@@ -4104,7 +4137,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ update_channel_LDKWatch_jcall(const void
        void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
        CHECK_ACCESS(ret_ptr);
        LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr);
-       ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone((LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1));
+       FREE((void*)ret);
        if (get_jenv_res == JNI_EDETACHED) {
                DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
        }
@@ -4138,7 +4171,7 @@ LDKCVec_MonitorEventZ release_pending_monitor_events_LDKWatch_jcall(const void*
                void* ret_conv_14_ptr = (void*)(((uint64_t)ret_conv_14) & ~1);
                CHECK_ACCESS(ret_conv_14_ptr);
                LDKMonitorEvent ret_conv_14_conv = *(LDKMonitorEvent*)(ret_conv_14_ptr);
-               ret_conv_14_conv = MonitorEvent_clone((LDKMonitorEvent*)(((uint64_t)ret_conv_14) & ~1));
+               FREE((void*)ret_conv_14);
                ret_constr.data[o] = ret_conv_14_conv;
        }
        (*env)->ReleaseLongArrayElements(env, ret, ret_vals, 0);
@@ -4186,10 +4219,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Watch_1watch_1channel(JNIEn
        LDKOutPoint funding_txo_conv;
        funding_txo_conv.inner = (void*)(funding_txo & (~1));
        funding_txo_conv.is_owned = (funding_txo & 1) || (funding_txo == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv);
        funding_txo_conv = OutPoint_clone(&funding_txo_conv);
        LDKChannelMonitor monitor_conv;
        monitor_conv.inner = (void*)(monitor & (~1));
        monitor_conv.is_owned = (monitor & 1) || (monitor == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(monitor_conv);
        monitor_conv = ChannelMonitor_clone(&monitor_conv);
        LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
        *ret_conv = (this_arg_conv->watch_channel)(this_arg_conv->this_arg, funding_txo_conv, monitor_conv);
@@ -4203,10 +4238,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Watch_1update_1channel(JNIE
        LDKOutPoint funding_txo_conv;
        funding_txo_conv.inner = (void*)(funding_txo & (~1));
        funding_txo_conv.is_owned = (funding_txo & 1) || (funding_txo == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv);
        funding_txo_conv = OutPoint_clone(&funding_txo_conv);
        LDKChannelMonitorUpdate update_conv;
        update_conv.inner = (void*)(update & (~1));
        update_conv.is_owned = (update & 1) || (update == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(update_conv);
        update_conv = ChannelMonitorUpdate_clone(&update_conv);
        LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
        *ret_conv = (this_arg_conv->update_channel)(this_arg_conv->this_arg, funding_txo_conv, update_conv);
@@ -4414,7 +4451,7 @@ LDKShutdownScript get_shutdown_scriptpubkey_LDKKeysInterface_jcall(const void* t
        LDKShutdownScript ret_conv;
        ret_conv.inner = (void*)(ret & (~1));
        ret_conv.is_owned = (ret & 1) || (ret == 0);
-       ret_conv = ShutdownScript_clone(&ret_conv);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv);
        if (get_jenv_res == JNI_EDETACHED) {
                DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
        }
@@ -4439,7 +4476,7 @@ LDKSign get_channel_signer_LDKKeysInterface_jcall(const void* this_arg, bool inb
        void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
        CHECK_ACCESS(ret_ptr);
        LDKSign ret_conv = *(LDKSign*)(ret_ptr);
-       ret_conv = Sign_clone(&ret_conv);
+       FREE((void*)ret);
        if (get_jenv_res == JNI_EDETACHED) {
                DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
        }
@@ -4491,7 +4528,7 @@ LDKCResult_SignDecodeErrorZ read_chan_signer_LDKKeysInterface_jcall(const void*
        void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
        CHECK_ACCESS(ret_ptr);
        LDKCResult_SignDecodeErrorZ ret_conv = *(LDKCResult_SignDecodeErrorZ*)(ret_ptr);
-       ret_conv = CResult_SignDecodeErrorZ_clone((LDKCResult_SignDecodeErrorZ*)(((uint64_t)ret) & ~1));
+       FREE((void*)ret);
        if (get_jenv_res == JNI_EDETACHED) {
                DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
        }
@@ -4520,7 +4557,7 @@ LDKCResult_RecoverableSignatureNoneZ sign_invoice_LDKKeysInterface_jcall(const v
        void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
        CHECK_ACCESS(ret_ptr);
        LDKCResult_RecoverableSignatureNoneZ ret_conv = *(LDKCResult_RecoverableSignatureNoneZ*)(ret_ptr);
-       ret_conv = CResult_RecoverableSignatureNoneZ_clone((LDKCResult_RecoverableSignatureNoneZ*)(((uint64_t)ret) & ~1));
+       FREE((void*)ret);
        if (get_jenv_res == JNI_EDETACHED) {
                DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
        }
@@ -4598,6 +4635,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysInterface_1get_1shutdow
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -4752,7 +4790,7 @@ static void LDKLogger_JCalls_free(void* this_arg) {
                FREE(j_calls);
        }
 }
-void log_LDKLogger_jcall(const void* this_arg, const char* record) {
+void log_LDKLogger_jcall(const void* this_arg, const LDKRecord * record) {
        LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) this_arg;
        JNIEnv *env;
        jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
@@ -4761,11 +4799,19 @@ void log_LDKLogger_jcall(const void* this_arg, const char* record) {
        } else {
                DO_ASSERT(get_jenv_res == JNI_OK);
        }
-       const char* record_str = record;
-       jstring record_conv = str_ref_to_java(env, record_str, strlen(record_str));
+       LDKRecord record_var = *record;
+       uint64_t record_ref = 0;
+       record_var = Record_clone(record);
+       CHECK((((uint64_t)record_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+       CHECK((((uint64_t)&record_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(record_var);
+       record_ref = (uint64_t)record_var.inner;
+       if (record_var.is_owned) {
+               record_ref |= 1;
+       }
        jobject obj = (*env)->NewLocalRef(env, j_calls->o);
        CHECK(obj != NULL);
-       (*env)->CallVoidMethod(env, obj, j_calls->log_meth, record_conv);
+       (*env)->CallVoidMethod(env, obj, j_calls->log_meth, record_ref);
        if ((*env)->ExceptionCheck(env)) {
                (*env)->ExceptionDescribe(env);
                (*env)->FatalError(env, "A call to log in LDKLogger from rust threw an exception.");
@@ -4785,7 +4831,7 @@ static inline LDKLogger LDKLogger_init (JNIEnv *env, jclass clz, jobject o) {
        atomic_init(&calls->refcnt, 1);
        DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
        calls->o = (*env)->NewWeakGlobalRef(env, o);
-       calls->log_meth = (*env)->GetMethodID(env, c, "log", "(Ljava/lang/String;)V");
+       calls->log_meth = (*env)->GetMethodID(env, c, "log", "(J)V");
        CHECK(calls->log_meth != NULL);
 
        LDKLogger ret = {
@@ -4819,13 +4865,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMa
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner & ~1;
        return ret_ref;
 }
 
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ *val = (LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -4840,12 +4884,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1BlockH
        uint64_t err_ref = 0;
        CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
        err_ref = (uint64_t)err_var.inner & ~1;
        return err_ref;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelConfigDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_ChannelConfigDecodeErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelConfigDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_ChannelConfigDecodeErrorZ *val = (LDKCResult_ChannelConfigDecodeErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -4853,6 +4895,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelConfigDe
        uint64_t res_ref = 0;
        CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
        res_ref = (uint64_t)res_var.inner & ~1;
        return res_ref;
 }
@@ -4863,12 +4906,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelConfigDe
        uint64_t err_ref = 0;
        CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
        err_ref = (uint64_t)err_var.inner & ~1;
        return err_ref;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1OutPointDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_OutPointDecodeErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1OutPointDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_OutPointDecodeErrorZ *val = (LDKCResult_OutPointDecodeErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -4876,6 +4917,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1OutPointDecodeE
        uint64_t res_ref = 0;
        CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
        res_ref = (uint64_t)res_var.inner & ~1;
        return res_ref;
 }
@@ -4886,6 +4928,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1OutPointDecodeE
        uint64_t err_ref = 0;
        CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
        err_ref = (uint64_t)err_var.inner & ~1;
        return err_ref;
 }
@@ -5074,9 +5117,6 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1TypeZ_1ref_1fro
                default: abort();
        }
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1COption_1TypeZDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_COption_TypeZDecodeErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1COption_1TypeZDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_COption_TypeZDecodeErrorZ *val = (LDKCResult_COption_TypeZDecodeErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -5090,6 +5130,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1COption_1TypeZD
        uint64_t err_ref = 0;
        CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
        err_ref = (uint64_t)err_var.inner & ~1;
        return err_ref;
 }
@@ -5129,6 +5170,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPaymentError_1ref_1from_
                        uint64_t routing_ref = 0;
                        CHECK((((uint64_t)routing_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
                        CHECK((((uint64_t)&routing_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+                       CHECK_INNER_FIELD_ACCESS_OR_NULL(routing_var);
                        routing_ref = (uint64_t)routing_var.inner & ~1;
                        return (*env)->NewObject(env, LDKPaymentError_Routing_class, LDKPaymentError_Routing_meth, routing_ref);
                }
@@ -5139,9 +5181,6 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPaymentError_1ref_1from_
                default: abort();
        }
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentIdPaymentErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_PaymentIdPaymentErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentIdPaymentErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_PaymentIdPaymentErrorZ *val = (LDKCResult_PaymentIdPaymentErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -5155,9 +5194,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentIdPaymen
        uint64_t err_ref = ((uint64_t)&(*val->contents.err)) | 1;
        return err_ref;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SiPrefixNoneZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_SiPrefixNoneZ*)arg)->result_ok;
-}
 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SiPrefixNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_SiPrefixNoneZ *val = (LDKCResult_SiPrefixNoneZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -5169,9 +5205,6 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SiPrefixNoneZ_1get
        CHECK(!val->result_ok);
        return *val->contents.err;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceNoneZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_InvoiceNoneZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_InvoiceNoneZ *val = (LDKCResult_InvoiceNoneZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -5179,6 +5212,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceNoneZ_1g
        uint64_t res_ref = 0;
        CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
        res_ref = (uint64_t)res_var.inner & ~1;
        return res_ref;
 }
@@ -5187,9 +5221,6 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceNoneZ_1get_
        CHECK(!val->result_ok);
        return *val->contents.err;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SignedRawInvoiceNoneZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_SignedRawInvoiceNoneZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SignedRawInvoiceNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_SignedRawInvoiceNoneZ *val = (LDKCResult_SignedRawInvoiceNoneZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -5197,6 +5228,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SignedRawInvoic
        uint64_t res_ref = 0;
        CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
        res_ref = (uint64_t)res_var.inner & ~1;
        return res_ref;
 }
@@ -5214,6 +5246,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832In
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -5240,6 +5273,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832In
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -5247,9 +5281,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832In
        return ret_ref;
 }
 
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PayeePubKeyErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_PayeePubKeyErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PayeePubKeyErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_PayeePubKeyErrorZ *val = (LDKCResult_PayeePubKeyErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -5257,6 +5288,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PayeePubKeyErro
        uint64_t res_ref = 0;
        CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
        res_ref = (uint64_t)res_var.inner & ~1;
        return res_ref;
 }
@@ -5266,26 +5298,6 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PayeePubKeyError
        jclass err_conv = LDKSecp256k1Error_to_java(env, (*val->contents.err));
        return err_conv;
 }
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1PrivateRouteZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) {
-       LDKCVec_PrivateRouteZ *ret = MALLOC(sizeof(LDKCVec_PrivateRouteZ), "LDKCVec_PrivateRouteZ");
-       ret->datalen = (*env)->GetArrayLength(env, elems);
-       if (ret->datalen == 0) {
-               ret->data = NULL;
-       } else {
-               ret->data = MALLOC(sizeof(LDKPrivateRoute) * ret->datalen, "LDKCVec_PrivateRouteZ Data");
-               int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
-               for (size_t i = 0; i < ret->datalen; i++) {
-                       int64_t arr_elem = java_elems[i];
-                       LDKPrivateRoute arr_elem_conv;
-                       arr_elem_conv.inner = (void*)(arr_elem & (~1));
-                       arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0);
-                       arr_elem_conv = PrivateRoute_clone(&arr_elem_conv);
-                       ret->data[i] = arr_elem_conv;
-               }
-               (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0);
-       }
-       return (uint64_t)ret;
-}
 static inline LDKCVec_PrivateRouteZ CVec_PrivateRouteZ_clone(const LDKCVec_PrivateRouteZ *orig) {
        LDKCVec_PrivateRouteZ ret = { .data = MALLOC(sizeof(LDKPrivateRoute) * orig->datalen, "LDKCVec_PrivateRouteZ clone bytes"), .datalen = orig->datalen };
        for (size_t i = 0; i < ret.datalen; i++) {
@@ -5293,9 +5305,6 @@ static inline LDKCVec_PrivateRouteZ CVec_PrivateRouteZ_clone(const LDKCVec_Priva
        }
        return ret;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PositiveTimestampCreationErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_PositiveTimestampCreationErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PositiveTimestampCreationErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_PositiveTimestampCreationErrorZ *val = (LDKCResult_PositiveTimestampCreationErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -5303,6 +5312,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PositiveTimesta
        uint64_t res_ref = 0;
        CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
        res_ref = (uint64_t)res_var.inner & ~1;
        return res_ref;
 }
@@ -5312,9 +5322,6 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PositiveTimestam
        jclass err_conv = LDKCreationError_to_java(env, (*val->contents.err));
        return err_conv;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneSemanticErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_NoneSemanticErrorZ*)arg)->result_ok;
-}
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneSemanticErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_NoneSemanticErrorZ *val = (LDKCResult_NoneSemanticErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -5326,9 +5333,6 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneSemanticErro
        jclass err_conv = LDKSemanticError_to_java(env, (*val->contents.err));
        return err_conv;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceSemanticErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_InvoiceSemanticErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceSemanticErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_InvoiceSemanticErrorZ *val = (LDKCResult_InvoiceSemanticErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -5336,6 +5340,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceSemantic
        uint64_t res_ref = 0;
        CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
        res_ref = (uint64_t)res_var.inner & ~1;
        return res_ref;
 }
@@ -5345,9 +5350,6 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceSemanticE
        jclass err_conv = LDKSemanticError_to_java(env, (*val->contents.err));
        return err_conv;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1DescriptionCreationErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_DescriptionCreationErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1DescriptionCreationErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_DescriptionCreationErrorZ *val = (LDKCResult_DescriptionCreationErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -5355,6 +5357,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1DescriptionCrea
        uint64_t res_ref = 0;
        CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
        res_ref = (uint64_t)res_var.inner & ~1;
        return res_ref;
 }
@@ -5364,9 +5367,6 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_LDKCResult_1DescriptionCreat
        jclass err_conv = LDKCreationError_to_java(env, (*val->contents.err));
        return err_conv;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ExpiryTimeCreationErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_ExpiryTimeCreationErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ExpiryTimeCreationErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_ExpiryTimeCreationErrorZ *val = (LDKCResult_ExpiryTimeCreationErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -5374,6 +5374,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ExpiryTimeCreat
        uint64_t res_ref = 0;
        CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
        res_ref = (uint64_t)res_var.inner & ~1;
        return res_ref;
 }
@@ -5383,9 +5384,6 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ExpiryTimeCreati
        jclass err_conv = LDKCreationError_to_java(env, (*val->contents.err));
        return err_conv;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PrivateRouteCreationErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_PrivateRouteCreationErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PrivateRouteCreationErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_PrivateRouteCreationErrorZ *val = (LDKCResult_PrivateRouteCreationErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -5393,6 +5391,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PrivateRouteCre
        uint64_t res_ref = 0;
        CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
        res_ref = (uint64_t)res_var.inner & ~1;
        return res_ref;
 }
@@ -5402,9 +5401,6 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PrivateRouteCrea
        jclass err_conv = LDKCreationError_to_java(env, (*val->contents.err));
        return err_conv;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1StringErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_StringErrorZ*)arg)->result_ok;
-}
 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_LDKCResult_1StringErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_StringErrorZ *val = (LDKCResult_StringErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -5418,9 +5414,6 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_LDKCResult_1StringErrorZ_1ge
        jclass err_conv = LDKSecp256k1Error_to_java(env, (*val->contents.err));
        return err_conv;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelMonitorUpdateDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelMonitorUpdateDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_ChannelMonitorUpdateDecodeErrorZ *val = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -5428,6 +5421,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelMonitorU
        uint64_t res_ref = 0;
        CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
        res_ref = (uint64_t)res_var.inner & ~1;
        return res_ref;
 }
@@ -5438,11 +5432,55 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelMonitorU
        uint64_t err_ref = 0;
        CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
        err_ref = (uint64_t)err_var.inner & ~1;
        return err_ref;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1HTLCUpdateDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_HTLCUpdateDecodeErrorZ*)arg)->result_ok;
+static jclass LDKCOption_MonitorEventZ_Some_class = NULL;
+static jmethodID LDKCOption_MonitorEventZ_Some_meth = NULL;
+static jclass LDKCOption_MonitorEventZ_None_class = NULL;
+static jmethodID LDKCOption_MonitorEventZ_None_meth = NULL;
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1MonitorEventZ_init (JNIEnv *env, jclass clz) {
+       LDKCOption_MonitorEventZ_Some_class =
+               (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKCOption_MonitorEventZ$Some;"));
+       CHECK(LDKCOption_MonitorEventZ_Some_class != NULL);
+       LDKCOption_MonitorEventZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_MonitorEventZ_Some_class, "<init>", "(J)V");
+       CHECK(LDKCOption_MonitorEventZ_Some_meth != NULL);
+       LDKCOption_MonitorEventZ_None_class =
+               (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKCOption_MonitorEventZ$None;"));
+       CHECK(LDKCOption_MonitorEventZ_None_class != NULL);
+       LDKCOption_MonitorEventZ_None_meth = (*env)->GetMethodID(env, LDKCOption_MonitorEventZ_None_class, "<init>", "()V");
+       CHECK(LDKCOption_MonitorEventZ_None_meth != NULL);
+}
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1MonitorEventZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
+       LDKCOption_MonitorEventZ *obj = (LDKCOption_MonitorEventZ*)(ptr & ~1);
+       switch(obj->tag) {
+               case LDKCOption_MonitorEventZ_Some: {
+                       uint64_t some_ref = ((uint64_t)&obj->some) | 1;
+                       return (*env)->NewObject(env, LDKCOption_MonitorEventZ_Some_class, LDKCOption_MonitorEventZ_Some_meth, some_ref);
+               }
+               case LDKCOption_MonitorEventZ_None: {
+                       return (*env)->NewObject(env, LDKCOption_MonitorEventZ_None_class, LDKCOption_MonitorEventZ_None_meth);
+               }
+               default: abort();
+       }
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1COption_1MonitorEventZDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_COption_MonitorEventZDecodeErrorZ *val = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)(arg & ~1);
+       CHECK(val->result_ok);
+       uint64_t res_ref = ((uint64_t)&(*val->contents.result)) | 1;
+       return res_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1COption_1MonitorEventZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_COption_MonitorEventZDecodeErrorZ *val = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)(arg & ~1);
+       CHECK(!val->result_ok);
+       LDKDecodeError err_var = (*val->contents.err);
+       uint64_t err_ref = 0;
+       CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+       CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
+       err_ref = (uint64_t)err_var.inner & ~1;
+       return err_ref;
 }
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1HTLCUpdateDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_HTLCUpdateDecodeErrorZ *val = (LDKCResult_HTLCUpdateDecodeErrorZ*)(arg & ~1);
@@ -5451,6 +5489,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1HTLCUpdateDecod
        uint64_t res_ref = 0;
        CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
        res_ref = (uint64_t)res_var.inner & ~1;
        return res_ref;
 }
@@ -5461,12 +5500,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1HTLCUpdateDecod
        uint64_t err_ref = 0;
        CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
        err_ref = (uint64_t)err_var.inner & ~1;
        return err_ref;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneMonitorUpdateErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_NoneMonitorUpdateErrorZ*)arg)->result_ok;
-}
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneMonitorUpdateErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_NoneMonitorUpdateErrorZ *val = (LDKCResult_NoneMonitorUpdateErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -5479,6 +5516,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneMonitorUpda
        uint64_t err_ref = 0;
        CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
        err_ref = (uint64_t)err_var.inner & ~1;
        return err_ref;
 }
@@ -5491,6 +5529,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1g
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -5531,26 +5570,6 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1ge
        return ret_arr;
 }
 
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1C2Tuple_1u32ScriptZZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) {
-       LDKCVec_C2Tuple_u32ScriptZZ *ret = MALLOC(sizeof(LDKCVec_C2Tuple_u32ScriptZZ), "LDKCVec_C2Tuple_u32ScriptZZ");
-       ret->datalen = (*env)->GetArrayLength(env, elems);
-       if (ret->datalen == 0) {
-               ret->data = NULL;
-       } else {
-               ret->data = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ) * ret->datalen, "LDKCVec_C2Tuple_u32ScriptZZ Data");
-               int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
-               for (size_t i = 0; i < ret->datalen; i++) {
-                       int64_t arr_elem = java_elems[i];
-                       void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
-                       CHECK_ACCESS(arr_elem_ptr);
-                       LDKC2Tuple_u32ScriptZ arr_elem_conv = *(LDKC2Tuple_u32ScriptZ*)(arr_elem_ptr);
-                       arr_elem_conv = C2Tuple_u32ScriptZ_clone((LDKC2Tuple_u32ScriptZ*)(((uint64_t)arr_elem) & ~1));
-                       ret->data[i] = arr_elem_conv;
-               }
-               (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0);
-       }
-       return (uint64_t)ret;
-}
 static inline LDKCVec_C2Tuple_u32ScriptZZ CVec_C2Tuple_u32ScriptZZ_clone(const LDKCVec_C2Tuple_u32ScriptZZ *orig) {
        LDKCVec_C2Tuple_u32ScriptZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ) * orig->datalen, "LDKCVec_C2Tuple_u32ScriptZZ clone bytes"), .datalen = orig->datalen };
        for (size_t i = 0; i < ret.datalen; i++) {
@@ -5587,26 +5606,6 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2T
        return ret_arr;
 }
 
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) {
-       LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ *ret = MALLOC(sizeof(LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ), "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ");
-       ret->datalen = (*env)->GetArrayLength(env, elems);
-       if (ret->datalen == 0) {
-               ret->data = NULL;
-       } else {
-               ret->data = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ) * ret->datalen, "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ Data");
-               int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
-               for (size_t i = 0; i < ret->datalen; i++) {
-                       int64_t arr_elem = java_elems[i];
-                       void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
-                       CHECK_ACCESS(arr_elem_ptr);
-                       LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ arr_elem_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(arr_elem_ptr);
-                       arr_elem_conv = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone((LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(((uint64_t)arr_elem) & ~1));
-                       ret->data[i] = arr_elem_conv;
-               }
-               (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0);
-       }
-       return (uint64_t)ret;
-}
 static inline LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_clone(const LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ *orig) {
        LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ) * orig->datalen, "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ clone bytes"), .datalen = orig->datalen };
        for (size_t i = 0; i < ret.datalen; i++) {
@@ -5614,299 +5613,6 @@ static inline LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ CVec_C2Tuple_TxidCV
        }
        return ret;
 }
-static jclass LDKPaymentPurpose_InvoicePayment_class = NULL;
-static jmethodID LDKPaymentPurpose_InvoicePayment_meth = NULL;
-static jclass LDKPaymentPurpose_SpontaneousPayment_class = NULL;
-static jmethodID LDKPaymentPurpose_SpontaneousPayment_meth = NULL;
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKPaymentPurpose_init (JNIEnv *env, jclass clz) {
-       LDKPaymentPurpose_InvoicePayment_class =
-               (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKPaymentPurpose$InvoicePayment;"));
-       CHECK(LDKPaymentPurpose_InvoicePayment_class != NULL);
-       LDKPaymentPurpose_InvoicePayment_meth = (*env)->GetMethodID(env, LDKPaymentPurpose_InvoicePayment_class, "<init>", "([B[BJ)V");
-       CHECK(LDKPaymentPurpose_InvoicePayment_meth != NULL);
-       LDKPaymentPurpose_SpontaneousPayment_class =
-               (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKPaymentPurpose$SpontaneousPayment;"));
-       CHECK(LDKPaymentPurpose_SpontaneousPayment_class != NULL);
-       LDKPaymentPurpose_SpontaneousPayment_meth = (*env)->GetMethodID(env, LDKPaymentPurpose_SpontaneousPayment_class, "<init>", "([B)V");
-       CHECK(LDKPaymentPurpose_SpontaneousPayment_meth != NULL);
-}
-JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPaymentPurpose_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
-       LDKPaymentPurpose *obj = (LDKPaymentPurpose*)(ptr & ~1);
-       switch(obj->tag) {
-               case LDKPaymentPurpose_InvoicePayment: {
-                       int8_tArray payment_preimage_arr = (*env)->NewByteArray(env, 32);
-                       (*env)->SetByteArrayRegion(env, payment_preimage_arr, 0, 32, obj->invoice_payment.payment_preimage.data);
-                       int8_tArray payment_secret_arr = (*env)->NewByteArray(env, 32);
-                       (*env)->SetByteArrayRegion(env, payment_secret_arr, 0, 32, obj->invoice_payment.payment_secret.data);
-                       return (*env)->NewObject(env, LDKPaymentPurpose_InvoicePayment_class, LDKPaymentPurpose_InvoicePayment_meth, payment_preimage_arr, payment_secret_arr, obj->invoice_payment.user_payment_id);
-               }
-               case LDKPaymentPurpose_SpontaneousPayment: {
-                       int8_tArray spontaneous_payment_arr = (*env)->NewByteArray(env, 32);
-                       (*env)->SetByteArrayRegion(env, spontaneous_payment_arr, 0, 32, obj->spontaneous_payment.data);
-                       return (*env)->NewObject(env, LDKPaymentPurpose_SpontaneousPayment_class, LDKPaymentPurpose_SpontaneousPayment_meth, spontaneous_payment_arr);
-               }
-               default: abort();
-       }
-}
-static jclass LDKClosureReason_CounterpartyForceClosed_class = NULL;
-static jmethodID LDKClosureReason_CounterpartyForceClosed_meth = NULL;
-static jclass LDKClosureReason_HolderForceClosed_class = NULL;
-static jmethodID LDKClosureReason_HolderForceClosed_meth = NULL;
-static jclass LDKClosureReason_CooperativeClosure_class = NULL;
-static jmethodID LDKClosureReason_CooperativeClosure_meth = NULL;
-static jclass LDKClosureReason_CommitmentTxConfirmed_class = NULL;
-static jmethodID LDKClosureReason_CommitmentTxConfirmed_meth = NULL;
-static jclass LDKClosureReason_ProcessingError_class = NULL;
-static jmethodID LDKClosureReason_ProcessingError_meth = NULL;
-static jclass LDKClosureReason_DisconnectedPeer_class = NULL;
-static jmethodID LDKClosureReason_DisconnectedPeer_meth = NULL;
-static jclass LDKClosureReason_OutdatedChannelManager_class = NULL;
-static jmethodID LDKClosureReason_OutdatedChannelManager_meth = NULL;
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKClosureReason_init (JNIEnv *env, jclass clz) {
-       LDKClosureReason_CounterpartyForceClosed_class =
-               (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKClosureReason$CounterpartyForceClosed;"));
-       CHECK(LDKClosureReason_CounterpartyForceClosed_class != NULL);
-       LDKClosureReason_CounterpartyForceClosed_meth = (*env)->GetMethodID(env, LDKClosureReason_CounterpartyForceClosed_class, "<init>", "(Ljava/lang/String;)V");
-       CHECK(LDKClosureReason_CounterpartyForceClosed_meth != NULL);
-       LDKClosureReason_HolderForceClosed_class =
-               (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKClosureReason$HolderForceClosed;"));
-       CHECK(LDKClosureReason_HolderForceClosed_class != NULL);
-       LDKClosureReason_HolderForceClosed_meth = (*env)->GetMethodID(env, LDKClosureReason_HolderForceClosed_class, "<init>", "()V");
-       CHECK(LDKClosureReason_HolderForceClosed_meth != NULL);
-       LDKClosureReason_CooperativeClosure_class =
-               (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKClosureReason$CooperativeClosure;"));
-       CHECK(LDKClosureReason_CooperativeClosure_class != NULL);
-       LDKClosureReason_CooperativeClosure_meth = (*env)->GetMethodID(env, LDKClosureReason_CooperativeClosure_class, "<init>", "()V");
-       CHECK(LDKClosureReason_CooperativeClosure_meth != NULL);
-       LDKClosureReason_CommitmentTxConfirmed_class =
-               (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKClosureReason$CommitmentTxConfirmed;"));
-       CHECK(LDKClosureReason_CommitmentTxConfirmed_class != NULL);
-       LDKClosureReason_CommitmentTxConfirmed_meth = (*env)->GetMethodID(env, LDKClosureReason_CommitmentTxConfirmed_class, "<init>", "()V");
-       CHECK(LDKClosureReason_CommitmentTxConfirmed_meth != NULL);
-       LDKClosureReason_ProcessingError_class =
-               (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKClosureReason$ProcessingError;"));
-       CHECK(LDKClosureReason_ProcessingError_class != NULL);
-       LDKClosureReason_ProcessingError_meth = (*env)->GetMethodID(env, LDKClosureReason_ProcessingError_class, "<init>", "(Ljava/lang/String;)V");
-       CHECK(LDKClosureReason_ProcessingError_meth != NULL);
-       LDKClosureReason_DisconnectedPeer_class =
-               (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKClosureReason$DisconnectedPeer;"));
-       CHECK(LDKClosureReason_DisconnectedPeer_class != NULL);
-       LDKClosureReason_DisconnectedPeer_meth = (*env)->GetMethodID(env, LDKClosureReason_DisconnectedPeer_class, "<init>", "()V");
-       CHECK(LDKClosureReason_DisconnectedPeer_meth != NULL);
-       LDKClosureReason_OutdatedChannelManager_class =
-               (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKClosureReason$OutdatedChannelManager;"));
-       CHECK(LDKClosureReason_OutdatedChannelManager_class != NULL);
-       LDKClosureReason_OutdatedChannelManager_meth = (*env)->GetMethodID(env, LDKClosureReason_OutdatedChannelManager_class, "<init>", "()V");
-       CHECK(LDKClosureReason_OutdatedChannelManager_meth != NULL);
-}
-JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKClosureReason_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
-       LDKClosureReason *obj = (LDKClosureReason*)(ptr & ~1);
-       switch(obj->tag) {
-               case LDKClosureReason_CounterpartyForceClosed: {
-                       LDKStr peer_msg_str = obj->counterparty_force_closed.peer_msg;
-                       jstring peer_msg_conv = str_ref_to_java(env, peer_msg_str.chars, peer_msg_str.len);
-                       return (*env)->NewObject(env, LDKClosureReason_CounterpartyForceClosed_class, LDKClosureReason_CounterpartyForceClosed_meth, peer_msg_conv);
-               }
-               case LDKClosureReason_HolderForceClosed: {
-                       return (*env)->NewObject(env, LDKClosureReason_HolderForceClosed_class, LDKClosureReason_HolderForceClosed_meth);
-               }
-               case LDKClosureReason_CooperativeClosure: {
-                       return (*env)->NewObject(env, LDKClosureReason_CooperativeClosure_class, LDKClosureReason_CooperativeClosure_meth);
-               }
-               case LDKClosureReason_CommitmentTxConfirmed: {
-                       return (*env)->NewObject(env, LDKClosureReason_CommitmentTxConfirmed_class, LDKClosureReason_CommitmentTxConfirmed_meth);
-               }
-               case LDKClosureReason_ProcessingError: {
-                       LDKStr err_str = obj->processing_error.err;
-                       jstring err_conv = str_ref_to_java(env, err_str.chars, err_str.len);
-                       return (*env)->NewObject(env, LDKClosureReason_ProcessingError_class, LDKClosureReason_ProcessingError_meth, err_conv);
-               }
-               case LDKClosureReason_DisconnectedPeer: {
-                       return (*env)->NewObject(env, LDKClosureReason_DisconnectedPeer_class, LDKClosureReason_DisconnectedPeer_meth);
-               }
-               case LDKClosureReason_OutdatedChannelManager: {
-                       return (*env)->NewObject(env, LDKClosureReason_OutdatedChannelManager_class, LDKClosureReason_OutdatedChannelManager_meth);
-               }
-               default: abort();
-       }
-}
-static jclass LDKEvent_FundingGenerationReady_class = NULL;
-static jmethodID LDKEvent_FundingGenerationReady_meth = NULL;
-static jclass LDKEvent_PaymentReceived_class = NULL;
-static jmethodID LDKEvent_PaymentReceived_meth = NULL;
-static jclass LDKEvent_PaymentSent_class = NULL;
-static jmethodID LDKEvent_PaymentSent_meth = NULL;
-static jclass LDKEvent_PaymentPathFailed_class = NULL;
-static jmethodID LDKEvent_PaymentPathFailed_meth = NULL;
-static jclass LDKEvent_PendingHTLCsForwardable_class = NULL;
-static jmethodID LDKEvent_PendingHTLCsForwardable_meth = NULL;
-static jclass LDKEvent_SpendableOutputs_class = NULL;
-static jmethodID LDKEvent_SpendableOutputs_meth = NULL;
-static jclass LDKEvent_PaymentForwarded_class = NULL;
-static jmethodID LDKEvent_PaymentForwarded_meth = NULL;
-static jclass LDKEvent_ChannelClosed_class = NULL;
-static jmethodID LDKEvent_ChannelClosed_meth = NULL;
-static jclass LDKEvent_DiscardFunding_class = NULL;
-static jmethodID LDKEvent_DiscardFunding_meth = NULL;
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKEvent_init (JNIEnv *env, jclass clz) {
-       LDKEvent_FundingGenerationReady_class =
-               (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$FundingGenerationReady;"));
-       CHECK(LDKEvent_FundingGenerationReady_class != NULL);
-       LDKEvent_FundingGenerationReady_meth = (*env)->GetMethodID(env, LDKEvent_FundingGenerationReady_class, "<init>", "([BJ[BJ)V");
-       CHECK(LDKEvent_FundingGenerationReady_meth != NULL);
-       LDKEvent_PaymentReceived_class =
-               (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$PaymentReceived;"));
-       CHECK(LDKEvent_PaymentReceived_class != NULL);
-       LDKEvent_PaymentReceived_meth = (*env)->GetMethodID(env, LDKEvent_PaymentReceived_class, "<init>", "([BJJ)V");
-       CHECK(LDKEvent_PaymentReceived_meth != NULL);
-       LDKEvent_PaymentSent_class =
-               (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$PaymentSent;"));
-       CHECK(LDKEvent_PaymentSent_class != NULL);
-       LDKEvent_PaymentSent_meth = (*env)->GetMethodID(env, LDKEvent_PaymentSent_class, "<init>", "([B[B[BJ)V");
-       CHECK(LDKEvent_PaymentSent_meth != NULL);
-       LDKEvent_PaymentPathFailed_class =
-               (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$PaymentPathFailed;"));
-       CHECK(LDKEvent_PaymentPathFailed_class != NULL);
-       LDKEvent_PaymentPathFailed_meth = (*env)->GetMethodID(env, LDKEvent_PaymentPathFailed_class, "<init>", "([B[BZJZ[JJJ)V");
-       CHECK(LDKEvent_PaymentPathFailed_meth != NULL);
-       LDKEvent_PendingHTLCsForwardable_class =
-               (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$PendingHTLCsForwardable;"));
-       CHECK(LDKEvent_PendingHTLCsForwardable_class != NULL);
-       LDKEvent_PendingHTLCsForwardable_meth = (*env)->GetMethodID(env, LDKEvent_PendingHTLCsForwardable_class, "<init>", "(J)V");
-       CHECK(LDKEvent_PendingHTLCsForwardable_meth != NULL);
-       LDKEvent_SpendableOutputs_class =
-               (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$SpendableOutputs;"));
-       CHECK(LDKEvent_SpendableOutputs_class != NULL);
-       LDKEvent_SpendableOutputs_meth = (*env)->GetMethodID(env, LDKEvent_SpendableOutputs_class, "<init>", "([J)V");
-       CHECK(LDKEvent_SpendableOutputs_meth != NULL);
-       LDKEvent_PaymentForwarded_class =
-               (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$PaymentForwarded;"));
-       CHECK(LDKEvent_PaymentForwarded_class != NULL);
-       LDKEvent_PaymentForwarded_meth = (*env)->GetMethodID(env, LDKEvent_PaymentForwarded_class, "<init>", "(JZ)V");
-       CHECK(LDKEvent_PaymentForwarded_meth != NULL);
-       LDKEvent_ChannelClosed_class =
-               (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$ChannelClosed;"));
-       CHECK(LDKEvent_ChannelClosed_class != NULL);
-       LDKEvent_ChannelClosed_meth = (*env)->GetMethodID(env, LDKEvent_ChannelClosed_class, "<init>", "([BJJ)V");
-       CHECK(LDKEvent_ChannelClosed_meth != NULL);
-       LDKEvent_DiscardFunding_class =
-               (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$DiscardFunding;"));
-       CHECK(LDKEvent_DiscardFunding_class != NULL);
-       LDKEvent_DiscardFunding_meth = (*env)->GetMethodID(env, LDKEvent_DiscardFunding_class, "<init>", "([B[B)V");
-       CHECK(LDKEvent_DiscardFunding_meth != NULL);
-}
-JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEvent_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
-       LDKEvent *obj = (LDKEvent*)(ptr & ~1);
-       switch(obj->tag) {
-               case LDKEvent_FundingGenerationReady: {
-                       int8_tArray temporary_channel_id_arr = (*env)->NewByteArray(env, 32);
-                       (*env)->SetByteArrayRegion(env, temporary_channel_id_arr, 0, 32, obj->funding_generation_ready.temporary_channel_id.data);
-                       LDKCVec_u8Z output_script_var = obj->funding_generation_ready.output_script;
-                       int8_tArray output_script_arr = (*env)->NewByteArray(env, output_script_var.datalen);
-                       (*env)->SetByteArrayRegion(env, output_script_arr, 0, output_script_var.datalen, output_script_var.data);
-                       return (*env)->NewObject(env, LDKEvent_FundingGenerationReady_class, LDKEvent_FundingGenerationReady_meth, temporary_channel_id_arr, obj->funding_generation_ready.channel_value_satoshis, output_script_arr, obj->funding_generation_ready.user_channel_id);
-               }
-               case LDKEvent_PaymentReceived: {
-                       int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32);
-                       (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->payment_received.payment_hash.data);
-                       uint64_t purpose_ref = ((uint64_t)&obj->payment_received.purpose) | 1;
-                       return (*env)->NewObject(env, LDKEvent_PaymentReceived_class, LDKEvent_PaymentReceived_meth, payment_hash_arr, obj->payment_received.amt, purpose_ref);
-               }
-               case LDKEvent_PaymentSent: {
-                       int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32);
-                       (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, obj->payment_sent.payment_id.data);
-                       int8_tArray payment_preimage_arr = (*env)->NewByteArray(env, 32);
-                       (*env)->SetByteArrayRegion(env, payment_preimage_arr, 0, 32, obj->payment_sent.payment_preimage.data);
-                       int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32);
-                       (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->payment_sent.payment_hash.data);
-                       uint64_t fee_paid_msat_ref = ((uint64_t)&obj->payment_sent.fee_paid_msat) | 1;
-                       return (*env)->NewObject(env, LDKEvent_PaymentSent_class, LDKEvent_PaymentSent_meth, payment_id_arr, payment_preimage_arr, payment_hash_arr, fee_paid_msat_ref);
-               }
-               case LDKEvent_PaymentPathFailed: {
-                       int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32);
-                       (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, obj->payment_path_failed.payment_id.data);
-                       int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32);
-                       (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->payment_path_failed.payment_hash.data);
-                       uint64_t network_update_ref = ((uint64_t)&obj->payment_path_failed.network_update) | 1;
-                       LDKCVec_RouteHopZ path_var = obj->payment_path_failed.path;
-                       int64_tArray path_arr = NULL;
-                       path_arr = (*env)->NewLongArray(env, path_var.datalen);
-                       int64_t *path_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, path_arr, NULL);
-                       for (size_t k = 0; k < path_var.datalen; k++) {
-                               LDKRouteHop path_conv_10_var = path_var.data[k];
-                               uint64_t path_conv_10_ref = 0;
-                               CHECK((((uint64_t)path_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
-                               CHECK((((uint64_t)&path_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
-                               path_conv_10_ref = (uint64_t)path_conv_10_var.inner & ~1;
-                               path_arr_ptr[k] = path_conv_10_ref;
-                       }
-                       (*env)->ReleasePrimitiveArrayCritical(env, path_arr, path_arr_ptr, 0);
-                       uint64_t short_channel_id_ref = ((uint64_t)&obj->payment_path_failed.short_channel_id) | 1;
-                       LDKRouteParameters retry_var = obj->payment_path_failed.retry;
-                       uint64_t retry_ref = 0;
-                       if ((uint64_t)retry_var.inner > 4096) {
-                               CHECK((((uint64_t)retry_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
-                               CHECK((((uint64_t)&retry_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
-                               retry_ref = (uint64_t)retry_var.inner & ~1;
-                       }
-                       return (*env)->NewObject(env, LDKEvent_PaymentPathFailed_class, LDKEvent_PaymentPathFailed_meth, payment_id_arr, payment_hash_arr, obj->payment_path_failed.rejected_by_dest, network_update_ref, obj->payment_path_failed.all_paths_failed, path_arr, short_channel_id_ref, retry_ref);
-               }
-               case LDKEvent_PendingHTLCsForwardable: {
-                       return (*env)->NewObject(env, LDKEvent_PendingHTLCsForwardable_class, LDKEvent_PendingHTLCsForwardable_meth, obj->pending_htl_cs_forwardable.time_forwardable);
-               }
-               case LDKEvent_SpendableOutputs: {
-                       LDKCVec_SpendableOutputDescriptorZ outputs_var = obj->spendable_outputs.outputs;
-                       int64_tArray outputs_arr = NULL;
-                       outputs_arr = (*env)->NewLongArray(env, outputs_var.datalen);
-                       int64_t *outputs_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, outputs_arr, NULL);
-                       for (size_t b = 0; b < outputs_var.datalen; b++) {
-                               uint64_t outputs_conv_27_ref = ((uint64_t)&outputs_var.data[b]) | 1;
-                               outputs_arr_ptr[b] = outputs_conv_27_ref;
-                       }
-                       (*env)->ReleasePrimitiveArrayCritical(env, outputs_arr, outputs_arr_ptr, 0);
-                       return (*env)->NewObject(env, LDKEvent_SpendableOutputs_class, LDKEvent_SpendableOutputs_meth, outputs_arr);
-               }
-               case LDKEvent_PaymentForwarded: {
-                       uint64_t fee_earned_msat_ref = ((uint64_t)&obj->payment_forwarded.fee_earned_msat) | 1;
-                       return (*env)->NewObject(env, LDKEvent_PaymentForwarded_class, LDKEvent_PaymentForwarded_meth, fee_earned_msat_ref, obj->payment_forwarded.claim_from_onchain_tx);
-               }
-               case LDKEvent_ChannelClosed: {
-                       int8_tArray channel_id_arr = (*env)->NewByteArray(env, 32);
-                       (*env)->SetByteArrayRegion(env, channel_id_arr, 0, 32, obj->channel_closed.channel_id.data);
-                       uint64_t reason_ref = ((uint64_t)&obj->channel_closed.reason) | 1;
-                       return (*env)->NewObject(env, LDKEvent_ChannelClosed_class, LDKEvent_ChannelClosed_meth, channel_id_arr, obj->channel_closed.user_channel_id, reason_ref);
-               }
-               case LDKEvent_DiscardFunding: {
-                       int8_tArray channel_id_arr = (*env)->NewByteArray(env, 32);
-                       (*env)->SetByteArrayRegion(env, channel_id_arr, 0, 32, obj->discard_funding.channel_id.data);
-                       LDKTransaction transaction_var = obj->discard_funding.transaction;
-                       int8_tArray transaction_arr = (*env)->NewByteArray(env, transaction_var.datalen);
-                       (*env)->SetByteArrayRegion(env, transaction_arr, 0, transaction_var.datalen, transaction_var.data);
-                       return (*env)->NewObject(env, LDKEvent_DiscardFunding_class, LDKEvent_DiscardFunding_meth, channel_id_arr, transaction_arr);
-               }
-               default: abort();
-       }
-}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1EventZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) {
-       LDKCVec_EventZ *ret = MALLOC(sizeof(LDKCVec_EventZ), "LDKCVec_EventZ");
-       ret->datalen = (*env)->GetArrayLength(env, elems);
-       if (ret->datalen == 0) {
-               ret->data = NULL;
-       } else {
-               ret->data = MALLOC(sizeof(LDKEvent) * ret->datalen, "LDKCVec_EventZ Data");
-               int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
-               for (size_t i = 0; i < ret->datalen; i++) {
-                       int64_t arr_elem = java_elems[i];
-                       void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
-                       CHECK_ACCESS(arr_elem_ptr);
-                       LDKEvent arr_elem_conv = *(LDKEvent*)(arr_elem_ptr);
-                       arr_elem_conv = Event_clone((LDKEvent*)(((uint64_t)arr_elem) & ~1));
-                       ret->data[i] = arr_elem_conv;
-               }
-               (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0);
-       }
-       return (uint64_t)ret;
-}
 static inline LDKCVec_EventZ CVec_EventZ_clone(const LDKCVec_EventZ *orig) {
        LDKCVec_EventZ ret = { .data = MALLOC(sizeof(LDKEvent) * orig->datalen, "LDKCVec_EventZ clone bytes"), .datalen = orig->datalen };
        for (size_t i = 0; i < ret.datalen; i++) {
@@ -5933,26 +5639,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1get_1b(
        return (uint64_t)ret_ref;
 }
 
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1C2Tuple_1u32TxOutZZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) {
-       LDKCVec_C2Tuple_u32TxOutZZ *ret = MALLOC(sizeof(LDKCVec_C2Tuple_u32TxOutZZ), "LDKCVec_C2Tuple_u32TxOutZZ");
-       ret->datalen = (*env)->GetArrayLength(env, elems);
-       if (ret->datalen == 0) {
-               ret->data = NULL;
-       } else {
-               ret->data = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ) * ret->datalen, "LDKCVec_C2Tuple_u32TxOutZZ Data");
-               int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
-               for (size_t i = 0; i < ret->datalen; i++) {
-                       int64_t arr_elem = java_elems[i];
-                       void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
-                       CHECK_ACCESS(arr_elem_ptr);
-                       LDKC2Tuple_u32TxOutZ arr_elem_conv = *(LDKC2Tuple_u32TxOutZ*)(arr_elem_ptr);
-                       arr_elem_conv = C2Tuple_u32TxOutZ_clone((LDKC2Tuple_u32TxOutZ*)(((uint64_t)arr_elem) & ~1));
-                       ret->data[i] = arr_elem_conv;
-               }
-               (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0);
-       }
-       return (uint64_t)ret;
-}
 static inline LDKCVec_C2Tuple_u32TxOutZZ CVec_C2Tuple_u32TxOutZZ_clone(const LDKCVec_C2Tuple_u32TxOutZZ *orig) {
        LDKCVec_C2Tuple_u32TxOutZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ) * orig->datalen, "LDKCVec_C2Tuple_u32TxOutZZ clone bytes"), .datalen = orig->datalen };
        for (size_t i = 0; i < ret.datalen; i++) {
@@ -5989,26 +5675,6 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2T
        return ret_arr;
 }
 
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) {
-       LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ *ret = MALLOC(sizeof(LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ), "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ");
-       ret->datalen = (*env)->GetArrayLength(env, elems);
-       if (ret->datalen == 0) {
-               ret->data = NULL;
-       } else {
-               ret->data = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ) * ret->datalen, "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ Data");
-               int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
-               for (size_t i = 0; i < ret->datalen; i++) {
-                       int64_t arr_elem = java_elems[i];
-                       void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
-                       CHECK_ACCESS(arr_elem_ptr);
-                       LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ arr_elem_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(arr_elem_ptr);
-                       arr_elem_conv = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone((LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(((uint64_t)arr_elem) & ~1));
-                       ret->data[i] = arr_elem_conv;
-               }
-               (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0);
-       }
-       return (uint64_t)ret;
-}
 static inline LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_clone(const LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ *orig) {
        LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ) * orig->datalen, "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ clone bytes"), .datalen = orig->datalen };
        for (size_t i = 0; i < ret.datalen; i++) {
@@ -6064,26 +5730,6 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKBalance_1ref_1from_1ptr(
                default: abort();
        }
 }
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1BalanceZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) {
-       LDKCVec_BalanceZ *ret = MALLOC(sizeof(LDKCVec_BalanceZ), "LDKCVec_BalanceZ");
-       ret->datalen = (*env)->GetArrayLength(env, elems);
-       if (ret->datalen == 0) {
-               ret->data = NULL;
-       } else {
-               ret->data = MALLOC(sizeof(LDKBalance) * ret->datalen, "LDKCVec_BalanceZ Data");
-               int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
-               for (size_t i = 0; i < ret->datalen; i++) {
-                       int64_t arr_elem = java_elems[i];
-                       void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
-                       CHECK_ACCESS(arr_elem_ptr);
-                       LDKBalance arr_elem_conv = *(LDKBalance*)(arr_elem_ptr);
-                       arr_elem_conv = Balance_clone((LDKBalance*)(((uint64_t)arr_elem) & ~1));
-                       ret->data[i] = arr_elem_conv;
-               }
-               (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0);
-       }
-       return (uint64_t)ret;
-}
 static inline LDKCVec_BalanceZ CVec_BalanceZ_clone(const LDKCVec_BalanceZ *orig) {
        LDKCVec_BalanceZ ret = { .data = MALLOC(sizeof(LDKBalance) * orig->datalen, "LDKCVec_BalanceZ clone bytes"), .datalen = orig->datalen };
        for (size_t i = 0; i < ret.datalen; i++) {
@@ -6091,9 +5737,6 @@ static inline LDKCVec_BalanceZ CVec_BalanceZ_clone(const LDKCVec_BalanceZ *orig)
        }
        return ret;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *val = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -6109,12 +5752,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1BlockH
        uint64_t err_ref = 0;
        CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
        err_ref = (uint64_t)err_var.inner & ~1;
        return err_ref;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneLightningErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_NoneLightningErrorZ*)arg)->result_ok;
-}
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneLightningErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_NoneLightningErrorZ *val = (LDKCResult_NoneLightningErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -6127,6 +5768,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneLightningEr
        uint64_t err_ref = 0;
        CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
        err_ref = (uint64_t)err_var.inner & ~1;
        return err_ref;
 }
@@ -6150,26 +5792,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyTypeZ_1ge
        return (uint64_t)ret_ret;
 }
 
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1C2Tuple_1PublicKeyTypeZZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) {
-       LDKCVec_C2Tuple_PublicKeyTypeZZ *ret = MALLOC(sizeof(LDKCVec_C2Tuple_PublicKeyTypeZZ), "LDKCVec_C2Tuple_PublicKeyTypeZZ");
-       ret->datalen = (*env)->GetArrayLength(env, elems);
-       if (ret->datalen == 0) {
-               ret->data = NULL;
-       } else {
-               ret->data = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ) * ret->datalen, "LDKCVec_C2Tuple_PublicKeyTypeZZ Data");
-               int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
-               for (size_t i = 0; i < ret->datalen; i++) {
-                       int64_t arr_elem = java_elems[i];
-                       void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
-                       CHECK_ACCESS(arr_elem_ptr);
-                       LDKC2Tuple_PublicKeyTypeZ arr_elem_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(arr_elem_ptr);
-                       arr_elem_conv = C2Tuple_PublicKeyTypeZ_clone((LDKC2Tuple_PublicKeyTypeZ*)(((uint64_t)arr_elem) & ~1));
-                       ret->data[i] = arr_elem_conv;
-               }
-               (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0);
-       }
-       return (uint64_t)ret;
-}
 static inline LDKCVec_C2Tuple_PublicKeyTypeZZ CVec_C2Tuple_PublicKeyTypeZZ_clone(const LDKCVec_C2Tuple_PublicKeyTypeZZ *orig) {
        LDKCVec_C2Tuple_PublicKeyTypeZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ) * orig->datalen, "LDKCVec_C2Tuple_PublicKeyTypeZZ clone bytes"), .datalen = orig->datalen };
        for (size_t i = 0; i < ret.datalen; i++) {
@@ -6177,9 +5799,6 @@ static inline LDKCVec_C2Tuple_PublicKeyTypeZZ CVec_C2Tuple_PublicKeyTypeZZ_clone
        }
        return ret;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolLightningErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_boolLightningErrorZ*)arg)->result_ok;
-}
 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolLightningErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_boolLightningErrorZ *val = (LDKCResult_boolLightningErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -6192,6 +5811,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolLightningEr
        uint64_t err_ref = 0;
        CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
        err_ref = (uint64_t)err_var.inner & ~1;
        return err_ref;
 }
@@ -6204,6 +5824,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncemen
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -6220,6 +5841,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncemen
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -6236,6 +5858,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncemen
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -6243,26 +5866,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncemen
        return ret_ref;
 }
 
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) {
-       LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *ret = MALLOC(sizeof(LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ), "LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ");
-       ret->datalen = (*env)->GetArrayLength(env, elems);
-       if (ret->datalen == 0) {
-               ret->data = NULL;
-       } else {
-               ret->data = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ) * ret->datalen, "LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ Data");
-               int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
-               for (size_t i = 0; i < ret->datalen; i++) {
-                       int64_t arr_elem = java_elems[i];
-                       void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
-                       CHECK_ACCESS(arr_elem_ptr);
-                       LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ arr_elem_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(arr_elem_ptr);
-                       arr_elem_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone((LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(((uint64_t)arr_elem) & ~1));
-                       ret->data[i] = arr_elem_conv;
-               }
-               (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0);
-       }
-       return (uint64_t)ret;
-}
 static inline LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_clone(const LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *orig) {
        LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ ret = { .data = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ) * orig->datalen, "LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ clone bytes"), .datalen = orig->datalen };
        for (size_t i = 0; i < ret.datalen; i++) {
@@ -6270,26 +5873,6 @@ static inline LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ CV
        }
        return ret;
 }
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1NodeAnnouncementZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) {
-       LDKCVec_NodeAnnouncementZ *ret = MALLOC(sizeof(LDKCVec_NodeAnnouncementZ), "LDKCVec_NodeAnnouncementZ");
-       ret->datalen = (*env)->GetArrayLength(env, elems);
-       if (ret->datalen == 0) {
-               ret->data = NULL;
-       } else {
-               ret->data = MALLOC(sizeof(LDKNodeAnnouncement) * ret->datalen, "LDKCVec_NodeAnnouncementZ Data");
-               int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
-               for (size_t i = 0; i < ret->datalen; i++) {
-                       int64_t arr_elem = java_elems[i];
-                       LDKNodeAnnouncement arr_elem_conv;
-                       arr_elem_conv.inner = (void*)(arr_elem & (~1));
-                       arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0);
-                       arr_elem_conv = NodeAnnouncement_clone(&arr_elem_conv);
-                       ret->data[i] = arr_elem_conv;
-               }
-               (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0);
-       }
-       return (uint64_t)ret;
-}
 static inline LDKCVec_NodeAnnouncementZ CVec_NodeAnnouncementZ_clone(const LDKCVec_NodeAnnouncementZ *orig) {
        LDKCVec_NodeAnnouncementZ ret = { .data = MALLOC(sizeof(LDKNodeAnnouncement) * orig->datalen, "LDKCVec_NodeAnnouncementZ clone bytes"), .datalen = orig->datalen };
        for (size_t i = 0; i < ret.datalen; i++) {
@@ -6297,9 +5880,6 @@ static inline LDKCVec_NodeAnnouncementZ CVec_NodeAnnouncementZ_clone(const LDKCV
        }
        return ret;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1u8ZPeerHandleErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_CVec_u8ZPeerHandleErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1u8ZPeerHandleErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_CVec_u8ZPeerHandleErrorZ *val = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -6315,12 +5895,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1u8ZPeerHa
        uint64_t err_ref = 0;
        CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
        err_ref = (uint64_t)err_var.inner & ~1;
        return err_ref;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePeerHandleErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_NonePeerHandleErrorZ*)arg)->result_ok;
-}
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePeerHandleErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_NonePeerHandleErrorZ *val = (LDKCResult_NonePeerHandleErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -6333,12 +5911,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePeerHandleE
        uint64_t err_ref = 0;
        CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
        err_ref = (uint64_t)err_var.inner & ~1;
        return err_ref;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolPeerHandleErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_boolPeerHandleErrorZ*)arg)->result_ok;
-}
 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolPeerHandleErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_boolPeerHandleErrorZ *val = (LDKCResult_boolPeerHandleErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -6351,12 +5927,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolPeerHandleE
        uint64_t err_ref = 0;
        CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
        err_ref = (uint64_t)err_var.inner & ~1;
        return err_ref;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeIdDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_NodeIdDecodeErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeIdDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_NodeIdDecodeErrorZ *val = (LDKCResult_NodeIdDecodeErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -6364,6 +5938,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeIdDecodeErr
        uint64_t res_ref = 0;
        CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
        res_ref = (uint64_t)res_var.inner & ~1;
        return res_ref;
 }
@@ -6374,6 +5949,24 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeIdDecodeErr
        uint64_t err_ref = 0;
        CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
+       err_ref = (uint64_t)err_var.inner & ~1;
+       return err_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1COption_1NetworkUpdateZDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_COption_NetworkUpdateZDecodeErrorZ *val = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)(arg & ~1);
+       CHECK(val->result_ok);
+       uint64_t res_ref = ((uint64_t)&(*val->contents.result)) | 1;
+       return res_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1COption_1NetworkUpdateZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_COption_NetworkUpdateZDecodeErrorZ *val = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)(arg & ~1);
+       CHECK(!val->result_ok);
+       LDKDecodeError err_var = (*val->contents.err);
+       uint64_t err_ref = 0;
+       CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+       CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
        err_ref = (uint64_t)err_var.inner & ~1;
        return err_ref;
 }
@@ -6421,7 +6014,7 @@ LDKCResult_TxOutAccessErrorZ get_utxo_LDKAccess_jcall(const void* this_arg, cons
        void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
        CHECK_ACCESS(ret_ptr);
        LDKCResult_TxOutAccessErrorZ ret_conv = *(LDKCResult_TxOutAccessErrorZ*)(ret_ptr);
-       ret_conv = CResult_TxOutAccessErrorZ_clone((LDKCResult_TxOutAccessErrorZ*)(((uint64_t)ret) & ~1));
+       FREE((void*)ret);
        if (get_jenv_res == JNI_EDETACHED) {
                DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
        }
@@ -6501,9 +6094,6 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1AccessZ_1ref_1f
                default: abort();
        }
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1DirectionalChannelInfoDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_DirectionalChannelInfoDecodeErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1DirectionalChannelInfoDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_DirectionalChannelInfoDecodeErrorZ *val = (LDKCResult_DirectionalChannelInfoDecodeErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -6511,6 +6101,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1DirectionalChan
        uint64_t res_ref = 0;
        CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
        res_ref = (uint64_t)res_var.inner & ~1;
        return res_ref;
 }
@@ -6521,12 +6112,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1DirectionalChan
        uint64_t err_ref = 0;
        CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
        err_ref = (uint64_t)err_var.inner & ~1;
        return err_ref;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelInfoDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_ChannelInfoDecodeErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelInfoDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_ChannelInfoDecodeErrorZ *val = (LDKCResult_ChannelInfoDecodeErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -6534,6 +6123,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelInfoDeco
        uint64_t res_ref = 0;
        CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
        res_ref = (uint64_t)res_var.inner & ~1;
        return res_ref;
 }
@@ -6544,12 +6134,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelInfoDeco
        uint64_t err_ref = 0;
        CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
        err_ref = (uint64_t)err_var.inner & ~1;
        return err_ref;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RoutingFeesDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_RoutingFeesDecodeErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RoutingFeesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_RoutingFeesDecodeErrorZ *val = (LDKCResult_RoutingFeesDecodeErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -6557,6 +6145,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RoutingFeesDeco
        uint64_t res_ref = 0;
        CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
        res_ref = (uint64_t)res_var.inner & ~1;
        return res_ref;
 }
@@ -6567,12 +6156,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RoutingFeesDeco
        uint64_t err_ref = 0;
        CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
        err_ref = (uint64_t)err_var.inner & ~1;
        return err_ref;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeAnnouncementInfoDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeAnnouncementInfoDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_NodeAnnouncementInfoDecodeErrorZ *val = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -6580,6 +6167,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeAnnouncemen
        uint64_t res_ref = 0;
        CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
        res_ref = (uint64_t)res_var.inner & ~1;
        return res_ref;
 }
@@ -6590,32 +6178,15 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeAnnouncemen
        uint64_t err_ref = 0;
        CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
        err_ref = (uint64_t)err_var.inner & ~1;
        return err_ref;
 }
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1u64Z_1new(JNIEnv *env, jclass clz, int64_tArray elems) {
-       LDKCVec_u64Z *ret = MALLOC(sizeof(LDKCVec_u64Z), "LDKCVec_u64Z");
-       ret->datalen = (*env)->GetArrayLength(env, elems);
-       if (ret->datalen == 0) {
-               ret->data = NULL;
-       } else {
-               ret->data = MALLOC(sizeof(uint64_t) * ret->datalen, "LDKCVec_u64Z Data");
-               int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
-               for (size_t i = 0; i < ret->datalen; i++) {
-                       ret->data[i] = java_elems[i];
-               }
-               (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0);
-       }
-       return (uint64_t)ret;
-}
 static inline LDKCVec_u64Z CVec_u64Z_clone(const LDKCVec_u64Z *orig) {
        LDKCVec_u64Z ret = { .data = MALLOC(sizeof(int64_t) * orig->datalen, "LDKCVec_u64Z clone bytes"), .datalen = orig->datalen };
        memcpy(ret.data, orig->data, sizeof(int64_t) * ret.datalen);
        return ret;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeInfoDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_NodeInfoDecodeErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeInfoDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_NodeInfoDecodeErrorZ *val = (LDKCResult_NodeInfoDecodeErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -6623,6 +6194,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeInfoDecodeE
        uint64_t res_ref = 0;
        CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
        res_ref = (uint64_t)res_var.inner & ~1;
        return res_ref;
 }
@@ -6633,12 +6205,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeInfoDecodeE
        uint64_t err_ref = 0;
        CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
        err_ref = (uint64_t)err_var.inner & ~1;
        return err_ref;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NetworkGraphDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_NetworkGraphDecodeErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NetworkGraphDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_NetworkGraphDecodeErrorZ *val = (LDKCResult_NetworkGraphDecodeErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -6646,6 +6216,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NetworkGraphDec
        uint64_t res_ref = 0;
        CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
        res_ref = (uint64_t)res_var.inner & ~1;
        return res_ref;
 }
@@ -6656,6 +6227,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NetworkGraphDec
        uint64_t err_ref = 0;
        CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
        err_ref = (uint64_t)err_var.inner & ~1;
        return err_ref;
 }
@@ -6696,9 +6268,6 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1CVec_1NetAddres
                default: abort();
        }
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NetAddressDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_NetAddressDecodeErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NetAddressDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_NetAddressDecodeErrorZ *val = (LDKCResult_NetAddressDecodeErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -6712,29 +6281,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NetAddressDecod
        uint64_t err_ref = 0;
        CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
        err_ref = (uint64_t)err_var.inner & ~1;
        return err_ref;
 }
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1UpdateAddHTLCZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) {
-       LDKCVec_UpdateAddHTLCZ *ret = MALLOC(sizeof(LDKCVec_UpdateAddHTLCZ), "LDKCVec_UpdateAddHTLCZ");
-       ret->datalen = (*env)->GetArrayLength(env, elems);
-       if (ret->datalen == 0) {
-               ret->data = NULL;
-       } else {
-               ret->data = MALLOC(sizeof(LDKUpdateAddHTLC) * ret->datalen, "LDKCVec_UpdateAddHTLCZ Data");
-               int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
-               for (size_t i = 0; i < ret->datalen; i++) {
-                       int64_t arr_elem = java_elems[i];
-                       LDKUpdateAddHTLC arr_elem_conv;
-                       arr_elem_conv.inner = (void*)(arr_elem & (~1));
-                       arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0);
-                       arr_elem_conv = UpdateAddHTLC_clone(&arr_elem_conv);
-                       ret->data[i] = arr_elem_conv;
-               }
-               (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0);
-       }
-       return (uint64_t)ret;
-}
 static inline LDKCVec_UpdateAddHTLCZ CVec_UpdateAddHTLCZ_clone(const LDKCVec_UpdateAddHTLCZ *orig) {
        LDKCVec_UpdateAddHTLCZ ret = { .data = MALLOC(sizeof(LDKUpdateAddHTLC) * orig->datalen, "LDKCVec_UpdateAddHTLCZ clone bytes"), .datalen = orig->datalen };
        for (size_t i = 0; i < ret.datalen; i++) {
@@ -6742,26 +6292,6 @@ static inline LDKCVec_UpdateAddHTLCZ CVec_UpdateAddHTLCZ_clone(const LDKCVec_Upd
        }
        return ret;
 }
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1UpdateFulfillHTLCZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) {
-       LDKCVec_UpdateFulfillHTLCZ *ret = MALLOC(sizeof(LDKCVec_UpdateFulfillHTLCZ), "LDKCVec_UpdateFulfillHTLCZ");
-       ret->datalen = (*env)->GetArrayLength(env, elems);
-       if (ret->datalen == 0) {
-               ret->data = NULL;
-       } else {
-               ret->data = MALLOC(sizeof(LDKUpdateFulfillHTLC) * ret->datalen, "LDKCVec_UpdateFulfillHTLCZ Data");
-               int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
-               for (size_t i = 0; i < ret->datalen; i++) {
-                       int64_t arr_elem = java_elems[i];
-                       LDKUpdateFulfillHTLC arr_elem_conv;
-                       arr_elem_conv.inner = (void*)(arr_elem & (~1));
-                       arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0);
-                       arr_elem_conv = UpdateFulfillHTLC_clone(&arr_elem_conv);
-                       ret->data[i] = arr_elem_conv;
-               }
-               (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0);
-       }
-       return (uint64_t)ret;
-}
 static inline LDKCVec_UpdateFulfillHTLCZ CVec_UpdateFulfillHTLCZ_clone(const LDKCVec_UpdateFulfillHTLCZ *orig) {
        LDKCVec_UpdateFulfillHTLCZ ret = { .data = MALLOC(sizeof(LDKUpdateFulfillHTLC) * orig->datalen, "LDKCVec_UpdateFulfillHTLCZ clone bytes"), .datalen = orig->datalen };
        for (size_t i = 0; i < ret.datalen; i++) {
@@ -6769,26 +6299,6 @@ static inline LDKCVec_UpdateFulfillHTLCZ CVec_UpdateFulfillHTLCZ_clone(const LDK
        }
        return ret;
 }
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1UpdateFailHTLCZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) {
-       LDKCVec_UpdateFailHTLCZ *ret = MALLOC(sizeof(LDKCVec_UpdateFailHTLCZ), "LDKCVec_UpdateFailHTLCZ");
-       ret->datalen = (*env)->GetArrayLength(env, elems);
-       if (ret->datalen == 0) {
-               ret->data = NULL;
-       } else {
-               ret->data = MALLOC(sizeof(LDKUpdateFailHTLC) * ret->datalen, "LDKCVec_UpdateFailHTLCZ Data");
-               int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
-               for (size_t i = 0; i < ret->datalen; i++) {
-                       int64_t arr_elem = java_elems[i];
-                       LDKUpdateFailHTLC arr_elem_conv;
-                       arr_elem_conv.inner = (void*)(arr_elem & (~1));
-                       arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0);
-                       arr_elem_conv = UpdateFailHTLC_clone(&arr_elem_conv);
-                       ret->data[i] = arr_elem_conv;
-               }
-               (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0);
-       }
-       return (uint64_t)ret;
-}
 static inline LDKCVec_UpdateFailHTLCZ CVec_UpdateFailHTLCZ_clone(const LDKCVec_UpdateFailHTLCZ *orig) {
        LDKCVec_UpdateFailHTLCZ ret = { .data = MALLOC(sizeof(LDKUpdateFailHTLC) * orig->datalen, "LDKCVec_UpdateFailHTLCZ clone bytes"), .datalen = orig->datalen };
        for (size_t i = 0; i < ret.datalen; i++) {
@@ -6796,26 +6306,6 @@ static inline LDKCVec_UpdateFailHTLCZ CVec_UpdateFailHTLCZ_clone(const LDKCVec_U
        }
        return ret;
 }
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1UpdateFailMalformedHTLCZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) {
-       LDKCVec_UpdateFailMalformedHTLCZ *ret = MALLOC(sizeof(LDKCVec_UpdateFailMalformedHTLCZ), "LDKCVec_UpdateFailMalformedHTLCZ");
-       ret->datalen = (*env)->GetArrayLength(env, elems);
-       if (ret->datalen == 0) {
-               ret->data = NULL;
-       } else {
-               ret->data = MALLOC(sizeof(LDKUpdateFailMalformedHTLC) * ret->datalen, "LDKCVec_UpdateFailMalformedHTLCZ Data");
-               int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
-               for (size_t i = 0; i < ret->datalen; i++) {
-                       int64_t arr_elem = java_elems[i];
-                       LDKUpdateFailMalformedHTLC arr_elem_conv;
-                       arr_elem_conv.inner = (void*)(arr_elem & (~1));
-                       arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0);
-                       arr_elem_conv = UpdateFailMalformedHTLC_clone(&arr_elem_conv);
-                       ret->data[i] = arr_elem_conv;
-               }
-               (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0);
-       }
-       return (uint64_t)ret;
-}
 static inline LDKCVec_UpdateFailMalformedHTLCZ CVec_UpdateFailMalformedHTLCZ_clone(const LDKCVec_UpdateFailMalformedHTLCZ *orig) {
        LDKCVec_UpdateFailMalformedHTLCZ ret = { .data = MALLOC(sizeof(LDKUpdateFailMalformedHTLC) * orig->datalen, "LDKCVec_UpdateFailMalformedHTLCZ clone bytes"), .datalen = orig->datalen };
        for (size_t i = 0; i < ret.datalen; i++) {
@@ -6823,9 +6313,6 @@ static inline LDKCVec_UpdateFailMalformedHTLCZ CVec_UpdateFailMalformedHTLCZ_clo
        }
        return ret;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1AcceptChannelDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_AcceptChannelDecodeErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1AcceptChannelDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_AcceptChannelDecodeErrorZ *val = (LDKCResult_AcceptChannelDecodeErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -6833,6 +6320,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1AcceptChannelDe
        uint64_t res_ref = 0;
        CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
        res_ref = (uint64_t)res_var.inner & ~1;
        return res_ref;
 }
@@ -6843,12 +6331,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1AcceptChannelDe
        uint64_t err_ref = 0;
        CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
        err_ref = (uint64_t)err_var.inner & ~1;
        return err_ref;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1AnnouncementSignaturesDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_AnnouncementSignaturesDecodeErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1AnnouncementSignaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_AnnouncementSignaturesDecodeErrorZ *val = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -6856,6 +6342,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1AnnouncementSig
        uint64_t res_ref = 0;
        CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
        res_ref = (uint64_t)res_var.inner & ~1;
        return res_ref;
 }
@@ -6866,12 +6353,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1AnnouncementSig
        uint64_t err_ref = 0;
        CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
        err_ref = (uint64_t)err_var.inner & ~1;
        return err_ref;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelReestablishDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_ChannelReestablishDecodeErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelReestablishDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_ChannelReestablishDecodeErrorZ *val = (LDKCResult_ChannelReestablishDecodeErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -6879,6 +6364,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelReestabl
        uint64_t res_ref = 0;
        CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
        res_ref = (uint64_t)res_var.inner & ~1;
        return res_ref;
 }
@@ -6889,12 +6375,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelReestabl
        uint64_t err_ref = 0;
        CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
        err_ref = (uint64_t)err_var.inner & ~1;
        return err_ref;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ClosingSignedDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_ClosingSignedDecodeErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ClosingSignedDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_ClosingSignedDecodeErrorZ *val = (LDKCResult_ClosingSignedDecodeErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -6902,6 +6386,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ClosingSignedDe
        uint64_t res_ref = 0;
        CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
        res_ref = (uint64_t)res_var.inner & ~1;
        return res_ref;
 }
@@ -6912,12 +6397,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ClosingSignedDe
        uint64_t err_ref = 0;
        CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
        err_ref = (uint64_t)err_var.inner & ~1;
        return err_ref;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ClosingSignedFeeRangeDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ClosingSignedFeeRangeDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *val = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -6925,6 +6408,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ClosingSignedFe
        uint64_t res_ref = 0;
        CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
        res_ref = (uint64_t)res_var.inner & ~1;
        return res_ref;
 }
@@ -6935,12 +6419,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ClosingSignedFe
        uint64_t err_ref = 0;
        CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
        err_ref = (uint64_t)err_var.inner & ~1;
        return err_ref;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CommitmentSignedDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_CommitmentSignedDecodeErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CommitmentSignedDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_CommitmentSignedDecodeErrorZ *val = (LDKCResult_CommitmentSignedDecodeErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -6948,6 +6430,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CommitmentSigne
        uint64_t res_ref = 0;
        CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
        res_ref = (uint64_t)res_var.inner & ~1;
        return res_ref;
 }
@@ -6958,12 +6441,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CommitmentSigne
        uint64_t err_ref = 0;
        CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
        err_ref = (uint64_t)err_var.inner & ~1;
        return err_ref;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1FundingCreatedDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_FundingCreatedDecodeErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1FundingCreatedDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_FundingCreatedDecodeErrorZ *val = (LDKCResult_FundingCreatedDecodeErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -6971,6 +6452,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1FundingCreatedD
        uint64_t res_ref = 0;
        CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
        res_ref = (uint64_t)res_var.inner & ~1;
        return res_ref;
 }
@@ -6981,12 +6463,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1FundingCreatedD
        uint64_t err_ref = 0;
        CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
        err_ref = (uint64_t)err_var.inner & ~1;
        return err_ref;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1FundingSignedDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_FundingSignedDecodeErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1FundingSignedDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_FundingSignedDecodeErrorZ *val = (LDKCResult_FundingSignedDecodeErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -6994,6 +6474,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1FundingSignedDe
        uint64_t res_ref = 0;
        CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
        res_ref = (uint64_t)res_var.inner & ~1;
        return res_ref;
 }
@@ -7004,12 +6485,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1FundingSignedDe
        uint64_t err_ref = 0;
        CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
        err_ref = (uint64_t)err_var.inner & ~1;
        return err_ref;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1FundingLockedDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_FundingLockedDecodeErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1FundingLockedDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_FundingLockedDecodeErrorZ *val = (LDKCResult_FundingLockedDecodeErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -7017,6 +6496,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1FundingLockedDe
        uint64_t res_ref = 0;
        CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
        res_ref = (uint64_t)res_var.inner & ~1;
        return res_ref;
 }
@@ -7027,12 +6507,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1FundingLockedDe
        uint64_t err_ref = 0;
        CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
        err_ref = (uint64_t)err_var.inner & ~1;
        return err_ref;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InitDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_InitDecodeErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InitDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_InitDecodeErrorZ *val = (LDKCResult_InitDecodeErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -7040,6 +6518,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InitDecodeError
        uint64_t res_ref = 0;
        CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
        res_ref = (uint64_t)res_var.inner & ~1;
        return res_ref;
 }
@@ -7050,12 +6529,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InitDecodeError
        uint64_t err_ref = 0;
        CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
        err_ref = (uint64_t)err_var.inner & ~1;
        return err_ref;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1OpenChannelDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_OpenChannelDecodeErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1OpenChannelDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_OpenChannelDecodeErrorZ *val = (LDKCResult_OpenChannelDecodeErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -7063,6 +6540,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1OpenChannelDeco
        uint64_t res_ref = 0;
        CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
        res_ref = (uint64_t)res_var.inner & ~1;
        return res_ref;
 }
@@ -7073,12 +6551,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1OpenChannelDeco
        uint64_t err_ref = 0;
        CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
        err_ref = (uint64_t)err_var.inner & ~1;
        return err_ref;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RevokeAndACKDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_RevokeAndACKDecodeErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RevokeAndACKDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_RevokeAndACKDecodeErrorZ *val = (LDKCResult_RevokeAndACKDecodeErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -7086,6 +6562,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RevokeAndACKDec
        uint64_t res_ref = 0;
        CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
        res_ref = (uint64_t)res_var.inner & ~1;
        return res_ref;
 }
@@ -7096,12 +6573,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RevokeAndACKDec
        uint64_t err_ref = 0;
        CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
        err_ref = (uint64_t)err_var.inner & ~1;
        return err_ref;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ShutdownDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_ShutdownDecodeErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ShutdownDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_ShutdownDecodeErrorZ *val = (LDKCResult_ShutdownDecodeErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -7109,6 +6584,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ShutdownDecodeE
        uint64_t res_ref = 0;
        CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
        res_ref = (uint64_t)res_var.inner & ~1;
        return res_ref;
 }
@@ -7119,12 +6595,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ShutdownDecodeE
        uint64_t err_ref = 0;
        CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
        err_ref = (uint64_t)err_var.inner & ~1;
        return err_ref;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFailHTLCDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_UpdateFailHTLCDecodeErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFailHTLCDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_UpdateFailHTLCDecodeErrorZ *val = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -7132,6 +6606,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFailHTLCD
        uint64_t res_ref = 0;
        CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
        res_ref = (uint64_t)res_var.inner & ~1;
        return res_ref;
 }
@@ -7142,12 +6617,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFailHTLCD
        uint64_t err_ref = 0;
        CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
        err_ref = (uint64_t)err_var.inner & ~1;
        return err_ref;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFailMalformedHTLCDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFailMalformedHTLCDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *val = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -7155,6 +6628,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFailMalfo
        uint64_t res_ref = 0;
        CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
        res_ref = (uint64_t)res_var.inner & ~1;
        return res_ref;
 }
@@ -7165,12 +6639,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFailMalfo
        uint64_t err_ref = 0;
        CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
        err_ref = (uint64_t)err_var.inner & ~1;
        return err_ref;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFeeDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_UpdateFeeDecodeErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFeeDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_UpdateFeeDecodeErrorZ *val = (LDKCResult_UpdateFeeDecodeErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -7178,6 +6650,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFeeDecode
        uint64_t res_ref = 0;
        CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
        res_ref = (uint64_t)res_var.inner & ~1;
        return res_ref;
 }
@@ -7188,12 +6661,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFeeDecode
        uint64_t err_ref = 0;
        CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
        err_ref = (uint64_t)err_var.inner & ~1;
        return err_ref;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFulfillHTLCDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFulfillHTLCDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_UpdateFulfillHTLCDecodeErrorZ *val = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -7201,6 +6672,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFulfillHT
        uint64_t res_ref = 0;
        CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
        res_ref = (uint64_t)res_var.inner & ~1;
        return res_ref;
 }
@@ -7211,12 +6683,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFulfillHT
        uint64_t err_ref = 0;
        CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
        err_ref = (uint64_t)err_var.inner & ~1;
        return err_ref;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateAddHTLCDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_UpdateAddHTLCDecodeErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateAddHTLCDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_UpdateAddHTLCDecodeErrorZ *val = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -7224,6 +6694,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateAddHTLCDe
        uint64_t res_ref = 0;
        CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
        res_ref = (uint64_t)res_var.inner & ~1;
        return res_ref;
 }
@@ -7234,12 +6705,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateAddHTLCDe
        uint64_t err_ref = 0;
        CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
        err_ref = (uint64_t)err_var.inner & ~1;
        return err_ref;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PingDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_PingDecodeErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PingDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_PingDecodeErrorZ *val = (LDKCResult_PingDecodeErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -7247,6 +6716,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PingDecodeError
        uint64_t res_ref = 0;
        CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
        res_ref = (uint64_t)res_var.inner & ~1;
        return res_ref;
 }
@@ -7257,12 +6727,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PingDecodeError
        uint64_t err_ref = 0;
        CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
        err_ref = (uint64_t)err_var.inner & ~1;
        return err_ref;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PongDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_PongDecodeErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PongDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_PongDecodeErrorZ *val = (LDKCResult_PongDecodeErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -7270,6 +6738,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PongDecodeError
        uint64_t res_ref = 0;
        CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
        res_ref = (uint64_t)res_var.inner & ~1;
        return res_ref;
 }
@@ -7280,12 +6749,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PongDecodeError
        uint64_t err_ref = 0;
        CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
        err_ref = (uint64_t)err_var.inner & ~1;
        return err_ref;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedChannelAnnouncementDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedChannelAnnouncementDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *val = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -7293,6 +6760,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedChannel
        uint64_t res_ref = 0;
        CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
        res_ref = (uint64_t)res_var.inner & ~1;
        return res_ref;
 }
@@ -7303,12 +6771,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedChannel
        uint64_t err_ref = 0;
        CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
        err_ref = (uint64_t)err_var.inner & ~1;
        return err_ref;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelAnnouncementDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_ChannelAnnouncementDecodeErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelAnnouncementDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_ChannelAnnouncementDecodeErrorZ *val = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -7316,6 +6782,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelAnnounce
        uint64_t res_ref = 0;
        CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
        res_ref = (uint64_t)res_var.inner & ~1;
        return res_ref;
 }
@@ -7326,12 +6793,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelAnnounce
        uint64_t err_ref = 0;
        CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
        err_ref = (uint64_t)err_var.inner & ~1;
        return err_ref;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedChannelUpdateDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedChannelUpdateDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_UnsignedChannelUpdateDecodeErrorZ *val = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -7339,6 +6804,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedChannel
        uint64_t res_ref = 0;
        CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
        res_ref = (uint64_t)res_var.inner & ~1;
        return res_ref;
 }
@@ -7349,12 +6815,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedChannel
        uint64_t err_ref = 0;
        CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
        err_ref = (uint64_t)err_var.inner & ~1;
        return err_ref;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelUpdateDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_ChannelUpdateDecodeErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelUpdateDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_ChannelUpdateDecodeErrorZ *val = (LDKCResult_ChannelUpdateDecodeErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -7362,6 +6826,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelUpdateDe
        uint64_t res_ref = 0;
        CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
        res_ref = (uint64_t)res_var.inner & ~1;
        return res_ref;
 }
@@ -7372,12 +6837,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelUpdateDe
        uint64_t err_ref = 0;
        CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
        err_ref = (uint64_t)err_var.inner & ~1;
        return err_ref;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ErrorMessageDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_ErrorMessageDecodeErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ErrorMessageDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_ErrorMessageDecodeErrorZ *val = (LDKCResult_ErrorMessageDecodeErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -7385,6 +6848,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ErrorMessageDec
        uint64_t res_ref = 0;
        CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
        res_ref = (uint64_t)res_var.inner & ~1;
        return res_ref;
 }
@@ -7395,12 +6859,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ErrorMessageDec
        uint64_t err_ref = 0;
        CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
        err_ref = (uint64_t)err_var.inner & ~1;
        return err_ref;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedNodeAnnouncementDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedNodeAnnouncementDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *val = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -7408,6 +6870,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedNodeAnn
        uint64_t res_ref = 0;
        CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
        res_ref = (uint64_t)res_var.inner & ~1;
        return res_ref;
 }
@@ -7418,12 +6881,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedNodeAnn
        uint64_t err_ref = 0;
        CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
        err_ref = (uint64_t)err_var.inner & ~1;
        return err_ref;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeAnnouncementDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_NodeAnnouncementDecodeErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeAnnouncementDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_NodeAnnouncementDecodeErrorZ *val = (LDKCResult_NodeAnnouncementDecodeErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -7431,6 +6892,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeAnnouncemen
        uint64_t res_ref = 0;
        CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
        res_ref = (uint64_t)res_var.inner & ~1;
        return res_ref;
 }
@@ -7441,12 +6903,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeAnnouncemen
        uint64_t err_ref = 0;
        CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
        err_ref = (uint64_t)err_var.inner & ~1;
        return err_ref;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1QueryShortChannelIdsDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_QueryShortChannelIdsDecodeErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1QueryShortChannelIdsDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_QueryShortChannelIdsDecodeErrorZ *val = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -7454,6 +6914,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1QueryShortChann
        uint64_t res_ref = 0;
        CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
        res_ref = (uint64_t)res_var.inner & ~1;
        return res_ref;
 }
@@ -7464,12 +6925,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1QueryShortChann
        uint64_t err_ref = 0;
        CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
        err_ref = (uint64_t)err_var.inner & ~1;
        return err_ref;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ReplyShortChannelIdsEndDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ReplyShortChannelIdsEndDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *val = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -7477,6 +6936,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ReplyShortChann
        uint64_t res_ref = 0;
        CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
        res_ref = (uint64_t)res_var.inner & ~1;
        return res_ref;
 }
@@ -7487,12 +6947,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ReplyShortChann
        uint64_t err_ref = 0;
        CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
        err_ref = (uint64_t)err_var.inner & ~1;
        return err_ref;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1QueryChannelRangeDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_QueryChannelRangeDecodeErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1QueryChannelRangeDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_QueryChannelRangeDecodeErrorZ *val = (LDKCResult_QueryChannelRangeDecodeErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -7500,6 +6958,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1QueryChannelRan
        uint64_t res_ref = 0;
        CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
        res_ref = (uint64_t)res_var.inner & ~1;
        return res_ref;
 }
@@ -7510,12 +6969,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1QueryChannelRan
        uint64_t err_ref = 0;
        CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
        err_ref = (uint64_t)err_var.inner & ~1;
        return err_ref;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ReplyChannelRangeDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_ReplyChannelRangeDecodeErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ReplyChannelRangeDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_ReplyChannelRangeDecodeErrorZ *val = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -7523,6 +6980,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ReplyChannelRan
        uint64_t res_ref = 0;
        CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
        res_ref = (uint64_t)res_var.inner & ~1;
        return res_ref;
 }
@@ -7533,12 +6991,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ReplyChannelRan
        uint64_t err_ref = 0;
        CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
        err_ref = (uint64_t)err_var.inner & ~1;
        return err_ref;
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1GossipTimestampFilterDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_GossipTimestampFilterDecodeErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1GossipTimestampFilterDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_GossipTimestampFilterDecodeErrorZ *val = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -7546,6 +7002,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1GossipTimestamp
        uint64_t res_ref = 0;
        CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
        res_ref = (uint64_t)res_var.inner & ~1;
        return res_ref;
 }
@@ -7556,6 +7013,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1GossipTimestamp
        uint64_t err_ref = 0;
        CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
        err_ref = (uint64_t)err_var.inner & ~1;
        return err_ref;
 }
@@ -7588,9 +7046,6 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKSignOrCreationError_1ref
                default: abort();
        }
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceSignOrCreationErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_InvoiceSignOrCreationErrorZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceSignOrCreationErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_InvoiceSignOrCreationErrorZ *val = (LDKCResult_InvoiceSignOrCreationErrorZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -7598,6 +7053,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceSignOrCr
        uint64_t res_ref = 0;
        CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
        res_ref = (uint64_t)res_var.inner & ~1;
        return res_ref;
 }
@@ -7669,6 +7125,7 @@ LDKCOption_C2Tuple_usizeTransactionZZ register_output_LDKFilter_jcall(const void
        uint64_t output_ref = 0;
        CHECK((((uint64_t)output_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&output_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(output_var);
        output_ref = (uint64_t)output_var.inner;
        if (output_var.is_owned) {
                output_ref |= 1;
@@ -7683,7 +7140,7 @@ LDKCOption_C2Tuple_usizeTransactionZZ register_output_LDKFilter_jcall(const void
        void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
        CHECK_ACCESS(ret_ptr);
        LDKCOption_C2Tuple_usizeTransactionZZ ret_conv = *(LDKCOption_C2Tuple_usizeTransactionZZ*)(ret_ptr);
-       ret_conv = COption_C2Tuple_usizeTransactionZZ_clone((LDKCOption_C2Tuple_usizeTransactionZZ*)(((uint64_t)ret) & ~1));
+       FREE((void*)ret);
        if (get_jenv_res == JNI_EDETACHED) {
                DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
        }
@@ -7740,6 +7197,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Filter_1register_1output(JN
        LDKWatchedOutput output_conv;
        output_conv.inner = (void*)(output & (~1));
        output_conv.is_owned = (output & 1) || (output == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(output_conv);
        output_conv = WatchedOutput_clone(&output_conv);
        LDKCOption_C2Tuple_usizeTransactionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_usizeTransactionZZ), "LDKCOption_C2Tuple_usizeTransactionZZ");
        *ret_copy = (this_arg_conv->register_output)(this_arg_conv->this_arg, output_conv);
@@ -7782,9 +7240,6 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1FilterZ_1ref_1f
                default: abort();
        }
 }
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1LockedChannelMonitorNoneZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
-       return ((LDKCResult_LockedChannelMonitorNoneZ*)arg)->result_ok;
-}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1LockedChannelMonitorNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        LDKCResult_LockedChannelMonitorNoneZ *val = (LDKCResult_LockedChannelMonitorNoneZ*)(arg & ~1);
        CHECK(val->result_ok);
@@ -7792,6 +7247,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1LockedChannelMo
        uint64_t res_ref = 0;
        CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
        res_ref = (uint64_t)res_var.inner & ~1;
        return res_ref;
 }
@@ -7800,26 +7256,6 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1LockedChannelMonit
        CHECK(!val->result_ok);
        return *val->contents.err;
 }
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1OutPointZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) {
-       LDKCVec_OutPointZ *ret = MALLOC(sizeof(LDKCVec_OutPointZ), "LDKCVec_OutPointZ");
-       ret->datalen = (*env)->GetArrayLength(env, elems);
-       if (ret->datalen == 0) {
-               ret->data = NULL;
-       } else {
-               ret->data = MALLOC(sizeof(LDKOutPoint) * ret->datalen, "LDKCVec_OutPointZ Data");
-               int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
-               for (size_t i = 0; i < ret->datalen; i++) {
-                       int64_t arr_elem = java_elems[i];
-                       LDKOutPoint arr_elem_conv;
-                       arr_elem_conv.inner = (void*)(arr_elem & (~1));
-                       arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0);
-                       arr_elem_conv = OutPoint_clone(&arr_elem_conv);
-                       ret->data[i] = arr_elem_conv;
-               }
-               (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0);
-       }
-       return (uint64_t)ret;
-}
 static inline LDKCVec_OutPointZ CVec_OutPointZ_clone(const LDKCVec_OutPointZ *orig) {
        LDKCVec_OutPointZ ret = { .data = MALLOC(sizeof(LDKOutPoint) * orig->datalen, "LDKCVec_OutPointZ clone bytes"), .datalen = orig->datalen };
        for (size_t i = 0; i < ret.datalen; i++) {
@@ -7878,7 +7314,7 @@ LDKCVec_MessageSendEventZ get_and_clear_pending_msg_events_LDKMessageSendEventsP
                void* ret_conv_18_ptr = (void*)(((uint64_t)ret_conv_18) & ~1);
                CHECK_ACCESS(ret_conv_18_ptr);
                LDKMessageSendEvent ret_conv_18_conv = *(LDKMessageSendEvent*)(ret_conv_18_ptr);
-               ret_conv_18_conv = MessageSendEvent_clone((LDKMessageSendEvent*)(((uint64_t)ret_conv_18) & ~1));
+               FREE((void*)ret_conv_18);
                ret_constr.data[s] = ret_conv_18_conv;
        }
        (*env)->ReleaseLongArrayElements(env, ret, ret_vals, 0);
@@ -8492,6 +7928,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ persist_new_channel_LDKPersist_jcall(con
        uint64_t channel_id_ref = 0;
        CHECK((((uint64_t)channel_id_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&channel_id_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_var);
        channel_id_ref = (uint64_t)channel_id_var.inner;
        if (channel_id_var.is_owned) {
                channel_id_ref |= 1;
@@ -8501,6 +7938,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ persist_new_channel_LDKPersist_jcall(con
        data_var = ChannelMonitor_clone(data);
        CHECK((((uint64_t)data_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&data_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(data_var);
        data_ref = (uint64_t)data_var.inner;
        if (data_var.is_owned) {
                data_ref |= 1;
@@ -8509,6 +7947,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ persist_new_channel_LDKPersist_jcall(con
        uint64_t update_id_ref = 0;
        CHECK((((uint64_t)update_id_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&update_id_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_var);
        update_id_ref = (uint64_t)update_id_var.inner;
        if (update_id_var.is_owned) {
                update_id_ref |= 1;
@@ -8523,7 +7962,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ persist_new_channel_LDKPersist_jcall(con
        void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
        CHECK_ACCESS(ret_ptr);
        LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr);
-       ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone((LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1));
+       FREE((void*)ret);
        if (get_jenv_res == JNI_EDETACHED) {
                DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
        }
@@ -8542,6 +7981,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ update_persisted_channel_LDKPersist_jcal
        uint64_t channel_id_ref = 0;
        CHECK((((uint64_t)channel_id_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&channel_id_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_var);
        channel_id_ref = (uint64_t)channel_id_var.inner;
        if (channel_id_var.is_owned) {
                channel_id_ref |= 1;
@@ -8552,6 +7992,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ update_persisted_channel_LDKPersist_jcal
                update_var = ChannelMonitorUpdate_clone(update);
                CHECK((((uint64_t)update_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
                CHECK((((uint64_t)&update_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(update_var);
                update_ref = (uint64_t)update_var.inner;
                if (update_var.is_owned) {
                        update_ref |= 1;
@@ -8562,6 +8003,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ update_persisted_channel_LDKPersist_jcal
        data_var = ChannelMonitor_clone(data);
        CHECK((((uint64_t)data_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&data_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(data_var);
        data_ref = (uint64_t)data_var.inner;
        if (data_var.is_owned) {
                data_ref |= 1;
@@ -8570,6 +8012,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ update_persisted_channel_LDKPersist_jcal
        uint64_t update_id_ref = 0;
        CHECK((((uint64_t)update_id_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&update_id_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_var);
        update_id_ref = (uint64_t)update_id_var.inner;
        if (update_id_var.is_owned) {
                update_id_ref |= 1;
@@ -8584,7 +8027,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ update_persisted_channel_LDKPersist_jcal
        void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
        CHECK_ACCESS(ret_ptr);
        LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr);
-       ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone((LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1));
+       FREE((void*)ret);
        if (get_jenv_res == JNI_EDETACHED) {
                DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
        }
@@ -8626,13 +8069,16 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Persist_1persist_1new_1chan
        LDKOutPoint channel_id_conv;
        channel_id_conv.inner = (void*)(channel_id & (~1));
        channel_id_conv.is_owned = (channel_id & 1) || (channel_id == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv);
        channel_id_conv = OutPoint_clone(&channel_id_conv);
        LDKChannelMonitor data_conv;
        data_conv.inner = (void*)(data & (~1));
        data_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(data_conv);
        LDKMonitorUpdateId update_id_conv;
        update_id_conv.inner = (void*)(update_id & (~1));
        update_id_conv.is_owned = (update_id & 1) || (update_id == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_conv);
        update_id_conv = MonitorUpdateId_clone(&update_id_conv);
        LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
        *ret_conv = (this_arg_conv->persist_new_channel)(this_arg_conv->this_arg, channel_id_conv, &data_conv, update_id_conv);
@@ -8646,16 +8092,20 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Persist_1update_1persisted_
        LDKOutPoint channel_id_conv;
        channel_id_conv.inner = (void*)(channel_id & (~1));
        channel_id_conv.is_owned = (channel_id & 1) || (channel_id == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv);
        channel_id_conv = OutPoint_clone(&channel_id_conv);
        LDKChannelMonitorUpdate update_conv;
        update_conv.inner = (void*)(update & (~1));
        update_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(update_conv);
        LDKChannelMonitor data_conv;
        data_conv.inner = (void*)(data & (~1));
        data_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(data_conv);
        LDKMonitorUpdateId update_id_conv;
        update_id_conv.inner = (void*)(update_id & (~1));
        update_id_conv.is_owned = (update_id & 1) || (update_id == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_conv);
        update_id_conv = MonitorUpdateId_clone(&update_id_conv);
        LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
        *ret_conv = (this_arg_conv->update_persisted_channel)(this_arg_conv->this_arg, channel_id_conv, &update_conv, &data_conv, update_id_conv);
@@ -8720,6 +8170,7 @@ void handle_open_channel_LDKChannelMessageHandler_jcall(const void* this_arg, LD
        uint64_t their_features_ref = 0;
        CHECK((((uint64_t)their_features_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&their_features_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_var);
        their_features_ref = (uint64_t)their_features_var.inner;
        if (their_features_var.is_owned) {
                their_features_ref |= 1;
@@ -8729,6 +8180,7 @@ void handle_open_channel_LDKChannelMessageHandler_jcall(const void* this_arg, LD
        msg_var = OpenChannel_clone(msg);
        CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
        msg_ref = (uint64_t)msg_var.inner;
        if (msg_var.is_owned) {
                msg_ref |= 1;
@@ -8759,6 +8211,7 @@ void handle_accept_channel_LDKChannelMessageHandler_jcall(const void* this_arg,
        uint64_t their_features_ref = 0;
        CHECK((((uint64_t)their_features_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&their_features_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_var);
        their_features_ref = (uint64_t)their_features_var.inner;
        if (their_features_var.is_owned) {
                their_features_ref |= 1;
@@ -8768,6 +8221,7 @@ void handle_accept_channel_LDKChannelMessageHandler_jcall(const void* this_arg,
        msg_var = AcceptChannel_clone(msg);
        CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
        msg_ref = (uint64_t)msg_var.inner;
        if (msg_var.is_owned) {
                msg_ref |= 1;
@@ -8799,6 +8253,7 @@ void handle_funding_created_LDKChannelMessageHandler_jcall(const void* this_arg,
        msg_var = FundingCreated_clone(msg);
        CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
        msg_ref = (uint64_t)msg_var.inner;
        if (msg_var.is_owned) {
                msg_ref |= 1;
@@ -8830,6 +8285,7 @@ void handle_funding_signed_LDKChannelMessageHandler_jcall(const void* this_arg,
        msg_var = FundingSigned_clone(msg);
        CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
        msg_ref = (uint64_t)msg_var.inner;
        if (msg_var.is_owned) {
                msg_ref |= 1;
@@ -8861,6 +8317,7 @@ void handle_funding_locked_LDKChannelMessageHandler_jcall(const void* this_arg,
        msg_var = FundingLocked_clone(msg);
        CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
        msg_ref = (uint64_t)msg_var.inner;
        if (msg_var.is_owned) {
                msg_ref |= 1;
@@ -8892,6 +8349,7 @@ void handle_shutdown_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPub
        their_features_var = InitFeatures_clone(their_features);
        CHECK((((uint64_t)their_features_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&their_features_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_var);
        their_features_ref = (uint64_t)their_features_var.inner;
        if (their_features_var.is_owned) {
                their_features_ref |= 1;
@@ -8901,6 +8359,7 @@ void handle_shutdown_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPub
        msg_var = Shutdown_clone(msg);
        CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
        msg_ref = (uint64_t)msg_var.inner;
        if (msg_var.is_owned) {
                msg_ref |= 1;
@@ -8932,6 +8391,7 @@ void handle_closing_signed_LDKChannelMessageHandler_jcall(const void* this_arg,
        msg_var = ClosingSigned_clone(msg);
        CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
        msg_ref = (uint64_t)msg_var.inner;
        if (msg_var.is_owned) {
                msg_ref |= 1;
@@ -8963,6 +8423,7 @@ void handle_update_add_htlc_LDKChannelMessageHandler_jcall(const void* this_arg,
        msg_var = UpdateAddHTLC_clone(msg);
        CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
        msg_ref = (uint64_t)msg_var.inner;
        if (msg_var.is_owned) {
                msg_ref |= 1;
@@ -8994,6 +8455,7 @@ void handle_update_fulfill_htlc_LDKChannelMessageHandler_jcall(const void* this_
        msg_var = UpdateFulfillHTLC_clone(msg);
        CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
        msg_ref = (uint64_t)msg_var.inner;
        if (msg_var.is_owned) {
                msg_ref |= 1;
@@ -9025,6 +8487,7 @@ void handle_update_fail_htlc_LDKChannelMessageHandler_jcall(const void* this_arg
        msg_var = UpdateFailHTLC_clone(msg);
        CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
        msg_ref = (uint64_t)msg_var.inner;
        if (msg_var.is_owned) {
                msg_ref |= 1;
@@ -9056,6 +8519,7 @@ void handle_update_fail_malformed_htlc_LDKChannelMessageHandler_jcall(const void
        msg_var = UpdateFailMalformedHTLC_clone(msg);
        CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
        msg_ref = (uint64_t)msg_var.inner;
        if (msg_var.is_owned) {
                msg_ref |= 1;
@@ -9087,6 +8551,7 @@ void handle_commitment_signed_LDKChannelMessageHandler_jcall(const void* this_ar
        msg_var = CommitmentSigned_clone(msg);
        CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
        msg_ref = (uint64_t)msg_var.inner;
        if (msg_var.is_owned) {
                msg_ref |= 1;
@@ -9118,6 +8583,7 @@ void handle_revoke_and_ack_LDKChannelMessageHandler_jcall(const void* this_arg,
        msg_var = RevokeAndACK_clone(msg);
        CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
        msg_ref = (uint64_t)msg_var.inner;
        if (msg_var.is_owned) {
                msg_ref |= 1;
@@ -9149,6 +8615,7 @@ void handle_update_fee_LDKChannelMessageHandler_jcall(const void* this_arg, LDKP
        msg_var = UpdateFee_clone(msg);
        CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
        msg_ref = (uint64_t)msg_var.inner;
        if (msg_var.is_owned) {
                msg_ref |= 1;
@@ -9180,6 +8647,7 @@ void handle_announcement_signatures_LDKChannelMessageHandler_jcall(const void* t
        msg_var = AnnouncementSignatures_clone(msg);
        CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
        msg_ref = (uint64_t)msg_var.inner;
        if (msg_var.is_owned) {
                msg_ref |= 1;
@@ -9233,6 +8701,7 @@ void peer_connected_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPubl
        msg_var = Init_clone(msg);
        CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
        msg_ref = (uint64_t)msg_var.inner;
        if (msg_var.is_owned) {
                msg_ref |= 1;
@@ -9264,6 +8733,7 @@ void handle_channel_reestablish_LDKChannelMessageHandler_jcall(const void* this_
        msg_var = ChannelReestablish_clone(msg);
        CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
        msg_ref = (uint64_t)msg_var.inner;
        if (msg_var.is_owned) {
                msg_ref |= 1;
@@ -9295,6 +8765,7 @@ void handle_channel_update_LDKChannelMessageHandler_jcall(const void* this_arg,
        msg_var = ChannelUpdate_clone(msg);
        CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
        msg_ref = (uint64_t)msg_var.inner;
        if (msg_var.is_owned) {
                msg_ref |= 1;
@@ -9326,6 +8797,7 @@ void handle_error_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublic
        msg_var = ErrorMessage_clone(msg);
        CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
        msg_ref = (uint64_t)msg_var.inner;
        if (msg_var.is_owned) {
                msg_ref |= 1;
@@ -9443,10 +8915,12 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_
        LDKInitFeatures their_features_conv;
        their_features_conv.inner = (void*)(their_features & (~1));
        their_features_conv.is_owned = (their_features & 1) || (their_features == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_conv);
        their_features_conv = InitFeatures_clone(&their_features_conv);
        LDKOpenChannel msg_conv;
        msg_conv.inner = (void*)(msg & (~1));
        msg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
        (this_arg_conv->handle_open_channel)(this_arg_conv->this_arg, their_node_id_ref, their_features_conv, &msg_conv);
 }
 
@@ -9460,10 +8934,12 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_
        LDKInitFeatures their_features_conv;
        their_features_conv.inner = (void*)(their_features & (~1));
        their_features_conv.is_owned = (their_features & 1) || (their_features == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_conv);
        their_features_conv = InitFeatures_clone(&their_features_conv);
        LDKAcceptChannel msg_conv;
        msg_conv.inner = (void*)(msg & (~1));
        msg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
        (this_arg_conv->handle_accept_channel)(this_arg_conv->this_arg, their_node_id_ref, their_features_conv, &msg_conv);
 }
 
@@ -9477,6 +8953,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_
        LDKFundingCreated msg_conv;
        msg_conv.inner = (void*)(msg & (~1));
        msg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
        (this_arg_conv->handle_funding_created)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
 }
 
@@ -9490,6 +8967,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_
        LDKFundingSigned msg_conv;
        msg_conv.inner = (void*)(msg & (~1));
        msg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
        (this_arg_conv->handle_funding_signed)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
 }
 
@@ -9503,6 +8981,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_
        LDKFundingLocked msg_conv;
        msg_conv.inner = (void*)(msg & (~1));
        msg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
        (this_arg_conv->handle_funding_locked)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
 }
 
@@ -9516,9 +8995,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_
        LDKInitFeatures their_features_conv;
        their_features_conv.inner = (void*)(their_features & (~1));
        their_features_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_conv);
        LDKShutdown msg_conv;
        msg_conv.inner = (void*)(msg & (~1));
        msg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
        (this_arg_conv->handle_shutdown)(this_arg_conv->this_arg, their_node_id_ref, &their_features_conv, &msg_conv);
 }
 
@@ -9532,6 +9013,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_
        LDKClosingSigned msg_conv;
        msg_conv.inner = (void*)(msg & (~1));
        msg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
        (this_arg_conv->handle_closing_signed)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
 }
 
@@ -9545,6 +9027,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_
        LDKUpdateAddHTLC msg_conv;
        msg_conv.inner = (void*)(msg & (~1));
        msg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
        (this_arg_conv->handle_update_add_htlc)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
 }
 
@@ -9558,6 +9041,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_
        LDKUpdateFulfillHTLC msg_conv;
        msg_conv.inner = (void*)(msg & (~1));
        msg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
        (this_arg_conv->handle_update_fulfill_htlc)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
 }
 
@@ -9571,6 +9055,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_
        LDKUpdateFailHTLC msg_conv;
        msg_conv.inner = (void*)(msg & (~1));
        msg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
        (this_arg_conv->handle_update_fail_htlc)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
 }
 
@@ -9584,6 +9069,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_
        LDKUpdateFailMalformedHTLC msg_conv;
        msg_conv.inner = (void*)(msg & (~1));
        msg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
        (this_arg_conv->handle_update_fail_malformed_htlc)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
 }
 
@@ -9597,6 +9083,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_
        LDKCommitmentSigned msg_conv;
        msg_conv.inner = (void*)(msg & (~1));
        msg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
        (this_arg_conv->handle_commitment_signed)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
 }
 
@@ -9610,6 +9097,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_
        LDKRevokeAndACK msg_conv;
        msg_conv.inner = (void*)(msg & (~1));
        msg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
        (this_arg_conv->handle_revoke_and_ack)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
 }
 
@@ -9623,6 +9111,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_
        LDKUpdateFee msg_conv;
        msg_conv.inner = (void*)(msg & (~1));
        msg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
        (this_arg_conv->handle_update_fee)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
 }
 
@@ -9636,6 +9125,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_
        LDKAnnouncementSignatures msg_conv;
        msg_conv.inner = (void*)(msg & (~1));
        msg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
        (this_arg_conv->handle_announcement_signatures)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
 }
 
@@ -9659,6 +9149,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1peer_1c
        LDKInit msg_conv;
        msg_conv.inner = (void*)(msg & (~1));
        msg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
        (this_arg_conv->peer_connected)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
 }
 
@@ -9672,6 +9163,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_
        LDKChannelReestablish msg_conv;
        msg_conv.inner = (void*)(msg & (~1));
        msg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
        (this_arg_conv->handle_channel_reestablish)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
 }
 
@@ -9685,6 +9177,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_
        LDKChannelUpdate msg_conv;
        msg_conv.inner = (void*)(msg & (~1));
        msg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
        (this_arg_conv->handle_channel_update)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
 }
 
@@ -9698,6 +9191,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_
        LDKErrorMessage msg_conv;
        msg_conv.inner = (void*)(msg & (~1));
        msg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
        (this_arg_conv->handle_error)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
 }
 
@@ -9748,6 +9242,7 @@ LDKCResult_boolLightningErrorZ handle_node_announcement_LDKRoutingMessageHandler
        msg_var = NodeAnnouncement_clone(msg);
        CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
        msg_ref = (uint64_t)msg_var.inner;
        if (msg_var.is_owned) {
                msg_ref |= 1;
@@ -9762,7 +9257,7 @@ LDKCResult_boolLightningErrorZ handle_node_announcement_LDKRoutingMessageHandler
        void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
        CHECK_ACCESS(ret_ptr);
        LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr);
-       ret_conv = CResult_boolLightningErrorZ_clone((LDKCResult_boolLightningErrorZ*)(((uint64_t)ret) & ~1));
+       FREE((void*)ret);
        if (get_jenv_res == JNI_EDETACHED) {
                DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
        }
@@ -9782,6 +9277,7 @@ LDKCResult_boolLightningErrorZ handle_channel_announcement_LDKRoutingMessageHand
        msg_var = ChannelAnnouncement_clone(msg);
        CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
        msg_ref = (uint64_t)msg_var.inner;
        if (msg_var.is_owned) {
                msg_ref |= 1;
@@ -9796,7 +9292,7 @@ LDKCResult_boolLightningErrorZ handle_channel_announcement_LDKRoutingMessageHand
        void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
        CHECK_ACCESS(ret_ptr);
        LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr);
-       ret_conv = CResult_boolLightningErrorZ_clone((LDKCResult_boolLightningErrorZ*)(((uint64_t)ret) & ~1));
+       FREE((void*)ret);
        if (get_jenv_res == JNI_EDETACHED) {
                DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
        }
@@ -9816,6 +9312,7 @@ LDKCResult_boolLightningErrorZ handle_channel_update_LDKRoutingMessageHandler_jc
        msg_var = ChannelUpdate_clone(msg);
        CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
        msg_ref = (uint64_t)msg_var.inner;
        if (msg_var.is_owned) {
                msg_ref |= 1;
@@ -9830,7 +9327,7 @@ LDKCResult_boolLightningErrorZ handle_channel_update_LDKRoutingMessageHandler_jc
        void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
        CHECK_ACCESS(ret_ptr);
        LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr);
-       ret_conv = CResult_boolLightningErrorZ_clone((LDKCResult_boolLightningErrorZ*)(((uint64_t)ret) & ~1));
+       FREE((void*)ret);
        if (get_jenv_res == JNI_EDETACHED) {
                DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
        }
@@ -9864,7 +9361,7 @@ LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ get_next_channel
                void* ret_conv_59_ptr = (void*)(((uint64_t)ret_conv_59) & ~1);
                CHECK_ACCESS(ret_conv_59_ptr);
                LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ ret_conv_59_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(ret_conv_59_ptr);
-               ret_conv_59_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone((LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(((uint64_t)ret_conv_59) & ~1));
+               FREE((void*)ret_conv_59);
                ret_constr.data[h] = ret_conv_59_conv;
        }
        (*env)->ReleaseLongArrayElements(env, ret, ret_vals, 0);
@@ -9903,7 +9400,7 @@ LDKCVec_NodeAnnouncementZ get_next_node_announcements_LDKRoutingMessageHandler_j
                LDKNodeAnnouncement ret_conv_18_conv;
                ret_conv_18_conv.inner = (void*)(ret_conv_18 & (~1));
                ret_conv_18_conv.is_owned = (ret_conv_18 & 1) || (ret_conv_18 == 0);
-               ret_conv_18_conv = NodeAnnouncement_clone(&ret_conv_18_conv);
+               CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_18_conv);
                ret_constr.data[s] = ret_conv_18_conv;
        }
        (*env)->ReleaseLongArrayElements(env, ret, ret_vals, 0);
@@ -9928,6 +9425,7 @@ void sync_routing_table_LDKRoutingMessageHandler_jcall(const void* this_arg, LDK
        init_var = Init_clone(init);
        CHECK((((uint64_t)init_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&init_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(init_var);
        init_ref = (uint64_t)init_var.inner;
        if (init_var.is_owned) {
                init_ref |= 1;
@@ -9958,6 +9456,7 @@ LDKCResult_NoneLightningErrorZ handle_reply_channel_range_LDKRoutingMessageHandl
        uint64_t msg_ref = 0;
        CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
        msg_ref = (uint64_t)msg_var.inner;
        if (msg_var.is_owned) {
                msg_ref |= 1;
@@ -9972,7 +9471,7 @@ LDKCResult_NoneLightningErrorZ handle_reply_channel_range_LDKRoutingMessageHandl
        void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
        CHECK_ACCESS(ret_ptr);
        LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
-       ret_conv = CResult_NoneLightningErrorZ_clone((LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1));
+       FREE((void*)ret);
        if (get_jenv_res == JNI_EDETACHED) {
                DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
        }
@@ -9993,6 +9492,7 @@ LDKCResult_NoneLightningErrorZ handle_reply_short_channel_ids_end_LDKRoutingMess
        uint64_t msg_ref = 0;
        CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
        msg_ref = (uint64_t)msg_var.inner;
        if (msg_var.is_owned) {
                msg_ref |= 1;
@@ -10007,7 +9507,7 @@ LDKCResult_NoneLightningErrorZ handle_reply_short_channel_ids_end_LDKRoutingMess
        void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
        CHECK_ACCESS(ret_ptr);
        LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
-       ret_conv = CResult_NoneLightningErrorZ_clone((LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1));
+       FREE((void*)ret);
        if (get_jenv_res == JNI_EDETACHED) {
                DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
        }
@@ -10028,6 +9528,7 @@ LDKCResult_NoneLightningErrorZ handle_query_channel_range_LDKRoutingMessageHandl
        uint64_t msg_ref = 0;
        CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
        msg_ref = (uint64_t)msg_var.inner;
        if (msg_var.is_owned) {
                msg_ref |= 1;
@@ -10042,7 +9543,7 @@ LDKCResult_NoneLightningErrorZ handle_query_channel_range_LDKRoutingMessageHandl
        void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
        CHECK_ACCESS(ret_ptr);
        LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
-       ret_conv = CResult_NoneLightningErrorZ_clone((LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1));
+       FREE((void*)ret);
        if (get_jenv_res == JNI_EDETACHED) {
                DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
        }
@@ -10063,6 +9564,7 @@ LDKCResult_NoneLightningErrorZ handle_query_short_channel_ids_LDKRoutingMessageH
        uint64_t msg_ref = 0;
        CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
        msg_ref = (uint64_t)msg_var.inner;
        if (msg_var.is_owned) {
                msg_ref |= 1;
@@ -10077,7 +9579,7 @@ LDKCResult_NoneLightningErrorZ handle_query_short_channel_ids_LDKRoutingMessageH
        void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
        CHECK_ACCESS(ret_ptr);
        LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
-       ret_conv = CResult_NoneLightningErrorZ_clone((LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1));
+       FREE((void*)ret);
        if (get_jenv_res == JNI_EDETACHED) {
                DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
        }
@@ -10152,6 +9654,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1hand
        LDKNodeAnnouncement msg_conv;
        msg_conv.inner = (void*)(msg & (~1));
        msg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
        LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
        *ret_conv = (this_arg_conv->handle_node_announcement)(this_arg_conv->this_arg, &msg_conv);
        return (uint64_t)ret_conv;
@@ -10164,6 +9667,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1hand
        LDKChannelAnnouncement msg_conv;
        msg_conv.inner = (void*)(msg & (~1));
        msg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
        LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
        *ret_conv = (this_arg_conv->handle_channel_announcement)(this_arg_conv->this_arg, &msg_conv);
        return (uint64_t)ret_conv;
@@ -10176,6 +9680,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1hand
        LDKChannelUpdate msg_conv;
        msg_conv.inner = (void*)(msg & (~1));
        msg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
        LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
        *ret_conv = (this_arg_conv->handle_channel_update)(this_arg_conv->this_arg, &msg_conv);
        return (uint64_t)ret_conv;
@@ -10215,6 +9720,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_
                uint64_t ret_conv_18_ref = 0;
                CHECK((((uint64_t)ret_conv_18_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
                CHECK((((uint64_t)&ret_conv_18_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+               CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_18_var);
                ret_conv_18_ref = (uint64_t)ret_conv_18_var.inner;
                if (ret_conv_18_var.is_owned) {
                        ret_conv_18_ref |= 1;
@@ -10236,6 +9742,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1sync_1r
        LDKInit init_conv;
        init_conv.inner = (void*)(init & (~1));
        init_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(init_conv);
        (this_arg_conv->sync_routing_table)(this_arg_conv->this_arg, their_node_id_ref, &init_conv);
 }
 
@@ -10249,6 +9756,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1hand
        LDKReplyChannelRange msg_conv;
        msg_conv.inner = (void*)(msg & (~1));
        msg_conv.is_owned = (msg & 1) || (msg == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
        msg_conv = ReplyChannelRange_clone(&msg_conv);
        LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
        *ret_conv = (this_arg_conv->handle_reply_channel_range)(this_arg_conv->this_arg, their_node_id_ref, msg_conv);
@@ -10265,6 +9773,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1hand
        LDKReplyShortChannelIdsEnd msg_conv;
        msg_conv.inner = (void*)(msg & (~1));
        msg_conv.is_owned = (msg & 1) || (msg == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
        msg_conv = ReplyShortChannelIdsEnd_clone(&msg_conv);
        LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
        *ret_conv = (this_arg_conv->handle_reply_short_channel_ids_end)(this_arg_conv->this_arg, their_node_id_ref, msg_conv);
@@ -10281,6 +9790,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1hand
        LDKQueryChannelRange msg_conv;
        msg_conv.inner = (void*)(msg & (~1));
        msg_conv.is_owned = (msg & 1) || (msg == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
        msg_conv = QueryChannelRange_clone(&msg_conv);
        LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
        *ret_conv = (this_arg_conv->handle_query_channel_range)(this_arg_conv->this_arg, their_node_id_ref, msg_conv);
@@ -10297,6 +9807,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1hand
        LDKQueryShortChannelIds msg_conv;
        msg_conv.inner = (void*)(msg & (~1));
        msg_conv.is_owned = (msg & 1) || (msg == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
        msg_conv = QueryShortChannelIds_clone(&msg_conv);
        LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
        *ret_conv = (this_arg_conv->handle_query_short_channel_ids)(this_arg_conv->this_arg, their_node_id_ref, msg_conv);
@@ -10348,7 +9859,7 @@ LDKCResult_COption_TypeZDecodeErrorZ read_LDKCustomMessageReader_jcall(const voi
        void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
        CHECK_ACCESS(ret_ptr);
        LDKCResult_COption_TypeZDecodeErrorZ ret_conv = *(LDKCResult_COption_TypeZDecodeErrorZ*)(ret_ptr);
-       ret_conv = CResult_COption_TypeZDecodeErrorZ_clone((LDKCResult_COption_TypeZDecodeErrorZ*)(((uint64_t)ret) & ~1));
+       FREE((void*)ret);
        if (get_jenv_res == JNI_EDETACHED) {
                DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
        }
@@ -10441,7 +9952,7 @@ LDKCResult_NoneLightningErrorZ handle_custom_message_LDKCustomMessageHandler_jca
        void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
        CHECK_ACCESS(ret_ptr);
        LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
-       ret_conv = CResult_NoneLightningErrorZ_clone((LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1));
+       FREE((void*)ret);
        if (get_jenv_res == JNI_EDETACHED) {
                DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
        }
@@ -10475,7 +9986,7 @@ LDKCVec_C2Tuple_PublicKeyTypeZZ get_and_clear_pending_msg_LDKCustomMessageHandle
                void* ret_conv_25_ptr = (void*)(((uint64_t)ret_conv_25) & ~1);
                CHECK_ACCESS(ret_conv_25_ptr);
                LDKC2Tuple_PublicKeyTypeZ ret_conv_25_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(ret_conv_25_ptr);
-               ret_conv_25_conv = C2Tuple_PublicKeyTypeZ_clone((LDKC2Tuple_PublicKeyTypeZ*)(((uint64_t)ret_conv_25) & ~1));
+               FREE((void*)ret_conv_25);
                ret_constr.data[z] = ret_conv_25_conv;
        }
        (*env)->ReleaseLongArrayElements(env, ret, ret_vals, 0);
@@ -10775,6 +10286,7 @@ uint64_t channel_penalty_msat_LDKScore_jcall(const void* this_arg, uint64_t shor
        source_var = NodeId_clone(source);
        CHECK((((uint64_t)source_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&source_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(source_var);
        source_ref = (uint64_t)source_var.inner;
        if (source_var.is_owned) {
                source_ref |= 1;
@@ -10784,6 +10296,7 @@ uint64_t channel_penalty_msat_LDKScore_jcall(const void* this_arg, uint64_t shor
        target_var = NodeId_clone(target);
        CHECK((((uint64_t)target_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&target_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(target_var);
        target_ref = (uint64_t)target_var.inner;
        if (target_var.is_owned) {
                target_ref |= 1;
@@ -10818,6 +10331,7 @@ void payment_path_failed_LDKScore_jcall(void* this_arg, LDKCVec_RouteHopZ path,
                uint64_t path_conv_10_ref = 0;
                CHECK((((uint64_t)path_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
                CHECK((((uint64_t)&path_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+               CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
                path_conv_10_ref = (uint64_t)path_conv_10_var.inner;
                if (path_conv_10_var.is_owned) {
                        path_conv_10_ref |= 1;
@@ -10901,9 +10415,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Score_1channel_1penalty_1ms
        LDKNodeId source_conv;
        source_conv.inner = (void*)(source & (~1));
        source_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(source_conv);
        LDKNodeId target_conv;
        target_conv.inner = (void*)(target & (~1));
        target_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv);
        int64_t ret_val = (this_arg_conv->channel_penalty_msat)(this_arg_conv->this_arg, short_channel_id, &source_conv, &target_conv);
        return ret_val;
 }
@@ -10924,6 +10440,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Score_1payment_1path_1failed(J
                LDKRouteHop path_conv_10_conv;
                path_conv_10_conv.inner = (void*)(path_conv_10 & (~1));
                path_conv_10_conv.is_owned = (path_conv_10 & 1) || (path_conv_10 == 0);
+               CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
                path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
                path_constr.data[k] = path_conv_10_conv;
        }
@@ -10979,6 +10496,7 @@ LDKCResult_NoneErrorZ persist_manager_LDKChannelManagerPersister_jcall(const voi
        // Warning: we may need a move here but no clone is available for LDKChannelManager
        CHECK((((uint64_t)channel_manager_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&channel_manager_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_manager_var);
        channel_manager_ref = (uint64_t)channel_manager_var.inner;
        if (channel_manager_var.is_owned) {
                channel_manager_ref |= 1;
@@ -10993,7 +10511,7 @@ LDKCResult_NoneErrorZ persist_manager_LDKChannelManagerPersister_jcall(const voi
        void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
        CHECK_ACCESS(ret_ptr);
        LDKCResult_NoneErrorZ ret_conv = *(LDKCResult_NoneErrorZ*)(ret_ptr);
-       ret_conv = CResult_NoneErrorZ_clone((LDKCResult_NoneErrorZ*)(((uint64_t)ret) & ~1));
+       FREE((void*)ret);
        if (get_jenv_res == JNI_EDETACHED) {
                DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
        }
@@ -11032,6 +10550,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerPersister_1pe
        LDKChannelManager channel_manager_conv;
        channel_manager_conv.inner = (void*)(channel_manager & (~1));
        channel_manager_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_manager_conv);
        LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
        *ret_conv = (this_arg_conv->persist_manager)(this_arg_conv->this_arg, &channel_manager_conv);
        return (uint64_t)ret_conv;
@@ -11161,7 +10680,7 @@ LDKCVec_ChannelDetailsZ first_hops_LDKPayer_jcall(const void* this_arg) {
                LDKChannelDetails ret_conv_16_conv;
                ret_conv_16_conv.inner = (void*)(ret_conv_16 & (~1));
                ret_conv_16_conv.is_owned = (ret_conv_16 & 1) || (ret_conv_16 == 0);
-               ret_conv_16_conv = ChannelDetails_clone(&ret_conv_16_conv);
+               CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_conv);
                ret_constr.data[q] = ret_conv_16_conv;
        }
        (*env)->ReleaseLongArrayElements(env, ret, ret_vals, 0);
@@ -11184,6 +10703,7 @@ LDKCResult_PaymentIdPaymentSendFailureZ send_payment_LDKPayer_jcall(const void*
        route_var = Route_clone(route);
        CHECK((((uint64_t)route_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&route_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(route_var);
        route_ref = (uint64_t)route_var.inner;
        if (route_var.is_owned) {
                route_ref |= 1;
@@ -11202,7 +10722,7 @@ LDKCResult_PaymentIdPaymentSendFailureZ send_payment_LDKPayer_jcall(const void*
        void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
        CHECK_ACCESS(ret_ptr);
        LDKCResult_PaymentIdPaymentSendFailureZ ret_conv = *(LDKCResult_PaymentIdPaymentSendFailureZ*)(ret_ptr);
-       ret_conv = CResult_PaymentIdPaymentSendFailureZ_clone((LDKCResult_PaymentIdPaymentSendFailureZ*)(((uint64_t)ret) & ~1));
+       FREE((void*)ret);
        if (get_jenv_res == JNI_EDETACHED) {
                DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
        }
@@ -11222,6 +10742,7 @@ LDKCResult_NonePaymentSendFailureZ retry_payment_LDKPayer_jcall(const void* this
        route_var = Route_clone(route);
        CHECK((((uint64_t)route_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&route_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(route_var);
        route_ref = (uint64_t)route_var.inner;
        if (route_var.is_owned) {
                route_ref |= 1;
@@ -11238,7 +10759,7 @@ LDKCResult_NonePaymentSendFailureZ retry_payment_LDKPayer_jcall(const void* this
        void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
        CHECK_ACCESS(ret_ptr);
        LDKCResult_NonePaymentSendFailureZ ret_conv = *(LDKCResult_NonePaymentSendFailureZ*)(ret_ptr);
-       ret_conv = CResult_NonePaymentSendFailureZ_clone((LDKCResult_NonePaymentSendFailureZ*)(((uint64_t)ret) & ~1));
+       FREE((void*)ret);
        if (get_jenv_res == JNI_EDETACHED) {
                DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
        }
@@ -11301,6 +10822,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Payer_1first_1hops(JNI
                uint64_t ret_conv_16_ref = 0;
                CHECK((((uint64_t)ret_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
                CHECK((((uint64_t)&ret_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+               CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var);
                ret_conv_16_ref = (uint64_t)ret_conv_16_var.inner;
                if (ret_conv_16_var.is_owned) {
                        ret_conv_16_ref |= 1;
@@ -11319,6 +10841,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payer_1send_1payment(JNIEnv
        LDKRoute route_conv;
        route_conv.inner = (void*)(route & (~1));
        route_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv);
        LDKThirtyTwoBytes payment_hash_ref;
        CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
        (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
@@ -11337,6 +10860,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payer_1retry_1payment(JNIEn
        LDKRoute route_conv;
        route_conv.inner = (void*)(route & (~1));
        route_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv);
        LDKThirtyTwoBytes payment_id_ref;
        CHECK((*env)->GetArrayLength(env, payment_id) == 32);
        (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data);
@@ -11384,6 +10908,7 @@ LDKCResult_RouteLightningErrorZ find_route_LDKRouter_jcall(const void* this_arg,
        params_var = RouteParameters_clone(params);
        CHECK((((uint64_t)params_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&params_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(params_var);
        params_ref = (uint64_t)params_var.inner;
        if (params_var.is_owned) {
                params_ref |= 1;
@@ -11399,6 +10924,7 @@ LDKCResult_RouteLightningErrorZ find_route_LDKRouter_jcall(const void* this_arg,
                        uint64_t first_hops_conv_16_ref = 0;
                        CHECK((((uint64_t)first_hops_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
                        CHECK((((uint64_t)&first_hops_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+                       CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_var);
                        first_hops_conv_16_ref = (uint64_t)first_hops_conv_16_var.inner;
                        if (first_hops_conv_16_var.is_owned) {
                                first_hops_conv_16_ref |= 1;
@@ -11419,7 +10945,7 @@ LDKCResult_RouteLightningErrorZ find_route_LDKRouter_jcall(const void* this_arg,
        void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
        CHECK_ACCESS(ret_ptr);
        LDKCResult_RouteLightningErrorZ ret_conv = *(LDKCResult_RouteLightningErrorZ*)(ret_ptr);
-       ret_conv = CResult_RouteLightningErrorZ_clone((LDKCResult_RouteLightningErrorZ*)(((uint64_t)ret) & ~1));
+       FREE((void*)ret);
        if (get_jenv_res == JNI_EDETACHED) {
                DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
        }
@@ -11461,6 +10987,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Router_1find_1route(JNIEnv
        LDKRouteParameters params_conv;
        params_conv.inner = (void*)(params & (~1));
        params_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(params_conv);
        LDKCVec_ChannelDetailsZ first_hops_constr;
        LDKCVec_ChannelDetailsZ *first_hops_ptr = NULL;
        if (first_hops != NULL) {
@@ -11475,6 +11002,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Router_1find_1route(JNIEnv
                        LDKChannelDetails first_hops_conv_16_conv;
                        first_hops_conv_16_conv.inner = (void*)(first_hops_conv_16 & (~1));
                        first_hops_conv_16_conv.is_owned = (first_hops_conv_16 & 1) || (first_hops_conv_16 == 0);
+                       CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_conv);
                        first_hops_constr.data[q] = first_hops_conv_16_conv;
                }
                (*env)->ReleaseLongArrayElements(env, first_hops, first_hops_vals, 0);
@@ -11531,6 +11059,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxOut_1free(JNIEnv *env, jclas
        TxOut_free(_res_conv);
 }
 
+static inline uint64_t TxOut_clone_ptr(LDKTxOut *NONNULL_PTR arg) {
+       LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut");
+       *ret_ref = TxOut_clone(arg);
+       return (uint64_t)ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxOut_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKTxOut* arg_conv = (LDKTxOut*)(arg & ~1);
+       int64_t ret_val = TxOut_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxOut_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKTxOut* orig_conv = (LDKTxOut*)(orig & ~1);
        LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut");
@@ -11559,6 +11098,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyErrorZ_1e
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_SecretKeyErrorZ* o_conv = (LDKCResult_SecretKeyErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_SecretKeyErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -11584,6 +11129,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1e
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_PublicKeyErrorZ* o_conv = (LDKCResult_PublicKeyErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_PublicKeyErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -11593,6 +11144,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1free
        CResult_PublicKeyErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_PublicKeyErrorZ_clone_ptr(LDKCResult_PublicKeyErrorZ *NONNULL_PTR arg) {
+       LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ");
+       *ret_conv = CResult_PublicKeyErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_PublicKeyErrorZ* arg_conv = (LDKCResult_PublicKeyErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_PublicKeyErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_PublicKeyErrorZ* orig_conv = (LDKCResult_PublicKeyErrorZ*)(orig & ~1);
        LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ");
@@ -11604,6 +11166,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysDeco
        LDKTxCreationKeys o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = (o & 1) || (o == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        o_conv = TxCreationKeys_clone(&o_conv);
        LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ");
        *ret_conv = CResult_TxCreationKeysDecodeErrorZ_ok(o_conv);
@@ -11614,12 +11177,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysDeco
        LDKDecodeError e_conv;
        e_conv.inner = (void*)(e & (~1));
        e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
        e_conv = DecodeError_clone(&e_conv);
        LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ");
        *ret_conv = CResult_TxCreationKeysDecodeErrorZ_err(e_conv);
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_TxCreationKeysDecodeErrorZ* o_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_TxCreationKeysDecodeErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -11629,6 +11199,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysDecodeE
        CResult_TxCreationKeysDecodeErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_TxCreationKeysDecodeErrorZ_clone_ptr(LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR arg) {
+       LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ");
+       *ret_conv = CResult_TxCreationKeysDecodeErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_TxCreationKeysDecodeErrorZ* arg_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_TxCreationKeysDecodeErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_TxCreationKeysDecodeErrorZ* orig_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)(orig & ~1);
        LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ");
@@ -11640,6 +11221,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelPublicKeysD
        LDKChannelPublicKeys o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = (o & 1) || (o == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        o_conv = ChannelPublicKeys_clone(&o_conv);
        LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ");
        *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_ok(o_conv);
@@ -11650,12 +11232,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelPublicKeysD
        LDKDecodeError e_conv;
        e_conv.inner = (void*)(e & (~1));
        e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
        e_conv = DecodeError_clone(&e_conv);
        LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ");
        *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_err(e_conv);
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelPublicKeysDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_ChannelPublicKeysDecodeErrorZ* o_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_ChannelPublicKeysDecodeErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelPublicKeysDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -11665,6 +11254,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelPublicKeysDeco
        CResult_ChannelPublicKeysDecodeErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr(LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR arg) {
+       LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ");
+       *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelPublicKeysDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_ChannelPublicKeysDecodeErrorZ* arg_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelPublicKeysDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_ChannelPublicKeysDecodeErrorZ* orig_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)(orig & ~1);
        LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ");
@@ -11676,6 +11276,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysErro
        LDKTxCreationKeys o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = (o & 1) || (o == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        o_conv = TxCreationKeys_clone(&o_conv);
        LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ");
        *ret_conv = CResult_TxCreationKeysErrorZ_ok(o_conv);
@@ -11689,6 +11290,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysErro
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_TxCreationKeysErrorZ* o_conv = (LDKCResult_TxCreationKeysErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_TxCreationKeysErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -11698,6 +11305,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysErrorZ_
        CResult_TxCreationKeysErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_TxCreationKeysErrorZ_clone_ptr(LDKCResult_TxCreationKeysErrorZ *NONNULL_PTR arg) {
+       LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ");
+       *ret_conv = CResult_TxCreationKeysErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_TxCreationKeysErrorZ* arg_conv = (LDKCResult_TxCreationKeysErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_TxCreationKeysErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_TxCreationKeysErrorZ* orig_conv = (LDKCResult_TxCreationKeysErrorZ*)(orig & ~1);
        LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ");
@@ -11728,6 +11346,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1u32Z_1free(JNIEnv *en
        COption_u32Z_free(_res_conv);
 }
 
+static inline uint64_t COption_u32Z_clone_ptr(LDKCOption_u32Z *NONNULL_PTR arg) {
+       LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z");
+       *ret_copy = COption_u32Z_clone(arg);
+uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u32Z_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCOption_u32Z* arg_conv = (LDKCOption_u32Z*)arg;
+       int64_t ret_val = COption_u32Z_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u32Z_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCOption_u32Z* orig_conv = (LDKCOption_u32Z*)orig;
        LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z");
@@ -11740,6 +11370,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCOutputInCommit
        LDKHTLCOutputInCommitment o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = (o & 1) || (o == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        o_conv = HTLCOutputInCommitment_clone(&o_conv);
        LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ");
        *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(o_conv);
@@ -11750,12 +11381,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCOutputInCommit
        LDKDecodeError e_conv;
        e_conv.inner = (void*)(e & (~1));
        e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
        e_conv = DecodeError_clone(&e_conv);
        LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ");
        *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_err(e_conv);
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCOutputInCommitmentDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* o_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCOutputInCommitmentDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -11765,6 +11403,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCOutputInCommitmen
        CResult_HTLCOutputInCommitmentDecodeErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR arg) {
+       LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ");
+       *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCOutputInCommitmentDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* arg_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCOutputInCommitmentDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* orig_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)(orig & ~1);
        LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ");
@@ -11776,6 +11425,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyChanne
        LDKCounterpartyChannelTransactionParameters o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = (o & 1) || (o == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        o_conv = CounterpartyChannelTransactionParameters_clone(&o_conv);
        LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ");
        *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(o_conv);
@@ -11786,12 +11436,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyChanne
        LDKDecodeError e_conv;
        e_conv.inner = (void*)(e & (~1));
        e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
        e_conv = DecodeError_clone(&e_conv);
        LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ");
        *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(e_conv);
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyChannelTransactionParametersDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* o_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyChannelTransactionParametersDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -11801,6 +11458,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyChannelTr
        CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR arg) {
+       LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ");
+       *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyChannelTransactionParametersDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* arg_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyChannelTransactionParametersDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* orig_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)(orig & ~1);
        LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ");
@@ -11812,6 +11480,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTransaction
        LDKChannelTransactionParameters o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = (o & 1) || (o == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        o_conv = ChannelTransactionParameters_clone(&o_conv);
        LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ");
        *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_ok(o_conv);
@@ -11822,12 +11491,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTransaction
        LDKDecodeError e_conv;
        e_conv.inner = (void*)(e & (~1));
        e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
        e_conv = DecodeError_clone(&e_conv);
        LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ");
        *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_err(e_conv);
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTransactionParametersDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_ChannelTransactionParametersDecodeErrorZ* o_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_ChannelTransactionParametersDecodeErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTransactionParametersDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -11837,6 +11513,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTransactionPar
        CResult_ChannelTransactionParametersDecodeErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr(LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR arg) {
+       LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ");
+       *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTransactionParametersDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_ChannelTransactionParametersDecodeErrorZ* arg_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTransactionParametersDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_ChannelTransactionParametersDecodeErrorZ* orig_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)(orig & ~1);
        LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ");
@@ -11865,6 +11552,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HolderCommitmentTr
        LDKHolderCommitmentTransaction o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = (o & 1) || (o == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        o_conv = HolderCommitmentTransaction_clone(&o_conv);
        LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ");
        *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_ok(o_conv);
@@ -11875,12 +11563,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HolderCommitmentTr
        LDKDecodeError e_conv;
        e_conv.inner = (void*)(e & (~1));
        e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
        e_conv = DecodeError_clone(&e_conv);
        LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ");
        *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_err(e_conv);
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1HolderCommitmentTransactionDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_HolderCommitmentTransactionDecodeErrorZ* o_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1HolderCommitmentTransactionDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -11890,6 +11585,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1HolderCommitmentTrans
        CResult_HolderCommitmentTransactionDecodeErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR arg) {
+       LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ");
+       *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HolderCommitmentTransactionDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_HolderCommitmentTransactionDecodeErrorZ* arg_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HolderCommitmentTransactionDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_HolderCommitmentTransactionDecodeErrorZ* orig_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)(orig & ~1);
        LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ");
@@ -11901,6 +11607,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BuiltCommitmentTra
        LDKBuiltCommitmentTransaction o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = (o & 1) || (o == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        o_conv = BuiltCommitmentTransaction_clone(&o_conv);
        LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ");
        *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(o_conv);
@@ -11911,12 +11618,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BuiltCommitmentTra
        LDKDecodeError e_conv;
        e_conv.inner = (void*)(e & (~1));
        e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
        e_conv = DecodeError_clone(&e_conv);
        LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ");
        *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_err(e_conv);
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1BuiltCommitmentTransactionDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* o_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BuiltCommitmentTransactionDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -11926,6 +11640,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BuiltCommitmentTransa
        CResult_BuiltCommitmentTransactionDecodeErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR arg) {
+       LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ");
+       *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BuiltCommitmentTransactionDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* arg_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BuiltCommitmentTransactionDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* orig_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)(orig & ~1);
        LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ");
@@ -11937,6 +11662,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedClosingTran
        LDKTrustedClosingTransaction o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = (o & 1) || (o == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        // Warning: we need a move here but no clone is available for LDKTrustedClosingTransaction
        LDKCResult_TrustedClosingTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedClosingTransactionNoneZ), "LDKCResult_TrustedClosingTransactionNoneZ");
        *ret_conv = CResult_TrustedClosingTransactionNoneZ_ok(o_conv);
@@ -11949,6 +11675,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedClosingTran
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedClosingTransactionNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_TrustedClosingTransactionNoneZ* o_conv = (LDKCResult_TrustedClosingTransactionNoneZ*)(o & ~1);
+       jboolean ret_val = CResult_TrustedClosingTransactionNoneZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedClosingTransactionNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -11962,6 +11694,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentTransact
        LDKCommitmentTransaction o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = (o & 1) || (o == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        o_conv = CommitmentTransaction_clone(&o_conv);
        LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ");
        *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_ok(o_conv);
@@ -11972,12 +11705,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentTransact
        LDKDecodeError e_conv;
        e_conv.inner = (void*)(e & (~1));
        e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
        e_conv = DecodeError_clone(&e_conv);
        LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ");
        *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_err(e_conv);
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentTransactionDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_CommitmentTransactionDecodeErrorZ* o_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_CommitmentTransactionDecodeErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentTransactionDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -11987,6 +11727,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentTransaction
        CResult_CommitmentTransactionDecodeErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_CommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR arg) {
+       LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ");
+       *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentTransactionDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_CommitmentTransactionDecodeErrorZ* arg_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_CommitmentTransactionDecodeErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentTransactionDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_CommitmentTransactionDecodeErrorZ* orig_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)(orig & ~1);
        LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ");
@@ -11998,6 +11749,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedCommitmentT
        LDKTrustedCommitmentTransaction o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = (o & 1) || (o == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        // Warning: we need a move here but no clone is available for LDKTrustedCommitmentTransaction
        LDKCResult_TrustedCommitmentTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedCommitmentTransactionNoneZ), "LDKCResult_TrustedCommitmentTransactionNoneZ");
        *ret_conv = CResult_TrustedCommitmentTransactionNoneZ_ok(o_conv);
@@ -12010,6 +11762,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedCommitmentT
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedCommitmentTransactionNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_TrustedCommitmentTransactionNoneZ* o_conv = (LDKCResult_TrustedCommitmentTransactionNoneZ*)(o & ~1);
+       jboolean ret_val = CResult_TrustedCommitmentTransactionNoneZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedCommitmentTransactionNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -12044,6 +11802,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNo
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_CVec_SignatureZNoneZ* o_conv = (LDKCResult_CVec_SignatureZNoneZ*)(o & ~1);
+       jboolean ret_val = CResult_CVec_SignatureZNoneZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -12053,6 +11817,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ
        CResult_CVec_SignatureZNoneZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_CVec_SignatureZNoneZ_clone_ptr(LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR arg) {
+       LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
+       *ret_conv = CResult_CVec_SignatureZNoneZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_CVec_SignatureZNoneZ* arg_conv = (LDKCResult_CVec_SignatureZNoneZ*)(arg & ~1);
+       int64_t ret_val = CResult_CVec_SignatureZNoneZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_CVec_SignatureZNoneZ* orig_conv = (LDKCResult_CVec_SignatureZNoneZ*)(orig & ~1);
        LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
@@ -12064,6 +11839,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptDeco
        LDKShutdownScript o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = (o & 1) || (o == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        o_conv = ShutdownScript_clone(&o_conv);
        LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ");
        *ret_conv = CResult_ShutdownScriptDecodeErrorZ_ok(o_conv);
@@ -12074,12 +11850,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptDeco
        LDKDecodeError e_conv;
        e_conv.inner = (void*)(e & (~1));
        e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
        e_conv = DecodeError_clone(&e_conv);
        LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ");
        *ret_conv = CResult_ShutdownScriptDecodeErrorZ_err(e_conv);
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_ShutdownScriptDecodeErrorZ* o_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_ShutdownScriptDecodeErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -12089,6 +11872,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptDecodeE
        CResult_ShutdownScriptDecodeErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_ShutdownScriptDecodeErrorZ_clone_ptr(LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR arg) {
+       LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ");
+       *ret_conv = CResult_ShutdownScriptDecodeErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_ShutdownScriptDecodeErrorZ* arg_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_ShutdownScriptDecodeErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_ShutdownScriptDecodeErrorZ* orig_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)(orig & ~1);
        LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ");
@@ -12100,6 +11894,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInva
        LDKShutdownScript o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = (o & 1) || (o == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        o_conv = ShutdownScript_clone(&o_conv);
        LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ");
        *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_ok(o_conv);
@@ -12110,12 +11905,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInva
        LDKInvalidShutdownScript e_conv;
        e_conv.inner = (void*)(e & (~1));
        e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
        e_conv = InvalidShutdownScript_clone(&e_conv);
        LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ");
        *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_err(e_conv);
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInvalidShutdownScriptZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_ShutdownScriptInvalidShutdownScriptZ* o_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)(o & ~1);
+       jboolean ret_val = CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInvalidShutdownScriptZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -12125,6 +11927,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInvalid
        CResult_ShutdownScriptInvalidShutdownScriptZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr(LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR arg) {
+       LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ");
+       *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInvalidShutdownScriptZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_ShutdownScriptInvalidShutdownScriptZ* arg_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)(arg & ~1);
+       int64_t ret_val = CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInvalidShutdownScriptZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_ShutdownScriptInvalidShutdownScriptZ* orig_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)(orig & ~1);
        LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ");
@@ -12145,6 +11958,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1err(JN
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_NoneErrorZ* o_conv = (LDKCResult_NoneErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_NoneErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -12154,6 +11973,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1free(JNIE
        CResult_NoneErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_NoneErrorZ_clone_ptr(LDKCResult_NoneErrorZ *NONNULL_PTR arg) {
+       LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
+       *ret_conv = CResult_NoneErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_NoneErrorZ* arg_conv = (LDKCResult_NoneErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_NoneErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_NoneErrorZ* orig_conv = (LDKCResult_NoneErrorZ*)(orig & ~1);
        LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
@@ -12165,6 +11995,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErro
        LDKRouteHop o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = (o & 1) || (o == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        o_conv = RouteHop_clone(&o_conv);
        LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ");
        *ret_conv = CResult_RouteHopDecodeErrorZ_ok(o_conv);
@@ -12175,12 +12006,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErro
        LDKDecodeError e_conv;
        e_conv.inner = (void*)(e & (~1));
        e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
        e_conv = DecodeError_clone(&e_conv);
        LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ");
        *ret_conv = CResult_RouteHopDecodeErrorZ_err(e_conv);
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_RouteHopDecodeErrorZ* o_conv = (LDKCResult_RouteHopDecodeErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_RouteHopDecodeErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -12190,6 +12028,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_
        CResult_RouteHopDecodeErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_RouteHopDecodeErrorZ_clone_ptr(LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR arg) {
+       LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ");
+       *ret_conv = CResult_RouteHopDecodeErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_RouteHopDecodeErrorZ* arg_conv = (LDKCResult_RouteHopDecodeErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_RouteHopDecodeErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_RouteHopDecodeErrorZ* orig_conv = (LDKCResult_RouteHopDecodeErrorZ*)(orig & ~1);
        LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ");
@@ -12210,6 +12059,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHopZ_1free(JNIEnv *
                LDKRouteHop _res_conv_10_conv;
                _res_conv_10_conv.inner = (void*)(_res_conv_10 & (~1));
                _res_conv_10_conv.is_owned = (_res_conv_10 & 1) || (_res_conv_10 == 0);
+               CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_10_conv);
                _res_constr.data[k] = _res_conv_10_conv;
        }
        (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
@@ -12237,6 +12087,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1CVec_1RouteHopZZ_1free(J
                        LDKRouteHop _res_conv_12_conv_10_conv;
                        _res_conv_12_conv_10_conv.inner = (void*)(_res_conv_12_conv_10 & (~1));
                        _res_conv_12_conv_10_conv.is_owned = (_res_conv_12_conv_10 & 1) || (_res_conv_12_conv_10 == 0);
+                       CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_12_conv_10_conv);
                        _res_conv_12_constr.data[k] = _res_conv_12_conv_10_conv;
                }
                (*env)->ReleaseLongArrayElements(env, _res_conv_12, _res_conv_12_vals, 0);
@@ -12249,6 +12100,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_
        LDKRoute o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = (o & 1) || (o == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        o_conv = Route_clone(&o_conv);
        LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ");
        *ret_conv = CResult_RouteDecodeErrorZ_ok(o_conv);
@@ -12259,12 +12111,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_
        LDKDecodeError e_conv;
        e_conv.inner = (void*)(e & (~1));
        e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
        e_conv = DecodeError_clone(&e_conv);
        LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ");
        *ret_conv = CResult_RouteDecodeErrorZ_err(e_conv);
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_RouteDecodeErrorZ* o_conv = (LDKCResult_RouteDecodeErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_RouteDecodeErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -12274,6 +12133,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1fr
        CResult_RouteDecodeErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_RouteDecodeErrorZ_clone_ptr(LDKCResult_RouteDecodeErrorZ *NONNULL_PTR arg) {
+       LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ");
+       *ret_conv = CResult_RouteDecodeErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_RouteDecodeErrorZ* arg_conv = (LDKCResult_RouteDecodeErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_RouteDecodeErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_RouteDecodeErrorZ* orig_conv = (LDKCResult_RouteDecodeErrorZ*)(orig & ~1);
        LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ");
@@ -12285,6 +12155,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDec
        LDKRouteParameters o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = (o & 1) || (o == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        o_conv = RouteParameters_clone(&o_conv);
        LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ");
        *ret_conv = CResult_RouteParametersDecodeErrorZ_ok(o_conv);
@@ -12295,12 +12166,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDec
        LDKDecodeError e_conv;
        e_conv.inner = (void*)(e & (~1));
        e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
        e_conv = DecodeError_clone(&e_conv);
        LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ");
        *ret_conv = CResult_RouteParametersDecodeErrorZ_err(e_conv);
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_RouteParametersDecodeErrorZ* o_conv = (LDKCResult_RouteParametersDecodeErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_RouteParametersDecodeErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -12310,6 +12188,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecode
        CResult_RouteParametersDecodeErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_RouteParametersDecodeErrorZ_clone_ptr(LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR arg) {
+       LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ");
+       *ret_conv = CResult_RouteParametersDecodeErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_RouteParametersDecodeErrorZ* arg_conv = (LDKCResult_RouteParametersDecodeErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_RouteParametersDecodeErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_RouteParametersDecodeErrorZ* orig_conv = (LDKCResult_RouteParametersDecodeErrorZ*)(orig & ~1);
        LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ");
@@ -12330,6 +12219,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHintZ_1free(JNIEnv
                LDKRouteHint _res_conv_11_conv;
                _res_conv_11_conv.inner = (void*)(_res_conv_11 & (~1));
                _res_conv_11_conv.is_owned = (_res_conv_11 & 1) || (_res_conv_11 == 0);
+               CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_11_conv);
                _res_constr.data[l] = _res_conv_11_conv;
        }
        (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
@@ -12359,6 +12249,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1free(JNIEnv *en
        COption_u64Z_free(_res_conv);
 }
 
+static inline uint64_t COption_u64Z_clone_ptr(LDKCOption_u64Z *NONNULL_PTR arg) {
+       LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
+       *ret_copy = COption_u64Z_clone(arg);
+uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCOption_u64Z* arg_conv = (LDKCOption_u64Z*)arg;
+       int64_t ret_val = COption_u64Z_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCOption_u64Z* orig_conv = (LDKCOption_u64Z*)orig;
        LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
@@ -12371,6 +12273,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PayeeDecodeErrorZ_
        LDKPayee o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = (o & 1) || (o == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        o_conv = Payee_clone(&o_conv);
        LDKCResult_PayeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeeDecodeErrorZ), "LDKCResult_PayeeDecodeErrorZ");
        *ret_conv = CResult_PayeeDecodeErrorZ_ok(o_conv);
@@ -12381,12 +12284,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PayeeDecodeErrorZ_
        LDKDecodeError e_conv;
        e_conv.inner = (void*)(e & (~1));
        e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
        e_conv = DecodeError_clone(&e_conv);
        LDKCResult_PayeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeeDecodeErrorZ), "LDKCResult_PayeeDecodeErrorZ");
        *ret_conv = CResult_PayeeDecodeErrorZ_err(e_conv);
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PayeeDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_PayeeDecodeErrorZ* o_conv = (LDKCResult_PayeeDecodeErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_PayeeDecodeErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PayeeDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -12396,6 +12306,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PayeeDecodeErrorZ_1fr
        CResult_PayeeDecodeErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_PayeeDecodeErrorZ_clone_ptr(LDKCResult_PayeeDecodeErrorZ *NONNULL_PTR arg) {
+       LDKCResult_PayeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeeDecodeErrorZ), "LDKCResult_PayeeDecodeErrorZ");
+       *ret_conv = CResult_PayeeDecodeErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PayeeDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_PayeeDecodeErrorZ* arg_conv = (LDKCResult_PayeeDecodeErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_PayeeDecodeErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PayeeDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_PayeeDecodeErrorZ* orig_conv = (LDKCResult_PayeeDecodeErrorZ*)(orig & ~1);
        LDKCResult_PayeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeeDecodeErrorZ), "LDKCResult_PayeeDecodeErrorZ");
@@ -12416,6 +12337,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHintHopZ_1free(JNIE
                LDKRouteHintHop _res_conv_14_conv;
                _res_conv_14_conv.inner = (void*)(_res_conv_14 & (~1));
                _res_conv_14_conv.is_owned = (_res_conv_14 & 1) || (_res_conv_14 == 0);
+               CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_14_conv);
                _res_constr.data[o] = _res_conv_14_conv;
        }
        (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
@@ -12426,6 +12348,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErr
        LDKRouteHint o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = (o & 1) || (o == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        o_conv = RouteHint_clone(&o_conv);
        LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ");
        *ret_conv = CResult_RouteHintDecodeErrorZ_ok(o_conv);
@@ -12436,12 +12359,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErr
        LDKDecodeError e_conv;
        e_conv.inner = (void*)(e & (~1));
        e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
        e_conv = DecodeError_clone(&e_conv);
        LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ");
        *ret_conv = CResult_RouteHintDecodeErrorZ_err(e_conv);
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_RouteHintDecodeErrorZ* o_conv = (LDKCResult_RouteHintDecodeErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_RouteHintDecodeErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -12451,6 +12381,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ
        CResult_RouteHintDecodeErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_RouteHintDecodeErrorZ_clone_ptr(LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR arg) {
+       LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ");
+       *ret_conv = CResult_RouteHintDecodeErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_RouteHintDecodeErrorZ* arg_conv = (LDKCResult_RouteHintDecodeErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_RouteHintDecodeErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_RouteHintDecodeErrorZ* orig_conv = (LDKCResult_RouteHintDecodeErrorZ*)(orig & ~1);
        LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ");
@@ -12462,6 +12403,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecode
        LDKRouteHintHop o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = (o & 1) || (o == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        o_conv = RouteHintHop_clone(&o_conv);
        LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ");
        *ret_conv = CResult_RouteHintHopDecodeErrorZ_ok(o_conv);
@@ -12472,12 +12414,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecode
        LDKDecodeError e_conv;
        e_conv.inner = (void*)(e & (~1));
        e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
        e_conv = DecodeError_clone(&e_conv);
        LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ");
        *ret_conv = CResult_RouteHintHopDecodeErrorZ_err(e_conv);
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_RouteHintHopDecodeErrorZ* o_conv = (LDKCResult_RouteHintHopDecodeErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_RouteHintHopDecodeErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -12487,6 +12436,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErr
        CResult_RouteHintHopDecodeErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_RouteHintHopDecodeErrorZ_clone_ptr(LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR arg) {
+       LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ");
+       *ret_conv = CResult_RouteHintHopDecodeErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_RouteHintHopDecodeErrorZ* arg_conv = (LDKCResult_RouteHintHopDecodeErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_RouteHintHopDecodeErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_RouteHintHopDecodeErrorZ* orig_conv = (LDKCResult_RouteHintHopDecodeErrorZ*)(orig & ~1);
        LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ");
@@ -12507,6 +12467,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ChannelDetailsZ_1free(JN
                LDKChannelDetails _res_conv_16_conv;
                _res_conv_16_conv.inner = (void*)(_res_conv_16 & (~1));
                _res_conv_16_conv.is_owned = (_res_conv_16 & 1) || (_res_conv_16 == 0);
+               CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_16_conv);
                _res_constr.data[q] = _res_conv_16_conv;
        }
        (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
@@ -12517,6 +12478,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErro
        LDKRoute o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = (o & 1) || (o == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        o_conv = Route_clone(&o_conv);
        LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
        *ret_conv = CResult_RouteLightningErrorZ_ok(o_conv);
@@ -12527,12 +12489,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErro
        LDKLightningError e_conv;
        e_conv.inner = (void*)(e & (~1));
        e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
        e_conv = LightningError_clone(&e_conv);
        LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
        *ret_conv = CResult_RouteLightningErrorZ_err(e_conv);
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_RouteLightningErrorZ* o_conv = (LDKCResult_RouteLightningErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_RouteLightningErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -12542,6 +12511,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_
        CResult_RouteLightningErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_RouteLightningErrorZ_clone_ptr(LDKCResult_RouteLightningErrorZ *NONNULL_PTR arg) {
+       LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
+       *ret_conv = CResult_RouteLightningErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_RouteLightningErrorZ* arg_conv = (LDKCResult_RouteLightningErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_RouteLightningErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_RouteLightningErrorZ* orig_conv = (LDKCResult_RouteLightningErrorZ*)(orig & ~1);
        LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
@@ -12566,6 +12546,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_TxOutAccessErrorZ* o_conv = (LDKCResult_TxOutAccessErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_TxOutAccessErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -12575,6 +12561,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1fr
        CResult_TxOutAccessErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_TxOutAccessErrorZ_clone_ptr(LDKCResult_TxOutAccessErrorZ *NONNULL_PTR arg) {
+       LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ");
+       *ret_conv = CResult_TxOutAccessErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_TxOutAccessErrorZ* arg_conv = (LDKCResult_TxOutAccessErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_TxOutAccessErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_TxOutAccessErrorZ* orig_conv = (LDKCResult_TxOutAccessErrorZ*)(orig & ~1);
        LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ");
@@ -12582,6 +12579,17 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_
        return (uint64_t)ret_conv;
 }
 
+static inline uint64_t C2Tuple_usizeTransactionZ_clone_ptr(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR arg) {
+       LDKC2Tuple_usizeTransactionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ");
+       *ret_conv = C2Tuple_usizeTransactionZ_clone(arg);
+       return ((uint64_t)ret_conv);
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKC2Tuple_usizeTransactionZ* arg_conv = (LDKC2Tuple_usizeTransactionZ*)(arg & ~1);
+       int64_t ret_val = C2Tuple_usizeTransactionZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKC2Tuple_usizeTransactionZ* orig_conv = (LDKC2Tuple_usizeTransactionZ*)(orig & ~1);
        LDKC2Tuple_usizeTransactionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ");
@@ -12659,6 +12667,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitor
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_NoneChannelMonitorUpdateErrZ* o_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(o & ~1);
+       jboolean ret_val = CResult_NoneChannelMonitorUpdateErrZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -12668,6 +12682,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpd
        CResult_NoneChannelMonitorUpdateErrZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_NoneChannelMonitorUpdateErrZ_clone_ptr(LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR arg) {
+       LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
+       *ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_NoneChannelMonitorUpdateErrZ* arg_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(arg & ~1);
+       int64_t ret_val = CResult_NoneChannelMonitorUpdateErrZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_NoneChannelMonitorUpdateErrZ* orig_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(orig & ~1);
        LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
@@ -12722,6 +12747,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1usizeTransac
        COption_C2Tuple_usizeTransactionZZ_free(_res_conv);
 }
 
+static inline uint64_t COption_C2Tuple_usizeTransactionZZ_clone_ptr(LDKCOption_C2Tuple_usizeTransactionZZ *NONNULL_PTR arg) {
+       LDKCOption_C2Tuple_usizeTransactionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_usizeTransactionZZ), "LDKCOption_C2Tuple_usizeTransactionZZ");
+       *ret_copy = COption_C2Tuple_usizeTransactionZZ_clone(arg);
+uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1usizeTransactionZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCOption_C2Tuple_usizeTransactionZZ* arg_conv = (LDKCOption_C2Tuple_usizeTransactionZZ*)arg;
+       int64_t ret_val = COption_C2Tuple_usizeTransactionZZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1usizeTransactionZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCOption_C2Tuple_usizeTransactionZZ* orig_conv = (LDKCOption_C2Tuple_usizeTransactionZZ*)orig;
        LDKCOption_C2Tuple_usizeTransactionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_usizeTransactionZZ), "LDKCOption_C2Tuple_usizeTransactionZZ");
@@ -12730,6 +12767,107 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1usizeTran
        return ret_ref;
 }
 
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1ClosureReasonZ_1some(JNIEnv *env, jclass clz, int64_t o) {
+       void* o_ptr = (void*)(((uint64_t)o) & ~1);
+       CHECK_ACCESS(o_ptr);
+       LDKClosureReason o_conv = *(LDKClosureReason*)(o_ptr);
+       o_conv = ClosureReason_clone((LDKClosureReason*)(((uint64_t)o) & ~1));
+       LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ");
+       *ret_copy = COption_ClosureReasonZ_some(o_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1ClosureReasonZ_1none(JNIEnv *env, jclass clz) {
+       LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ");
+       *ret_copy = COption_ClosureReasonZ_none();
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1ClosureReasonZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
+       if ((_res & 1) != 0) return;
+       void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+       CHECK_ACCESS(_res_ptr);
+       LDKCOption_ClosureReasonZ _res_conv = *(LDKCOption_ClosureReasonZ*)(_res_ptr);
+       FREE((void*)_res);
+       COption_ClosureReasonZ_free(_res_conv);
+}
+
+static inline uint64_t COption_ClosureReasonZ_clone_ptr(LDKCOption_ClosureReasonZ *NONNULL_PTR arg) {
+       LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ");
+       *ret_copy = COption_ClosureReasonZ_clone(arg);
+uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1ClosureReasonZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCOption_ClosureReasonZ* arg_conv = (LDKCOption_ClosureReasonZ*)arg;
+       int64_t ret_val = COption_ClosureReasonZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1ClosureReasonZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+       LDKCOption_ClosureReasonZ* orig_conv = (LDKCOption_ClosureReasonZ*)orig;
+       LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ");
+       *ret_copy = COption_ClosureReasonZ_clone(orig_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1ClosureReasonZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       void* o_ptr = (void*)(((uint64_t)o) & ~1);
+       CHECK_ACCESS(o_ptr);
+       LDKCOption_ClosureReasonZ o_conv = *(LDKCOption_ClosureReasonZ*)(o_ptr);
+       o_conv = COption_ClosureReasonZ_clone((LDKCOption_ClosureReasonZ*)(((uint64_t)o) & ~1));
+       LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ");
+       *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_ok(o_conv);
+       return (uint64_t)ret_conv;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1ClosureReasonZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
+       LDKDecodeError e_conv;
+       e_conv.inner = (void*)(e & (~1));
+       e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
+       e_conv = DecodeError_clone(&e_conv);
+       LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ");
+       *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_err(e_conv);
+       return (uint64_t)ret_conv;
+}
+
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1ClosureReasonZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_COption_ClosureReasonZDecodeErrorZ* o_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_COption_ClosureReasonZDecodeErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1ClosureReasonZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
+       if ((_res & 1) != 0) return;
+       void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+       CHECK_ACCESS(_res_ptr);
+       LDKCResult_COption_ClosureReasonZDecodeErrorZ _res_conv = *(LDKCResult_COption_ClosureReasonZDecodeErrorZ*)(_res_ptr);
+       FREE((void*)_res);
+       CResult_COption_ClosureReasonZDecodeErrorZ_free(_res_conv);
+}
+
+static inline uint64_t CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr(LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR arg) {
+       LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ");
+       *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1ClosureReasonZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_COption_ClosureReasonZDecodeErrorZ* arg_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1ClosureReasonZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+       LDKCResult_COption_ClosureReasonZDecodeErrorZ* orig_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)(orig & ~1);
+       LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ");
+       *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_clone(orig_conv);
+       return (uint64_t)ret_conv;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1NetworkUpdateZ_1some(JNIEnv *env, jclass clz, int64_t o) {
        void* o_ptr = (void*)(((uint64_t)o) & ~1);
        CHECK_ACCESS(o_ptr);
@@ -12757,6 +12895,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1NetworkUpdateZ_1free(
        COption_NetworkUpdateZ_free(_res_conv);
 }
 
+static inline uint64_t COption_NetworkUpdateZ_clone_ptr(LDKCOption_NetworkUpdateZ *NONNULL_PTR arg) {
+       LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ");
+       *ret_copy = COption_NetworkUpdateZ_clone(arg);
+uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1NetworkUpdateZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCOption_NetworkUpdateZ* arg_conv = (LDKCOption_NetworkUpdateZ*)arg;
+       int64_t ret_val = COption_NetworkUpdateZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1NetworkUpdateZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCOption_NetworkUpdateZ* orig_conv = (LDKCOption_NetworkUpdateZ*)orig;
        LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ");
@@ -12785,6 +12935,107 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1SpendableOutputDescripto
        CVec_SpendableOutputDescriptorZ_free(_res_constr);
 }
 
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1EventZ_1some(JNIEnv *env, jclass clz, int64_t o) {
+       void* o_ptr = (void*)(((uint64_t)o) & ~1);
+       CHECK_ACCESS(o_ptr);
+       LDKEvent o_conv = *(LDKEvent*)(o_ptr);
+       o_conv = Event_clone((LDKEvent*)(((uint64_t)o) & ~1));
+       LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ");
+       *ret_copy = COption_EventZ_some(o_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1EventZ_1none(JNIEnv *env, jclass clz) {
+       LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ");
+       *ret_copy = COption_EventZ_none();
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1EventZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
+       if ((_res & 1) != 0) return;
+       void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+       CHECK_ACCESS(_res_ptr);
+       LDKCOption_EventZ _res_conv = *(LDKCOption_EventZ*)(_res_ptr);
+       FREE((void*)_res);
+       COption_EventZ_free(_res_conv);
+}
+
+static inline uint64_t COption_EventZ_clone_ptr(LDKCOption_EventZ *NONNULL_PTR arg) {
+       LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ");
+       *ret_copy = COption_EventZ_clone(arg);
+uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1EventZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCOption_EventZ* arg_conv = (LDKCOption_EventZ*)arg;
+       int64_t ret_val = COption_EventZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1EventZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+       LDKCOption_EventZ* orig_conv = (LDKCOption_EventZ*)orig;
+       LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ");
+       *ret_copy = COption_EventZ_clone(orig_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       void* o_ptr = (void*)(((uint64_t)o) & ~1);
+       CHECK_ACCESS(o_ptr);
+       LDKCOption_EventZ o_conv = *(LDKCOption_EventZ*)(o_ptr);
+       o_conv = COption_EventZ_clone((LDKCOption_EventZ*)(((uint64_t)o) & ~1));
+       LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ");
+       *ret_conv = CResult_COption_EventZDecodeErrorZ_ok(o_conv);
+       return (uint64_t)ret_conv;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
+       LDKDecodeError e_conv;
+       e_conv.inner = (void*)(e & (~1));
+       e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
+       e_conv = DecodeError_clone(&e_conv);
+       LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ");
+       *ret_conv = CResult_COption_EventZDecodeErrorZ_err(e_conv);
+       return (uint64_t)ret_conv;
+}
+
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_COption_EventZDecodeErrorZ* o_conv = (LDKCResult_COption_EventZDecodeErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_COption_EventZDecodeErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
+       if ((_res & 1) != 0) return;
+       void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+       CHECK_ACCESS(_res_ptr);
+       LDKCResult_COption_EventZDecodeErrorZ _res_conv = *(LDKCResult_COption_EventZDecodeErrorZ*)(_res_ptr);
+       FREE((void*)_res);
+       CResult_COption_EventZDecodeErrorZ_free(_res_conv);
+}
+
+static inline uint64_t CResult_COption_EventZDecodeErrorZ_clone_ptr(LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR arg) {
+       LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ");
+       *ret_conv = CResult_COption_EventZDecodeErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_COption_EventZDecodeErrorZ* arg_conv = (LDKCResult_COption_EventZDecodeErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_COption_EventZDecodeErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+       LDKCResult_COption_EventZDecodeErrorZ* orig_conv = (LDKCResult_COption_EventZDecodeErrorZ*)(orig & ~1);
+       LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ");
+       *ret_conv = CResult_COption_EventZDecodeErrorZ_clone(orig_conv);
+       return (uint64_t)ret_conv;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1MessageSendEventZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
        LDKCVec_MessageSendEventZ _res_constr;
        _res_constr.datalen = (*env)->GetArrayLength(env, _res);
@@ -12809,6 +13060,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecode
        LDKInitFeatures o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = (o & 1) || (o == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        o_conv = InitFeatures_clone(&o_conv);
        LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ");
        *ret_conv = CResult_InitFeaturesDecodeErrorZ_ok(o_conv);
@@ -12819,12 +13071,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecode
        LDKDecodeError e_conv;
        e_conv.inner = (void*)(e & (~1));
        e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
        e_conv = DecodeError_clone(&e_conv);
        LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ");
        *ret_conv = CResult_InitFeaturesDecodeErrorZ_err(e_conv);
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_InitFeaturesDecodeErrorZ* o_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_InitFeaturesDecodeErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -12838,6 +13097,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecode
        LDKNodeFeatures o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = (o & 1) || (o == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        o_conv = NodeFeatures_clone(&o_conv);
        LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ");
        *ret_conv = CResult_NodeFeaturesDecodeErrorZ_ok(o_conv);
@@ -12848,12 +13108,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecode
        LDKDecodeError e_conv;
        e_conv.inner = (void*)(e & (~1));
        e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
        e_conv = DecodeError_clone(&e_conv);
        LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ");
        *ret_conv = CResult_NodeFeaturesDecodeErrorZ_err(e_conv);
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_NodeFeaturesDecodeErrorZ* o_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_NodeFeaturesDecodeErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -12867,6 +13134,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDec
        LDKChannelFeatures o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = (o & 1) || (o == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        o_conv = ChannelFeatures_clone(&o_conv);
        LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ");
        *ret_conv = CResult_ChannelFeaturesDecodeErrorZ_ok(o_conv);
@@ -12877,12 +13145,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDec
        LDKDecodeError e_conv;
        e_conv.inner = (void*)(e & (~1));
        e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
        e_conv = DecodeError_clone(&e_conv);
        LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ");
        *ret_conv = CResult_ChannelFeaturesDecodeErrorZ_err(e_conv);
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_ChannelFeaturesDecodeErrorZ* o_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_ChannelFeaturesDecodeErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -12896,6 +13171,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDec
        LDKInvoiceFeatures o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = (o & 1) || (o == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        o_conv = InvoiceFeatures_clone(&o_conv);
        LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
        *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_ok(o_conv);
@@ -12906,12 +13182,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDec
        LDKDecodeError e_conv;
        e_conv.inner = (void*)(e & (~1));
        e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
        e_conv = DecodeError_clone(&e_conv);
        LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
        *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_err(e_conv);
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_InvoiceFeaturesDecodeErrorZ* o_conv = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_InvoiceFeaturesDecodeErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -12925,6 +13208,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ScoringParametersD
        LDKScoringParameters o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = (o & 1) || (o == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        // Warning: we need a move here but no clone is available for LDKScoringParameters
        LDKCResult_ScoringParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScoringParametersDecodeErrorZ), "LDKCResult_ScoringParametersDecodeErrorZ");
        *ret_conv = CResult_ScoringParametersDecodeErrorZ_ok(o_conv);
@@ -12935,12 +13219,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ScoringParametersD
        LDKDecodeError e_conv;
        e_conv.inner = (void*)(e & (~1));
        e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
        e_conv = DecodeError_clone(&e_conv);
        LDKCResult_ScoringParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScoringParametersDecodeErrorZ), "LDKCResult_ScoringParametersDecodeErrorZ");
        *ret_conv = CResult_ScoringParametersDecodeErrorZ_err(e_conv);
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ScoringParametersDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_ScoringParametersDecodeErrorZ* o_conv = (LDKCResult_ScoringParametersDecodeErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_ScoringParametersDecodeErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ScoringParametersDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -12954,6 +13245,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ScorerDecodeErrorZ
        LDKScorer o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = (o & 1) || (o == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        // Warning: we need a move here but no clone is available for LDKScorer
        LDKCResult_ScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScorerDecodeErrorZ), "LDKCResult_ScorerDecodeErrorZ");
        *ret_conv = CResult_ScorerDecodeErrorZ_ok(o_conv);
@@ -12964,12 +13256,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ScorerDecodeErrorZ
        LDKDecodeError e_conv;
        e_conv.inner = (void*)(e & (~1));
        e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
        e_conv = DecodeError_clone(&e_conv);
        LDKCResult_ScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScorerDecodeErrorZ), "LDKCResult_ScorerDecodeErrorZ");
        *ret_conv = CResult_ScorerDecodeErrorZ_err(e_conv);
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ScorerDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_ScorerDecodeErrorZ* o_conv = (LDKCResult_ScorerDecodeErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_ScorerDecodeErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ScorerDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -12983,6 +13282,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutp
        LDKDelayedPaymentOutputDescriptor o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = (o & 1) || (o == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        o_conv = DelayedPaymentOutputDescriptor_clone(&o_conv);
        LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ");
        *ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(o_conv);
@@ -12993,12 +13293,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutp
        LDKDecodeError e_conv;
        e_conv.inner = (void*)(e & (~1));
        e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
        e_conv = DecodeError_clone(&e_conv);
        LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ");
        *ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(e_conv);
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* o_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -13008,6 +13315,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputD
        CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR arg) {
+       LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ");
+       *ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* arg_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* orig_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(orig & ~1);
        LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ");
@@ -13019,6 +13337,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutpu
        LDKStaticPaymentOutputDescriptor o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = (o & 1) || (o == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        o_conv = StaticPaymentOutputDescriptor_clone(&o_conv);
        LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ");
        *ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok(o_conv);
@@ -13029,12 +13348,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutpu
        LDKDecodeError e_conv;
        e_conv.inner = (void*)(e & (~1));
        e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
        e_conv = DecodeError_clone(&e_conv);
        LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ");
        *ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(e_conv);
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* o_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -13044,6 +13370,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDe
        CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR arg) {
+       LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ");
+       *ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* arg_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* orig_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(orig & ~1);
        LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ");
@@ -13065,12 +13402,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDes
        LDKDecodeError e_conv;
        e_conv.inner = (void*)(e & (~1));
        e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
        e_conv = DecodeError_clone(&e_conv);
        LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ");
        *ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_err(e_conv);
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_SpendableOutputDescriptorDecodeErrorZ* o_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -13080,6 +13424,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescri
        CResult_SpendableOutputDescriptorDecodeErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr(LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR arg) {
+       LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ");
+       *ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_SpendableOutputDescriptorDecodeErrorZ* arg_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_SpendableOutputDescriptorDecodeErrorZ* orig_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)(orig & ~1);
        LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ");
@@ -13099,6 +13454,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1err(JNI
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_NoneNoneZ* o_conv = (LDKCResult_NoneNoneZ*)(o & ~1);
+       jboolean ret_val = CResult_NoneNoneZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -13108,6 +13469,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1free(JNIEn
        CResult_NoneNoneZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_NoneNoneZ_clone_ptr(LDKCResult_NoneNoneZ *NONNULL_PTR arg) {
+       LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
+       *ret_conv = CResult_NoneNoneZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_NoneNoneZ* arg_conv = (LDKCResult_NoneNoneZ*)(arg & ~1);
+       int64_t ret_val = CResult_NoneNoneZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_NoneNoneZ* orig_conv = (LDKCResult_NoneNoneZ*)(orig & ~1);
        LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
@@ -13115,6 +13487,17 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1clone(J
        return (uint64_t)ret_conv;
 }
 
+static inline uint64_t C2Tuple_SignatureCVec_SignatureZZ_clone_ptr(LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR arg) {
+       LDKC2Tuple_SignatureCVec_SignatureZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ");
+       *ret_conv = C2Tuple_SignatureCVec_SignatureZZ_clone(arg);
+       return ((uint64_t)ret_conv);
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKC2Tuple_SignatureCVec_SignatureZZ* arg_conv = (LDKC2Tuple_SignatureCVec_SignatureZZ*)(arg & ~1);
+       int64_t ret_val = C2Tuple_SignatureCVec_SignatureZZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKC2Tuple_SignatureCVec_SignatureZZ* orig_conv = (LDKC2Tuple_SignatureCVec_SignatureZZ*)(orig & ~1);
        LDKC2Tuple_SignatureCVec_SignatureZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ");
@@ -13169,6 +13552,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1Signature
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* o_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(o & ~1);
+       jboolean ret_val = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -13178,6 +13567,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVe
        CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone_ptr(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR arg) {
+       LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
+       *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* arg_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(arg & ~1);
+       int64_t ret_val = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* orig_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(orig & ~1);
        LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
@@ -13200,6 +13600,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1er
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_SignatureNoneZ* o_conv = (LDKCResult_SignatureNoneZ*)(o & ~1);
+       jboolean ret_val = CResult_SignatureNoneZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -13209,6 +13615,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1free(
        CResult_SignatureNoneZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_SignatureNoneZ_clone_ptr(LDKCResult_SignatureNoneZ *NONNULL_PTR arg) {
+       LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
+       *ret_conv = CResult_SignatureNoneZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_SignatureNoneZ* arg_conv = (LDKCResult_SignatureNoneZ*)(arg & ~1);
+       int64_t ret_val = CResult_SignatureNoneZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_SignatureNoneZ* orig_conv = (LDKCResult_SignatureNoneZ*)(orig & ~1);
        LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
@@ -13233,12 +13650,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1
        LDKDecodeError e_conv;
        e_conv.inner = (void*)(e & (~1));
        e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
        e_conv = DecodeError_clone(&e_conv);
        LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ");
        *ret_conv = CResult_SignDecodeErrorZ_err(e_conv);
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_SignDecodeErrorZ* o_conv = (LDKCResult_SignDecodeErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_SignDecodeErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -13248,6 +13672,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1fre
        CResult_SignDecodeErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_SignDecodeErrorZ_clone_ptr(LDKCResult_SignDecodeErrorZ *NONNULL_PTR arg) {
+       LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ");
+       *ret_conv = CResult_SignDecodeErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_SignDecodeErrorZ* arg_conv = (LDKCResult_SignDecodeErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_SignDecodeErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_SignDecodeErrorZ* orig_conv = (LDKCResult_SignDecodeErrorZ*)(orig & ~1);
        LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ");
@@ -13278,6 +13713,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatu
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_RecoverableSignatureNoneZ* o_conv = (LDKCResult_RecoverableSignatureNoneZ*)(o & ~1);
+       jboolean ret_val = CResult_RecoverableSignatureNoneZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -13287,6 +13728,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureN
        CResult_RecoverableSignatureNoneZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_RecoverableSignatureNoneZ_clone_ptr(LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR arg) {
+       LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ");
+       *ret_conv = CResult_RecoverableSignatureNoneZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_RecoverableSignatureNoneZ* arg_conv = (LDKCResult_RecoverableSignatureNoneZ*)(arg & ~1);
+       int64_t ret_val = CResult_RecoverableSignatureNoneZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_RecoverableSignatureNoneZ* orig_conv = (LDKCResult_RecoverableSignatureNoneZ*)(orig & ~1);
        LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ");
@@ -13338,6 +13790,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNo
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_CVec_CVec_u8ZZNoneZ* o_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)(o & ~1);
+       jboolean ret_val = CResult_CVec_CVec_u8ZZNoneZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -13347,6 +13805,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ
        CResult_CVec_CVec_u8ZZNoneZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_CVec_CVec_u8ZZNoneZ_clone_ptr(LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR arg) {
+       LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ");
+       *ret_conv = CResult_CVec_CVec_u8ZZNoneZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_CVec_CVec_u8ZZNoneZ* arg_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)(arg & ~1);
+       int64_t ret_val = CResult_CVec_CVec_u8ZZNoneZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_CVec_CVec_u8ZZNoneZ* orig_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)(orig & ~1);
        LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ");
@@ -13358,6 +13827,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDeco
        LDKInMemorySigner o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = (o & 1) || (o == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        o_conv = InMemorySigner_clone(&o_conv);
        LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ");
        *ret_conv = CResult_InMemorySignerDecodeErrorZ_ok(o_conv);
@@ -13368,12 +13838,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDeco
        LDKDecodeError e_conv;
        e_conv.inner = (void*)(e & (~1));
        e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
        e_conv = DecodeError_clone(&e_conv);
        LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ");
        *ret_conv = CResult_InMemorySignerDecodeErrorZ_err(e_conv);
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_InMemorySignerDecodeErrorZ* o_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_InMemorySignerDecodeErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -13383,6 +13860,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeE
        CResult_InMemorySignerDecodeErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_InMemorySignerDecodeErrorZ_clone_ptr(LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR arg) {
+       LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ");
+       *ret_conv = CResult_InMemorySignerDecodeErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_InMemorySignerDecodeErrorZ* arg_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_InMemorySignerDecodeErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_InMemorySignerDecodeErrorZ* orig_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)(orig & ~1);
        LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ");
@@ -13427,6 +13915,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_TransactionNoneZ* o_conv = (LDKCResult_TransactionNoneZ*)(o & ~1);
+       jboolean ret_val = CResult_TransactionNoneZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -13436,6 +13930,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1fre
        CResult_TransactionNoneZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_TransactionNoneZ_clone_ptr(LDKCResult_TransactionNoneZ *NONNULL_PTR arg) {
+       LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ");
+       *ret_conv = CResult_TransactionNoneZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_TransactionNoneZ* arg_conv = (LDKCResult_TransactionNoneZ*)(arg & ~1);
+       int64_t ret_val = CResult_TransactionNoneZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_TransactionNoneZ* orig_conv = (LDKCResult_TransactionNoneZ*)(orig & ~1);
        LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ");
@@ -13443,6 +13948,17 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1
        return (uint64_t)ret_conv;
 }
 
+static inline uint64_t C2Tuple_BlockHashChannelMonitorZ_clone_ptr(LDKC2Tuple_BlockHashChannelMonitorZ *NONNULL_PTR arg) {
+       LDKC2Tuple_BlockHashChannelMonitorZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ");
+       *ret_conv = C2Tuple_BlockHashChannelMonitorZ_clone(arg);
+       return ((uint64_t)ret_conv);
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMonitorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKC2Tuple_BlockHashChannelMonitorZ* arg_conv = (LDKC2Tuple_BlockHashChannelMonitorZ*)(arg & ~1);
+       int64_t ret_val = C2Tuple_BlockHashChannelMonitorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMonitorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKC2Tuple_BlockHashChannelMonitorZ* orig_conv = (LDKC2Tuple_BlockHashChannelMonitorZ*)(orig & ~1);
        LDKC2Tuple_BlockHashChannelMonitorZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ");
@@ -13457,6 +13973,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMo
        LDKChannelMonitor b_conv;
        b_conv.inner = (void*)(b & (~1));
        b_conv.is_owned = (b & 1) || (b == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
        b_conv = ChannelMonitor_clone(&b_conv);
        LDKC2Tuple_BlockHashChannelMonitorZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ");
        *ret_conv = C2Tuple_BlockHashChannelMonitorZ_new(a_ref, b_conv);
@@ -13521,6 +14038,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1Blo
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* o_conv = (LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -13530,6 +14053,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockH
        CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone_ptr(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ *NONNULL_PTR arg) {
+       LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ), "LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ");
+       *ret_conv = CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* arg_conv = (LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* orig_conv = (LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ*)(orig & ~1);
        LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ), "LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ");
@@ -13560,6 +14094,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1u16Z_1free(JNIEnv *en
        COption_u16Z_free(_res_conv);
 }
 
+static inline uint64_t COption_u16Z_clone_ptr(LDKCOption_u16Z *NONNULL_PTR arg) {
+       LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z");
+       *ret_copy = COption_u16Z_clone(arg);
+uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u16Z_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCOption_u16Z* arg_conv = (LDKCOption_u16Z*)arg;
+       int64_t ret_val = COption_u16Z_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u16Z_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCOption_u16Z* orig_conv = (LDKCOption_u16Z*)orig;
        LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z");
@@ -13584,6 +14130,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1err
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_NoneAPIErrorZ* o_conv = (LDKCResult_NoneAPIErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_NoneAPIErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -13593,6 +14145,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1free(J
        CResult_NoneAPIErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_NoneAPIErrorZ_clone_ptr(LDKCResult_NoneAPIErrorZ *NONNULL_PTR arg) {
+       LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
+       *ret_conv = CResult_NoneAPIErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_NoneAPIErrorZ* arg_conv = (LDKCResult_NoneAPIErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_NoneAPIErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_NoneAPIErrorZ* orig_conv = (LDKCResult_NoneAPIErrorZ*)(orig & ~1);
        LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
@@ -13659,6 +14222,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1e
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult__u832APIErrorZ* o_conv = (LDKCResult__u832APIErrorZ*)(o & ~1);
+       jboolean ret_val = CResult__u832APIErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -13668,6 +14237,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1free
        CResult__u832APIErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult__u832APIErrorZ_clone_ptr(LDKCResult__u832APIErrorZ *NONNULL_PTR arg) {
+       LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ");
+       *ret_conv = CResult__u832APIErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult__u832APIErrorZ* arg_conv = (LDKCResult__u832APIErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult__u832APIErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult__u832APIErrorZ* orig_conv = (LDKCResult__u832APIErrorZ*)(orig & ~1);
        LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ");
@@ -13694,6 +14274,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSe
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_PaymentIdPaymentSendFailureZ* o_conv = (LDKCResult_PaymentIdPaymentSendFailureZ*)(o & ~1);
+       jboolean ret_val = CResult_PaymentIdPaymentSendFailureZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -13703,6 +14289,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendF
        CResult_PaymentIdPaymentSendFailureZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_PaymentIdPaymentSendFailureZ_clone_ptr(LDKCResult_PaymentIdPaymentSendFailureZ *NONNULL_PTR arg) {
+       LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ");
+       *ret_conv = CResult_PaymentIdPaymentSendFailureZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_PaymentIdPaymentSendFailureZ* arg_conv = (LDKCResult_PaymentIdPaymentSendFailureZ*)(arg & ~1);
+       int64_t ret_val = CResult_PaymentIdPaymentSendFailureZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_PaymentIdPaymentSendFailureZ* orig_conv = (LDKCResult_PaymentIdPaymentSendFailureZ*)(orig & ~1);
        LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ");
@@ -13726,6 +14323,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFai
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_NonePaymentSendFailureZ* o_conv = (LDKCResult_NonePaymentSendFailureZ*)(o & ~1);
+       jboolean ret_val = CResult_NonePaymentSendFailureZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -13735,6 +14338,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailur
        CResult_NonePaymentSendFailureZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_NonePaymentSendFailureZ_clone_ptr(LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR arg) {
+       LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
+       *ret_conv = CResult_NonePaymentSendFailureZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_NonePaymentSendFailureZ* arg_conv = (LDKCResult_NonePaymentSendFailureZ*)(arg & ~1);
+       int64_t ret_val = CResult_NonePaymentSendFailureZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_NonePaymentSendFailureZ* orig_conv = (LDKCResult_NonePaymentSendFailureZ*)(orig & ~1);
        LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
@@ -13742,6 +14356,17 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFai
        return (uint64_t)ret_conv;
 }
 
+static inline uint64_t C2Tuple_PaymentHashPaymentIdZ_clone_ptr(LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR arg) {
+       LDKC2Tuple_PaymentHashPaymentIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentIdZ), "LDKC2Tuple_PaymentHashPaymentIdZ");
+       *ret_conv = C2Tuple_PaymentHashPaymentIdZ_clone(arg);
+       return ((uint64_t)ret_conv);
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentIdZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKC2Tuple_PaymentHashPaymentIdZ* arg_conv = (LDKC2Tuple_PaymentHashPaymentIdZ*)(arg & ~1);
+       int64_t ret_val = C2Tuple_PaymentHashPaymentIdZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentIdZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKC2Tuple_PaymentHashPaymentIdZ* orig_conv = (LDKC2Tuple_PaymentHashPaymentIdZ*)(orig & ~1);
        LDKC2Tuple_PaymentHashPaymentIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentIdZ), "LDKC2Tuple_PaymentHashPaymentIdZ");
@@ -13790,6 +14415,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHa
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* o_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)(o & ~1);
+       jboolean ret_val = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -13799,6 +14430,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashP
        CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone_ptr(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR arg) {
+       LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ");
+       *ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* arg_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)(arg & ~1);
+       int64_t ret_val = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* orig_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)(orig & ~1);
        LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ");
@@ -13826,6 +14468,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1NetAddressZ_1free(JNIEnv
        CVec_NetAddressZ_free(_res_constr);
 }
 
+static inline uint64_t C2Tuple_PaymentHashPaymentSecretZ_clone_ptr(LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR arg) {
+       LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ");
+       *ret_conv = C2Tuple_PaymentHashPaymentSecretZ_clone(arg);
+       return ((uint64_t)ret_conv);
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentSecretZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKC2Tuple_PaymentHashPaymentSecretZ* arg_conv = (LDKC2Tuple_PaymentHashPaymentSecretZ*)(arg & ~1);
+       int64_t ret_val = C2Tuple_PaymentHashPaymentSecretZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentSecretZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKC2Tuple_PaymentHashPaymentSecretZ* orig_conv = (LDKC2Tuple_PaymentHashPaymentSecretZ*)(orig & ~1);
        LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ");
@@ -13873,6 +14526,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIEr
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_PaymentSecretAPIErrorZ* o_conv = (LDKCResult_PaymentSecretAPIErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_PaymentSecretAPIErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -13882,6 +14541,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIError
        CResult_PaymentSecretAPIErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_PaymentSecretAPIErrorZ_clone_ptr(LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR arg) {
+       LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ");
+       *ret_conv = CResult_PaymentSecretAPIErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_PaymentSecretAPIErrorZ* arg_conv = (LDKCResult_PaymentSecretAPIErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_PaymentSecretAPIErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_PaymentSecretAPIErrorZ* orig_conv = (LDKCResult_PaymentSecretAPIErrorZ*)(orig & ~1);
        LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ");
@@ -13902,6 +14572,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ChannelMonitorZ_1free(JN
                LDKChannelMonitor _res_conv_16_conv;
                _res_conv_16_conv.inner = (void*)(_res_conv_16 & (~1));
                _res_conv_16_conv.is_owned = (_res_conv_16 & 1) || (_res_conv_16 == 0);
+               CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_16_conv);
                _res_constr.data[q] = _res_conv_16_conv;
        }
        (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
@@ -13915,6 +14586,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMa
        LDKChannelManager b_conv;
        b_conv.inner = (void*)(b & (~1));
        b_conv.is_owned = (b & 1) || (b == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
        // Warning: we need a move here but no clone is available for LDKChannelManager
        LDKC2Tuple_BlockHashChannelManagerZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelManagerZ), "LDKC2Tuple_BlockHashChannelManagerZ");
        *ret_conv = C2Tuple_BlockHashChannelManagerZ_new(a_ref, b_conv);
@@ -13944,12 +14616,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHash
        LDKDecodeError e_conv;
        e_conv.inner = (void*)(e & (~1));
        e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
        e_conv = DecodeError_clone(&e_conv);
        LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ");
        *ret_conv = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(e_conv);
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* o_conv = (LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -13963,6 +14642,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecod
        LDKChannelConfig o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = (o & 1) || (o == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        o_conv = ChannelConfig_clone(&o_conv);
        LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ");
        *ret_conv = CResult_ChannelConfigDecodeErrorZ_ok(o_conv);
@@ -13973,12 +14653,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecod
        LDKDecodeError e_conv;
        e_conv.inner = (void*)(e & (~1));
        e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
        e_conv = DecodeError_clone(&e_conv);
        LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ");
        *ret_conv = CResult_ChannelConfigDecodeErrorZ_err(e_conv);
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_ChannelConfigDecodeErrorZ* o_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_ChannelConfigDecodeErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -13988,6 +14675,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeEr
        CResult_ChannelConfigDecodeErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_ChannelConfigDecodeErrorZ_clone_ptr(LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR arg) {
+       LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ");
+       *ret_conv = CResult_ChannelConfigDecodeErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_ChannelConfigDecodeErrorZ* arg_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_ChannelConfigDecodeErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_ChannelConfigDecodeErrorZ* orig_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)(orig & ~1);
        LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ");
@@ -13999,6 +14697,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErro
        LDKOutPoint o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = (o & 1) || (o == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        o_conv = OutPoint_clone(&o_conv);
        LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ");
        *ret_conv = CResult_OutPointDecodeErrorZ_ok(o_conv);
@@ -14009,12 +14708,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErro
        LDKDecodeError e_conv;
        e_conv.inner = (void*)(e & (~1));
        e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
        e_conv = DecodeError_clone(&e_conv);
        LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ");
        *ret_conv = CResult_OutPointDecodeErrorZ_err(e_conv);
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_OutPointDecodeErrorZ* o_conv = (LDKCResult_OutPointDecodeErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_OutPointDecodeErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -14024,6 +14730,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_
        CResult_OutPointDecodeErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_OutPointDecodeErrorZ_clone_ptr(LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR arg) {
+       LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ");
+       *ret_conv = CResult_OutPointDecodeErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_OutPointDecodeErrorZ* arg_conv = (LDKCResult_OutPointDecodeErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_OutPointDecodeErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_OutPointDecodeErrorZ* orig_conv = (LDKCResult_OutPointDecodeErrorZ*)(orig & ~1);
        LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ");
@@ -14061,6 +14778,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1TypeZ_1free(JNIEnv *e
        COption_TypeZ_free(_res_conv);
 }
 
+static inline uint64_t COption_TypeZ_clone_ptr(LDKCOption_TypeZ *NONNULL_PTR arg) {
+       LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ");
+       *ret_copy = COption_TypeZ_clone(arg);
+uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1TypeZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCOption_TypeZ* arg_conv = (LDKCOption_TypeZ*)arg;
+       int64_t ret_val = COption_TypeZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1TypeZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCOption_TypeZ* orig_conv = (LDKCOption_TypeZ*)orig;
        LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ");
@@ -14083,12 +14812,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDeco
        LDKDecodeError e_conv;
        e_conv.inner = (void*)(e & (~1));
        e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
        e_conv = DecodeError_clone(&e_conv);
        LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ");
        *ret_conv = CResult_COption_TypeZDecodeErrorZ_err(e_conv);
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_COption_TypeZDecodeErrorZ* o_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_COption_TypeZDecodeErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -14098,6 +14834,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeE
        CResult_COption_TypeZDecodeErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_COption_TypeZDecodeErrorZ_clone_ptr(LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR arg) {
+       LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ");
+       *ret_conv = CResult_COption_TypeZDecodeErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_COption_TypeZDecodeErrorZ* arg_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_COption_TypeZDecodeErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_COption_TypeZDecodeErrorZ* orig_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)(orig & ~1);
        LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ");
@@ -14124,6 +14871,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentEr
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_PaymentIdPaymentErrorZ* o_conv = (LDKCResult_PaymentIdPaymentErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_PaymentIdPaymentErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -14133,6 +14886,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentError
        CResult_PaymentIdPaymentErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_PaymentIdPaymentErrorZ_clone_ptr(LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR arg) {
+       LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
+       *ret_conv = CResult_PaymentIdPaymentErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_PaymentIdPaymentErrorZ* arg_conv = (LDKCResult_PaymentIdPaymentErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_PaymentIdPaymentErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_PaymentIdPaymentErrorZ* orig_conv = (LDKCResult_PaymentIdPaymentErrorZ*)(orig & ~1);
        LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
@@ -14153,6 +14917,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixNoneZ_1err
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_SiPrefixNoneZ* o_conv = (LDKCResult_SiPrefixNoneZ*)(o & ~1);
+       jboolean ret_val = CResult_SiPrefixNoneZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -14162,6 +14932,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixNoneZ_1free(J
        CResult_SiPrefixNoneZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_SiPrefixNoneZ_clone_ptr(LDKCResult_SiPrefixNoneZ *NONNULL_PTR arg) {
+       LDKCResult_SiPrefixNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixNoneZ), "LDKCResult_SiPrefixNoneZ");
+       *ret_conv = CResult_SiPrefixNoneZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_SiPrefixNoneZ* arg_conv = (LDKCResult_SiPrefixNoneZ*)(arg & ~1);
+       int64_t ret_val = CResult_SiPrefixNoneZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_SiPrefixNoneZ* orig_conv = (LDKCResult_SiPrefixNoneZ*)(orig & ~1);
        LDKCResult_SiPrefixNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixNoneZ), "LDKCResult_SiPrefixNoneZ");
@@ -14173,6 +14954,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceNoneZ_1ok(J
        LDKInvoice o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = (o & 1) || (o == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        o_conv = Invoice_clone(&o_conv);
        LDKCResult_InvoiceNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceNoneZ), "LDKCResult_InvoiceNoneZ");
        *ret_conv = CResult_InvoiceNoneZ_ok(o_conv);
@@ -14185,6 +14967,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceNoneZ_1err(
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_InvoiceNoneZ* o_conv = (LDKCResult_InvoiceNoneZ*)(o & ~1);
+       jboolean ret_val = CResult_InvoiceNoneZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -14194,6 +14982,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceNoneZ_1free(JN
        CResult_InvoiceNoneZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_InvoiceNoneZ_clone_ptr(LDKCResult_InvoiceNoneZ *NONNULL_PTR arg) {
+       LDKCResult_InvoiceNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceNoneZ), "LDKCResult_InvoiceNoneZ");
+       *ret_conv = CResult_InvoiceNoneZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_InvoiceNoneZ* arg_conv = (LDKCResult_InvoiceNoneZ*)(arg & ~1);
+       int64_t ret_val = CResult_InvoiceNoneZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_InvoiceNoneZ* orig_conv = (LDKCResult_InvoiceNoneZ*)(orig & ~1);
        LDKCResult_InvoiceNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceNoneZ), "LDKCResult_InvoiceNoneZ");
@@ -14205,6 +15004,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceNo
        LDKSignedRawInvoice o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = (o & 1) || (o == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        o_conv = SignedRawInvoice_clone(&o_conv);
        LDKCResult_SignedRawInvoiceNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceNoneZ), "LDKCResult_SignedRawInvoiceNoneZ");
        *ret_conv = CResult_SignedRawInvoiceNoneZ_ok(o_conv);
@@ -14217,6 +15017,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceNo
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_SignedRawInvoiceNoneZ* o_conv = (LDKCResult_SignedRawInvoiceNoneZ*)(o & ~1);
+       jboolean ret_val = CResult_SignedRawInvoiceNoneZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -14226,6 +15032,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceNoneZ
        CResult_SignedRawInvoiceNoneZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_SignedRawInvoiceNoneZ_clone_ptr(LDKCResult_SignedRawInvoiceNoneZ *NONNULL_PTR arg) {
+       LDKCResult_SignedRawInvoiceNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceNoneZ), "LDKCResult_SignedRawInvoiceNoneZ");
+       *ret_conv = CResult_SignedRawInvoiceNoneZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_SignedRawInvoiceNoneZ* arg_conv = (LDKCResult_SignedRawInvoiceNoneZ*)(arg & ~1);
+       int64_t ret_val = CResult_SignedRawInvoiceNoneZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_SignedRawInvoiceNoneZ* orig_conv = (LDKCResult_SignedRawInvoiceNoneZ*)(orig & ~1);
        LDKCResult_SignedRawInvoiceNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceNoneZ), "LDKCResult_SignedRawInvoiceNoneZ");
@@ -14233,6 +15050,17 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceNo
        return (uint64_t)ret_conv;
 }
 
+static inline uint64_t C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone_ptr(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR arg) {
+       LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ");
+       *ret_conv = C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone(arg);
+       return ((uint64_t)ret_conv);
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* arg_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)(arg & ~1);
+       int64_t ret_val = C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* orig_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)(orig & ~1);
        LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ");
@@ -14244,6 +15072,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832In
        LDKRawInvoice a_conv;
        a_conv.inner = (void*)(a & (~1));
        a_conv.is_owned = (a & 1) || (a == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
        a_conv = RawInvoice_clone(&a_conv);
        LDKThirtyTwoBytes b_ref;
        CHECK((*env)->GetArrayLength(env, b) == 32);
@@ -14251,6 +15080,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832In
        LDKInvoiceSignature c_conv;
        c_conv.inner = (void*)(c & (~1));
        c_conv.is_owned = (c & 1) || (c == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(c_conv);
        c_conv = InvoiceSignature_clone(&c_conv);
        LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ");
        *ret_conv = C3Tuple_RawInvoice_u832InvoiceSignatureZ_new(a_conv, b_ref, c_conv);
@@ -14270,6 +15100,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_
        LDKPayeePubKey o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = (o & 1) || (o == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        o_conv = PayeePubKey_clone(&o_conv);
        LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ");
        *ret_conv = CResult_PayeePubKeyErrorZ_ok(o_conv);
@@ -14283,6 +15114,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_PayeePubKeyErrorZ* o_conv = (LDKCResult_PayeePubKeyErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_PayeePubKeyErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -14292,6 +15129,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1fr
        CResult_PayeePubKeyErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_PayeePubKeyErrorZ_clone_ptr(LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR arg) {
+       LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ");
+       *ret_conv = CResult_PayeePubKeyErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_PayeePubKeyErrorZ* arg_conv = (LDKCResult_PayeePubKeyErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_PayeePubKeyErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_PayeePubKeyErrorZ* orig_conv = (LDKCResult_PayeePubKeyErrorZ*)(orig & ~1);
        LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ");
@@ -14312,6 +15160,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1PrivateRouteZ_1free(JNIE
                LDKPrivateRoute _res_conv_14_conv;
                _res_conv_14_conv.inner = (void*)(_res_conv_14 & (~1));
                _res_conv_14_conv.is_owned = (_res_conv_14 & 1) || (_res_conv_14 == 0);
+               CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_14_conv);
                _res_constr.data[o] = _res_conv_14_conv;
        }
        (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
@@ -14322,6 +15171,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampC
        LDKPositiveTimestamp o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = (o & 1) || (o == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        o_conv = PositiveTimestamp_clone(&o_conv);
        LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ");
        *ret_conv = CResult_PositiveTimestampCreationErrorZ_ok(o_conv);
@@ -14335,6 +15185,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampC
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_PositiveTimestampCreationErrorZ* o_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_PositiveTimestampCreationErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -14344,6 +15200,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCrea
        CResult_PositiveTimestampCreationErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_PositiveTimestampCreationErrorZ_clone_ptr(LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR arg) {
+       LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ");
+       *ret_conv = CResult_PositiveTimestampCreationErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_PositiveTimestampCreationErrorZ* arg_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_PositiveTimestampCreationErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_PositiveTimestampCreationErrorZ* orig_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)(orig & ~1);
        LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ");
@@ -14364,6 +15231,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_NoneSemanticErrorZ* o_conv = (LDKCResult_NoneSemanticErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_NoneSemanticErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -14373,6 +15246,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1f
        CResult_NoneSemanticErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_NoneSemanticErrorZ_clone_ptr(LDKCResult_NoneSemanticErrorZ *NONNULL_PTR arg) {
+       LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ");
+       *ret_conv = CResult_NoneSemanticErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_NoneSemanticErrorZ* arg_conv = (LDKCResult_NoneSemanticErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_NoneSemanticErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_NoneSemanticErrorZ* orig_conv = (LDKCResult_NoneSemanticErrorZ*)(orig & ~1);
        LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ");
@@ -14384,6 +15268,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErr
        LDKInvoice o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = (o & 1) || (o == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        o_conv = Invoice_clone(&o_conv);
        LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ");
        *ret_conv = CResult_InvoiceSemanticErrorZ_ok(o_conv);
@@ -14397,6 +15282,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErr
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_InvoiceSemanticErrorZ* o_conv = (LDKCResult_InvoiceSemanticErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_InvoiceSemanticErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -14406,6 +15297,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ
        CResult_InvoiceSemanticErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_InvoiceSemanticErrorZ_clone_ptr(LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR arg) {
+       LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ");
+       *ret_conv = CResult_InvoiceSemanticErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_InvoiceSemanticErrorZ* arg_conv = (LDKCResult_InvoiceSemanticErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_InvoiceSemanticErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_InvoiceSemanticErrorZ* orig_conv = (LDKCResult_InvoiceSemanticErrorZ*)(orig & ~1);
        LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ");
@@ -14417,6 +15319,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreatio
        LDKDescription o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = (o & 1) || (o == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        o_conv = Description_clone(&o_conv);
        LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ");
        *ret_conv = CResult_DescriptionCreationErrorZ_ok(o_conv);
@@ -14430,6 +15333,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreatio
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_DescriptionCreationErrorZ* o_conv = (LDKCResult_DescriptionCreationErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_DescriptionCreationErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -14439,6 +15348,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationEr
        CResult_DescriptionCreationErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_DescriptionCreationErrorZ_clone_ptr(LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR arg) {
+       LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ");
+       *ret_conv = CResult_DescriptionCreationErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_DescriptionCreationErrorZ* arg_conv = (LDKCResult_DescriptionCreationErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_DescriptionCreationErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_DescriptionCreationErrorZ* orig_conv = (LDKCResult_DescriptionCreationErrorZ*)(orig & ~1);
        LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ");
@@ -14450,6 +15370,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ExpiryTimeCreation
        LDKExpiryTime o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = (o & 1) || (o == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        o_conv = ExpiryTime_clone(&o_conv);
        LDKCResult_ExpiryTimeCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ExpiryTimeCreationErrorZ), "LDKCResult_ExpiryTimeCreationErrorZ");
        *ret_conv = CResult_ExpiryTimeCreationErrorZ_ok(o_conv);
@@ -14463,6 +15384,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ExpiryTimeCreation
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ExpiryTimeCreationErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_ExpiryTimeCreationErrorZ* o_conv = (LDKCResult_ExpiryTimeCreationErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_ExpiryTimeCreationErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ExpiryTimeCreationErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -14472,6 +15399,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ExpiryTimeCreationErr
        CResult_ExpiryTimeCreationErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_ExpiryTimeCreationErrorZ_clone_ptr(LDKCResult_ExpiryTimeCreationErrorZ *NONNULL_PTR arg) {
+       LDKCResult_ExpiryTimeCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ExpiryTimeCreationErrorZ), "LDKCResult_ExpiryTimeCreationErrorZ");
+       *ret_conv = CResult_ExpiryTimeCreationErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ExpiryTimeCreationErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_ExpiryTimeCreationErrorZ* arg_conv = (LDKCResult_ExpiryTimeCreationErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_ExpiryTimeCreationErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ExpiryTimeCreationErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_ExpiryTimeCreationErrorZ* orig_conv = (LDKCResult_ExpiryTimeCreationErrorZ*)(orig & ~1);
        LDKCResult_ExpiryTimeCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ExpiryTimeCreationErrorZ), "LDKCResult_ExpiryTimeCreationErrorZ");
@@ -14483,6 +15421,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreati
        LDKPrivateRoute o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = (o & 1) || (o == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        o_conv = PrivateRoute_clone(&o_conv);
        LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ");
        *ret_conv = CResult_PrivateRouteCreationErrorZ_ok(o_conv);
@@ -14496,6 +15435,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreati
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_PrivateRouteCreationErrorZ* o_conv = (LDKCResult_PrivateRouteCreationErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_PrivateRouteCreationErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -14505,6 +15450,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationE
        CResult_PrivateRouteCreationErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_PrivateRouteCreationErrorZ_clone_ptr(LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR arg) {
+       LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ");
+       *ret_conv = CResult_PrivateRouteCreationErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_PrivateRouteCreationErrorZ* arg_conv = (LDKCResult_PrivateRouteCreationErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_PrivateRouteCreationErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_PrivateRouteCreationErrorZ* orig_conv = (LDKCResult_PrivateRouteCreationErrorZ*)(orig & ~1);
        LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ");
@@ -14526,6 +15482,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1err(
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_StringErrorZ* o_conv = (LDKCResult_StringErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_StringErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -14539,6 +15501,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpda
        LDKChannelMonitorUpdate o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = (o & 1) || (o == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        o_conv = ChannelMonitorUpdate_clone(&o_conv);
        LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ");
        *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_ok(o_conv);
@@ -14549,12 +15512,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpda
        LDKDecodeError e_conv;
        e_conv.inner = (void*)(e & (~1));
        e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
        e_conv = DecodeError_clone(&e_conv);
        LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ");
        *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_err(e_conv);
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_ChannelMonitorUpdateDecodeErrorZ* o_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -14564,6 +15534,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateD
        CResult_ChannelMonitorUpdateDecodeErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr(LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR arg) {
+       LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ");
+       *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_ChannelMonitorUpdateDecodeErrorZ* arg_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_ChannelMonitorUpdateDecodeErrorZ* orig_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)(orig & ~1);
        LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ");
@@ -14571,10 +15552,112 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpda
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1some(JNIEnv *env, jclass clz, int64_t o) {
+       void* o_ptr = (void*)(((uint64_t)o) & ~1);
+       CHECK_ACCESS(o_ptr);
+       LDKMonitorEvent o_conv = *(LDKMonitorEvent*)(o_ptr);
+       o_conv = MonitorEvent_clone((LDKMonitorEvent*)(((uint64_t)o) & ~1));
+       LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ");
+       *ret_copy = COption_MonitorEventZ_some(o_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1none(JNIEnv *env, jclass clz) {
+       LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ");
+       *ret_copy = COption_MonitorEventZ_none();
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
+       if ((_res & 1) != 0) return;
+       void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+       CHECK_ACCESS(_res_ptr);
+       LDKCOption_MonitorEventZ _res_conv = *(LDKCOption_MonitorEventZ*)(_res_ptr);
+       FREE((void*)_res);
+       COption_MonitorEventZ_free(_res_conv);
+}
+
+static inline uint64_t COption_MonitorEventZ_clone_ptr(LDKCOption_MonitorEventZ *NONNULL_PTR arg) {
+       LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ");
+       *ret_copy = COption_MonitorEventZ_clone(arg);
+uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCOption_MonitorEventZ* arg_conv = (LDKCOption_MonitorEventZ*)arg;
+       int64_t ret_val = COption_MonitorEventZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+       LDKCOption_MonitorEventZ* orig_conv = (LDKCOption_MonitorEventZ*)orig;
+       LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ");
+       *ret_copy = COption_MonitorEventZ_clone(orig_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       void* o_ptr = (void*)(((uint64_t)o) & ~1);
+       CHECK_ACCESS(o_ptr);
+       LDKCOption_MonitorEventZ o_conv = *(LDKCOption_MonitorEventZ*)(o_ptr);
+       o_conv = COption_MonitorEventZ_clone((LDKCOption_MonitorEventZ*)(((uint64_t)o) & ~1));
+       LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ");
+       *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_ok(o_conv);
+       return (uint64_t)ret_conv;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
+       LDKDecodeError e_conv;
+       e_conv.inner = (void*)(e & (~1));
+       e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
+       e_conv = DecodeError_clone(&e_conv);
+       LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ");
+       *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_err(e_conv);
+       return (uint64_t)ret_conv;
+}
+
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_COption_MonitorEventZDecodeErrorZ* o_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_COption_MonitorEventZDecodeErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
+       if ((_res & 1) != 0) return;
+       void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+       CHECK_ACCESS(_res_ptr);
+       LDKCResult_COption_MonitorEventZDecodeErrorZ _res_conv = *(LDKCResult_COption_MonitorEventZDecodeErrorZ*)(_res_ptr);
+       FREE((void*)_res);
+       CResult_COption_MonitorEventZDecodeErrorZ_free(_res_conv);
+}
+
+static inline uint64_t CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr(LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR arg) {
+       LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ");
+       *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_COption_MonitorEventZDecodeErrorZ* arg_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+       LDKCResult_COption_MonitorEventZDecodeErrorZ* orig_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)(orig & ~1);
+       LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ");
+       *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_clone(orig_conv);
+       return (uint64_t)ret_conv;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
        LDKHTLCUpdate o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = (o & 1) || (o == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        o_conv = HTLCUpdate_clone(&o_conv);
        LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ");
        *ret_conv = CResult_HTLCUpdateDecodeErrorZ_ok(o_conv);
@@ -14585,12 +15668,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeEr
        LDKDecodeError e_conv;
        e_conv.inner = (void*)(e & (~1));
        e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
        e_conv = DecodeError_clone(&e_conv);
        LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ");
        *ret_conv = CResult_HTLCUpdateDecodeErrorZ_err(e_conv);
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_HTLCUpdateDecodeErrorZ* o_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_HTLCUpdateDecodeErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -14600,6 +15690,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeError
        CResult_HTLCUpdateDecodeErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_HTLCUpdateDecodeErrorZ_clone_ptr(LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR arg) {
+       LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ");
+       *ret_conv = CResult_HTLCUpdateDecodeErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_HTLCUpdateDecodeErrorZ* arg_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_HTLCUpdateDecodeErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_HTLCUpdateDecodeErrorZ* orig_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)(orig & ~1);
        LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ");
@@ -14617,12 +15718,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateE
        LDKMonitorUpdateError e_conv;
        e_conv.inner = (void*)(e & (~1));
        e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
        e_conv = MonitorUpdateError_clone(&e_conv);
        LDKCResult_NoneMonitorUpdateErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneMonitorUpdateErrorZ), "LDKCResult_NoneMonitorUpdateErrorZ");
        *ret_conv = CResult_NoneMonitorUpdateErrorZ_err(e_conv);
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_NoneMonitorUpdateErrorZ* o_conv = (LDKCResult_NoneMonitorUpdateErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_NoneMonitorUpdateErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -14632,6 +15740,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErro
        CResult_NoneMonitorUpdateErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_NoneMonitorUpdateErrorZ_clone_ptr(LDKCResult_NoneMonitorUpdateErrorZ *NONNULL_PTR arg) {
+       LDKCResult_NoneMonitorUpdateErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneMonitorUpdateErrorZ), "LDKCResult_NoneMonitorUpdateErrorZ");
+       *ret_conv = CResult_NoneMonitorUpdateErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_NoneMonitorUpdateErrorZ* arg_conv = (LDKCResult_NoneMonitorUpdateErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_NoneMonitorUpdateErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_NoneMonitorUpdateErrorZ* orig_conv = (LDKCResult_NoneMonitorUpdateErrorZ*)(orig & ~1);
        LDKCResult_NoneMonitorUpdateErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneMonitorUpdateErrorZ), "LDKCResult_NoneMonitorUpdateErrorZ");
@@ -14639,6 +15758,17 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateE
        return (uint64_t)ret_conv;
 }
 
+static inline uint64_t C2Tuple_OutPointScriptZ_clone_ptr(LDKC2Tuple_OutPointScriptZ *NONNULL_PTR arg) {
+       LDKC2Tuple_OutPointScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ");
+       *ret_conv = C2Tuple_OutPointScriptZ_clone(arg);
+       return ((uint64_t)ret_conv);
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKC2Tuple_OutPointScriptZ* arg_conv = (LDKC2Tuple_OutPointScriptZ*)(arg & ~1);
+       int64_t ret_val = C2Tuple_OutPointScriptZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKC2Tuple_OutPointScriptZ* orig_conv = (LDKC2Tuple_OutPointScriptZ*)(orig & ~1);
        LDKC2Tuple_OutPointScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ");
@@ -14650,6 +15780,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1n
        LDKOutPoint a_conv;
        a_conv.inner = (void*)(a & (~1));
        a_conv.is_owned = (a & 1) || (a == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
        a_conv = OutPoint_clone(&a_conv);
        LDKCVec_u8Z b_ref;
        b_ref.datalen = (*env)->GetArrayLength(env, b);
@@ -14669,6 +15800,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1free
        C2Tuple_OutPointScriptZ_free(_res_conv);
 }
 
+static inline uint64_t C2Tuple_u32ScriptZ_clone_ptr(LDKC2Tuple_u32ScriptZ *NONNULL_PTR arg) {
+       LDKC2Tuple_u32ScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ), "LDKC2Tuple_u32ScriptZ");
+       *ret_conv = C2Tuple_u32ScriptZ_clone(arg);
+       return ((uint64_t)ret_conv);
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKC2Tuple_u32ScriptZ* arg_conv = (LDKC2Tuple_u32ScriptZ*)(arg & ~1);
+       int64_t ret_val = C2Tuple_u32ScriptZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKC2Tuple_u32ScriptZ* orig_conv = (LDKC2Tuple_u32ScriptZ*)(orig & ~1);
        LDKC2Tuple_u32ScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ), "LDKC2Tuple_u32ScriptZ");
@@ -14715,6 +15857,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1u32ScriptZZ_1fr
        CVec_C2Tuple_u32ScriptZZ_free(_res_constr);
 }
 
+static inline uint64_t C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone_ptr(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR arg) {
+       LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ");
+       *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone(arg);
+       return ((uint64_t)ret_conv);
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* arg_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(arg & ~1);
+       int64_t ret_val = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* orig_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(orig & ~1);
        LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ");
@@ -14815,6 +15968,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1TransactionZ_1free(JNIEn
        CVec_TransactionZ_free(_res_constr);
 }
 
+static inline uint64_t C2Tuple_u32TxOutZ_clone_ptr(LDKC2Tuple_u32TxOutZ *NONNULL_PTR arg) {
+       LDKC2Tuple_u32TxOutZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ");
+       *ret_conv = C2Tuple_u32TxOutZ_clone(arg);
+       return ((uint64_t)ret_conv);
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKC2Tuple_u32TxOutZ* arg_conv = (LDKC2Tuple_u32TxOutZ*)(arg & ~1);
+       int64_t ret_val = C2Tuple_u32TxOutZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKC2Tuple_u32TxOutZ* orig_conv = (LDKC2Tuple_u32TxOutZ*)(orig & ~1);
        LDKC2Tuple_u32TxOutZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ");
@@ -14861,6 +16025,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1u32TxOutZZ_1fre
        CVec_C2Tuple_u32TxOutZZ_free(_res_constr);
 }
 
+static inline uint64_t C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR arg) {
+       LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ");
+       *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(arg);
+       return ((uint64_t)ret_conv);
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* arg_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(arg & ~1);
+       int64_t ret_val = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* orig_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(orig & ~1);
        LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ");
@@ -14956,12 +16131,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHash
        LDKDecodeError e_conv;
        e_conv.inner = (void*)(e & (~1));
        e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
        e_conv = DecodeError_clone(&e_conv);
        LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ");
        *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(e_conv);
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* o_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -14971,6 +16153,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashCha
        CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone_ptr(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *NONNULL_PTR arg) {
+       LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ");
+       *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* arg_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* orig_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)(orig & ~1);
        LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ");
@@ -14988,12 +16181,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningError
        LDKLightningError e_conv;
        e_conv.inner = (void*)(e & (~1));
        e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
        e_conv = LightningError_clone(&e_conv);
        LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
        *ret_conv = CResult_NoneLightningErrorZ_err(e_conv);
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_NoneLightningErrorZ* o_conv = (LDKCResult_NoneLightningErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_NoneLightningErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -15003,6 +16203,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1
        CResult_NoneLightningErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_NoneLightningErrorZ_clone_ptr(LDKCResult_NoneLightningErrorZ *NONNULL_PTR arg) {
+       LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
+       *ret_conv = CResult_NoneLightningErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_NoneLightningErrorZ* arg_conv = (LDKCResult_NoneLightningErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_NoneLightningErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_NoneLightningErrorZ* orig_conv = (LDKCResult_NoneLightningErrorZ*)(orig & ~1);
        LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
@@ -15010,6 +16221,17 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningError
        return (uint64_t)ret_conv;
 }
 
+static inline uint64_t C2Tuple_PublicKeyTypeZ_clone_ptr(LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR arg) {
+       LDKC2Tuple_PublicKeyTypeZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKC2Tuple_PublicKeyTypeZ");
+       *ret_conv = C2Tuple_PublicKeyTypeZ_clone(arg);
+       return ((uint64_t)ret_conv);
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyTypeZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKC2Tuple_PublicKeyTypeZ* arg_conv = (LDKC2Tuple_PublicKeyTypeZ*)(arg & ~1);
+       int64_t ret_val = C2Tuple_PublicKeyTypeZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyTypeZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKC2Tuple_PublicKeyTypeZ* orig_conv = (LDKC2Tuple_PublicKeyTypeZ*)(orig & ~1);
        LDKC2Tuple_PublicKeyTypeZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKC2Tuple_PublicKeyTypeZ");
@@ -15072,12 +16294,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningError
        LDKLightningError e_conv;
        e_conv.inner = (void*)(e & (~1));
        e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
        e_conv = LightningError_clone(&e_conv);
        LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
        *ret_conv = CResult_boolLightningErrorZ_err(e_conv);
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_boolLightningErrorZ* o_conv = (LDKCResult_boolLightningErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_boolLightningErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -15087,6 +16316,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1
        CResult_boolLightningErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_boolLightningErrorZ_clone_ptr(LDKCResult_boolLightningErrorZ *NONNULL_PTR arg) {
+       LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
+       *ret_conv = CResult_boolLightningErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_boolLightningErrorZ* arg_conv = (LDKCResult_boolLightningErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_boolLightningErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_boolLightningErrorZ* orig_conv = (LDKCResult_boolLightningErrorZ*)(orig & ~1);
        LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
@@ -15094,6 +16334,17 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningError
        return (uint64_t)ret_conv;
 }
 
+static inline uint64_t C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR arg) {
+       LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ");
+       *ret_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(arg);
+       return ((uint64_t)ret_conv);
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* arg_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(arg & ~1);
+       int64_t ret_val = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* orig_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(orig & ~1);
        LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ");
@@ -15105,14 +16356,17 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncemen
        LDKChannelAnnouncement a_conv;
        a_conv.inner = (void*)(a & (~1));
        a_conv.is_owned = (a & 1) || (a == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
        a_conv = ChannelAnnouncement_clone(&a_conv);
        LDKChannelUpdate b_conv;
        b_conv.inner = (void*)(b & (~1));
        b_conv.is_owned = (b & 1) || (b == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
        b_conv = ChannelUpdate_clone(&b_conv);
        LDKChannelUpdate c_conv;
        c_conv.inner = (void*)(c & (~1));
        c_conv.is_owned = (c & 1) || (c == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(c_conv);
        c_conv = ChannelUpdate_clone(&c_conv);
        LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ");
        *ret_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(a_conv, b_conv, c_conv);
@@ -15161,6 +16415,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1NodeAnnouncementZ_1free(
                LDKNodeAnnouncement _res_conv_18_conv;
                _res_conv_18_conv.inner = (void*)(_res_conv_18 & (~1));
                _res_conv_18_conv.is_owned = (_res_conv_18 & 1) || (_res_conv_18 == 0);
+               CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_18_conv);
                _res_constr.data[s] = _res_conv_18_conv;
        }
        (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
@@ -15198,12 +16453,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandl
        LDKPeerHandleError e_conv;
        e_conv.inner = (void*)(e & (~1));
        e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
        e_conv = PeerHandleError_clone(&e_conv);
        LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
        *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_err(e_conv);
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_CVec_u8ZPeerHandleErrorZ* o_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_CVec_u8ZPeerHandleErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -15213,6 +16475,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleEr
        CResult_CVec_u8ZPeerHandleErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr(LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR arg) {
+       LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
+       *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_CVec_u8ZPeerHandleErrorZ* arg_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_CVec_u8ZPeerHandleErrorZ* orig_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)(orig & ~1);
        LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
@@ -15230,12 +16503,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErro
        LDKPeerHandleError e_conv;
        e_conv.inner = (void*)(e & (~1));
        e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
        e_conv = PeerHandleError_clone(&e_conv);
        LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
        *ret_conv = CResult_NonePeerHandleErrorZ_err(e_conv);
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_NonePeerHandleErrorZ* o_conv = (LDKCResult_NonePeerHandleErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_NonePeerHandleErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -15245,6 +16525,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_
        CResult_NonePeerHandleErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_NonePeerHandleErrorZ_clone_ptr(LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR arg) {
+       LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
+       *ret_conv = CResult_NonePeerHandleErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_NonePeerHandleErrorZ* arg_conv = (LDKCResult_NonePeerHandleErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_NonePeerHandleErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_NonePeerHandleErrorZ* orig_conv = (LDKCResult_NonePeerHandleErrorZ*)(orig & ~1);
        LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
@@ -15262,12 +16553,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErro
        LDKPeerHandleError e_conv;
        e_conv.inner = (void*)(e & (~1));
        e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
        e_conv = PeerHandleError_clone(&e_conv);
        LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
        *ret_conv = CResult_boolPeerHandleErrorZ_err(e_conv);
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_boolPeerHandleErrorZ* o_conv = (LDKCResult_boolPeerHandleErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_boolPeerHandleErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -15277,6 +16575,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_
        CResult_boolPeerHandleErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_boolPeerHandleErrorZ_clone_ptr(LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR arg) {
+       LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
+       *ret_conv = CResult_boolPeerHandleErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_boolPeerHandleErrorZ* arg_conv = (LDKCResult_boolPeerHandleErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_boolPeerHandleErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_boolPeerHandleErrorZ* orig_conv = (LDKCResult_boolPeerHandleErrorZ*)(orig & ~1);
        LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
@@ -15288,6 +16597,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ
        LDKNodeId o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = (o & 1) || (o == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        o_conv = NodeId_clone(&o_conv);
        LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ");
        *ret_conv = CResult_NodeIdDecodeErrorZ_ok(o_conv);
@@ -15298,12 +16608,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ
        LDKDecodeError e_conv;
        e_conv.inner = (void*)(e & (~1));
        e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
        e_conv = DecodeError_clone(&e_conv);
        LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ");
        *ret_conv = CResult_NodeIdDecodeErrorZ_err(e_conv);
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_NodeIdDecodeErrorZ* o_conv = (LDKCResult_NodeIdDecodeErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_NodeIdDecodeErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -15313,6 +16630,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1f
        CResult_NodeIdDecodeErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_NodeIdDecodeErrorZ_clone_ptr(LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR arg) {
+       LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ");
+       *ret_conv = CResult_NodeIdDecodeErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_NodeIdDecodeErrorZ* arg_conv = (LDKCResult_NodeIdDecodeErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_NodeIdDecodeErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_NodeIdDecodeErrorZ* orig_conv = (LDKCResult_NodeIdDecodeErrorZ*)(orig & ~1);
        LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ");
@@ -15320,6 +16648,60 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       void* o_ptr = (void*)(((uint64_t)o) & ~1);
+       CHECK_ACCESS(o_ptr);
+       LDKCOption_NetworkUpdateZ o_conv = *(LDKCOption_NetworkUpdateZ*)(o_ptr);
+       o_conv = COption_NetworkUpdateZ_clone((LDKCOption_NetworkUpdateZ*)(((uint64_t)o) & ~1));
+       LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ");
+       *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_ok(o_conv);
+       return (uint64_t)ret_conv;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
+       LDKDecodeError e_conv;
+       e_conv.inner = (void*)(e & (~1));
+       e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
+       e_conv = DecodeError_clone(&e_conv);
+       LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ");
+       *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_err(e_conv);
+       return (uint64_t)ret_conv;
+}
+
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_COption_NetworkUpdateZDecodeErrorZ* o_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
+       if ((_res & 1) != 0) return;
+       void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+       CHECK_ACCESS(_res_ptr);
+       LDKCResult_COption_NetworkUpdateZDecodeErrorZ _res_conv = *(LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)(_res_ptr);
+       FREE((void*)_res);
+       CResult_COption_NetworkUpdateZDecodeErrorZ_free(_res_conv);
+}
+
+static inline uint64_t CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr(LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR arg) {
+       LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ");
+       *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_COption_NetworkUpdateZDecodeErrorZ* arg_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+       LDKCResult_COption_NetworkUpdateZDecodeErrorZ* orig_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)(orig & ~1);
+       LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ");
+       *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_clone(orig_conv);
+       return (uint64_t)ret_conv;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1AccessZ_1some(JNIEnv *env, jclass clz, int64_t o) {
        void* o_ptr = (void*)(((uint64_t)o) & ~1);
        CHECK_ACCESS(o_ptr);
@@ -15354,6 +16736,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DirectionalChannel
        LDKDirectionalChannelInfo o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = (o & 1) || (o == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        o_conv = DirectionalChannelInfo_clone(&o_conv);
        LDKCResult_DirectionalChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DirectionalChannelInfoDecodeErrorZ), "LDKCResult_DirectionalChannelInfoDecodeErrorZ");
        *ret_conv = CResult_DirectionalChannelInfoDecodeErrorZ_ok(o_conv);
@@ -15364,12 +16747,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DirectionalChannel
        LDKDecodeError e_conv;
        e_conv.inner = (void*)(e & (~1));
        e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
        e_conv = DecodeError_clone(&e_conv);
        LDKCResult_DirectionalChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DirectionalChannelInfoDecodeErrorZ), "LDKCResult_DirectionalChannelInfoDecodeErrorZ");
        *ret_conv = CResult_DirectionalChannelInfoDecodeErrorZ_err(e_conv);
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1DirectionalChannelInfoDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_DirectionalChannelInfoDecodeErrorZ* o_conv = (LDKCResult_DirectionalChannelInfoDecodeErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_DirectionalChannelInfoDecodeErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1DirectionalChannelInfoDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -15379,6 +16769,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1DirectionalChannelInf
        CResult_DirectionalChannelInfoDecodeErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_DirectionalChannelInfoDecodeErrorZ_clone_ptr(LDKCResult_DirectionalChannelInfoDecodeErrorZ *NONNULL_PTR arg) {
+       LDKCResult_DirectionalChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DirectionalChannelInfoDecodeErrorZ), "LDKCResult_DirectionalChannelInfoDecodeErrorZ");
+       *ret_conv = CResult_DirectionalChannelInfoDecodeErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DirectionalChannelInfoDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_DirectionalChannelInfoDecodeErrorZ* arg_conv = (LDKCResult_DirectionalChannelInfoDecodeErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_DirectionalChannelInfoDecodeErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DirectionalChannelInfoDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_DirectionalChannelInfoDecodeErrorZ* orig_conv = (LDKCResult_DirectionalChannelInfoDecodeErrorZ*)(orig & ~1);
        LDKCResult_DirectionalChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DirectionalChannelInfoDecodeErrorZ), "LDKCResult_DirectionalChannelInfoDecodeErrorZ");
@@ -15390,6 +16791,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeE
        LDKChannelInfo o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = (o & 1) || (o == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        o_conv = ChannelInfo_clone(&o_conv);
        LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ");
        *ret_conv = CResult_ChannelInfoDecodeErrorZ_ok(o_conv);
@@ -15400,12 +16802,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeE
        LDKDecodeError e_conv;
        e_conv.inner = (void*)(e & (~1));
        e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
        e_conv = DecodeError_clone(&e_conv);
        LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ");
        *ret_conv = CResult_ChannelInfoDecodeErrorZ_err(e_conv);
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_ChannelInfoDecodeErrorZ* o_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_ChannelInfoDecodeErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -15415,6 +16824,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErro
        CResult_ChannelInfoDecodeErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_ChannelInfoDecodeErrorZ_clone_ptr(LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR arg) {
+       LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ");
+       *ret_conv = CResult_ChannelInfoDecodeErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_ChannelInfoDecodeErrorZ* arg_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_ChannelInfoDecodeErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_ChannelInfoDecodeErrorZ* orig_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)(orig & ~1);
        LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ");
@@ -15426,6 +16846,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeE
        LDKRoutingFees o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = (o & 1) || (o == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        o_conv = RoutingFees_clone(&o_conv);
        LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ");
        *ret_conv = CResult_RoutingFeesDecodeErrorZ_ok(o_conv);
@@ -15436,12 +16857,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeE
        LDKDecodeError e_conv;
        e_conv.inner = (void*)(e & (~1));
        e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
        e_conv = DecodeError_clone(&e_conv);
        LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ");
        *ret_conv = CResult_RoutingFeesDecodeErrorZ_err(e_conv);
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_RoutingFeesDecodeErrorZ* o_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_RoutingFeesDecodeErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -15451,6 +16879,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErro
        CResult_RoutingFeesDecodeErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_RoutingFeesDecodeErrorZ_clone_ptr(LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR arg) {
+       LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ");
+       *ret_conv = CResult_RoutingFeesDecodeErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_RoutingFeesDecodeErrorZ* arg_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_RoutingFeesDecodeErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_RoutingFeesDecodeErrorZ* orig_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)(orig & ~1);
        LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ");
@@ -15462,6 +16901,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementIn
        LDKNodeAnnouncementInfo o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = (o & 1) || (o == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        o_conv = NodeAnnouncementInfo_clone(&o_conv);
        LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ");
        *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_ok(o_conv);
@@ -15472,12 +16912,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementIn
        LDKDecodeError e_conv;
        e_conv.inner = (void*)(e & (~1));
        e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
        e_conv = DecodeError_clone(&e_conv);
        LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ");
        *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_err(e_conv);
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_NodeAnnouncementInfoDecodeErrorZ* o_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -15487,6 +16934,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoD
        CResult_NodeAnnouncementInfoDecodeErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr(LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR arg) {
+       LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ");
+       *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_NodeAnnouncementInfoDecodeErrorZ* arg_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_NodeAnnouncementInfoDecodeErrorZ* orig_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(orig & ~1);
        LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ");
@@ -15514,6 +16972,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErro
        LDKNodeInfo o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = (o & 1) || (o == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        o_conv = NodeInfo_clone(&o_conv);
        LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ");
        *ret_conv = CResult_NodeInfoDecodeErrorZ_ok(o_conv);
@@ -15524,12 +16983,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErro
        LDKDecodeError e_conv;
        e_conv.inner = (void*)(e & (~1));
        e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
        e_conv = DecodeError_clone(&e_conv);
        LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ");
        *ret_conv = CResult_NodeInfoDecodeErrorZ_err(e_conv);
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_NodeInfoDecodeErrorZ* o_conv = (LDKCResult_NodeInfoDecodeErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_NodeInfoDecodeErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -15539,6 +17005,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_
        CResult_NodeInfoDecodeErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_NodeInfoDecodeErrorZ_clone_ptr(LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR arg) {
+       LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ");
+       *ret_conv = CResult_NodeInfoDecodeErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_NodeInfoDecodeErrorZ* arg_conv = (LDKCResult_NodeInfoDecodeErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_NodeInfoDecodeErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_NodeInfoDecodeErrorZ* orig_conv = (LDKCResult_NodeInfoDecodeErrorZ*)(orig & ~1);
        LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ");
@@ -15550,6 +17027,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecode
        LDKNetworkGraph o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = (o & 1) || (o == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        o_conv = NetworkGraph_clone(&o_conv);
        LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ");
        *ret_conv = CResult_NetworkGraphDecodeErrorZ_ok(o_conv);
@@ -15560,12 +17038,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecode
        LDKDecodeError e_conv;
        e_conv.inner = (void*)(e & (~1));
        e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
        e_conv = DecodeError_clone(&e_conv);
        LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ");
        *ret_conv = CResult_NetworkGraphDecodeErrorZ_err(e_conv);
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_NetworkGraphDecodeErrorZ* o_conv = (LDKCResult_NetworkGraphDecodeErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_NetworkGraphDecodeErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -15575,6 +17060,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErr
        CResult_NetworkGraphDecodeErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_NetworkGraphDecodeErrorZ_clone_ptr(LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR arg) {
+       LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ");
+       *ret_conv = CResult_NetworkGraphDecodeErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_NetworkGraphDecodeErrorZ* arg_conv = (LDKCResult_NetworkGraphDecodeErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_NetworkGraphDecodeErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_NetworkGraphDecodeErrorZ* orig_conv = (LDKCResult_NetworkGraphDecodeErrorZ*)(orig & ~1);
        LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ");
@@ -15621,6 +17117,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1NetAddressZZ_1f
        COption_CVec_NetAddressZZ_free(_res_conv);
 }
 
+static inline uint64_t COption_CVec_NetAddressZZ_clone_ptr(LDKCOption_CVec_NetAddressZZ *NONNULL_PTR arg) {
+       LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ");
+       *ret_copy = COption_CVec_NetAddressZZ_clone(arg);
+uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1NetAddressZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCOption_CVec_NetAddressZZ* arg_conv = (LDKCOption_CVec_NetAddressZZ*)arg;
+       int64_t ret_val = COption_CVec_NetAddressZZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1NetAddressZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCOption_CVec_NetAddressZZ* orig_conv = (LDKCOption_CVec_NetAddressZZ*)orig;
        LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ");
@@ -15643,12 +17151,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeEr
        LDKDecodeError e_conv;
        e_conv.inner = (void*)(e & (~1));
        e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
        e_conv = DecodeError_clone(&e_conv);
        LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ");
        *ret_conv = CResult_NetAddressDecodeErrorZ_err(e_conv);
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_NetAddressDecodeErrorZ* o_conv = (LDKCResult_NetAddressDecodeErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_NetAddressDecodeErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -15658,6 +17173,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeError
        CResult_NetAddressDecodeErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_NetAddressDecodeErrorZ_clone_ptr(LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR arg) {
+       LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ");
+       *ret_conv = CResult_NetAddressDecodeErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_NetAddressDecodeErrorZ* arg_conv = (LDKCResult_NetAddressDecodeErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_NetAddressDecodeErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_NetAddressDecodeErrorZ* orig_conv = (LDKCResult_NetAddressDecodeErrorZ*)(orig & ~1);
        LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ");
@@ -15678,6 +17204,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateAddHTLCZ_1free(JNI
                LDKUpdateAddHTLC _res_conv_15_conv;
                _res_conv_15_conv.inner = (void*)(_res_conv_15 & (~1));
                _res_conv_15_conv.is_owned = (_res_conv_15 & 1) || (_res_conv_15 == 0);
+               CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_15_conv);
                _res_constr.data[p] = _res_conv_15_conv;
        }
        (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
@@ -15697,6 +17224,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateFulfillHTLCZ_1free
                LDKUpdateFulfillHTLC _res_conv_19_conv;
                _res_conv_19_conv.inner = (void*)(_res_conv_19 & (~1));
                _res_conv_19_conv.is_owned = (_res_conv_19 & 1) || (_res_conv_19 == 0);
+               CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_19_conv);
                _res_constr.data[t] = _res_conv_19_conv;
        }
        (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
@@ -15716,6 +17244,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateFailHTLCZ_1free(JN
                LDKUpdateFailHTLC _res_conv_16_conv;
                _res_conv_16_conv.inner = (void*)(_res_conv_16 & (~1));
                _res_conv_16_conv.is_owned = (_res_conv_16 & 1) || (_res_conv_16 == 0);
+               CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_16_conv);
                _res_constr.data[q] = _res_conv_16_conv;
        }
        (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
@@ -15735,6 +17264,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateFailMalformedHTLCZ
                LDKUpdateFailMalformedHTLC _res_conv_25_conv;
                _res_conv_25_conv.inner = (void*)(_res_conv_25 & (~1));
                _res_conv_25_conv.is_owned = (_res_conv_25 & 1) || (_res_conv_25 == 0);
+               CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_25_conv);
                _res_constr.data[z] = _res_conv_25_conv;
        }
        (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
@@ -15745,6 +17275,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AcceptChannelDecod
        LDKAcceptChannel o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = (o & 1) || (o == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        o_conv = AcceptChannel_clone(&o_conv);
        LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ");
        *ret_conv = CResult_AcceptChannelDecodeErrorZ_ok(o_conv);
@@ -15755,12 +17286,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AcceptChannelDecod
        LDKDecodeError e_conv;
        e_conv.inner = (void*)(e & (~1));
        e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
        e_conv = DecodeError_clone(&e_conv);
        LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ");
        *ret_conv = CResult_AcceptChannelDecodeErrorZ_err(e_conv);
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1AcceptChannelDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_AcceptChannelDecodeErrorZ* o_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_AcceptChannelDecodeErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1AcceptChannelDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -15770,6 +17308,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1AcceptChannelDecodeEr
        CResult_AcceptChannelDecodeErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_AcceptChannelDecodeErrorZ_clone_ptr(LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR arg) {
+       LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ");
+       *ret_conv = CResult_AcceptChannelDecodeErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AcceptChannelDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_AcceptChannelDecodeErrorZ* arg_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_AcceptChannelDecodeErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AcceptChannelDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_AcceptChannelDecodeErrorZ* orig_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)(orig & ~1);
        LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ");
@@ -15781,6 +17330,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AnnouncementSignat
        LDKAnnouncementSignatures o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = (o & 1) || (o == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        o_conv = AnnouncementSignatures_clone(&o_conv);
        LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ");
        *ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_ok(o_conv);
@@ -15791,12 +17341,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AnnouncementSignat
        LDKDecodeError e_conv;
        e_conv.inner = (void*)(e & (~1));
        e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
        e_conv = DecodeError_clone(&e_conv);
        LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ");
        *ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_err(e_conv);
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1AnnouncementSignaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_AnnouncementSignaturesDecodeErrorZ* o_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_AnnouncementSignaturesDecodeErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1AnnouncementSignaturesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -15806,6 +17363,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1AnnouncementSignature
        CResult_AnnouncementSignaturesDecodeErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_AnnouncementSignaturesDecodeErrorZ_clone_ptr(LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR arg) {
+       LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ");
+       *ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AnnouncementSignaturesDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_AnnouncementSignaturesDecodeErrorZ* arg_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_AnnouncementSignaturesDecodeErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AnnouncementSignaturesDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_AnnouncementSignaturesDecodeErrorZ* orig_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)(orig & ~1);
        LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ");
@@ -15817,6 +17385,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReestablish
        LDKChannelReestablish o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = (o & 1) || (o == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        o_conv = ChannelReestablish_clone(&o_conv);
        LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ");
        *ret_conv = CResult_ChannelReestablishDecodeErrorZ_ok(o_conv);
@@ -15827,12 +17396,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReestablish
        LDKDecodeError e_conv;
        e_conv.inner = (void*)(e & (~1));
        e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
        e_conv = DecodeError_clone(&e_conv);
        LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ");
        *ret_conv = CResult_ChannelReestablishDecodeErrorZ_err(e_conv);
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReestablishDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_ChannelReestablishDecodeErrorZ* o_conv = (LDKCResult_ChannelReestablishDecodeErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_ChannelReestablishDecodeErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReestablishDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -15842,6 +17418,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReestablishDec
        CResult_ChannelReestablishDecodeErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_ChannelReestablishDecodeErrorZ_clone_ptr(LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR arg) {
+       LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ");
+       *ret_conv = CResult_ChannelReestablishDecodeErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReestablishDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_ChannelReestablishDecodeErrorZ* arg_conv = (LDKCResult_ChannelReestablishDecodeErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_ChannelReestablishDecodeErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReestablishDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_ChannelReestablishDecodeErrorZ* orig_conv = (LDKCResult_ChannelReestablishDecodeErrorZ*)(orig & ~1);
        LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ");
@@ -15853,6 +17440,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedDecod
        LDKClosingSigned o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = (o & 1) || (o == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        o_conv = ClosingSigned_clone(&o_conv);
        LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ");
        *ret_conv = CResult_ClosingSignedDecodeErrorZ_ok(o_conv);
@@ -15863,12 +17451,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedDecod
        LDKDecodeError e_conv;
        e_conv.inner = (void*)(e & (~1));
        e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
        e_conv = DecodeError_clone(&e_conv);
        LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ");
        *ret_conv = CResult_ClosingSignedDecodeErrorZ_err(e_conv);
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_ClosingSignedDecodeErrorZ* o_conv = (LDKCResult_ClosingSignedDecodeErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_ClosingSignedDecodeErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -15878,6 +17473,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedDecodeEr
        CResult_ClosingSignedDecodeErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_ClosingSignedDecodeErrorZ_clone_ptr(LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR arg) {
+       LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ");
+       *ret_conv = CResult_ClosingSignedDecodeErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_ClosingSignedDecodeErrorZ* arg_conv = (LDKCResult_ClosingSignedDecodeErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_ClosingSignedDecodeErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_ClosingSignedDecodeErrorZ* orig_conv = (LDKCResult_ClosingSignedDecodeErrorZ*)(orig & ~1);
        LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ");
@@ -15889,6 +17495,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedFeeRa
        LDKClosingSignedFeeRange o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = (o & 1) || (o == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        o_conv = ClosingSignedFeeRange_clone(&o_conv);
        LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ");
        *ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_ok(o_conv);
@@ -15899,12 +17506,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedFeeRa
        LDKDecodeError e_conv;
        e_conv.inner = (void*)(e & (~1));
        e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
        e_conv = DecodeError_clone(&e_conv);
        LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ");
        *ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_err(e_conv);
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedFeeRangeDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* o_conv = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_ClosingSignedFeeRangeDecodeErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedFeeRangeDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -15914,6 +17528,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedFeeRange
        CResult_ClosingSignedFeeRangeDecodeErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_ClosingSignedFeeRangeDecodeErrorZ_clone_ptr(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR arg) {
+       LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ");
+       *ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedFeeRangeDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* arg_conv = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_ClosingSignedFeeRangeDecodeErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedFeeRangeDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* orig_conv = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)(orig & ~1);
        LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ");
@@ -15925,6 +17550,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedDe
        LDKCommitmentSigned o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = (o & 1) || (o == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        o_conv = CommitmentSigned_clone(&o_conv);
        LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ");
        *ret_conv = CResult_CommitmentSignedDecodeErrorZ_ok(o_conv);
@@ -15935,12 +17561,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedDe
        LDKDecodeError e_conv;
        e_conv.inner = (void*)(e & (~1));
        e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
        e_conv = DecodeError_clone(&e_conv);
        LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ");
        *ret_conv = CResult_CommitmentSignedDecodeErrorZ_err(e_conv);
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_CommitmentSignedDecodeErrorZ* o_conv = (LDKCResult_CommitmentSignedDecodeErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_CommitmentSignedDecodeErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -15950,6 +17583,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedDecod
        CResult_CommitmentSignedDecodeErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_CommitmentSignedDecodeErrorZ_clone_ptr(LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR arg) {
+       LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ");
+       *ret_conv = CResult_CommitmentSignedDecodeErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_CommitmentSignedDecodeErrorZ* arg_conv = (LDKCResult_CommitmentSignedDecodeErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_CommitmentSignedDecodeErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_CommitmentSignedDecodeErrorZ* orig_conv = (LDKCResult_CommitmentSignedDecodeErrorZ*)(orig & ~1);
        LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ");
@@ -15961,6 +17605,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingCreatedDeco
        LDKFundingCreated o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = (o & 1) || (o == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        o_conv = FundingCreated_clone(&o_conv);
        LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ");
        *ret_conv = CResult_FundingCreatedDecodeErrorZ_ok(o_conv);
@@ -15971,12 +17616,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingCreatedDeco
        LDKDecodeError e_conv;
        e_conv.inner = (void*)(e & (~1));
        e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
        e_conv = DecodeError_clone(&e_conv);
        LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ");
        *ret_conv = CResult_FundingCreatedDecodeErrorZ_err(e_conv);
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1FundingCreatedDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_FundingCreatedDecodeErrorZ* o_conv = (LDKCResult_FundingCreatedDecodeErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_FundingCreatedDecodeErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1FundingCreatedDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -15986,6 +17638,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1FundingCreatedDecodeE
        CResult_FundingCreatedDecodeErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_FundingCreatedDecodeErrorZ_clone_ptr(LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR arg) {
+       LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ");
+       *ret_conv = CResult_FundingCreatedDecodeErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingCreatedDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_FundingCreatedDecodeErrorZ* arg_conv = (LDKCResult_FundingCreatedDecodeErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_FundingCreatedDecodeErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingCreatedDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_FundingCreatedDecodeErrorZ* orig_conv = (LDKCResult_FundingCreatedDecodeErrorZ*)(orig & ~1);
        LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ");
@@ -15997,6 +17660,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingSignedDecod
        LDKFundingSigned o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = (o & 1) || (o == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        o_conv = FundingSigned_clone(&o_conv);
        LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ");
        *ret_conv = CResult_FundingSignedDecodeErrorZ_ok(o_conv);
@@ -16007,12 +17671,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingSignedDecod
        LDKDecodeError e_conv;
        e_conv.inner = (void*)(e & (~1));
        e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
        e_conv = DecodeError_clone(&e_conv);
        LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ");
        *ret_conv = CResult_FundingSignedDecodeErrorZ_err(e_conv);
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1FundingSignedDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_FundingSignedDecodeErrorZ* o_conv = (LDKCResult_FundingSignedDecodeErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_FundingSignedDecodeErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1FundingSignedDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -16022,6 +17693,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1FundingSignedDecodeEr
        CResult_FundingSignedDecodeErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_FundingSignedDecodeErrorZ_clone_ptr(LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR arg) {
+       LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ");
+       *ret_conv = CResult_FundingSignedDecodeErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingSignedDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_FundingSignedDecodeErrorZ* arg_conv = (LDKCResult_FundingSignedDecodeErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_FundingSignedDecodeErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingSignedDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_FundingSignedDecodeErrorZ* orig_conv = (LDKCResult_FundingSignedDecodeErrorZ*)(orig & ~1);
        LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ");
@@ -16033,6 +17715,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingLockedDecod
        LDKFundingLocked o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = (o & 1) || (o == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        o_conv = FundingLocked_clone(&o_conv);
        LDKCResult_FundingLockedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingLockedDecodeErrorZ), "LDKCResult_FundingLockedDecodeErrorZ");
        *ret_conv = CResult_FundingLockedDecodeErrorZ_ok(o_conv);
@@ -16043,12 +17726,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingLockedDecod
        LDKDecodeError e_conv;
        e_conv.inner = (void*)(e & (~1));
        e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
        e_conv = DecodeError_clone(&e_conv);
        LDKCResult_FundingLockedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingLockedDecodeErrorZ), "LDKCResult_FundingLockedDecodeErrorZ");
        *ret_conv = CResult_FundingLockedDecodeErrorZ_err(e_conv);
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1FundingLockedDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_FundingLockedDecodeErrorZ* o_conv = (LDKCResult_FundingLockedDecodeErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_FundingLockedDecodeErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1FundingLockedDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -16058,6 +17748,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1FundingLockedDecodeEr
        CResult_FundingLockedDecodeErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_FundingLockedDecodeErrorZ_clone_ptr(LDKCResult_FundingLockedDecodeErrorZ *NONNULL_PTR arg) {
+       LDKCResult_FundingLockedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingLockedDecodeErrorZ), "LDKCResult_FundingLockedDecodeErrorZ");
+       *ret_conv = CResult_FundingLockedDecodeErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingLockedDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_FundingLockedDecodeErrorZ* arg_conv = (LDKCResult_FundingLockedDecodeErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_FundingLockedDecodeErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingLockedDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_FundingLockedDecodeErrorZ* orig_conv = (LDKCResult_FundingLockedDecodeErrorZ*)(orig & ~1);
        LDKCResult_FundingLockedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingLockedDecodeErrorZ), "LDKCResult_FundingLockedDecodeErrorZ");
@@ -16069,6 +17770,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitDecodeErrorZ_1
        LDKInit o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = (o & 1) || (o == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        o_conv = Init_clone(&o_conv);
        LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ");
        *ret_conv = CResult_InitDecodeErrorZ_ok(o_conv);
@@ -16079,12 +17781,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitDecodeErrorZ_1
        LDKDecodeError e_conv;
        e_conv.inner = (void*)(e & (~1));
        e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
        e_conv = DecodeError_clone(&e_conv);
        LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ");
        *ret_conv = CResult_InitDecodeErrorZ_err(e_conv);
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InitDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_InitDecodeErrorZ* o_conv = (LDKCResult_InitDecodeErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_InitDecodeErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InitDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -16094,6 +17803,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InitDecodeErrorZ_1fre
        CResult_InitDecodeErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_InitDecodeErrorZ_clone_ptr(LDKCResult_InitDecodeErrorZ *NONNULL_PTR arg) {
+       LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ");
+       *ret_conv = CResult_InitDecodeErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_InitDecodeErrorZ* arg_conv = (LDKCResult_InitDecodeErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_InitDecodeErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_InitDecodeErrorZ* orig_conv = (LDKCResult_InitDecodeErrorZ*)(orig & ~1);
        LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ");
@@ -16105,6 +17825,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OpenChannelDecodeE
        LDKOpenChannel o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = (o & 1) || (o == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        o_conv = OpenChannel_clone(&o_conv);
        LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ");
        *ret_conv = CResult_OpenChannelDecodeErrorZ_ok(o_conv);
@@ -16115,12 +17836,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OpenChannelDecodeE
        LDKDecodeError e_conv;
        e_conv.inner = (void*)(e & (~1));
        e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
        e_conv = DecodeError_clone(&e_conv);
        LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ");
        *ret_conv = CResult_OpenChannelDecodeErrorZ_err(e_conv);
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1OpenChannelDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_OpenChannelDecodeErrorZ* o_conv = (LDKCResult_OpenChannelDecodeErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_OpenChannelDecodeErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1OpenChannelDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -16130,6 +17858,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1OpenChannelDecodeErro
        CResult_OpenChannelDecodeErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_OpenChannelDecodeErrorZ_clone_ptr(LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR arg) {
+       LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ");
+       *ret_conv = CResult_OpenChannelDecodeErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OpenChannelDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_OpenChannelDecodeErrorZ* arg_conv = (LDKCResult_OpenChannelDecodeErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_OpenChannelDecodeErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OpenChannelDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_OpenChannelDecodeErrorZ* orig_conv = (LDKCResult_OpenChannelDecodeErrorZ*)(orig & ~1);
        LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ");
@@ -16141,6 +17880,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RevokeAndACKDecode
        LDKRevokeAndACK o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = (o & 1) || (o == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        o_conv = RevokeAndACK_clone(&o_conv);
        LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ");
        *ret_conv = CResult_RevokeAndACKDecodeErrorZ_ok(o_conv);
@@ -16151,12 +17891,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RevokeAndACKDecode
        LDKDecodeError e_conv;
        e_conv.inner = (void*)(e & (~1));
        e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
        e_conv = DecodeError_clone(&e_conv);
        LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ");
        *ret_conv = CResult_RevokeAndACKDecodeErrorZ_err(e_conv);
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RevokeAndACKDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_RevokeAndACKDecodeErrorZ* o_conv = (LDKCResult_RevokeAndACKDecodeErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_RevokeAndACKDecodeErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RevokeAndACKDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -16166,6 +17913,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RevokeAndACKDecodeErr
        CResult_RevokeAndACKDecodeErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_RevokeAndACKDecodeErrorZ_clone_ptr(LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR arg) {
+       LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ");
+       *ret_conv = CResult_RevokeAndACKDecodeErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RevokeAndACKDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_RevokeAndACKDecodeErrorZ* arg_conv = (LDKCResult_RevokeAndACKDecodeErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_RevokeAndACKDecodeErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RevokeAndACKDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_RevokeAndACKDecodeErrorZ* orig_conv = (LDKCResult_RevokeAndACKDecodeErrorZ*)(orig & ~1);
        LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ");
@@ -16177,6 +17935,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownDecodeErro
        LDKShutdown o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = (o & 1) || (o == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        o_conv = Shutdown_clone(&o_conv);
        LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ");
        *ret_conv = CResult_ShutdownDecodeErrorZ_ok(o_conv);
@@ -16187,12 +17946,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownDecodeErro
        LDKDecodeError e_conv;
        e_conv.inner = (void*)(e & (~1));
        e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
        e_conv = DecodeError_clone(&e_conv);
        LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ");
        *ret_conv = CResult_ShutdownDecodeErrorZ_err(e_conv);
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_ShutdownDecodeErrorZ* o_conv = (LDKCResult_ShutdownDecodeErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_ShutdownDecodeErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -16202,6 +17968,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownDecodeErrorZ_
        CResult_ShutdownDecodeErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_ShutdownDecodeErrorZ_clone_ptr(LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR arg) {
+       LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ");
+       *ret_conv = CResult_ShutdownDecodeErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_ShutdownDecodeErrorZ* arg_conv = (LDKCResult_ShutdownDecodeErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_ShutdownDecodeErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_ShutdownDecodeErrorZ* orig_conv = (LDKCResult_ShutdownDecodeErrorZ*)(orig & ~1);
        LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ");
@@ -16213,6 +17990,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailHTLCDeco
        LDKUpdateFailHTLC o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = (o & 1) || (o == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        o_conv = UpdateFailHTLC_clone(&o_conv);
        LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ");
        *ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_ok(o_conv);
@@ -16223,12 +18001,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailHTLCDeco
        LDKDecodeError e_conv;
        e_conv.inner = (void*)(e & (~1));
        e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
        e_conv = DecodeError_clone(&e_conv);
        LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ");
        *ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_err(e_conv);
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailHTLCDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_UpdateFailHTLCDecodeErrorZ* o_conv = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_UpdateFailHTLCDecodeErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailHTLCDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -16238,6 +18023,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailHTLCDecodeE
        CResult_UpdateFailHTLCDecodeErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_UpdateFailHTLCDecodeErrorZ_clone_ptr(LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR arg) {
+       LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ");
+       *ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailHTLCDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_UpdateFailHTLCDecodeErrorZ* arg_conv = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_UpdateFailHTLCDecodeErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailHTLCDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_UpdateFailHTLCDecodeErrorZ* orig_conv = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)(orig & ~1);
        LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ");
@@ -16249,6 +18045,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailMalforme
        LDKUpdateFailMalformedHTLC o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = (o & 1) || (o == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        o_conv = UpdateFailMalformedHTLC_clone(&o_conv);
        LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ");
        *ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(o_conv);
@@ -16259,12 +18056,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailMalforme
        LDKDecodeError e_conv;
        e_conv.inner = (void*)(e & (~1));
        e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
        e_conv = DecodeError_clone(&e_conv);
        LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ");
        *ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(e_conv);
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailMalformedHTLCDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* o_conv = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_UpdateFailMalformedHTLCDecodeErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailMalformedHTLCDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -16274,6 +18078,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailMalformedHT
        CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone_ptr(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR arg) {
+       LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ");
+       *ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailMalformedHTLCDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* arg_conv = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailMalformedHTLCDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* orig_conv = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)(orig & ~1);
        LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ");
@@ -16285,6 +18100,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFeeDecodeErr
        LDKUpdateFee o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = (o & 1) || (o == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        o_conv = UpdateFee_clone(&o_conv);
        LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ");
        *ret_conv = CResult_UpdateFeeDecodeErrorZ_ok(o_conv);
@@ -16295,12 +18111,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFeeDecodeErr
        LDKDecodeError e_conv;
        e_conv.inner = (void*)(e & (~1));
        e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
        e_conv = DecodeError_clone(&e_conv);
        LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ");
        *ret_conv = CResult_UpdateFeeDecodeErrorZ_err(e_conv);
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFeeDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_UpdateFeeDecodeErrorZ* o_conv = (LDKCResult_UpdateFeeDecodeErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_UpdateFeeDecodeErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFeeDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -16310,6 +18133,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFeeDecodeErrorZ
        CResult_UpdateFeeDecodeErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_UpdateFeeDecodeErrorZ_clone_ptr(LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR arg) {
+       LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ");
+       *ret_conv = CResult_UpdateFeeDecodeErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFeeDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_UpdateFeeDecodeErrorZ* arg_conv = (LDKCResult_UpdateFeeDecodeErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_UpdateFeeDecodeErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFeeDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_UpdateFeeDecodeErrorZ* orig_conv = (LDKCResult_UpdateFeeDecodeErrorZ*)(orig & ~1);
        LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ");
@@ -16321,6 +18155,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFulfillHTLCD
        LDKUpdateFulfillHTLC o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = (o & 1) || (o == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        o_conv = UpdateFulfillHTLC_clone(&o_conv);
        LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ");
        *ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_ok(o_conv);
@@ -16331,12 +18166,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFulfillHTLCD
        LDKDecodeError e_conv;
        e_conv.inner = (void*)(e & (~1));
        e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
        e_conv = DecodeError_clone(&e_conv);
        LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ");
        *ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_err(e_conv);
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFulfillHTLCDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_UpdateFulfillHTLCDecodeErrorZ* o_conv = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_UpdateFulfillHTLCDecodeErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFulfillHTLCDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -16346,6 +18188,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFulfillHTLCDeco
        CResult_UpdateFulfillHTLCDecodeErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_UpdateFulfillHTLCDecodeErrorZ_clone_ptr(LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR arg) {
+       LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ");
+       *ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFulfillHTLCDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_UpdateFulfillHTLCDecodeErrorZ* arg_conv = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_UpdateFulfillHTLCDecodeErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFulfillHTLCDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_UpdateFulfillHTLCDecodeErrorZ* orig_conv = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)(orig & ~1);
        LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ");
@@ -16357,6 +18210,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateAddHTLCDecod
        LDKUpdateAddHTLC o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = (o & 1) || (o == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        o_conv = UpdateAddHTLC_clone(&o_conv);
        LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ");
        *ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_ok(o_conv);
@@ -16367,12 +18221,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateAddHTLCDecod
        LDKDecodeError e_conv;
        e_conv.inner = (void*)(e & (~1));
        e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
        e_conv = DecodeError_clone(&e_conv);
        LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ");
        *ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_err(e_conv);
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateAddHTLCDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_UpdateAddHTLCDecodeErrorZ* o_conv = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_UpdateAddHTLCDecodeErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateAddHTLCDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -16382,6 +18243,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateAddHTLCDecodeEr
        CResult_UpdateAddHTLCDecodeErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_UpdateAddHTLCDecodeErrorZ_clone_ptr(LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR arg) {
+       LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ");
+       *ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateAddHTLCDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_UpdateAddHTLCDecodeErrorZ* arg_conv = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_UpdateAddHTLCDecodeErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateAddHTLCDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_UpdateAddHTLCDecodeErrorZ* orig_conv = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)(orig & ~1);
        LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ");
@@ -16393,6 +18265,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PingDecodeErrorZ_1
        LDKPing o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = (o & 1) || (o == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        o_conv = Ping_clone(&o_conv);
        LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ");
        *ret_conv = CResult_PingDecodeErrorZ_ok(o_conv);
@@ -16403,12 +18276,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PingDecodeErrorZ_1
        LDKDecodeError e_conv;
        e_conv.inner = (void*)(e & (~1));
        e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
        e_conv = DecodeError_clone(&e_conv);
        LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ");
        *ret_conv = CResult_PingDecodeErrorZ_err(e_conv);
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PingDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_PingDecodeErrorZ* o_conv = (LDKCResult_PingDecodeErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_PingDecodeErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PingDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -16418,6 +18298,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PingDecodeErrorZ_1fre
        CResult_PingDecodeErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_PingDecodeErrorZ_clone_ptr(LDKCResult_PingDecodeErrorZ *NONNULL_PTR arg) {
+       LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ");
+       *ret_conv = CResult_PingDecodeErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PingDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_PingDecodeErrorZ* arg_conv = (LDKCResult_PingDecodeErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_PingDecodeErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PingDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_PingDecodeErrorZ* orig_conv = (LDKCResult_PingDecodeErrorZ*)(orig & ~1);
        LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ");
@@ -16429,6 +18320,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PongDecodeErrorZ_1
        LDKPong o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = (o & 1) || (o == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        o_conv = Pong_clone(&o_conv);
        LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ");
        *ret_conv = CResult_PongDecodeErrorZ_ok(o_conv);
@@ -16439,12 +18331,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PongDecodeErrorZ_1
        LDKDecodeError e_conv;
        e_conv.inner = (void*)(e & (~1));
        e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
        e_conv = DecodeError_clone(&e_conv);
        LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ");
        *ret_conv = CResult_PongDecodeErrorZ_err(e_conv);
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PongDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_PongDecodeErrorZ* o_conv = (LDKCResult_PongDecodeErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_PongDecodeErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PongDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -16454,6 +18353,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PongDecodeErrorZ_1fre
        CResult_PongDecodeErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_PongDecodeErrorZ_clone_ptr(LDKCResult_PongDecodeErrorZ *NONNULL_PTR arg) {
+       LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ");
+       *ret_conv = CResult_PongDecodeErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PongDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_PongDecodeErrorZ* arg_conv = (LDKCResult_PongDecodeErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_PongDecodeErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PongDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_PongDecodeErrorZ* orig_conv = (LDKCResult_PongDecodeErrorZ*)(orig & ~1);
        LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ");
@@ -16465,6 +18375,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelAnn
        LDKUnsignedChannelAnnouncement o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = (o & 1) || (o == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        o_conv = UnsignedChannelAnnouncement_clone(&o_conv);
        LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ");
        *ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(o_conv);
@@ -16475,12 +18386,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelAnn
        LDKDecodeError e_conv;
        e_conv.inner = (void*)(e & (~1));
        e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
        e_conv = DecodeError_clone(&e_conv);
        LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ");
        *ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(e_conv);
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelAnnouncementDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* o_conv = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_UnsignedChannelAnnouncementDecodeErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelAnnouncementDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -16490,6 +18408,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelAnnoun
        CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR arg) {
+       LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ");
+       *ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelAnnouncementDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* arg_conv = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelAnnouncementDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* orig_conv = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)(orig & ~1);
        LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ");
@@ -16501,6 +18430,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelAnnouncemen
        LDKChannelAnnouncement o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = (o & 1) || (o == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        o_conv = ChannelAnnouncement_clone(&o_conv);
        LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ");
        *ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_ok(o_conv);
@@ -16511,12 +18441,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelAnnouncemen
        LDKDecodeError e_conv;
        e_conv.inner = (void*)(e & (~1));
        e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
        e_conv = DecodeError_clone(&e_conv);
        LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ");
        *ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_err(e_conv);
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelAnnouncementDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_ChannelAnnouncementDecodeErrorZ* o_conv = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_ChannelAnnouncementDecodeErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelAnnouncementDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -16526,6 +18463,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelAnnouncementDe
        CResult_ChannelAnnouncementDecodeErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_ChannelAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR arg) {
+       LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ");
+       *ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelAnnouncementDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_ChannelAnnouncementDecodeErrorZ* arg_conv = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_ChannelAnnouncementDecodeErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelAnnouncementDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_ChannelAnnouncementDecodeErrorZ* orig_conv = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)(orig & ~1);
        LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ");
@@ -16537,6 +18485,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelUpd
        LDKUnsignedChannelUpdate o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = (o & 1) || (o == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        o_conv = UnsignedChannelUpdate_clone(&o_conv);
        LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ");
        *ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_ok(o_conv);
@@ -16547,12 +18496,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelUpd
        LDKDecodeError e_conv;
        e_conv.inner = (void*)(e & (~1));
        e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
        e_conv = DecodeError_clone(&e_conv);
        LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ");
        *ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_err(e_conv);
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelUpdateDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_UnsignedChannelUpdateDecodeErrorZ* o_conv = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_UnsignedChannelUpdateDecodeErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelUpdateDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -16562,6 +18518,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelUpdate
        CResult_UnsignedChannelUpdateDecodeErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_UnsignedChannelUpdateDecodeErrorZ_clone_ptr(LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR arg) {
+       LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ");
+       *ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelUpdateDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_UnsignedChannelUpdateDecodeErrorZ* arg_conv = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_UnsignedChannelUpdateDecodeErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelUpdateDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_UnsignedChannelUpdateDecodeErrorZ* orig_conv = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)(orig & ~1);
        LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ");
@@ -16573,6 +18540,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateDecod
        LDKChannelUpdate o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = (o & 1) || (o == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        o_conv = ChannelUpdate_clone(&o_conv);
        LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ");
        *ret_conv = CResult_ChannelUpdateDecodeErrorZ_ok(o_conv);
@@ -16583,12 +18551,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateDecod
        LDKDecodeError e_conv;
        e_conv.inner = (void*)(e & (~1));
        e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
        e_conv = DecodeError_clone(&e_conv);
        LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ");
        *ret_conv = CResult_ChannelUpdateDecodeErrorZ_err(e_conv);
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_ChannelUpdateDecodeErrorZ* o_conv = (LDKCResult_ChannelUpdateDecodeErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_ChannelUpdateDecodeErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -16598,6 +18573,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateDecodeEr
        CResult_ChannelUpdateDecodeErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_ChannelUpdateDecodeErrorZ_clone_ptr(LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR arg) {
+       LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ");
+       *ret_conv = CResult_ChannelUpdateDecodeErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_ChannelUpdateDecodeErrorZ* arg_conv = (LDKCResult_ChannelUpdateDecodeErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_ChannelUpdateDecodeErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_ChannelUpdateDecodeErrorZ* orig_conv = (LDKCResult_ChannelUpdateDecodeErrorZ*)(orig & ~1);
        LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ");
@@ -16609,6 +18595,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ErrorMessageDecode
        LDKErrorMessage o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = (o & 1) || (o == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        o_conv = ErrorMessage_clone(&o_conv);
        LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ");
        *ret_conv = CResult_ErrorMessageDecodeErrorZ_ok(o_conv);
@@ -16619,12 +18606,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ErrorMessageDecode
        LDKDecodeError e_conv;
        e_conv.inner = (void*)(e & (~1));
        e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
        e_conv = DecodeError_clone(&e_conv);
        LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ");
        *ret_conv = CResult_ErrorMessageDecodeErrorZ_err(e_conv);
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ErrorMessageDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_ErrorMessageDecodeErrorZ* o_conv = (LDKCResult_ErrorMessageDecodeErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_ErrorMessageDecodeErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ErrorMessageDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -16634,6 +18628,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ErrorMessageDecodeErr
        CResult_ErrorMessageDecodeErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_ErrorMessageDecodeErrorZ_clone_ptr(LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR arg) {
+       LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ");
+       *ret_conv = CResult_ErrorMessageDecodeErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ErrorMessageDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_ErrorMessageDecodeErrorZ* arg_conv = (LDKCResult_ErrorMessageDecodeErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_ErrorMessageDecodeErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ErrorMessageDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_ErrorMessageDecodeErrorZ* orig_conv = (LDKCResult_ErrorMessageDecodeErrorZ*)(orig & ~1);
        LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ");
@@ -16645,6 +18650,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedNodeAnnoun
        LDKUnsignedNodeAnnouncement o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = (o & 1) || (o == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        o_conv = UnsignedNodeAnnouncement_clone(&o_conv);
        LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ");
        *ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(o_conv);
@@ -16655,12 +18661,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedNodeAnnoun
        LDKDecodeError e_conv;
        e_conv.inner = (void*)(e & (~1));
        e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
        e_conv = DecodeError_clone(&e_conv);
        LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ");
        *ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(e_conv);
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedNodeAnnouncementDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* o_conv = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_UnsignedNodeAnnouncementDecodeErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedNodeAnnouncementDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -16670,6 +18683,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedNodeAnnouncem
        CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR arg) {
+       LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ");
+       *ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedNodeAnnouncementDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* arg_conv = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedNodeAnnouncementDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* orig_conv = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)(orig & ~1);
        LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ");
@@ -16681,6 +18705,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementDe
        LDKNodeAnnouncement o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = (o & 1) || (o == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        o_conv = NodeAnnouncement_clone(&o_conv);
        LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ");
        *ret_conv = CResult_NodeAnnouncementDecodeErrorZ_ok(o_conv);
@@ -16691,12 +18716,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementDe
        LDKDecodeError e_conv;
        e_conv.inner = (void*)(e & (~1));
        e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
        e_conv = DecodeError_clone(&e_conv);
        LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ");
        *ret_conv = CResult_NodeAnnouncementDecodeErrorZ_err(e_conv);
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_NodeAnnouncementDecodeErrorZ* o_conv = (LDKCResult_NodeAnnouncementDecodeErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_NodeAnnouncementDecodeErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -16706,6 +18738,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementDecod
        CResult_NodeAnnouncementDecodeErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_NodeAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR arg) {
+       LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ");
+       *ret_conv = CResult_NodeAnnouncementDecodeErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_NodeAnnouncementDecodeErrorZ* arg_conv = (LDKCResult_NodeAnnouncementDecodeErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_NodeAnnouncementDecodeErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_NodeAnnouncementDecodeErrorZ* orig_conv = (LDKCResult_NodeAnnouncementDecodeErrorZ*)(orig & ~1);
        LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ");
@@ -16717,6 +18760,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryShortChannelI
        LDKQueryShortChannelIds o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = (o & 1) || (o == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        o_conv = QueryShortChannelIds_clone(&o_conv);
        LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ");
        *ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_ok(o_conv);
@@ -16727,12 +18771,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryShortChannelI
        LDKDecodeError e_conv;
        e_conv.inner = (void*)(e & (~1));
        e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
        e_conv = DecodeError_clone(&e_conv);
        LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ");
        *ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_err(e_conv);
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1QueryShortChannelIdsDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_QueryShortChannelIdsDecodeErrorZ* o_conv = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_QueryShortChannelIdsDecodeErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1QueryShortChannelIdsDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -16742,6 +18793,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1QueryShortChannelIdsD
        CResult_QueryShortChannelIdsDecodeErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_QueryShortChannelIdsDecodeErrorZ_clone_ptr(LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR arg) {
+       LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ");
+       *ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryShortChannelIdsDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_QueryShortChannelIdsDecodeErrorZ* arg_conv = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_QueryShortChannelIdsDecodeErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryShortChannelIdsDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_QueryShortChannelIdsDecodeErrorZ* orig_conv = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)(orig & ~1);
        LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ");
@@ -16753,6 +18815,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyShortChannelI
        LDKReplyShortChannelIdsEnd o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = (o & 1) || (o == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        o_conv = ReplyShortChannelIdsEnd_clone(&o_conv);
        LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ");
        *ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(o_conv);
@@ -16763,12 +18826,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyShortChannelI
        LDKDecodeError e_conv;
        e_conv.inner = (void*)(e & (~1));
        e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
        e_conv = DecodeError_clone(&e_conv);
        LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ");
        *ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(e_conv);
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyShortChannelIdsEndDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* o_conv = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_ReplyShortChannelIdsEndDecodeErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyShortChannelIdsEndDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -16778,6 +18848,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyShortChannelIdsE
        CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone_ptr(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR arg) {
+       LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ");
+       *ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyShortChannelIdsEndDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* arg_conv = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyShortChannelIdsEndDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* orig_conv = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)(orig & ~1);
        LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ");
@@ -16789,6 +18870,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryChannelRangeD
        LDKQueryChannelRange o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = (o & 1) || (o == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        o_conv = QueryChannelRange_clone(&o_conv);
        LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ");
        *ret_conv = CResult_QueryChannelRangeDecodeErrorZ_ok(o_conv);
@@ -16799,12 +18881,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryChannelRangeD
        LDKDecodeError e_conv;
        e_conv.inner = (void*)(e & (~1));
        e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
        e_conv = DecodeError_clone(&e_conv);
        LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ");
        *ret_conv = CResult_QueryChannelRangeDecodeErrorZ_err(e_conv);
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1QueryChannelRangeDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_QueryChannelRangeDecodeErrorZ* o_conv = (LDKCResult_QueryChannelRangeDecodeErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_QueryChannelRangeDecodeErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1QueryChannelRangeDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -16814,6 +18903,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1QueryChannelRangeDeco
        CResult_QueryChannelRangeDecodeErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_QueryChannelRangeDecodeErrorZ_clone_ptr(LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR arg) {
+       LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ");
+       *ret_conv = CResult_QueryChannelRangeDecodeErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryChannelRangeDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_QueryChannelRangeDecodeErrorZ* arg_conv = (LDKCResult_QueryChannelRangeDecodeErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_QueryChannelRangeDecodeErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryChannelRangeDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_QueryChannelRangeDecodeErrorZ* orig_conv = (LDKCResult_QueryChannelRangeDecodeErrorZ*)(orig & ~1);
        LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ");
@@ -16825,6 +18925,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyChannelRangeD
        LDKReplyChannelRange o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = (o & 1) || (o == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        o_conv = ReplyChannelRange_clone(&o_conv);
        LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ");
        *ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_ok(o_conv);
@@ -16835,12 +18936,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyChannelRangeD
        LDKDecodeError e_conv;
        e_conv.inner = (void*)(e & (~1));
        e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
        e_conv = DecodeError_clone(&e_conv);
        LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ");
        *ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_err(e_conv);
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyChannelRangeDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_ReplyChannelRangeDecodeErrorZ* o_conv = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_ReplyChannelRangeDecodeErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyChannelRangeDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -16850,6 +18958,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyChannelRangeDeco
        CResult_ReplyChannelRangeDecodeErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_ReplyChannelRangeDecodeErrorZ_clone_ptr(LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR arg) {
+       LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ");
+       *ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyChannelRangeDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_ReplyChannelRangeDecodeErrorZ* arg_conv = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_ReplyChannelRangeDecodeErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyChannelRangeDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_ReplyChannelRangeDecodeErrorZ* orig_conv = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)(orig & ~1);
        LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ");
@@ -16861,6 +18980,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFil
        LDKGossipTimestampFilter o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = (o & 1) || (o == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        o_conv = GossipTimestampFilter_clone(&o_conv);
        LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ");
        *ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_ok(o_conv);
@@ -16871,12 +18991,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFil
        LDKDecodeError e_conv;
        e_conv.inner = (void*)(e & (~1));
        e_conv.is_owned = (e & 1) || (e == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
        e_conv = DecodeError_clone(&e_conv);
        LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ");
        *ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_err(e_conv);
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFilterDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_GossipTimestampFilterDecodeErrorZ* o_conv = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_GossipTimestampFilterDecodeErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFilterDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -16886,6 +19013,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFilter
        CResult_GossipTimestampFilterDecodeErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_GossipTimestampFilterDecodeErrorZ_clone_ptr(LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR arg) {
+       LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ");
+       *ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFilterDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_GossipTimestampFilterDecodeErrorZ* arg_conv = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_GossipTimestampFilterDecodeErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFilterDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_GossipTimestampFilterDecodeErrorZ* orig_conv = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)(orig & ~1);
        LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ");
@@ -16897,6 +19035,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSignOrCreat
        LDKInvoice o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = (o & 1) || (o == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        o_conv = Invoice_clone(&o_conv);
        LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
        *ret_conv = CResult_InvoiceSignOrCreationErrorZ_ok(o_conv);
@@ -16913,6 +19052,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSignOrCreat
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSignOrCreationErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_InvoiceSignOrCreationErrorZ* o_conv = (LDKCResult_InvoiceSignOrCreationErrorZ*)(o & ~1);
+       jboolean ret_val = CResult_InvoiceSignOrCreationErrorZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSignOrCreationErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -16922,6 +19067,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSignOrCreation
        CResult_InvoiceSignOrCreationErrorZ_free(_res_conv);
 }
 
+static inline uint64_t CResult_InvoiceSignOrCreationErrorZ_clone_ptr(LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR arg) {
+       LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
+       *ret_conv = CResult_InvoiceSignOrCreationErrorZ_clone(arg);
+       return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSignOrCreationErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_InvoiceSignOrCreationErrorZ* arg_conv = (LDKCResult_InvoiceSignOrCreationErrorZ*)(arg & ~1);
+       int64_t ret_val = CResult_InvoiceSignOrCreationErrorZ_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSignOrCreationErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCResult_InvoiceSignOrCreationErrorZ* orig_conv = (LDKCResult_InvoiceSignOrCreationErrorZ*)(orig & ~1);
        LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
@@ -16963,6 +19119,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1LockedChannelMonit
        LDKLockedChannelMonitor o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = (o & 1) || (o == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        // Warning: we need a move here but no clone is available for LDKLockedChannelMonitor
        LDKCResult_LockedChannelMonitorNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_LockedChannelMonitorNoneZ), "LDKCResult_LockedChannelMonitorNoneZ");
        *ret_conv = CResult_LockedChannelMonitorNoneZ_ok(o_conv);
@@ -16975,6 +19132,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1LockedChannelMonit
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1LockedChannelMonitorNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+       LDKCResult_LockedChannelMonitorNoneZ* o_conv = (LDKCResult_LockedChannelMonitorNoneZ*)(o & ~1);
+       jboolean ret_val = CResult_LockedChannelMonitorNoneZ_is_ok(o_conv);
+       return ret_val;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1LockedChannelMonitorNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
@@ -16997,6 +19160,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1OutPointZ_1free(JNIEnv *
                LDKOutPoint _res_conv_10_conv;
                _res_conv_10_conv.inner = (void*)(_res_conv_10 & (~1));
                _res_conv_10_conv.is_owned = (_res_conv_10 & 1) || (_res_conv_10 == 0);
+               CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_10_conv);
                _res_constr.data[k] = _res_conv_10_conv;
        }
        (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
@@ -17012,6 +19176,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1free(JNIEnv *e
        PaymentPurpose_free(this_ptr_conv);
 }
 
+static inline uint64_t PaymentPurpose_clone_ptr(LDKPaymentPurpose *NONNULL_PTR arg) {
+       LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose");
+       *ret_copy = PaymentPurpose_clone(arg);
+uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKPaymentPurpose* arg_conv = (LDKPaymentPurpose*)arg;
+       int64_t ret_val = PaymentPurpose_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKPaymentPurpose* orig_conv = (LDKPaymentPurpose*)orig;
        LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose");
@@ -17052,6 +19228,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosureReason_1free(JNIEnv *en
        ClosureReason_free(this_ptr_conv);
 }
 
+static inline uint64_t ClosureReason_clone_ptr(LDKClosureReason *NONNULL_PTR arg) {
+       LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
+       *ret_copy = ClosureReason_clone(arg);
+uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKClosureReason* arg_conv = (LDKClosureReason*)arg;
+       int64_t ret_val = ClosureReason_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKClosureReason* orig_conv = (LDKClosureReason*)orig;
        LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
@@ -17120,6 +19308,16 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosureReason_1write(JN
        return ret_arr;
 }
 
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
+       LDKu8slice ser_ref;
+       ser_ref.datalen = (*env)->GetArrayLength(env, ser);
+       ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
+       LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ");
+       *ret_conv = ClosureReason_read(ser_ref);
+       (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
+       return (uint64_t)ret_conv;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Event_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
        if ((this_ptr & 1) != 0) return;
        void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
@@ -17129,6 +19327,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Event_1free(JNIEnv *env, jclas
        Event_free(this_ptr_conv);
 }
 
+static inline uint64_t Event_clone_ptr(LDKEvent *NONNULL_PTR arg) {
+       LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
+       *ret_copy = Event_clone(arg);
+uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKEvent* arg_conv = (LDKEvent*)arg;
+       int64_t ret_val = Event_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKEvent* orig_conv = (LDKEvent*)orig;
        LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
@@ -17208,6 +19418,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1path_1faile
                LDKRouteHop path_conv_10_conv;
                path_conv_10_conv.inner = (void*)(path_conv_10 & (~1));
                path_conv_10_conv.is_owned = (path_conv_10 & 1) || (path_conv_10 == 0);
+               CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
                path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
                path_constr.data[k] = path_conv_10_conv;
        }
@@ -17219,6 +19430,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1path_1faile
        LDKRouteParameters retry_conv;
        retry_conv.inner = (void*)(retry & (~1));
        retry_conv.is_owned = (retry & 1) || (retry == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(retry_conv);
        retry_conv = RouteParameters_clone(&retry_conv);
        LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
        *ret_copy = Event_payment_path_failed(payment_id_ref, payment_hash_ref, rejected_by_dest, network_update_conv, all_paths_failed, path_constr, short_channel_id_conv, retry_conv);
@@ -17305,6 +19517,16 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Event_1write(JNIEnv *en
        return ret_arr;
 }
 
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
+       LDKu8slice ser_ref;
+       ser_ref.datalen = (*env)->GetArrayLength(env, ser);
+       ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
+       LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ");
+       *ret_conv = Event_read(ser_ref);
+       (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
+       return (uint64_t)ret_conv;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
        if ((this_ptr & 1) != 0) return;
        void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
@@ -17314,6 +19536,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1free(JNIEnv
        MessageSendEvent_free(this_ptr_conv);
 }
 
+static inline uint64_t MessageSendEvent_clone_ptr(LDKMessageSendEvent *NONNULL_PTR arg) {
+       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+       *ret_copy = MessageSendEvent_clone(arg);
+uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKMessageSendEvent* arg_conv = (LDKMessageSendEvent*)arg;
+       int64_t ret_val = MessageSendEvent_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKMessageSendEvent* orig_conv = (LDKMessageSendEvent*)orig;
        LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
@@ -17329,6 +19563,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1acc
        LDKAcceptChannel msg_conv;
        msg_conv.inner = (void*)(msg & (~1));
        msg_conv.is_owned = (msg & 1) || (msg == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
        msg_conv = AcceptChannel_clone(&msg_conv);
        LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
        *ret_copy = MessageSendEvent_send_accept_channel(node_id_ref, msg_conv);
@@ -17343,6 +19578,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1ope
        LDKOpenChannel msg_conv;
        msg_conv.inner = (void*)(msg & (~1));
        msg_conv.is_owned = (msg & 1) || (msg == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
        msg_conv = OpenChannel_clone(&msg_conv);
        LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
        *ret_copy = MessageSendEvent_send_open_channel(node_id_ref, msg_conv);
@@ -17357,6 +19593,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1fun
        LDKFundingCreated msg_conv;
        msg_conv.inner = (void*)(msg & (~1));
        msg_conv.is_owned = (msg & 1) || (msg == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
        msg_conv = FundingCreated_clone(&msg_conv);
        LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
        *ret_copy = MessageSendEvent_send_funding_created(node_id_ref, msg_conv);
@@ -17371,6 +19608,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1fun
        LDKFundingSigned msg_conv;
        msg_conv.inner = (void*)(msg & (~1));
        msg_conv.is_owned = (msg & 1) || (msg == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
        msg_conv = FundingSigned_clone(&msg_conv);
        LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
        *ret_copy = MessageSendEvent_send_funding_signed(node_id_ref, msg_conv);
@@ -17385,6 +19623,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1fun
        LDKFundingLocked msg_conv;
        msg_conv.inner = (void*)(msg & (~1));
        msg_conv.is_owned = (msg & 1) || (msg == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
        msg_conv = FundingLocked_clone(&msg_conv);
        LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
        *ret_copy = MessageSendEvent_send_funding_locked(node_id_ref, msg_conv);
@@ -17399,6 +19638,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1ann
        LDKAnnouncementSignatures msg_conv;
        msg_conv.inner = (void*)(msg & (~1));
        msg_conv.is_owned = (msg & 1) || (msg == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
        msg_conv = AnnouncementSignatures_clone(&msg_conv);
        LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
        *ret_copy = MessageSendEvent_send_announcement_signatures(node_id_ref, msg_conv);
@@ -17413,6 +19653,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1update_1h
        LDKCommitmentUpdate updates_conv;
        updates_conv.inner = (void*)(updates & (~1));
        updates_conv.is_owned = (updates & 1) || (updates == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(updates_conv);
        updates_conv = CommitmentUpdate_clone(&updates_conv);
        LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
        *ret_copy = MessageSendEvent_update_htlcs(node_id_ref, updates_conv);
@@ -17427,6 +19668,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1rev
        LDKRevokeAndACK msg_conv;
        msg_conv.inner = (void*)(msg & (~1));
        msg_conv.is_owned = (msg & 1) || (msg == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
        msg_conv = RevokeAndACK_clone(&msg_conv);
        LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
        *ret_copy = MessageSendEvent_send_revoke_and_ack(node_id_ref, msg_conv);
@@ -17441,6 +19683,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1clo
        LDKClosingSigned msg_conv;
        msg_conv.inner = (void*)(msg & (~1));
        msg_conv.is_owned = (msg & 1) || (msg == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
        msg_conv = ClosingSigned_clone(&msg_conv);
        LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
        *ret_copy = MessageSendEvent_send_closing_signed(node_id_ref, msg_conv);
@@ -17455,6 +19698,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1shu
        LDKShutdown msg_conv;
        msg_conv.inner = (void*)(msg & (~1));
        msg_conv.is_owned = (msg & 1) || (msg == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
        msg_conv = Shutdown_clone(&msg_conv);
        LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
        *ret_copy = MessageSendEvent_send_shutdown(node_id_ref, msg_conv);
@@ -17469,6 +19713,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1cha
        LDKChannelReestablish msg_conv;
        msg_conv.inner = (void*)(msg & (~1));
        msg_conv.is_owned = (msg & 1) || (msg == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
        msg_conv = ChannelReestablish_clone(&msg_conv);
        LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
        *ret_copy = MessageSendEvent_send_channel_reestablish(node_id_ref, msg_conv);
@@ -17480,10 +19725,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1broadcast
        LDKChannelAnnouncement msg_conv;
        msg_conv.inner = (void*)(msg & (~1));
        msg_conv.is_owned = (msg & 1) || (msg == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
        msg_conv = ChannelAnnouncement_clone(&msg_conv);
        LDKChannelUpdate update_msg_conv;
        update_msg_conv.inner = (void*)(update_msg & (~1));
        update_msg_conv.is_owned = (update_msg & 1) || (update_msg == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(update_msg_conv);
        update_msg_conv = ChannelUpdate_clone(&update_msg_conv);
        LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
        *ret_copy = MessageSendEvent_broadcast_channel_announcement(msg_conv, update_msg_conv);
@@ -17495,6 +19742,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1broadcast
        LDKNodeAnnouncement msg_conv;
        msg_conv.inner = (void*)(msg & (~1));
        msg_conv.is_owned = (msg & 1) || (msg == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
        msg_conv = NodeAnnouncement_clone(&msg_conv);
        LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
        *ret_copy = MessageSendEvent_broadcast_node_announcement(msg_conv);
@@ -17506,6 +19754,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1broadcast
        LDKChannelUpdate msg_conv;
        msg_conv.inner = (void*)(msg & (~1));
        msg_conv.is_owned = (msg & 1) || (msg == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
        msg_conv = ChannelUpdate_clone(&msg_conv);
        LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
        *ret_copy = MessageSendEvent_broadcast_channel_update(msg_conv);
@@ -17520,6 +19769,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1cha
        LDKChannelUpdate msg_conv;
        msg_conv.inner = (void*)(msg & (~1));
        msg_conv.is_owned = (msg & 1) || (msg == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
        msg_conv = ChannelUpdate_clone(&msg_conv);
        LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
        *ret_copy = MessageSendEvent_send_channel_update(node_id_ref, msg_conv);
@@ -17548,6 +19798,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1cha
        LDKQueryChannelRange msg_conv;
        msg_conv.inner = (void*)(msg & (~1));
        msg_conv.is_owned = (msg & 1) || (msg == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
        msg_conv = QueryChannelRange_clone(&msg_conv);
        LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
        *ret_copy = MessageSendEvent_send_channel_range_query(node_id_ref, msg_conv);
@@ -17562,6 +19813,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1sho
        LDKQueryShortChannelIds msg_conv;
        msg_conv.inner = (void*)(msg & (~1));
        msg_conv.is_owned = (msg & 1) || (msg == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
        msg_conv = QueryShortChannelIds_clone(&msg_conv);
        LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
        *ret_copy = MessageSendEvent_send_short_ids_query(node_id_ref, msg_conv);
@@ -17576,6 +19828,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1rep
        LDKReplyChannelRange msg_conv;
        msg_conv.inner = (void*)(msg & (~1));
        msg_conv.is_owned = (msg & 1) || (msg == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
        msg_conv = ReplyChannelRange_clone(&msg_conv);
        LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
        *ret_copy = MessageSendEvent_send_reply_channel_range(node_id_ref, msg_conv);
@@ -17619,6 +19872,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_APIError_1free(JNIEnv *env, jc
        APIError_free(this_ptr_conv);
 }
 
+static inline uint64_t APIError_clone_ptr(LDKAPIError *NONNULL_PTR arg) {
+       LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
+       *ret_copy = APIError_clone(arg);
+uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKAPIError* arg_conv = (LDKAPIError*)arg;
+       int64_t ret_val = APIError_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKAPIError* orig_conv = (LDKAPIError*)orig;
        LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
@@ -17670,6 +19935,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1incompatible_1shu
        LDKShutdownScript script_conv;
        script_conv.inner = (void*)(script & (~1));
        script_conv.is_owned = (script & 1) || (script == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(script_conv);
        script_conv = ShutdownScript_clone(&script_conv);
        LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
        *ret_copy = APIError_incompatible_shutdown_script(script_conv);
@@ -17764,6 +20030,147 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1max(JNIEnv *env, jcla
        return ret_conv;
 }
 
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
+       LDKRecord this_obj_conv;
+       this_obj_conv.inner = (void*)(this_obj & (~1));
+       this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
+       Record_free(this_obj_conv);
+}
+
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Record_1get_1level(JNIEnv *env, jclass clz, int64_t this_ptr) {
+       LDKRecord this_ptr_conv;
+       this_ptr_conv.inner = (void*)(this_ptr & (~1));
+       this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+       jclass ret_conv = LDKLevel_to_java(env, Record_get_level(&this_ptr_conv));
+       return ret_conv;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1set_1level(JNIEnv *env, jclass clz, int64_t this_ptr, jclass val) {
+       LDKRecord this_ptr_conv;
+       this_ptr_conv.inner = (void*)(this_ptr & (~1));
+       this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+       LDKLevel val_conv = LDKLevel_from_java(env, val);
+       Record_set_level(&this_ptr_conv, val_conv);
+}
+
+JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Record_1get_1args(JNIEnv *env, jclass clz, int64_t this_ptr) {
+       LDKRecord this_ptr_conv;
+       this_ptr_conv.inner = (void*)(this_ptr & (~1));
+       this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+       LDKStr ret_str = Record_get_args(&this_ptr_conv);
+       jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
+       Str_free(ret_str);
+       return ret_conv;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1set_1args(JNIEnv *env, jclass clz, int64_t this_ptr, jstring val) {
+       LDKRecord this_ptr_conv;
+       this_ptr_conv.inner = (void*)(this_ptr & (~1));
+       this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+       LDKStr val_conv = java_to_owned_str(env, val);
+       Record_set_args(&this_ptr_conv, val_conv);
+}
+
+JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Record_1get_1module_1path(JNIEnv *env, jclass clz, int64_t this_ptr) {
+       LDKRecord this_ptr_conv;
+       this_ptr_conv.inner = (void*)(this_ptr & (~1));
+       this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+       LDKStr ret_str = Record_get_module_path(&this_ptr_conv);
+       jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
+       Str_free(ret_str);
+       return ret_conv;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1set_1module_1path(JNIEnv *env, jclass clz, int64_t this_ptr, jstring val) {
+       LDKRecord this_ptr_conv;
+       this_ptr_conv.inner = (void*)(this_ptr & (~1));
+       this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+       LDKStr val_conv = java_to_owned_str(env, val);
+       Record_set_module_path(&this_ptr_conv, val_conv);
+}
+
+JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Record_1get_1file(JNIEnv *env, jclass clz, int64_t this_ptr) {
+       LDKRecord this_ptr_conv;
+       this_ptr_conv.inner = (void*)(this_ptr & (~1));
+       this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+       LDKStr ret_str = Record_get_file(&this_ptr_conv);
+       jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
+       Str_free(ret_str);
+       return ret_conv;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1set_1file(JNIEnv *env, jclass clz, int64_t this_ptr, jstring val) {
+       LDKRecord this_ptr_conv;
+       this_ptr_conv.inner = (void*)(this_ptr & (~1));
+       this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+       LDKStr val_conv = java_to_owned_str(env, val);
+       Record_set_file(&this_ptr_conv, val_conv);
+}
+
+JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_Record_1get_1line(JNIEnv *env, jclass clz, int64_t this_ptr) {
+       LDKRecord this_ptr_conv;
+       this_ptr_conv.inner = (void*)(this_ptr & (~1));
+       this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+       int32_t ret_val = Record_get_line(&this_ptr_conv);
+       return ret_val;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1set_1line(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
+       LDKRecord this_ptr_conv;
+       this_ptr_conv.inner = (void*)(this_ptr & (~1));
+       this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+       Record_set_line(&this_ptr_conv, val);
+}
+
+static inline uint64_t Record_clone_ptr(LDKRecord *NONNULL_PTR arg) {
+       LDKRecord ret_var = Record_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Record_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKRecord arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = Record_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Record_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+       LDKRecord orig_conv;
+       orig_conv.inner = (void*)(orig & (~1));
+       orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
+       LDKRecord ret_var = Record_clone(&orig_conv);
+       uint64_t ret_ref = 0;
+       CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+       CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+       ret_ref = (uint64_t)ret_var.inner;
+       if (ret_var.is_owned) {
+               ret_ref |= 1;
+       }
+       return ret_ref;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Logger_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
        if ((this_ptr & 1) != 0) return;
        void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
@@ -17777,6 +20184,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1free(J
        LDKChannelHandshakeConfig this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        ChannelHandshakeConfig_free(this_obj_conv);
 }
 
@@ -17784,6 +20192,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get
        LDKChannelHandshakeConfig this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int32_t ret_val = ChannelHandshakeConfig_get_minimum_depth(&this_ptr_conv);
        return ret_val;
 }
@@ -17792,6 +20201,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1m
        LDKChannelHandshakeConfig this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        ChannelHandshakeConfig_set_minimum_depth(&this_ptr_conv, val);
 }
 
@@ -17799,6 +20209,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get
        LDKChannelHandshakeConfig this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int16_t ret_val = ChannelHandshakeConfig_get_our_to_self_delay(&this_ptr_conv);
        return ret_val;
 }
@@ -17807,6 +20218,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1o
        LDKChannelHandshakeConfig this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        ChannelHandshakeConfig_set_our_to_self_delay(&this_ptr_conv, val);
 }
 
@@ -17814,6 +20226,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get
        LDKChannelHandshakeConfig this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int64_t ret_val = ChannelHandshakeConfig_get_our_htlc_minimum_msat(&this_ptr_conv);
        return ret_val;
 }
@@ -17822,6 +20235,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1o
        LDKChannelHandshakeConfig this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        ChannelHandshakeConfig_set_our_htlc_minimum_msat(&this_ptr_conv, val);
 }
 
@@ -17830,6 +20244,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1new
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -17837,14 +20252,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1new
        return ret_ref;
 }
 
+static inline uint64_t ChannelHandshakeConfig_clone_ptr(LDKChannelHandshakeConfig *NONNULL_PTR arg) {
+       LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKChannelHandshakeConfig arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = ChannelHandshakeConfig_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKChannelHandshakeConfig orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -17857,6 +20295,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1def
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -17868,6 +20307,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1free(J
        LDKChannelHandshakeLimits this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        ChannelHandshakeLimits_free(this_obj_conv);
 }
 
@@ -17875,6 +20315,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get
        LDKChannelHandshakeLimits this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int64_t ret_val = ChannelHandshakeLimits_get_min_funding_satoshis(&this_ptr_conv);
        return ret_val;
 }
@@ -17883,6 +20324,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1m
        LDKChannelHandshakeLimits this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        ChannelHandshakeLimits_set_min_funding_satoshis(&this_ptr_conv, val);
 }
 
@@ -17890,6 +20332,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get
        LDKChannelHandshakeLimits this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int64_t ret_val = ChannelHandshakeLimits_get_max_htlc_minimum_msat(&this_ptr_conv);
        return ret_val;
 }
@@ -17898,6 +20341,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1m
        LDKChannelHandshakeLimits this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        ChannelHandshakeLimits_set_max_htlc_minimum_msat(&this_ptr_conv, val);
 }
 
@@ -17905,6 +20349,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get
        LDKChannelHandshakeLimits this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int64_t ret_val = ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(&this_ptr_conv);
        return ret_val;
 }
@@ -17913,6 +20358,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1m
        LDKChannelHandshakeLimits this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(&this_ptr_conv, val);
 }
 
@@ -17920,6 +20366,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get
        LDKChannelHandshakeLimits this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int64_t ret_val = ChannelHandshakeLimits_get_max_channel_reserve_satoshis(&this_ptr_conv);
        return ret_val;
 }
@@ -17928,6 +20375,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1m
        LDKChannelHandshakeLimits this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        ChannelHandshakeLimits_set_max_channel_reserve_satoshis(&this_ptr_conv, val);
 }
 
@@ -17935,6 +20383,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get
        LDKChannelHandshakeLimits this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int16_t ret_val = ChannelHandshakeLimits_get_min_max_accepted_htlcs(&this_ptr_conv);
        return ret_val;
 }
@@ -17943,6 +20392,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1m
        LDKChannelHandshakeLimits this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        ChannelHandshakeLimits_set_min_max_accepted_htlcs(&this_ptr_conv, val);
 }
 
@@ -17950,6 +20400,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get
        LDKChannelHandshakeLimits this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int32_t ret_val = ChannelHandshakeLimits_get_max_minimum_depth(&this_ptr_conv);
        return ret_val;
 }
@@ -17958,6 +20409,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1m
        LDKChannelHandshakeLimits this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        ChannelHandshakeLimits_set_max_minimum_depth(&this_ptr_conv, val);
 }
 
@@ -17965,6 +20417,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1ge
        LDKChannelHandshakeLimits this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        jboolean ret_val = ChannelHandshakeLimits_get_force_announced_channel_preference(&this_ptr_conv);
        return ret_val;
 }
@@ -17973,6 +20426,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1f
        LDKChannelHandshakeLimits this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        ChannelHandshakeLimits_set_force_announced_channel_preference(&this_ptr_conv, val);
 }
 
@@ -17980,6 +20434,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get
        LDKChannelHandshakeLimits this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int16_t ret_val = ChannelHandshakeLimits_get_their_to_self_delay(&this_ptr_conv);
        return ret_val;
 }
@@ -17988,6 +20443,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1t
        LDKChannelHandshakeLimits this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        ChannelHandshakeLimits_set_their_to_self_delay(&this_ptr_conv, val);
 }
 
@@ -17996,6 +20452,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1new
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -18003,14 +20460,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1new
        return ret_ref;
 }
 
+static inline uint64_t ChannelHandshakeLimits_clone_ptr(LDKChannelHandshakeLimits *NONNULL_PTR arg) {
+       LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKChannelHandshakeLimits arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = ChannelHandshakeLimits_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKChannelHandshakeLimits orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -18023,6 +20503,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1def
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -18034,6 +20515,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1free(JNIEnv *en
        LDKChannelConfig this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        ChannelConfig_free(this_obj_conv);
 }
 
@@ -18041,6 +20523,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1forward
        LDKChannelConfig this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int32_t ret_val = ChannelConfig_get_forwarding_fee_proportional_millionths(&this_ptr_conv);
        return ret_val;
 }
@@ -18049,6 +20532,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1forwarding
        LDKChannelConfig this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        ChannelConfig_set_forwarding_fee_proportional_millionths(&this_ptr_conv, val);
 }
 
@@ -18056,6 +20540,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1forward
        LDKChannelConfig this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int32_t ret_val = ChannelConfig_get_forwarding_fee_base_msat(&this_ptr_conv);
        return ret_val;
 }
@@ -18064,6 +20549,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1forwarding
        LDKChannelConfig this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        ChannelConfig_set_forwarding_fee_base_msat(&this_ptr_conv, val);
 }
 
@@ -18071,6 +20557,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1cltv_1e
        LDKChannelConfig this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int16_t ret_val = ChannelConfig_get_cltv_expiry_delta(&this_ptr_conv);
        return ret_val;
 }
@@ -18079,6 +20566,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1cltv_1expi
        LDKChannelConfig this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        ChannelConfig_set_cltv_expiry_delta(&this_ptr_conv, val);
 }
 
@@ -18086,6 +20574,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1announ
        LDKChannelConfig this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        jboolean ret_val = ChannelConfig_get_announced_channel(&this_ptr_conv);
        return ret_val;
 }
@@ -18094,6 +20583,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1announced_
        LDKChannelConfig this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        ChannelConfig_set_announced_channel(&this_ptr_conv, val);
 }
 
@@ -18101,6 +20591,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1commit
        LDKChannelConfig this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        jboolean ret_val = ChannelConfig_get_commit_upfront_shutdown_pubkey(&this_ptr_conv);
        return ret_val;
 }
@@ -18109,6 +20600,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1commit_1up
        LDKChannelConfig this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        ChannelConfig_set_commit_upfront_shutdown_pubkey(&this_ptr_conv, val);
 }
 
@@ -18116,6 +20608,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1max_1du
        LDKChannelConfig this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int64_t ret_val = ChannelConfig_get_max_dust_htlc_exposure_msat(&this_ptr_conv);
        return ret_val;
 }
@@ -18124,6 +20617,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1max_1dust_
        LDKChannelConfig this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        ChannelConfig_set_max_dust_htlc_exposure_msat(&this_ptr_conv, val);
 }
 
@@ -18131,6 +20625,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1force_1
        LDKChannelConfig this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int64_t ret_val = ChannelConfig_get_force_close_avoidance_max_fee_satoshis(&this_ptr_conv);
        return ret_val;
 }
@@ -18139,6 +20634,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1force_1clo
        LDKChannelConfig this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        ChannelConfig_set_force_close_avoidance_max_fee_satoshis(&this_ptr_conv, val);
 }
 
@@ -18147,6 +20643,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1new(JNIEnv *
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -18154,14 +20651,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1new(JNIEnv *
        return ret_ref;
 }
 
+static inline uint64_t ChannelConfig_clone_ptr(LDKChannelConfig *NONNULL_PTR arg) {
+       LDKChannelConfig ret_var = ChannelConfig_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKChannelConfig arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = ChannelConfig_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKChannelConfig orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKChannelConfig ret_var = ChannelConfig_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -18174,6 +20694,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1default(JNIE
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -18185,6 +20706,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1write(JN
        LDKChannelConfig obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
        obj_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
        LDKCVec_u8Z ret_var = ChannelConfig_write(&obj_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
@@ -18206,6 +20728,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1free(JNIEnv *env,
        LDKUserConfig this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        UserConfig_free(this_obj_conv);
 }
 
@@ -18213,10 +20736,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1own_1chann
        LDKUserConfig this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKChannelHandshakeConfig ret_var = UserConfig_get_own_channel_config(&this_ptr_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -18228,9 +20753,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1own_1channel_
        LDKUserConfig this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKChannelHandshakeConfig val_conv;
        val_conv.inner = (void*)(val & (~1));
        val_conv.is_owned = (val & 1) || (val == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
        val_conv = ChannelHandshakeConfig_clone(&val_conv);
        UserConfig_set_own_channel_config(&this_ptr_conv, val_conv);
 }
@@ -18239,10 +20766,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1peer_1chan
        LDKUserConfig this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKChannelHandshakeLimits ret_var = UserConfig_get_peer_channel_config_limits(&this_ptr_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -18254,9 +20783,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1peer_1channel
        LDKUserConfig this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKChannelHandshakeLimits val_conv;
        val_conv.inner = (void*)(val & (~1));
        val_conv.is_owned = (val & 1) || (val == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
        val_conv = ChannelHandshakeLimits_clone(&val_conv);
        UserConfig_set_peer_channel_config_limits(&this_ptr_conv, val_conv);
 }
@@ -18265,10 +20796,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1channel_1o
        LDKUserConfig this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKChannelConfig ret_var = UserConfig_get_channel_options(&this_ptr_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -18280,9 +20813,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1channel_1opti
        LDKUserConfig this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKChannelConfig val_conv;
        val_conv.inner = (void*)(val & (~1));
        val_conv.is_owned = (val & 1) || (val == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
        val_conv = ChannelConfig_clone(&val_conv);
        UserConfig_set_channel_options(&this_ptr_conv, val_conv);
 }
@@ -18291,6 +20826,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1accept_1f
        LDKUserConfig this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        jboolean ret_val = UserConfig_get_accept_forwards_to_priv_channels(&this_ptr_conv);
        return ret_val;
 }
@@ -18299,6 +20835,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1accept_1forwa
        LDKUserConfig this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        UserConfig_set_accept_forwards_to_priv_channels(&this_ptr_conv, val);
 }
 
@@ -18306,19 +20843,23 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1new(JNIEnv *env
        LDKChannelHandshakeConfig own_channel_config_arg_conv;
        own_channel_config_arg_conv.inner = (void*)(own_channel_config_arg & (~1));
        own_channel_config_arg_conv.is_owned = (own_channel_config_arg & 1) || (own_channel_config_arg == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(own_channel_config_arg_conv);
        own_channel_config_arg_conv = ChannelHandshakeConfig_clone(&own_channel_config_arg_conv);
        LDKChannelHandshakeLimits peer_channel_config_limits_arg_conv;
        peer_channel_config_limits_arg_conv.inner = (void*)(peer_channel_config_limits_arg & (~1));
        peer_channel_config_limits_arg_conv.is_owned = (peer_channel_config_limits_arg & 1) || (peer_channel_config_limits_arg == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(peer_channel_config_limits_arg_conv);
        peer_channel_config_limits_arg_conv = ChannelHandshakeLimits_clone(&peer_channel_config_limits_arg_conv);
        LDKChannelConfig channel_options_arg_conv;
        channel_options_arg_conv.inner = (void*)(channel_options_arg & (~1));
        channel_options_arg_conv.is_owned = (channel_options_arg & 1) || (channel_options_arg == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_options_arg_conv);
        channel_options_arg_conv = ChannelConfig_clone(&channel_options_arg_conv);
        LDKUserConfig ret_var = UserConfig_new(own_channel_config_arg_conv, peer_channel_config_limits_arg_conv, channel_options_arg_conv, accept_forwards_to_priv_channels_arg);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -18326,14 +20867,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1new(JNIEnv *env
        return ret_ref;
 }
 
+static inline uint64_t UserConfig_clone_ptr(LDKUserConfig *NONNULL_PTR arg) {
+       LDKUserConfig ret_var = UserConfig_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKUserConfig arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = UserConfig_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKUserConfig orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKUserConfig ret_var = UserConfig_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -18346,6 +20910,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1default(JNIEnv
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -18357,17 +20922,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BestBlock_1free(JNIEnv *env, j
        LDKBestBlock this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        BestBlock_free(this_obj_conv);
 }
 
+static inline uint64_t BestBlock_clone_ptr(LDKBestBlock *NONNULL_PTR arg) {
+       LDKBestBlock ret_var = BestBlock_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BestBlock_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKBestBlock arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = BestBlock_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BestBlock_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKBestBlock orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKBestBlock ret_var = BestBlock_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -18381,6 +20970,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BestBlock_1from_1genesis(JN
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -18396,6 +20986,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BestBlock_1new(JNIEnv *env,
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -18407,6 +20998,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BestBlock_1block_1hash(
        LDKBestBlock this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, BestBlock_block_hash(&this_arg_conv).data);
        return ret_arr;
@@ -18416,6 +21008,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_BestBlock_1height(JNIEnv *e
        LDKBestBlock this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        int32_t ret_val = BestBlock_height(&this_arg_conv);
        return ret_val;
 }
@@ -18501,6 +21094,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1free(JNIEnv *en
        LDKWatchedOutput this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        WatchedOutput_free(this_obj_conv);
 }
 
@@ -18508,6 +21102,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1get_1blo
        LDKWatchedOutput this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, WatchedOutput_get_block_hash(&this_ptr_conv).data);
        return ret_arr;
@@ -18517,6 +21112,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1set_1block_1has
        LDKWatchedOutput this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKThirtyTwoBytes val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 32);
        (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
@@ -18527,10 +21123,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1get_1outpoin
        LDKWatchedOutput this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKOutPoint ret_var = WatchedOutput_get_outpoint(&this_ptr_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -18542,9 +21140,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1set_1outpoint(J
        LDKWatchedOutput this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKOutPoint val_conv;
        val_conv.inner = (void*)(val & (~1));
        val_conv.is_owned = (val & 1) || (val == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
        val_conv = OutPoint_clone(&val_conv);
        WatchedOutput_set_outpoint(&this_ptr_conv, val_conv);
 }
@@ -18553,6 +21153,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1get_1scr
        LDKWatchedOutput this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKu8slice ret_var = WatchedOutput_get_script_pubkey(&this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
@@ -18563,6 +21164,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1set_1script_1pu
        LDKWatchedOutput this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKCVec_u8Z val_ref;
        val_ref.datalen = (*env)->GetArrayLength(env, val);
        val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes");
@@ -18577,6 +21179,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1new(JNIEnv *
        LDKOutPoint outpoint_arg_conv;
        outpoint_arg_conv.inner = (void*)(outpoint_arg & (~1));
        outpoint_arg_conv.is_owned = (outpoint_arg & 1) || (outpoint_arg == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv);
        outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv);
        LDKCVec_u8Z script_pubkey_arg_ref;
        script_pubkey_arg_ref.datalen = (*env)->GetArrayLength(env, script_pubkey_arg);
@@ -18586,6 +21189,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1new(JNIEnv *
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -18593,14 +21197,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1new(JNIEnv *
        return ret_ref;
 }
 
+static inline uint64_t WatchedOutput_clone_ptr(LDKWatchedOutput *NONNULL_PTR arg) {
+       LDKWatchedOutput ret_var = WatchedOutput_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKWatchedOutput arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = WatchedOutput_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKWatchedOutput orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKWatchedOutput ret_var = WatchedOutput_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -18612,6 +21239,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1hash(JNIEnv
        LDKWatchedOutput o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        int64_t ret_val = WatchedOutput_hash(&o_conv);
        return ret_val;
 }
@@ -18666,17 +21294,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1free(JNIEnv *
        LDKMonitorUpdateId this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        MonitorUpdateId_free(this_obj_conv);
 }
 
+static inline uint64_t MonitorUpdateId_clone_ptr(LDKMonitorUpdateId *NONNULL_PTR arg) {
+       LDKMonitorUpdateId ret_var = MonitorUpdateId_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKMonitorUpdateId arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = MonitorUpdateId_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKMonitorUpdateId orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKMonitorUpdateId ret_var = MonitorUpdateId_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -18688,6 +21340,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1hash(JNIEn
        LDKMonitorUpdateId o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        int64_t ret_val = MonitorUpdateId_hash(&o_conv);
        return ret_val;
 }
@@ -18696,9 +21349,11 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1eq(JNIEnv
        LDKMonitorUpdateId a_conv;
        a_conv.inner = (void*)(a & (~1));
        a_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
        LDKMonitorUpdateId b_conv;
        b_conv.inner = (void*)(b & (~1));
        b_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
        jboolean ret_val = MonitorUpdateId_eq(&a_conv, &b_conv);
        return ret_val;
 }
@@ -18716,6 +21371,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LockedChannelMonitor_1free(JNI
        LDKLockedChannelMonitor this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        LockedChannelMonitor_free(this_obj_conv);
 }
 
@@ -18723,6 +21379,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1free(JNIEnv *env
        LDKChainMonitor this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        ChainMonitor_free(this_obj_conv);
 }
 
@@ -18770,6 +21427,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1new(JNIEnv *e
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -18781,6 +21439,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1get_1cla
        LDKChainMonitor this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKCVec_ChannelDetailsZ ignored_channels_constr;
        ignored_channels_constr.datalen = (*env)->GetArrayLength(env, ignored_channels);
        if (ignored_channels_constr.datalen > 0)
@@ -18793,6 +21452,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1get_1cla
                LDKChannelDetails ignored_channels_conv_16_conv;
                ignored_channels_conv_16_conv.inner = (void*)(ignored_channels_conv_16 & (~1));
                ignored_channels_conv_16_conv.is_owned = (ignored_channels_conv_16 & 1) || (ignored_channels_conv_16 == 0);
+               CHECK_INNER_FIELD_ACCESS_OR_NULL(ignored_channels_conv_16_conv);
                ignored_channels_conv_16_conv = ChannelDetails_clone(&ignored_channels_conv_16_conv);
                ignored_channels_constr.data[q] = ignored_channels_conv_16_conv;
        }
@@ -18816,9 +21476,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1get_1monitor(
        LDKChainMonitor this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKOutPoint funding_txo_conv;
        funding_txo_conv.inner = (void*)(funding_txo & (~1));
        funding_txo_conv.is_owned = (funding_txo & 1) || (funding_txo == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv);
        funding_txo_conv = OutPoint_clone(&funding_txo_conv);
        LDKCResult_LockedChannelMonitorNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_LockedChannelMonitorNoneZ), "LDKCResult_LockedChannelMonitorNoneZ");
        *ret_conv = ChainMonitor_get_monitor(&this_arg_conv, funding_txo_conv);
@@ -18829,6 +21491,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1list_1mo
        LDKChainMonitor this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKCVec_OutPointZ ret_var = ChainMonitor_list_monitors(&this_arg_conv);
        int64_tArray ret_arr = NULL;
        ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
@@ -18838,6 +21501,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1list_1mo
                uint64_t ret_conv_10_ref = 0;
                CHECK((((uint64_t)ret_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
                CHECK((((uint64_t)&ret_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+               CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_10_var);
                ret_conv_10_ref = (uint64_t)ret_conv_10_var.inner;
                if (ret_conv_10_var.is_owned) {
                        ret_conv_10_ref |= 1;
@@ -18853,13 +21517,16 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1channel_1moni
        LDKChainMonitor this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKOutPoint funding_txo_conv;
        funding_txo_conv.inner = (void*)(funding_txo & (~1));
        funding_txo_conv.is_owned = (funding_txo & 1) || (funding_txo == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv);
        funding_txo_conv = OutPoint_clone(&funding_txo_conv);
        LDKMonitorUpdateId completed_update_id_conv;
        completed_update_id_conv.inner = (void*)(completed_update_id & (~1));
        completed_update_id_conv.is_owned = (completed_update_id & 1) || (completed_update_id == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(completed_update_id_conv);
        completed_update_id_conv = MonitorUpdateId_clone(&completed_update_id_conv);
        LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
        *ret_conv = ChainMonitor_channel_monitor_updated(&this_arg_conv, funding_txo_conv, completed_update_id_conv);
@@ -18870,6 +21537,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1as_1Listen(JN
        LDKChainMonitor this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKListen* ret_ret = MALLOC(sizeof(LDKListen), "LDKListen");
        *ret_ret = ChainMonitor_as_Listen(&this_arg_conv);
        return (uint64_t)ret_ret;
@@ -18879,6 +21547,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1as_1Confirm(J
        LDKChainMonitor this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKConfirm* ret_ret = MALLOC(sizeof(LDKConfirm), "LDKConfirm");
        *ret_ret = ChainMonitor_as_Confirm(&this_arg_conv);
        return (uint64_t)ret_ret;
@@ -18888,6 +21557,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1as_1Watch(JNI
        LDKChainMonitor this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKWatch* ret_ret = MALLOC(sizeof(LDKWatch), "LDKWatch");
        *ret_ret = ChainMonitor_as_Watch(&this_arg_conv);
        return (uint64_t)ret_ret;
@@ -18897,6 +21567,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1as_1EventsPro
        LDKChainMonitor this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKEventsProvider* ret_ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider");
        *ret_ret = ChainMonitor_as_EventsProvider(&this_arg_conv);
        return (uint64_t)ret_ret;
@@ -18906,6 +21577,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1free(JNI
        LDKChannelMonitorUpdate this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        ChannelMonitorUpdate_free(this_obj_conv);
 }
 
@@ -18913,6 +21585,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1get_1
        LDKChannelMonitorUpdate this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int64_t ret_val = ChannelMonitorUpdate_get_update_id(&this_ptr_conv);
        return ret_val;
 }
@@ -18921,17 +21594,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1set_1upd
        LDKChannelMonitorUpdate this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        ChannelMonitorUpdate_set_update_id(&this_ptr_conv, val);
 }
 
+static inline uint64_t ChannelMonitorUpdate_clone_ptr(LDKChannelMonitorUpdate *NONNULL_PTR arg) {
+       LDKChannelMonitorUpdate ret_var = ChannelMonitorUpdate_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKChannelMonitorUpdate arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = ChannelMonitorUpdate_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKChannelMonitorUpdate orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKChannelMonitorUpdate ret_var = ChannelMonitorUpdate_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -18943,6 +21640,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1w
        LDKChannelMonitorUpdate obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
        obj_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
        LDKCVec_u8Z ret_var = ChannelMonitorUpdate_write(&obj_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
@@ -18964,6 +21662,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorUpdateError_1free(JNIEn
        LDKMonitorUpdateError this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        MonitorUpdateError_free(this_obj_conv);
 }
 
@@ -18971,6 +21670,7 @@ JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_MonitorUpdateError_1get_1a(
        LDKMonitorUpdateError this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKStr ret_str = MonitorUpdateError_get_a(&this_ptr_conv);
        jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
        Str_free(ret_str);
@@ -18981,6 +21681,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorUpdateError_1set_1a(JNI
        LDKMonitorUpdateError this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKStr val_conv = java_to_owned_str(env, val);
        MonitorUpdateError_set_a(&this_ptr_conv, val_conv);
 }
@@ -18991,6 +21692,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdateError_1new(JNI
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -18998,14 +21700,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdateError_1new(JNI
        return ret_ref;
 }
 
+static inline uint64_t MonitorUpdateError_clone_ptr(LDKMonitorUpdateError *NONNULL_PTR arg) {
+       LDKMonitorUpdateError ret_var = MonitorUpdateError_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdateError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKMonitorUpdateError arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = MonitorUpdateError_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdateError_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKMonitorUpdateError orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKMonitorUpdateError ret_var = MonitorUpdateError_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -19022,6 +21747,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1free(JNIEnv *env
        MonitorEvent_free(this_ptr_conv);
 }
 
+static inline uint64_t MonitorEvent_clone_ptr(LDKMonitorEvent *NONNULL_PTR arg) {
+       LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
+       *ret_copy = MonitorEvent_clone(arg);
+uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKMonitorEvent* arg_conv = (LDKMonitorEvent*)arg;
+       int64_t ret_val = MonitorEvent_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKMonitorEvent* orig_conv = (LDKMonitorEvent*)orig;
        LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
@@ -19034,6 +21771,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1htlcevent(JNI
        LDKHTLCUpdate a_conv;
        a_conv.inner = (void*)(a & (~1));
        a_conv.is_owned = (a & 1) || (a == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
        a_conv = HTLCUpdate_clone(&a_conv);
        LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
        *ret_copy = MonitorEvent_htlcevent(a_conv);
@@ -19045,6 +21783,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1commitment_1t
        LDKOutPoint a_conv;
        a_conv.inner = (void*)(a & (~1));
        a_conv.is_owned = (a & 1) || (a == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
        a_conv = OutPoint_clone(&a_conv);
        LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
        *ret_copy = MonitorEvent_commitment_tx_confirmed(a_conv);
@@ -19056,6 +21795,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1update_1compl
        LDKOutPoint funding_txo_conv;
        funding_txo_conv.inner = (void*)(funding_txo & (~1));
        funding_txo_conv.is_owned = (funding_txo & 1) || (funding_txo == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv);
        funding_txo_conv = OutPoint_clone(&funding_txo_conv);
        LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
        *ret_copy = MonitorEvent_update_completed(funding_txo_conv, monitor_update_id);
@@ -19067,6 +21807,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1update_1faile
        LDKOutPoint a_conv;
        a_conv.inner = (void*)(a & (~1));
        a_conv.is_owned = (a & 1) || (a == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
        a_conv = OutPoint_clone(&a_conv);
        LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
        *ret_copy = MonitorEvent_update_failed(a_conv);
@@ -19083,21 +21824,55 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1write(JNI
        return ret_arr;
 }
 
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
+       LDKu8slice ser_ref;
+       ser_ref.datalen = (*env)->GetArrayLength(env, ser);
+       ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
+       LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ");
+       *ret_conv = MonitorEvent_read(ser_ref);
+       (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
+       return (uint64_t)ret_conv;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
        LDKHTLCUpdate this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        HTLCUpdate_free(this_obj_conv);
 }
 
+static inline uint64_t HTLCUpdate_clone_ptr(LDKHTLCUpdate *NONNULL_PTR arg) {
+       LDKHTLCUpdate ret_var = HTLCUpdate_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKHTLCUpdate arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = HTLCUpdate_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKHTLCUpdate orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKHTLCUpdate ret_var = HTLCUpdate_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -19109,6 +21884,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1write(JNIEn
        LDKHTLCUpdate obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
        obj_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
        LDKCVec_u8Z ret_var = HTLCUpdate_write(&obj_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
@@ -19135,6 +21911,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Balance_1free(JNIEnv *env, jcl
        Balance_free(this_ptr_conv);
 }
 
+static inline uint64_t Balance_clone_ptr(LDKBalance *NONNULL_PTR arg) {
+       LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
+       *ret_copy = Balance_clone(arg);
+uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Balance_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKBalance* arg_conv = (LDKBalance*)arg;
+       int64_t ret_val = Balance_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Balance_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKBalance* orig_conv = (LDKBalance*)orig;
        LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
@@ -19182,17 +21970,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1free(JNIEnv *e
        LDKChannelMonitor this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        ChannelMonitor_free(this_obj_conv);
 }
 
+static inline uint64_t ChannelMonitor_clone_ptr(LDKChannelMonitor *NONNULL_PTR arg) {
+       LDKChannelMonitor ret_var = ChannelMonitor_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKChannelMonitor arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = ChannelMonitor_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKChannelMonitor orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKChannelMonitor ret_var = ChannelMonitor_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -19204,6 +22016,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1write(J
        LDKChannelMonitor obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
        obj_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
        LDKCVec_u8Z ret_var = ChannelMonitor_write(&obj_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
@@ -19215,9 +22028,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1update_1mon
        LDKChannelMonitor this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKChannelMonitorUpdate updates_conv;
        updates_conv.inner = (void*)(updates & (~1));
        updates_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(updates_conv);
        void* broadcaster_ptr = (void*)(((uint64_t)broadcaster) & ~1);
        if (!(broadcaster & 1)) { CHECK_ACCESS(broadcaster_ptr); }
        LDKBroadcasterInterface* broadcaster_conv = (LDKBroadcasterInterface*)broadcaster_ptr;
@@ -19236,6 +22051,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1latest
        LDKChannelMonitor this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        int64_t ret_val = ChannelMonitor_get_latest_update_id(&this_arg_conv);
        return ret_val;
 }
@@ -19244,6 +22060,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1fundin
        LDKChannelMonitor this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKC2Tuple_OutPointScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ");
        *ret_conv = ChannelMonitor_get_funding_txo(&this_arg_conv);
        return ((uint64_t)ret_conv);
@@ -19253,6 +22070,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1o
        LDKChannelMonitor this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ ret_var = ChannelMonitor_get_outputs_to_watch(&this_arg_conv);
        int64_tArray ret_arr = NULL;
        ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
@@ -19271,6 +22089,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1load_1outputs_
        LDKChannelMonitor this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        void* filter_ptr = (void*)(((uint64_t)filter) & ~1);
        if (!(filter & 1)) { CHECK_ACCESS(filter_ptr); }
        LDKFilter* filter_conv = (LDKFilter*)filter_ptr;
@@ -19281,6 +22100,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1a
        LDKChannelMonitor this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKCVec_MonitorEventZ ret_var = ChannelMonitor_get_and_clear_pending_monitor_events(&this_arg_conv);
        int64_tArray ret_arr = NULL;
        ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
@@ -19300,6 +22120,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1a
        LDKChannelMonitor this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKCVec_EventZ ret_var = ChannelMonitor_get_and_clear_pending_events(&this_arg_conv);
        int64_tArray ret_arr = NULL;
        ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
@@ -19319,6 +22140,7 @@ JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1l
        LDKChannelMonitor this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
        if (!(logger & 1)) { CHECK_ACCESS(logger_ptr); }
        LDKLogger* logger_conv = (LDKLogger*)logger_ptr;
@@ -19342,6 +22164,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1block_
        LDKChannelMonitor this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        unsigned char header_arr[80];
        CHECK((*env)->GetArrayLength(env, header) == 80);
        (*env)->GetByteArrayRegion(env, header, 0, 80, header_arr);
@@ -19401,6 +22224,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1block_1disconn
        LDKChannelMonitor this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        unsigned char header_arr[80];
        CHECK((*env)->GetArrayLength(env, header) == 80);
        (*env)->GetByteArrayRegion(env, header, 0, 80, header_arr);
@@ -19433,6 +22257,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1transa
        LDKChannelMonitor this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        unsigned char header_arr[80];
        CHECK((*env)->GetArrayLength(env, header) == 80);
        (*env)->GetByteArrayRegion(env, header, 0, 80, header_arr);
@@ -19492,6 +22317,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1transaction_1u
        LDKChannelMonitor this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        unsigned char txid_arr[32];
        CHECK((*env)->GetArrayLength(env, txid) == 32);
        (*env)->GetByteArrayRegion(env, txid, 0, 32, txid_arr);
@@ -19524,6 +22350,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1best_1
        LDKChannelMonitor this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        unsigned char header_arr[80];
        CHECK((*env)->GetArrayLength(env, header) == 80);
        (*env)->GetByteArrayRegion(env, header, 0, 80, header_arr);
@@ -19567,6 +22394,7 @@ JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1r
        LDKChannelMonitor this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKCVec_TxidZ ret_var = ChannelMonitor_get_relevant_txids(&this_arg_conv);
        jobjectArray ret_arr = NULL;
        ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL);
@@ -19585,10 +22413,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1current_1be
        LDKChannelMonitor this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKBestBlock ret_var = ChannelMonitor_current_best_block(&this_arg_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -19600,6 +22430,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1c
        LDKChannelMonitor this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKCVec_BalanceZ ret_var = ChannelMonitor_get_claimable_balances(&this_arg_conv);
        int64_tArray ret_arr = NULL;
        ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
@@ -19632,6 +22463,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1free(JNIEnv *env, jc
        LDKOutPoint this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        OutPoint_free(this_obj_conv);
 }
 
@@ -19639,6 +22471,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OutPoint_1get_1txid(JNI
        LDKOutPoint this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *OutPoint_get_txid(&this_ptr_conv));
        return ret_arr;
@@ -19648,6 +22481,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1set_1txid(JNIEnv *en
        LDKOutPoint this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKThirtyTwoBytes val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 32);
        (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
@@ -19658,6 +22492,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_OutPoint_1get_1index(JNIEnv
        LDKOutPoint this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int16_t ret_val = OutPoint_get_index(&this_ptr_conv);
        return ret_val;
 }
@@ -19666,6 +22501,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1set_1index(JNIEnv *e
        LDKOutPoint this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        OutPoint_set_index(&this_ptr_conv, val);
 }
 
@@ -19677,6 +22513,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OutPoint_1new(JNIEnv *env,
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -19684,14 +22521,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OutPoint_1new(JNIEnv *env,
        return ret_ref;
 }
 
+static inline uint64_t OutPoint_clone_ptr(LDKOutPoint *NONNULL_PTR arg) {
+       LDKOutPoint ret_var = OutPoint_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OutPoint_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKOutPoint arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = OutPoint_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OutPoint_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKOutPoint orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKOutPoint ret_var = OutPoint_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -19703,9 +22563,11 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_OutPoint_1eq(JNIEnv *env,
        LDKOutPoint a_conv;
        a_conv.inner = (void*)(a & (~1));
        a_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
        LDKOutPoint b_conv;
        b_conv.inner = (void*)(b & (~1));
        b_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
        jboolean ret_val = OutPoint_eq(&a_conv, &b_conv);
        return ret_val;
 }
@@ -19714,6 +22576,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OutPoint_1hash(JNIEnv *env,
        LDKOutPoint o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        int64_t ret_val = OutPoint_hash(&o_conv);
        return ret_val;
 }
@@ -19722,6 +22585,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OutPoint_1to_1channel_1
        LDKOutPoint this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, OutPoint_to_channel_id(&this_arg_conv).data);
        return ret_arr;
@@ -19731,6 +22595,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OutPoint_1write(JNIEnv
        LDKOutPoint obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
        obj_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
        LDKCVec_u8Z ret_var = OutPoint_write(&obj_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
@@ -19752,6 +22617,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor
        LDKDelayedPaymentOutputDescriptor this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        DelayedPaymentOutputDescriptor_free(this_obj_conv);
 }
 
@@ -19759,10 +22625,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescrip
        LDKDelayedPaymentOutputDescriptor this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKOutPoint ret_var = DelayedPaymentOutputDescriptor_get_outpoint(&this_ptr_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -19774,9 +22642,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor
        LDKDelayedPaymentOutputDescriptor this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKOutPoint val_conv;
        val_conv.inner = (void*)(val & (~1));
        val_conv.is_owned = (val & 1) || (val == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
        val_conv = OutPoint_clone(&val_conv);
        DelayedPaymentOutputDescriptor_set_outpoint(&this_ptr_conv, val_conv);
 }
@@ -19785,6 +22655,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDes
        LDKDelayedPaymentOutputDescriptor this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, DelayedPaymentOutputDescriptor_get_per_commitment_point(&this_ptr_conv).compressed_form);
        return ret_arr;
@@ -19794,6 +22665,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor
        LDKDelayedPaymentOutputDescriptor this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKPublicKey val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 33);
        (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
@@ -19804,6 +22676,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescrip
        LDKDelayedPaymentOutputDescriptor this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int16_t ret_val = DelayedPaymentOutputDescriptor_get_to_self_delay(&this_ptr_conv);
        return ret_val;
 }
@@ -19812,6 +22685,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor
        LDKDelayedPaymentOutputDescriptor this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        DelayedPaymentOutputDescriptor_set_to_self_delay(&this_ptr_conv, val);
 }
 
@@ -19819,6 +22693,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor
        LDKDelayedPaymentOutputDescriptor this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        void* val_ptr = (void*)(((uint64_t)val) & ~1);
        CHECK_ACCESS(val_ptr);
        LDKTxOut val_conv = *(LDKTxOut*)(val_ptr);
@@ -19830,6 +22705,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDes
        LDKDelayedPaymentOutputDescriptor this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, DelayedPaymentOutputDescriptor_get_revocation_pubkey(&this_ptr_conv).compressed_form);
        return ret_arr;
@@ -19839,6 +22715,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor
        LDKDelayedPaymentOutputDescriptor this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKPublicKey val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 33);
        (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
@@ -19849,6 +22726,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDes
        LDKDelayedPaymentOutputDescriptor this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *DelayedPaymentOutputDescriptor_get_channel_keys_id(&this_ptr_conv));
        return ret_arr;
@@ -19858,6 +22736,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor
        LDKDelayedPaymentOutputDescriptor this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKThirtyTwoBytes val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 32);
        (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
@@ -19868,6 +22747,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescrip
        LDKDelayedPaymentOutputDescriptor this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int64_t ret_val = DelayedPaymentOutputDescriptor_get_channel_value_satoshis(&this_ptr_conv);
        return ret_val;
 }
@@ -19876,6 +22756,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor
        LDKDelayedPaymentOutputDescriptor this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        DelayedPaymentOutputDescriptor_set_channel_value_satoshis(&this_ptr_conv, val);
 }
 
@@ -19883,6 +22764,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescrip
        LDKOutPoint outpoint_arg_conv;
        outpoint_arg_conv.inner = (void*)(outpoint_arg & (~1));
        outpoint_arg_conv.is_owned = (outpoint_arg & 1) || (outpoint_arg == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv);
        outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv);
        LDKPublicKey per_commitment_point_arg_ref;
        CHECK((*env)->GetArrayLength(env, per_commitment_point_arg) == 33);
@@ -19901,6 +22783,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescrip
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -19908,14 +22791,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescrip
        return ret_ref;
 }
 
+static inline uint64_t DelayedPaymentOutputDescriptor_clone_ptr(LDKDelayedPaymentOutputDescriptor *NONNULL_PTR arg) {
+       LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKDelayedPaymentOutputDescriptor arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = DelayedPaymentOutputDescriptor_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKDelayedPaymentOutputDescriptor orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -19927,6 +22833,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDes
        LDKDelayedPaymentOutputDescriptor obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
        obj_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
        LDKCVec_u8Z ret_var = DelayedPaymentOutputDescriptor_write(&obj_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
@@ -19948,6 +22855,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_
        LDKStaticPaymentOutputDescriptor this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        StaticPaymentOutputDescriptor_free(this_obj_conv);
 }
 
@@ -19955,10 +22863,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescript
        LDKStaticPaymentOutputDescriptor this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKOutPoint ret_var = StaticPaymentOutputDescriptor_get_outpoint(&this_ptr_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -19970,9 +22880,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_
        LDKStaticPaymentOutputDescriptor this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKOutPoint val_conv;
        val_conv.inner = (void*)(val & (~1));
        val_conv.is_owned = (val & 1) || (val == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
        val_conv = OutPoint_clone(&val_conv);
        StaticPaymentOutputDescriptor_set_outpoint(&this_ptr_conv, val_conv);
 }
@@ -19981,6 +22893,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_
        LDKStaticPaymentOutputDescriptor this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        void* val_ptr = (void*)(((uint64_t)val) & ~1);
        CHECK_ACCESS(val_ptr);
        LDKTxOut val_conv = *(LDKTxOut*)(val_ptr);
@@ -19992,6 +22905,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDesc
        LDKStaticPaymentOutputDescriptor this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *StaticPaymentOutputDescriptor_get_channel_keys_id(&this_ptr_conv));
        return ret_arr;
@@ -20001,6 +22915,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_
        LDKStaticPaymentOutputDescriptor this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKThirtyTwoBytes val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 32);
        (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
@@ -20011,6 +22926,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescript
        LDKStaticPaymentOutputDescriptor this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int64_t ret_val = StaticPaymentOutputDescriptor_get_channel_value_satoshis(&this_ptr_conv);
        return ret_val;
 }
@@ -20019,6 +22935,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_
        LDKStaticPaymentOutputDescriptor this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        StaticPaymentOutputDescriptor_set_channel_value_satoshis(&this_ptr_conv, val);
 }
 
@@ -20026,6 +22943,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescript
        LDKOutPoint outpoint_arg_conv;
        outpoint_arg_conv.inner = (void*)(outpoint_arg & (~1));
        outpoint_arg_conv.is_owned = (outpoint_arg & 1) || (outpoint_arg == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv);
        outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv);
        void* output_arg_ptr = (void*)(((uint64_t)output_arg) & ~1);
        CHECK_ACCESS(output_arg_ptr);
@@ -20038,6 +22956,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescript
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -20045,14 +22964,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescript
        return ret_ref;
 }
 
+static inline uint64_t StaticPaymentOutputDescriptor_clone_ptr(LDKStaticPaymentOutputDescriptor *NONNULL_PTR arg) {
+       LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKStaticPaymentOutputDescriptor arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = StaticPaymentOutputDescriptor_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKStaticPaymentOutputDescriptor orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -20064,6 +23006,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDesc
        LDKStaticPaymentOutputDescriptor obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
        obj_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
        LDKCVec_u8Z ret_var = StaticPaymentOutputDescriptor_write(&obj_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
@@ -20090,6 +23033,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1fre
        SpendableOutputDescriptor_free(this_ptr_conv);
 }
 
+static inline uint64_t SpendableOutputDescriptor_clone_ptr(LDKSpendableOutputDescriptor *NONNULL_PTR arg) {
+       LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor");
+       *ret_copy = SpendableOutputDescriptor_clone(arg);
+uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKSpendableOutputDescriptor* arg_conv = (LDKSpendableOutputDescriptor*)arg;
+       int64_t ret_val = SpendableOutputDescriptor_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKSpendableOutputDescriptor* orig_conv = (LDKSpendableOutputDescriptor*)orig;
        LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor");
@@ -20102,6 +23057,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1
        LDKOutPoint outpoint_conv;
        outpoint_conv.inner = (void*)(outpoint & (~1));
        outpoint_conv.is_owned = (outpoint & 1) || (outpoint == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_conv);
        outpoint_conv = OutPoint_clone(&outpoint_conv);
        void* output_ptr = (void*)(((uint64_t)output) & ~1);
        CHECK_ACCESS(output_ptr);
@@ -20117,6 +23073,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1
        LDKDelayedPaymentOutputDescriptor a_conv;
        a_conv.inner = (void*)(a & (~1));
        a_conv.is_owned = (a & 1) || (a == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
        a_conv = DelayedPaymentOutputDescriptor_clone(&a_conv);
        LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor");
        *ret_copy = SpendableOutputDescriptor_delayed_payment_output(a_conv);
@@ -20128,6 +23085,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1
        LDKStaticPaymentOutputDescriptor a_conv;
        a_conv.inner = (void*)(a & (~1));
        a_conv.is_owned = (a & 1) || (a == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
        a_conv = StaticPaymentOutputDescriptor_clone(&a_conv);
        LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor");
        *ret_copy = SpendableOutputDescriptor_static_payment_output(a_conv);
@@ -20163,6 +23121,19 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BaseSign_1free(JNIEnv *env, jc
        BaseSign_free(this_ptr_conv);
 }
 
+static inline uint64_t Sign_clone_ptr(LDKSign *NONNULL_PTR arg) {
+       LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign");
+       *ret_ret = Sign_clone(arg);
+       return (uint64_t)ret_ret;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Sign_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       void* arg_ptr = (void*)(((uint64_t)arg) & ~1);
+       if (!(arg & 1)) { CHECK_ACCESS(arg_ptr); }
+       LDKSign* arg_conv = (LDKSign*)arg_ptr;
+       int64_t ret_val = Sign_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Sign_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        void* orig_ptr = (void*)(((uint64_t)orig) & ~1);
        if (!(orig & 1)) { CHECK_ACCESS(orig_ptr); }
@@ -20194,6 +23165,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1free(JNIEnv *e
        LDKInMemorySigner this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        InMemorySigner_free(this_obj_conv);
 }
 
@@ -20201,6 +23173,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1fu
        LDKInMemorySigner this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_funding_key(&this_ptr_conv));
        return ret_arr;
@@ -20210,6 +23183,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1funding_1
        LDKInMemorySigner this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKSecretKey val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 32);
        (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.bytes);
@@ -20220,6 +23194,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1re
        LDKInMemorySigner this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_revocation_base_key(&this_ptr_conv));
        return ret_arr;
@@ -20229,6 +23204,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1revocatio
        LDKInMemorySigner this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKSecretKey val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 32);
        (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.bytes);
@@ -20239,6 +23215,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1pa
        LDKInMemorySigner this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_payment_key(&this_ptr_conv));
        return ret_arr;
@@ -20248,6 +23225,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1payment_1
        LDKInMemorySigner this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKSecretKey val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 32);
        (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.bytes);
@@ -20258,6 +23236,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1de
        LDKInMemorySigner this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_delayed_payment_base_key(&this_ptr_conv));
        return ret_arr;
@@ -20267,6 +23246,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1delayed_1
        LDKInMemorySigner this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKSecretKey val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 32);
        (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.bytes);
@@ -20277,6 +23257,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1ht
        LDKInMemorySigner this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_htlc_base_key(&this_ptr_conv));
        return ret_arr;
@@ -20286,6 +23267,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1htlc_1bas
        LDKInMemorySigner this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKSecretKey val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 32);
        (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.bytes);
@@ -20296,6 +23278,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1co
        LDKInMemorySigner this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_commitment_seed(&this_ptr_conv));
        return ret_arr;
@@ -20305,20 +23288,44 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1commitmen
        LDKInMemorySigner this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKThirtyTwoBytes val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 32);
        (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
        InMemorySigner_set_commitment_seed(&this_ptr_conv, val_ref);
 }
 
+static inline uint64_t InMemorySigner_clone_ptr(LDKInMemorySigner *NONNULL_PTR arg) {
+       LDKInMemorySigner ret_var = InMemorySigner_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKInMemorySigner arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = InMemorySigner_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKInMemorySigner orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKInMemorySigner ret_var = InMemorySigner_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -20352,6 +23359,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1new(JNIEnv
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -20363,10 +23371,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1counterpart
        LDKInMemorySigner this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKChannelPublicKeys ret_var = InMemorySigner_counterparty_pubkeys(&this_arg_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -20378,6 +23388,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1counterpart
        LDKInMemorySigner this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        int16_t ret_val = InMemorySigner_counterparty_selected_contest_delay(&this_arg_conv);
        return ret_val;
 }
@@ -20386,6 +23397,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1holder_1sel
        LDKInMemorySigner this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        int16_t ret_val = InMemorySigner_holder_selected_contest_delay(&this_arg_conv);
        return ret_val;
 }
@@ -20394,6 +23406,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1is_1outbou
        LDKInMemorySigner this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        jboolean ret_val = InMemorySigner_is_outbound(&this_arg_conv);
        return ret_val;
 }
@@ -20402,10 +23415,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1funding_1ou
        LDKInMemorySigner this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKOutPoint ret_var = InMemorySigner_funding_outpoint(&this_arg_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -20417,10 +23432,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1channe
        LDKInMemorySigner this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKChannelTransactionParameters ret_var = InMemorySigner_get_channel_parameters(&this_arg_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -20432,6 +23449,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1sign_1count
        LDKInMemorySigner this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKTransaction spend_tx_ref;
        spend_tx_ref.datalen = (*env)->GetArrayLength(env, spend_tx);
        spend_tx_ref.data = MALLOC(spend_tx_ref.datalen, "LDKTransaction Bytes");
@@ -20440,6 +23458,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1sign_1count
        LDKStaticPaymentOutputDescriptor descriptor_conv;
        descriptor_conv.inner = (void*)(descriptor & (~1));
        descriptor_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(descriptor_conv);
        LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ");
        *ret_conv = InMemorySigner_sign_counterparty_payment_input(&this_arg_conv, spend_tx_ref, input_idx, &descriptor_conv);
        return (uint64_t)ret_conv;
@@ -20449,6 +23468,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1sign_1dynam
        LDKInMemorySigner this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKTransaction spend_tx_ref;
        spend_tx_ref.datalen = (*env)->GetArrayLength(env, spend_tx);
        spend_tx_ref.data = MALLOC(spend_tx_ref.datalen, "LDKTransaction Bytes");
@@ -20457,6 +23477,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1sign_1dynam
        LDKDelayedPaymentOutputDescriptor descriptor_conv;
        descriptor_conv.inner = (void*)(descriptor & (~1));
        descriptor_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(descriptor_conv);
        LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ");
        *ret_conv = InMemorySigner_sign_dynamic_p2wsh_input(&this_arg_conv, spend_tx_ref, input_idx, &descriptor_conv);
        return (uint64_t)ret_conv;
@@ -20466,6 +23487,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1as_1BaseSig
        LDKInMemorySigner this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKBaseSign* ret_ret = MALLOC(sizeof(LDKBaseSign), "LDKBaseSign");
        *ret_ret = InMemorySigner_as_BaseSign(&this_arg_conv);
        return (uint64_t)ret_ret;
@@ -20475,6 +23497,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1as_1Sign(JN
        LDKInMemorySigner this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign");
        *ret_ret = InMemorySigner_as_Sign(&this_arg_conv);
        return (uint64_t)ret_ret;
@@ -20484,6 +23507,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1write(J
        LDKInMemorySigner obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
        obj_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
        LDKCVec_u8Z ret_var = InMemorySigner_write(&obj_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
@@ -20505,6 +23529,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_KeysManager_1free(JNIEnv *env,
        LDKKeysManager this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        KeysManager_free(this_obj_conv);
 }
 
@@ -20517,6 +23542,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1new(JNIEnv *en
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -20528,6 +23554,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1derive_1channe
        LDKKeysManager this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        unsigned char params_arr[32];
        CHECK((*env)->GetArrayLength(env, params) == 32);
        (*env)->GetByteArrayRegion(env, params, 0, 32, params_arr);
@@ -20536,6 +23563,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1derive_1channe
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -20547,6 +23575,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1spend_1spendab
        LDKKeysManager this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKCVec_SpendableOutputDescriptorZ descriptors_constr;
        descriptors_constr.datalen = (*env)->GetArrayLength(env, descriptors);
        if (descriptors_constr.datalen > 0)
@@ -20592,6 +23621,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1as_1KeysInterf
        LDKKeysManager this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKKeysInterface* ret_ret = MALLOC(sizeof(LDKKeysInterface), "LDKKeysInterface");
        *ret_ret = KeysManager_as_KeysInterface(&this_arg_conv);
        return (uint64_t)ret_ret;
@@ -20601,6 +23631,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1free(JNIEnv *e
        LDKChannelManager this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        ChannelManager_free(this_obj_conv);
 }
 
@@ -20608,6 +23639,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainParameters_1free(JNIEnv *
        LDKChainParameters this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        ChainParameters_free(this_obj_conv);
 }
 
@@ -20615,6 +23647,7 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ChainParameters_1get_1networ
        LDKChainParameters this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        jclass ret_conv = LDKNetwork_to_java(env, ChainParameters_get_network(&this_ptr_conv));
        return ret_conv;
 }
@@ -20623,6 +23656,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainParameters_1set_1network(
        LDKChainParameters this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKNetwork val_conv = LDKNetwork_from_java(env, val);
        ChainParameters_set_network(&this_ptr_conv, val_conv);
 }
@@ -20631,10 +23665,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainParameters_1get_1best_
        LDKChainParameters this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKBestBlock ret_var = ChainParameters_get_best_block(&this_ptr_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -20646,9 +23682,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainParameters_1set_1best_1bl
        LDKChainParameters this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKBestBlock val_conv;
        val_conv.inner = (void*)(val & (~1));
        val_conv.is_owned = (val & 1) || (val == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
        val_conv = BestBlock_clone(&val_conv);
        ChainParameters_set_best_block(&this_ptr_conv, val_conv);
 }
@@ -20658,11 +23696,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainParameters_1new(JNIEnv
        LDKBestBlock best_block_arg_conv;
        best_block_arg_conv.inner = (void*)(best_block_arg & (~1));
        best_block_arg_conv.is_owned = (best_block_arg & 1) || (best_block_arg == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(best_block_arg_conv);
        best_block_arg_conv = BestBlock_clone(&best_block_arg_conv);
        LDKChainParameters ret_var = ChainParameters_new(network_arg_conv, best_block_arg_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -20670,14 +23710,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainParameters_1new(JNIEnv
        return ret_ref;
 }
 
+static inline uint64_t ChainParameters_clone_ptr(LDKChainParameters *NONNULL_PTR arg) {
+       LDKChainParameters ret_var = ChainParameters_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainParameters_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKChainParameters arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = ChainParameters_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainParameters_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKChainParameters orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKChainParameters ret_var = ChainParameters_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -20689,6 +23752,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1fr
        LDKCounterpartyForwardingInfo this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        CounterpartyForwardingInfo_free(this_obj_conv);
 }
 
@@ -20696,6 +23760,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_
        LDKCounterpartyForwardingInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int32_t ret_val = CounterpartyForwardingInfo_get_fee_base_msat(&this_ptr_conv);
        return ret_val;
 }
@@ -20704,6 +23769,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1se
        LDKCounterpartyForwardingInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        CounterpartyForwardingInfo_set_fee_base_msat(&this_ptr_conv, val);
 }
 
@@ -20711,6 +23777,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_
        LDKCounterpartyForwardingInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int32_t ret_val = CounterpartyForwardingInfo_get_fee_proportional_millionths(&this_ptr_conv);
        return ret_val;
 }
@@ -20719,6 +23786,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1se
        LDKCounterpartyForwardingInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        CounterpartyForwardingInfo_set_fee_proportional_millionths(&this_ptr_conv, val);
 }
 
@@ -20726,6 +23794,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_
        LDKCounterpartyForwardingInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int16_t ret_val = CounterpartyForwardingInfo_get_cltv_expiry_delta(&this_ptr_conv);
        return ret_val;
 }
@@ -20734,6 +23803,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1se
        LDKCounterpartyForwardingInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        CounterpartyForwardingInfo_set_cltv_expiry_delta(&this_ptr_conv, val);
 }
 
@@ -20742,6 +23812,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -20749,14 +23820,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_
        return ret_ref;
 }
 
+static inline uint64_t CounterpartyForwardingInfo_clone_ptr(LDKCounterpartyForwardingInfo *NONNULL_PTR arg) {
+       LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCounterpartyForwardingInfo arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = CounterpartyForwardingInfo_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCounterpartyForwardingInfo orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -20768,6 +23862,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1free(JNIE
        LDKChannelCounterparty this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        ChannelCounterparty_free(this_obj_conv);
 }
 
@@ -20775,6 +23870,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1ge
        LDKChannelCounterparty this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelCounterparty_get_node_id(&this_ptr_conv).compressed_form);
        return ret_arr;
@@ -20784,6 +23880,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1set_1node
        LDKChannelCounterparty this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKPublicKey val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 33);
        (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
@@ -20794,10 +23891,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1get_1f
        LDKChannelCounterparty this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKInitFeatures ret_var = ChannelCounterparty_get_features(&this_ptr_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -20809,9 +23908,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1set_1feat
        LDKChannelCounterparty this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKInitFeatures val_conv;
        val_conv.inner = (void*)(val & (~1));
        val_conv.is_owned = (val & 1) || (val == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
        val_conv = InitFeatures_clone(&val_conv);
        ChannelCounterparty_set_features(&this_ptr_conv, val_conv);
 }
@@ -20820,6 +23921,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1get_1u
        LDKChannelCounterparty this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int64_t ret_val = ChannelCounterparty_get_unspendable_punishment_reserve(&this_ptr_conv);
        return ret_val;
 }
@@ -20828,6 +23930,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1set_1unsp
        LDKChannelCounterparty this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        ChannelCounterparty_set_unspendable_punishment_reserve(&this_ptr_conv, val);
 }
 
@@ -20835,11 +23938,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1get_1f
        LDKChannelCounterparty this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKCounterpartyForwardingInfo ret_var = ChannelCounterparty_get_forwarding_info(&this_ptr_conv);
        uint64_t ret_ref = 0;
        if ((uint64_t)ret_var.inner > 4096) {
                CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
                CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
                ret_ref = (uint64_t)ret_var.inner;
                if (ret_var.is_owned) {
                        ret_ref |= 1;
@@ -20852,9 +23957,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1set_1forw
        LDKChannelCounterparty this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKCounterpartyForwardingInfo val_conv;
        val_conv.inner = (void*)(val & (~1));
        val_conv.is_owned = (val & 1) || (val == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
        val_conv = CounterpartyForwardingInfo_clone(&val_conv);
        ChannelCounterparty_set_forwarding_info(&this_ptr_conv, val_conv);
 }
@@ -20866,15 +23973,18 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1new(JN
        LDKInitFeatures features_arg_conv;
        features_arg_conv.inner = (void*)(features_arg & (~1));
        features_arg_conv.is_owned = (features_arg & 1) || (features_arg == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv);
        features_arg_conv = InitFeatures_clone(&features_arg_conv);
        LDKCounterpartyForwardingInfo forwarding_info_arg_conv;
        forwarding_info_arg_conv.inner = (void*)(forwarding_info_arg & (~1));
        forwarding_info_arg_conv.is_owned = (forwarding_info_arg & 1) || (forwarding_info_arg == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(forwarding_info_arg_conv);
        forwarding_info_arg_conv = CounterpartyForwardingInfo_clone(&forwarding_info_arg_conv);
        LDKChannelCounterparty ret_var = ChannelCounterparty_new(node_id_arg_ref, features_arg_conv, unspendable_punishment_reserve_arg, forwarding_info_arg_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -20882,14 +23992,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1new(JN
        return ret_ref;
 }
 
+static inline uint64_t ChannelCounterparty_clone_ptr(LDKChannelCounterparty *NONNULL_PTR arg) {
+       LDKChannelCounterparty ret_var = ChannelCounterparty_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKChannelCounterparty arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = ChannelCounterparty_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKChannelCounterparty orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKChannelCounterparty ret_var = ChannelCounterparty_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -20901,6 +24034,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1free(JNIEnv *e
        LDKChannelDetails this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        ChannelDetails_free(this_obj_conv);
 }
 
@@ -20908,6 +24042,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1ch
        LDKChannelDetails this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ChannelDetails_get_channel_id(&this_ptr_conv));
        return ret_arr;
@@ -20917,6 +24052,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1channel_1
        LDKChannelDetails this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKThirtyTwoBytes val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 32);
        (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
@@ -20927,10 +24063,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1counte
        LDKChannelDetails this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKChannelCounterparty ret_var = ChannelDetails_get_counterparty(&this_ptr_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -20942,9 +24080,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1counterpa
        LDKChannelDetails this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKChannelCounterparty val_conv;
        val_conv.inner = (void*)(val & (~1));
        val_conv.is_owned = (val & 1) || (val == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
        val_conv = ChannelCounterparty_clone(&val_conv);
        ChannelDetails_set_counterparty(&this_ptr_conv, val_conv);
 }
@@ -20953,11 +24093,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1fundin
        LDKChannelDetails this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKOutPoint ret_var = ChannelDetails_get_funding_txo(&this_ptr_conv);
        uint64_t ret_ref = 0;
        if ((uint64_t)ret_var.inner > 4096) {
                CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
                CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
                ret_ref = (uint64_t)ret_var.inner;
                if (ret_var.is_owned) {
                        ret_ref |= 1;
@@ -20970,9 +24112,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1funding_1
        LDKChannelDetails this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKOutPoint val_conv;
        val_conv.inner = (void*)(val & (~1));
        val_conv.is_owned = (val & 1) || (val == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
        val_conv = OutPoint_clone(&val_conv);
        ChannelDetails_set_funding_txo(&this_ptr_conv, val_conv);
 }
@@ -20981,6 +24125,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1short_
        LDKChannelDetails this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
        *ret_copy = ChannelDetails_get_short_channel_id(&this_ptr_conv);
        uint64_t ret_ref = (uint64_t)ret_copy;
@@ -20991,6 +24136,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1short_1ch
        LDKChannelDetails this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        void* val_ptr = (void*)(((uint64_t)val) & ~1);
        CHECK_ACCESS(val_ptr);
        LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
@@ -21002,6 +24148,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1channe
        LDKChannelDetails this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int64_t ret_val = ChannelDetails_get_channel_value_satoshis(&this_ptr_conv);
        return ret_val;
 }
@@ -21010,6 +24157,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1channel_1
        LDKChannelDetails this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        ChannelDetails_set_channel_value_satoshis(&this_ptr_conv, val);
 }
 
@@ -21017,6 +24165,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1unspen
        LDKChannelDetails this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
        *ret_copy = ChannelDetails_get_unspendable_punishment_reserve(&this_ptr_conv);
        uint64_t ret_ref = (uint64_t)ret_copy;
@@ -21027,6 +24176,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1unspendab
        LDKChannelDetails this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        void* val_ptr = (void*)(((uint64_t)val) & ~1);
        CHECK_ACCESS(val_ptr);
        LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
@@ -21038,6 +24188,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1user_1
        LDKChannelDetails this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int64_t ret_val = ChannelDetails_get_user_channel_id(&this_ptr_conv);
        return ret_val;
 }
@@ -21046,6 +24197,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1user_1cha
        LDKChannelDetails this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        ChannelDetails_set_user_channel_id(&this_ptr_conv, val);
 }
 
@@ -21053,6 +24205,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1outbou
        LDKChannelDetails this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int64_t ret_val = ChannelDetails_get_outbound_capacity_msat(&this_ptr_conv);
        return ret_val;
 }
@@ -21061,6 +24214,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1outbound_
        LDKChannelDetails this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        ChannelDetails_set_outbound_capacity_msat(&this_ptr_conv, val);
 }
 
@@ -21068,6 +24222,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1inboun
        LDKChannelDetails this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int64_t ret_val = ChannelDetails_get_inbound_capacity_msat(&this_ptr_conv);
        return ret_val;
 }
@@ -21076,6 +24231,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1inbound_1
        LDKChannelDetails this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        ChannelDetails_set_inbound_capacity_msat(&this_ptr_conv, val);
 }
 
@@ -21083,6 +24239,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1confir
        LDKChannelDetails this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z");
        *ret_copy = ChannelDetails_get_confirmations_required(&this_ptr_conv);
        uint64_t ret_ref = (uint64_t)ret_copy;
@@ -21093,6 +24250,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1confirmat
        LDKChannelDetails this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        void* val_ptr = (void*)(((uint64_t)val) & ~1);
        CHECK_ACCESS(val_ptr);
        LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr);
@@ -21104,6 +24262,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1force_
        LDKChannelDetails this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z");
        *ret_copy = ChannelDetails_get_force_close_spend_delay(&this_ptr_conv);
        uint64_t ret_ref = (uint64_t)ret_copy;
@@ -21114,6 +24273,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1force_1cl
        LDKChannelDetails this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        void* val_ptr = (void*)(((uint64_t)val) & ~1);
        CHECK_ACCESS(val_ptr);
        LDKCOption_u16Z val_conv = *(LDKCOption_u16Z*)(val_ptr);
@@ -21125,6 +24285,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1is_1o
        LDKChannelDetails this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        jboolean ret_val = ChannelDetails_get_is_outbound(&this_ptr_conv);
        return ret_val;
 }
@@ -21133,6 +24294,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1is_1outbo
        LDKChannelDetails this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        ChannelDetails_set_is_outbound(&this_ptr_conv, val);
 }
 
@@ -21140,6 +24302,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1is_1f
        LDKChannelDetails this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        jboolean ret_val = ChannelDetails_get_is_funding_locked(&this_ptr_conv);
        return ret_val;
 }
@@ -21148,6 +24311,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1is_1fundi
        LDKChannelDetails this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        ChannelDetails_set_is_funding_locked(&this_ptr_conv, val);
 }
 
@@ -21155,6 +24319,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1is_1u
        LDKChannelDetails this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        jboolean ret_val = ChannelDetails_get_is_usable(&this_ptr_conv);
        return ret_val;
 }
@@ -21163,6 +24328,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1is_1usabl
        LDKChannelDetails this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        ChannelDetails_set_is_usable(&this_ptr_conv, val);
 }
 
@@ -21170,6 +24336,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1is_1p
        LDKChannelDetails this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        jboolean ret_val = ChannelDetails_get_is_public(&this_ptr_conv);
        return ret_val;
 }
@@ -21178,6 +24345,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1is_1publi
        LDKChannelDetails this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        ChannelDetails_set_is_public(&this_ptr_conv, val);
 }
 
@@ -21188,10 +24356,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1new(JNIEnv
        LDKChannelCounterparty counterparty_arg_conv;
        counterparty_arg_conv.inner = (void*)(counterparty_arg & (~1));
        counterparty_arg_conv.is_owned = (counterparty_arg & 1) || (counterparty_arg == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(counterparty_arg_conv);
        counterparty_arg_conv = ChannelCounterparty_clone(&counterparty_arg_conv);
        LDKOutPoint funding_txo_arg_conv;
        funding_txo_arg_conv.inner = (void*)(funding_txo_arg & (~1));
        funding_txo_arg_conv.is_owned = (funding_txo_arg & 1) || (funding_txo_arg == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_arg_conv);
        funding_txo_arg_conv = OutPoint_clone(&funding_txo_arg_conv);
        void* short_channel_id_arg_ptr = (void*)(((uint64_t)short_channel_id_arg) & ~1);
        CHECK_ACCESS(short_channel_id_arg_ptr);
@@ -21212,6 +24382,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1new(JNIEnv
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -21219,14 +24390,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1new(JNIEnv
        return ret_ref;
 }
 
+static inline uint64_t ChannelDetails_clone_ptr(LDKChannelDetails *NONNULL_PTR arg) {
+       LDKChannelDetails ret_var = ChannelDetails_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKChannelDetails arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = ChannelDetails_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKChannelDetails orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKChannelDetails ret_var = ChannelDetails_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -21243,6 +24437,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1free(JNIEn
        PaymentSendFailure_free(this_ptr_conv);
 }
 
+static inline uint64_t PaymentSendFailure_clone_ptr(LDKPaymentSendFailure *NONNULL_PTR arg) {
+       LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
+       *ret_copy = PaymentSendFailure_clone(arg);
+uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKPaymentSendFailure* arg_conv = (LDKPaymentSendFailure*)arg;
+       int64_t ret_val = PaymentSendFailure_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKPaymentSendFailure* orig_conv = (LDKPaymentSendFailure*)orig;
        LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
@@ -21327,6 +24533,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1partial
        LDKRouteParameters failed_paths_retry_conv;
        failed_paths_retry_conv.inner = (void*)(failed_paths_retry & (~1));
        failed_paths_retry_conv.is_owned = (failed_paths_retry & 1) || (failed_paths_retry == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(failed_paths_retry_conv);
        failed_paths_retry_conv = RouteParameters_clone(&failed_paths_retry_conv);
        LDKThirtyTwoBytes payment_id_ref;
        CHECK((*env)->GetArrayLength(env, payment_id) == 32);
@@ -21376,15 +24583,18 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1new(JNIEnv
        LDKUserConfig config_conv;
        config_conv.inner = (void*)(config & (~1));
        config_conv.is_owned = (config & 1) || (config == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(config_conv);
        config_conv = UserConfig_clone(&config_conv);
        LDKChainParameters params_conv;
        params_conv.inner = (void*)(params & (~1));
        params_conv.is_owned = (params & 1) || (params == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(params_conv);
        params_conv = ChainParameters_clone(&params_conv);
        LDKChannelManager ret_var = ChannelManager_new(fee_est_conv, chain_monitor_conv, tx_broadcaster_conv, logger_conv, keys_manager_conv, config_conv, params_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -21396,10 +24606,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1curren
        LDKChannelManager this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKUserConfig ret_var = ChannelManager_get_current_default_configuration(&this_arg_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -21411,12 +24623,14 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1create_1cha
        LDKChannelManager this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKPublicKey their_network_key_ref;
        CHECK((*env)->GetArrayLength(env, their_network_key) == 33);
        (*env)->GetByteArrayRegion(env, their_network_key, 0, 33, their_network_key_ref.compressed_form);
        LDKUserConfig override_config_conv;
        override_config_conv.inner = (void*)(override_config & (~1));
        override_config_conv.is_owned = (override_config & 1) || (override_config == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(override_config_conv);
        override_config_conv = UserConfig_clone(&override_config_conv);
        LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ");
        *ret_conv = ChannelManager_create_channel(&this_arg_conv, their_network_key_ref, channel_value_satoshis, push_msat, user_channel_id, override_config_conv);
@@ -21427,6 +24641,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelManager_1list_1
        LDKChannelManager this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKCVec_ChannelDetailsZ ret_var = ChannelManager_list_channels(&this_arg_conv);
        int64_tArray ret_arr = NULL;
        ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
@@ -21436,6 +24651,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelManager_1list_1
                uint64_t ret_conv_16_ref = 0;
                CHECK((((uint64_t)ret_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
                CHECK((((uint64_t)&ret_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+               CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var);
                ret_conv_16_ref = (uint64_t)ret_conv_16_var.inner;
                if (ret_conv_16_var.is_owned) {
                        ret_conv_16_ref |= 1;
@@ -21451,6 +24667,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelManager_1list_1
        LDKChannelManager this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKCVec_ChannelDetailsZ ret_var = ChannelManager_list_usable_channels(&this_arg_conv);
        int64_tArray ret_arr = NULL;
        ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
@@ -21460,6 +24677,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelManager_1list_1
                uint64_t ret_conv_16_ref = 0;
                CHECK((((uint64_t)ret_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
                CHECK((((uint64_t)&ret_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+               CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var);
                ret_conv_16_ref = (uint64_t)ret_conv_16_var.inner;
                if (ret_conv_16_var.is_owned) {
                        ret_conv_16_ref |= 1;
@@ -21475,6 +24693,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1close_1chan
        LDKChannelManager this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        unsigned char channel_id_arr[32];
        CHECK((*env)->GetArrayLength(env, channel_id) == 32);
        (*env)->GetByteArrayRegion(env, channel_id, 0, 32, channel_id_arr);
@@ -21488,6 +24707,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1close_1chan
        LDKChannelManager this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        unsigned char channel_id_arr[32];
        CHECK((*env)->GetArrayLength(env, channel_id) == 32);
        (*env)->GetByteArrayRegion(env, channel_id, 0, 32, channel_id_arr);
@@ -21501,6 +24721,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1clos
        LDKChannelManager this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        unsigned char channel_id_arr[32];
        CHECK((*env)->GetArrayLength(env, channel_id) == 32);
        (*env)->GetByteArrayRegion(env, channel_id, 0, 32, channel_id_arr);
@@ -21514,6 +24735,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1close_1
        LDKChannelManager this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        ChannelManager_force_close_all_channels(&this_arg_conv);
 }
 
@@ -21521,9 +24743,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1send_1payme
        LDKChannelManager this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKRoute route_conv;
        route_conv.inner = (void*)(route & (~1));
        route_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv);
        LDKThirtyTwoBytes payment_hash_ref;
        CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
        (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
@@ -21539,9 +24763,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1retry_1paym
        LDKChannelManager this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKRoute route_conv;
        route_conv.inner = (void*)(route & (~1));
        route_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv);
        LDKThirtyTwoBytes payment_id_ref;
        CHECK((*env)->GetArrayLength(env, payment_id) == 32);
        (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data);
@@ -21554,9 +24780,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1send_1spont
        LDKChannelManager this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKRoute route_conv;
        route_conv.inner = (void*)(route & (~1));
        route_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv);
        LDKThirtyTwoBytes payment_preimage_ref;
        CHECK((*env)->GetArrayLength(env, payment_preimage) == 32);
        (*env)->GetByteArrayRegion(env, payment_preimage, 0, 32, payment_preimage_ref.data);
@@ -21569,6 +24797,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1funding_1tr
        LDKChannelManager this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        unsigned char temporary_channel_id_arr[32];
        CHECK((*env)->GetArrayLength(env, temporary_channel_id) == 32);
        (*env)->GetByteArrayRegion(env, temporary_channel_id, 0, 32, temporary_channel_id_arr);
@@ -21587,6 +24816,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1broadcast_1nod
        LDKChannelManager this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKThreeBytes rgb_ref;
        CHECK((*env)->GetArrayLength(env, rgb) == 3);
        (*env)->GetByteArrayRegion(env, rgb, 0, 3, rgb_ref.data);
@@ -21615,6 +24845,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1process_1pendi
        LDKChannelManager this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        ChannelManager_process_pending_htlc_forwards(&this_arg_conv);
 }
 
@@ -21622,6 +24853,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1timer_1tick_1o
        LDKChannelManager this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        ChannelManager_timer_tick_occurred(&this_arg_conv);
 }
 
@@ -21629,6 +24861,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelManager_1fail_1htlc
        LDKChannelManager this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        unsigned char payment_hash_arr[32];
        CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
        (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_arr);
@@ -21641,6 +24874,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelManager_1claim_1fun
        LDKChannelManager this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKThirtyTwoBytes payment_preimage_ref;
        CHECK((*env)->GetArrayLength(env, payment_preimage) == 32);
        (*env)->GetByteArrayRegion(env, payment_preimage, 0, 32, payment_preimage_ref.data);
@@ -21652,6 +24886,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1ou
        LDKChannelManager this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelManager_get_our_node_id(&this_arg_conv).compressed_form);
        return ret_arr;
@@ -21661,6 +24896,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1create_1inb
        LDKChannelManager this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        void* min_value_msat_ptr = (void*)(((uint64_t)min_value_msat) & ~1);
        CHECK_ACCESS(min_value_msat_ptr);
        LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr);
@@ -21674,6 +24910,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1create_1inb
        LDKChannelManager this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKThirtyTwoBytes payment_hash_ref;
        CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
        (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
@@ -21690,6 +24927,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1Message
        LDKChannelManager this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
        *ret_ret = ChannelManager_as_MessageSendEventsProvider(&this_arg_conv);
        return (uint64_t)ret_ret;
@@ -21699,6 +24937,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1EventsP
        LDKChannelManager this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKEventsProvider* ret_ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider");
        *ret_ret = ChannelManager_as_EventsProvider(&this_arg_conv);
        return (uint64_t)ret_ret;
@@ -21708,6 +24947,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1Listen(
        LDKChannelManager this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKListen* ret_ret = MALLOC(sizeof(LDKListen), "LDKListen");
        *ret_ret = ChannelManager_as_Listen(&this_arg_conv);
        return (uint64_t)ret_ret;
@@ -21717,6 +24957,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1Confirm
        LDKChannelManager this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKConfirm* ret_ret = MALLOC(sizeof(LDKConfirm), "LDKConfirm");
        *ret_ret = ChannelManager_as_Confirm(&this_arg_conv);
        return (uint64_t)ret_ret;
@@ -21726,6 +24967,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelManager_1await_1per
        LDKChannelManager this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        jboolean ret_val = ChannelManager_await_persistable_update_timeout(&this_arg_conv, max_wait);
        return ret_val;
 }
@@ -21734,6 +24976,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1await_1persist
        LDKChannelManager this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        ChannelManager_await_persistable_update(&this_arg_conv);
 }
 
@@ -21741,10 +24984,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1current_1be
        LDKChannelManager this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKBestBlock ret_var = ChannelManager_current_best_block(&this_arg_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -21756,6 +25001,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1Channel
        LDKChannelManager this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKChannelMessageHandler* ret_ret = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler");
        *ret_ret = ChannelManager_as_ChannelMessageHandler(&this_arg_conv);
        return (uint64_t)ret_ret;
@@ -21765,6 +25011,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelManager_1write(J
        LDKChannelManager obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
        obj_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
        LDKCVec_u8Z ret_var = ChannelManager_write(&obj_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
@@ -21776,6 +25023,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1free(J
        LDKChannelManagerReadArgs this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        ChannelManagerReadArgs_free(this_obj_conv);
 }
 
@@ -21783,6 +25031,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get
        LDKChannelManagerReadArgs this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        // WARNING: This object doesn't live past this scope, needs clone!
        uint64_t ret_ret = ((uint64_t)ChannelManagerReadArgs_get_keys_manager(&this_ptr_conv)) | 1;
        return ret_ret;
@@ -21792,6 +25041,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1k
        LDKChannelManagerReadArgs this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        void* val_ptr = (void*)(((uint64_t)val) & ~1);
        CHECK_ACCESS(val_ptr);
        LDKKeysInterface val_conv = *(LDKKeysInterface*)(val_ptr);
@@ -21806,6 +25056,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get
        LDKChannelManagerReadArgs this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        // WARNING: This object doesn't live past this scope, needs clone!
        uint64_t ret_ret = ((uint64_t)ChannelManagerReadArgs_get_fee_estimator(&this_ptr_conv)) | 1;
        return ret_ret;
@@ -21815,6 +25066,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1f
        LDKChannelManagerReadArgs this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        void* val_ptr = (void*)(((uint64_t)val) & ~1);
        CHECK_ACCESS(val_ptr);
        LDKFeeEstimator val_conv = *(LDKFeeEstimator*)(val_ptr);
@@ -21829,6 +25081,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get
        LDKChannelManagerReadArgs this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        // WARNING: This object doesn't live past this scope, needs clone!
        uint64_t ret_ret = ((uint64_t)ChannelManagerReadArgs_get_chain_monitor(&this_ptr_conv)) | 1;
        return ret_ret;
@@ -21838,6 +25091,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1c
        LDKChannelManagerReadArgs this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        void* val_ptr = (void*)(((uint64_t)val) & ~1);
        CHECK_ACCESS(val_ptr);
        LDKWatch val_conv = *(LDKWatch*)(val_ptr);
@@ -21852,6 +25106,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get
        LDKChannelManagerReadArgs this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        // WARNING: This object doesn't live past this scope, needs clone!
        uint64_t ret_ret = ((uint64_t)ChannelManagerReadArgs_get_tx_broadcaster(&this_ptr_conv)) | 1;
        return ret_ret;
@@ -21861,6 +25116,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1t
        LDKChannelManagerReadArgs this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        void* val_ptr = (void*)(((uint64_t)val) & ~1);
        CHECK_ACCESS(val_ptr);
        LDKBroadcasterInterface val_conv = *(LDKBroadcasterInterface*)(val_ptr);
@@ -21875,6 +25131,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get
        LDKChannelManagerReadArgs this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        // WARNING: This object doesn't live past this scope, needs clone!
        uint64_t ret_ret = ((uint64_t)ChannelManagerReadArgs_get_logger(&this_ptr_conv)) | 1;
        return ret_ret;
@@ -21884,6 +25141,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1l
        LDKChannelManagerReadArgs this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        void* val_ptr = (void*)(((uint64_t)val) & ~1);
        CHECK_ACCESS(val_ptr);
        LDKLogger val_conv = *(LDKLogger*)(val_ptr);
@@ -21898,10 +25156,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get
        LDKChannelManagerReadArgs this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKUserConfig ret_var = ChannelManagerReadArgs_get_default_config(&this_ptr_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -21913,9 +25173,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1d
        LDKChannelManagerReadArgs this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKUserConfig val_conv;
        val_conv.inner = (void*)(val & (~1));
        val_conv.is_owned = (val & 1) || (val == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
        val_conv = UserConfig_clone(&val_conv);
        ChannelManagerReadArgs_set_default_config(&this_ptr_conv, val_conv);
 }
@@ -21959,6 +25221,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1new
        LDKUserConfig default_config_conv;
        default_config_conv.inner = (void*)(default_config & (~1));
        default_config_conv.is_owned = (default_config & 1) || (default_config == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(default_config_conv);
        default_config_conv = UserConfig_clone(&default_config_conv);
        LDKCVec_ChannelMonitorZ channel_monitors_constr;
        channel_monitors_constr.datalen = (*env)->GetArrayLength(env, channel_monitors);
@@ -21972,6 +25235,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1new
                LDKChannelMonitor channel_monitors_conv_16_conv;
                channel_monitors_conv_16_conv.inner = (void*)(channel_monitors_conv_16 & (~1));
                channel_monitors_conv_16_conv.is_owned = (channel_monitors_conv_16 & 1) || (channel_monitors_conv_16 == 0);
+               CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_monitors_conv_16_conv);
                channel_monitors_constr.data[q] = channel_monitors_conv_16_conv;
        }
        (*env)->ReleaseLongArrayElements(env, channel_monitors, channel_monitors_vals, 0);
@@ -21979,6 +25243,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1new
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -21993,6 +25258,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMa
        LDKChannelManagerReadArgs arg_conv;
        arg_conv.inner = (void*)(arg & (~1));
        arg_conv.is_owned = (arg & 1) || (arg == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
        // Warning: we need a move here but no clone is available for LDKChannelManagerReadArgs
        LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ");
        *ret_conv = C2Tuple_BlockHashChannelManagerZ_read(ser_ref, arg_conv);
@@ -22004,17 +25270,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DecodeError_1free(JNIEnv *env,
        LDKDecodeError this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        DecodeError_free(this_obj_conv);
 }
 
+static inline uint64_t DecodeError_clone_ptr(LDKDecodeError *NONNULL_PTR arg) {
+       LDKDecodeError ret_var = DecodeError_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DecodeError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKDecodeError arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = DecodeError_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DecodeError_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKDecodeError orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKDecodeError ret_var = DecodeError_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -22026,6 +25316,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Init_1free(JNIEnv *env, jclass
        LDKInit this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        Init_free(this_obj_conv);
 }
 
@@ -22033,10 +25324,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Init_1get_1features(JNIEnv
        LDKInit this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKInitFeatures ret_var = Init_get_features(&this_ptr_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -22048,9 +25341,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Init_1set_1features(JNIEnv *en
        LDKInit this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKInitFeatures val_conv;
        val_conv.inner = (void*)(val & (~1));
        val_conv.is_owned = (val & 1) || (val == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
        val_conv = InitFeatures_clone(&val_conv);
        Init_set_features(&this_ptr_conv, val_conv);
 }
@@ -22059,11 +25354,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Init_1new(JNIEnv *env, jcla
        LDKInitFeatures features_arg_conv;
        features_arg_conv.inner = (void*)(features_arg & (~1));
        features_arg_conv.is_owned = (features_arg & 1) || (features_arg == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv);
        features_arg_conv = InitFeatures_clone(&features_arg_conv);
        LDKInit ret_var = Init_new(features_arg_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -22071,14 +25368,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Init_1new(JNIEnv *env, jcla
        return ret_ref;
 }
 
+static inline uint64_t Init_clone_ptr(LDKInit *NONNULL_PTR arg) {
+       LDKInit ret_var = Init_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Init_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKInit arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = Init_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Init_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKInit orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKInit ret_var = Init_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -22090,6 +25410,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1free(JNIEnv *env
        LDKErrorMessage this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        ErrorMessage_free(this_obj_conv);
 }
 
@@ -22097,6 +25418,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1get_1chan
        LDKErrorMessage this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ErrorMessage_get_channel_id(&this_ptr_conv));
        return ret_arr;
@@ -22106,6 +25428,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1set_1channel_1id
        LDKErrorMessage this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKThirtyTwoBytes val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 32);
        (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
@@ -22116,6 +25439,7 @@ JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1get_1data(JNI
        LDKErrorMessage this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKStr ret_str = ErrorMessage_get_data(&this_ptr_conv);
        jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
        Str_free(ret_str);
@@ -22126,6 +25450,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1set_1data(JNIEnv
        LDKErrorMessage this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKStr val_conv = java_to_owned_str(env, val);
        ErrorMessage_set_data(&this_ptr_conv, val_conv);
 }
@@ -22139,6 +25464,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1new(JNIEnv *e
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -22146,14 +25472,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1new(JNIEnv *e
        return ret_ref;
 }
 
+static inline uint64_t ErrorMessage_clone_ptr(LDKErrorMessage *NONNULL_PTR arg) {
+       LDKErrorMessage ret_var = ErrorMessage_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKErrorMessage arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = ErrorMessage_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKErrorMessage orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKErrorMessage ret_var = ErrorMessage_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -22165,6 +25514,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Ping_1free(JNIEnv *env, jclass
        LDKPing this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        Ping_free(this_obj_conv);
 }
 
@@ -22172,6 +25522,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_Ping_1get_1ponglen(JNIEnv *
        LDKPing this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int16_t ret_val = Ping_get_ponglen(&this_ptr_conv);
        return ret_val;
 }
@@ -22180,6 +25531,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Ping_1set_1ponglen(JNIEnv *env
        LDKPing this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        Ping_set_ponglen(&this_ptr_conv, val);
 }
 
@@ -22187,6 +25539,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_Ping_1get_1byteslen(JNIEnv
        LDKPing this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int16_t ret_val = Ping_get_byteslen(&this_ptr_conv);
        return ret_val;
 }
@@ -22195,6 +25548,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Ping_1set_1byteslen(JNIEnv *en
        LDKPing this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        Ping_set_byteslen(&this_ptr_conv, val);
 }
 
@@ -22203,6 +25557,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Ping_1new(JNIEnv *env, jcla
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -22210,14 +25565,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Ping_1new(JNIEnv *env, jcla
        return ret_ref;
 }
 
+static inline uint64_t Ping_clone_ptr(LDKPing *NONNULL_PTR arg) {
+       LDKPing ret_var = Ping_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Ping_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKPing arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = Ping_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Ping_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKPing orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKPing ret_var = Ping_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -22229,6 +25607,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Pong_1free(JNIEnv *env, jclass
        LDKPong this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        Pong_free(this_obj_conv);
 }
 
@@ -22236,6 +25615,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_Pong_1get_1byteslen(JNIEnv
        LDKPong this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int16_t ret_val = Pong_get_byteslen(&this_ptr_conv);
        return ret_val;
 }
@@ -22244,6 +25624,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Pong_1set_1byteslen(JNIEnv *en
        LDKPong this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        Pong_set_byteslen(&this_ptr_conv, val);
 }
 
@@ -22252,6 +25633,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Pong_1new(JNIEnv *env, jcla
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -22259,14 +25641,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Pong_1new(JNIEnv *env, jcla
        return ret_ref;
 }
 
+static inline uint64_t Pong_clone_ptr(LDKPong *NONNULL_PTR arg) {
+       LDKPong ret_var = Pong_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Pong_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKPong arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = Pong_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Pong_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKPong orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKPong ret_var = Pong_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -22278,6 +25683,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1free(JNIEnv *env,
        LDKOpenChannel this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        OpenChannel_free(this_obj_conv);
 }
 
@@ -22285,6 +25691,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1chain
        LDKOpenChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *OpenChannel_get_chain_hash(&this_ptr_conv));
        return ret_arr;
@@ -22294,6 +25701,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1chain_1hash(
        LDKOpenChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKThirtyTwoBytes val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 32);
        (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
@@ -22304,6 +25712,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1tempo
        LDKOpenChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *OpenChannel_get_temporary_channel_id(&this_ptr_conv));
        return ret_arr;
@@ -22313,6 +25722,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1temporary_1c
        LDKOpenChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKThirtyTwoBytes val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 32);
        (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
@@ -22323,6 +25733,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1funding_1
        LDKOpenChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int64_t ret_val = OpenChannel_get_funding_satoshis(&this_ptr_conv);
        return ret_val;
 }
@@ -22331,6 +25742,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1funding_1sat
        LDKOpenChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        OpenChannel_set_funding_satoshis(&this_ptr_conv, val);
 }
 
@@ -22338,6 +25750,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1push_1msa
        LDKOpenChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int64_t ret_val = OpenChannel_get_push_msat(&this_ptr_conv);
        return ret_val;
 }
@@ -22346,6 +25759,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1push_1msat(J
        LDKOpenChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        OpenChannel_set_push_msat(&this_ptr_conv, val);
 }
 
@@ -22353,6 +25767,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1dust_1lim
        LDKOpenChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int64_t ret_val = OpenChannel_get_dust_limit_satoshis(&this_ptr_conv);
        return ret_val;
 }
@@ -22361,6 +25776,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1dust_1limit_
        LDKOpenChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        OpenChannel_set_dust_limit_satoshis(&this_ptr_conv, val);
 }
 
@@ -22368,6 +25784,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1max_1htlc
        LDKOpenChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int64_t ret_val = OpenChannel_get_max_htlc_value_in_flight_msat(&this_ptr_conv);
        return ret_val;
 }
@@ -22376,6 +25793,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1max_1htlc_1v
        LDKOpenChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        OpenChannel_set_max_htlc_value_in_flight_msat(&this_ptr_conv, val);
 }
 
@@ -22383,6 +25801,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1channel_1
        LDKOpenChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int64_t ret_val = OpenChannel_get_channel_reserve_satoshis(&this_ptr_conv);
        return ret_val;
 }
@@ -22391,6 +25810,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1channel_1res
        LDKOpenChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        OpenChannel_set_channel_reserve_satoshis(&this_ptr_conv, val);
 }
 
@@ -22398,6 +25818,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1htlc_1min
        LDKOpenChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int64_t ret_val = OpenChannel_get_htlc_minimum_msat(&this_ptr_conv);
        return ret_val;
 }
@@ -22406,6 +25827,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1htlc_1minimu
        LDKOpenChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        OpenChannel_set_htlc_minimum_msat(&this_ptr_conv, val);
 }
 
@@ -22413,6 +25835,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1feerate_1
        LDKOpenChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int32_t ret_val = OpenChannel_get_feerate_per_kw(&this_ptr_conv);
        return ret_val;
 }
@@ -22421,6 +25844,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1feerate_1per
        LDKOpenChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        OpenChannel_set_feerate_per_kw(&this_ptr_conv, val);
 }
 
@@ -22428,6 +25852,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1to_1self_
        LDKOpenChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int16_t ret_val = OpenChannel_get_to_self_delay(&this_ptr_conv);
        return ret_val;
 }
@@ -22436,6 +25861,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1to_1self_1de
        LDKOpenChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        OpenChannel_set_to_self_delay(&this_ptr_conv, val);
 }
 
@@ -22443,6 +25869,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1max_1acce
        LDKOpenChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int16_t ret_val = OpenChannel_get_max_accepted_htlcs(&this_ptr_conv);
        return ret_val;
 }
@@ -22451,6 +25878,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1max_1accepte
        LDKOpenChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        OpenChannel_set_max_accepted_htlcs(&this_ptr_conv, val);
 }
 
@@ -22458,6 +25886,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1fundi
        LDKOpenChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OpenChannel_get_funding_pubkey(&this_ptr_conv).compressed_form);
        return ret_arr;
@@ -22467,6 +25896,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1funding_1pub
        LDKOpenChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKPublicKey val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 33);
        (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
@@ -22477,6 +25907,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1revoc
        LDKOpenChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OpenChannel_get_revocation_basepoint(&this_ptr_conv).compressed_form);
        return ret_arr;
@@ -22486,6 +25917,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1revocation_1
        LDKOpenChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKPublicKey val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 33);
        (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
@@ -22496,6 +25928,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1payme
        LDKOpenChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OpenChannel_get_payment_point(&this_ptr_conv).compressed_form);
        return ret_arr;
@@ -22505,6 +25938,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1payment_1poi
        LDKOpenChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKPublicKey val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 33);
        (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
@@ -22515,6 +25949,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1delay
        LDKOpenChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OpenChannel_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form);
        return ret_arr;
@@ -22524,6 +25959,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1delayed_1pay
        LDKOpenChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKPublicKey val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 33);
        (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
@@ -22534,6 +25970,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1htlc_
        LDKOpenChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OpenChannel_get_htlc_basepoint(&this_ptr_conv).compressed_form);
        return ret_arr;
@@ -22543,6 +25980,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1htlc_1basepo
        LDKOpenChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKPublicKey val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 33);
        (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
@@ -22553,6 +25991,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1first
        LDKOpenChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OpenChannel_get_first_per_commitment_point(&this_ptr_conv).compressed_form);
        return ret_arr;
@@ -22562,6 +26001,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1first_1per_1
        LDKOpenChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKPublicKey val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 33);
        (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
@@ -22572,6 +26012,7 @@ JNIEXPORT int8_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1channel_1f
        LDKOpenChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_t ret_val = OpenChannel_get_channel_flags(&this_ptr_conv);
        return ret_val;
 }
@@ -22580,17 +26021,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1channel_1fla
        LDKOpenChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        OpenChannel_set_channel_flags(&this_ptr_conv, val);
 }
 
+static inline uint64_t OpenChannel_clone_ptr(LDKOpenChannel *NONNULL_PTR arg) {
+       LDKOpenChannel ret_var = OpenChannel_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKOpenChannel arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = OpenChannel_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKOpenChannel orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKOpenChannel ret_var = OpenChannel_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -22602,6 +26067,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1free(JNIEnv *en
        LDKAcceptChannel this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        AcceptChannel_free(this_obj_conv);
 }
 
@@ -22609,6 +26075,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1tem
        LDKAcceptChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *AcceptChannel_get_temporary_channel_id(&this_ptr_conv));
        return ret_arr;
@@ -22618,6 +26085,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1temporary_
        LDKAcceptChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKThirtyTwoBytes val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 32);
        (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
@@ -22628,6 +26096,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1dust_1l
        LDKAcceptChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int64_t ret_val = AcceptChannel_get_dust_limit_satoshis(&this_ptr_conv);
        return ret_val;
 }
@@ -22636,6 +26105,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1dust_1limi
        LDKAcceptChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        AcceptChannel_set_dust_limit_satoshis(&this_ptr_conv, val);
 }
 
@@ -22643,6 +26113,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1max_1ht
        LDKAcceptChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int64_t ret_val = AcceptChannel_get_max_htlc_value_in_flight_msat(&this_ptr_conv);
        return ret_val;
 }
@@ -22651,6 +26122,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1max_1htlc_
        LDKAcceptChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        AcceptChannel_set_max_htlc_value_in_flight_msat(&this_ptr_conv, val);
 }
 
@@ -22658,6 +26130,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1channel
        LDKAcceptChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int64_t ret_val = AcceptChannel_get_channel_reserve_satoshis(&this_ptr_conv);
        return ret_val;
 }
@@ -22666,6 +26139,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1channel_1r
        LDKAcceptChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        AcceptChannel_set_channel_reserve_satoshis(&this_ptr_conv, val);
 }
 
@@ -22673,6 +26147,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1htlc_1m
        LDKAcceptChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int64_t ret_val = AcceptChannel_get_htlc_minimum_msat(&this_ptr_conv);
        return ret_val;
 }
@@ -22681,6 +26156,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1htlc_1mini
        LDKAcceptChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        AcceptChannel_set_htlc_minimum_msat(&this_ptr_conv, val);
 }
 
@@ -22688,6 +26164,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1minimum
        LDKAcceptChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int32_t ret_val = AcceptChannel_get_minimum_depth(&this_ptr_conv);
        return ret_val;
 }
@@ -22696,6 +26173,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1minimum_1d
        LDKAcceptChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        AcceptChannel_set_minimum_depth(&this_ptr_conv, val);
 }
 
@@ -22703,6 +26181,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1to_1sel
        LDKAcceptChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int16_t ret_val = AcceptChannel_get_to_self_delay(&this_ptr_conv);
        return ret_val;
 }
@@ -22711,6 +26190,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1to_1self_1
        LDKAcceptChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        AcceptChannel_set_to_self_delay(&this_ptr_conv, val);
 }
 
@@ -22718,6 +26198,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1max_1ac
        LDKAcceptChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int16_t ret_val = AcceptChannel_get_max_accepted_htlcs(&this_ptr_conv);
        return ret_val;
 }
@@ -22726,6 +26207,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1max_1accep
        LDKAcceptChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        AcceptChannel_set_max_accepted_htlcs(&this_ptr_conv, val);
 }
 
@@ -22733,6 +26215,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1fun
        LDKAcceptChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, AcceptChannel_get_funding_pubkey(&this_ptr_conv).compressed_form);
        return ret_arr;
@@ -22742,6 +26225,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1funding_1p
        LDKAcceptChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKPublicKey val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 33);
        (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
@@ -22752,6 +26236,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1rev
        LDKAcceptChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, AcceptChannel_get_revocation_basepoint(&this_ptr_conv).compressed_form);
        return ret_arr;
@@ -22761,6 +26246,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1revocation
        LDKAcceptChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKPublicKey val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 33);
        (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
@@ -22771,6 +26257,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1pay
        LDKAcceptChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, AcceptChannel_get_payment_point(&this_ptr_conv).compressed_form);
        return ret_arr;
@@ -22780,6 +26267,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1payment_1p
        LDKAcceptChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKPublicKey val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 33);
        (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
@@ -22790,6 +26278,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1del
        LDKAcceptChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, AcceptChannel_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form);
        return ret_arr;
@@ -22799,6 +26288,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1delayed_1p
        LDKAcceptChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKPublicKey val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 33);
        (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
@@ -22809,6 +26299,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1htl
        LDKAcceptChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, AcceptChannel_get_htlc_basepoint(&this_ptr_conv).compressed_form);
        return ret_arr;
@@ -22818,6 +26309,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1htlc_1base
        LDKAcceptChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKPublicKey val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 33);
        (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
@@ -22828,6 +26320,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1fir
        LDKAcceptChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, AcceptChannel_get_first_per_commitment_point(&this_ptr_conv).compressed_form);
        return ret_arr;
@@ -22837,20 +26330,44 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1first_1per
        LDKAcceptChannel this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKPublicKey val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 33);
        (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
        AcceptChannel_set_first_per_commitment_point(&this_ptr_conv, val_ref);
 }
 
+static inline uint64_t AcceptChannel_clone_ptr(LDKAcceptChannel *NONNULL_PTR arg) {
+       LDKAcceptChannel ret_var = AcceptChannel_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKAcceptChannel arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = AcceptChannel_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKAcceptChannel orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKAcceptChannel ret_var = AcceptChannel_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -22862,6 +26379,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1free(JNIEnv *e
        LDKFundingCreated this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        FundingCreated_free(this_obj_conv);
 }
 
@@ -22869,6 +26387,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1te
        LDKFundingCreated this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *FundingCreated_get_temporary_channel_id(&this_ptr_conv));
        return ret_arr;
@@ -22878,6 +26397,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1temporary
        LDKFundingCreated this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKThirtyTwoBytes val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 32);
        (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
@@ -22888,6 +26408,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1fu
        LDKFundingCreated this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *FundingCreated_get_funding_txid(&this_ptr_conv));
        return ret_arr;
@@ -22897,6 +26418,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1funding_1
        LDKFundingCreated this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKThirtyTwoBytes val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 32);
        (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
@@ -22907,6 +26429,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1fundin
        LDKFundingCreated this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int16_t ret_val = FundingCreated_get_funding_output_index(&this_ptr_conv);
        return ret_val;
 }
@@ -22915,6 +26438,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1funding_1
        LDKFundingCreated this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        FundingCreated_set_funding_output_index(&this_ptr_conv, val);
 }
 
@@ -22922,6 +26446,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1si
        LDKFundingCreated this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, FundingCreated_get_signature(&this_ptr_conv).compact_form);
        return ret_arr;
@@ -22931,6 +26456,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1signature
        LDKFundingCreated this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKSignature val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 64);
        (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form);
@@ -22951,6 +26477,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingCreated_1new(JNIEnv
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -22958,14 +26485,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingCreated_1new(JNIEnv
        return ret_ref;
 }
 
+static inline uint64_t FundingCreated_clone_ptr(LDKFundingCreated *NONNULL_PTR arg) {
+       LDKFundingCreated ret_var = FundingCreated_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingCreated_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKFundingCreated arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = FundingCreated_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingCreated_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKFundingCreated orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKFundingCreated ret_var = FundingCreated_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -22977,6 +26527,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1free(JNIEnv *en
        LDKFundingSigned this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        FundingSigned_free(this_obj_conv);
 }
 
@@ -22984,6 +26535,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingSigned_1get_1cha
        LDKFundingSigned this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *FundingSigned_get_channel_id(&this_ptr_conv));
        return ret_arr;
@@ -22993,6 +26545,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1set_1channel_1i
        LDKFundingSigned this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKThirtyTwoBytes val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 32);
        (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
@@ -23003,6 +26556,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingSigned_1get_1sig
        LDKFundingSigned this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, FundingSigned_get_signature(&this_ptr_conv).compact_form);
        return ret_arr;
@@ -23012,6 +26566,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1set_1signature(
        LDKFundingSigned this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKSignature val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 64);
        (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form);
@@ -23029,6 +26584,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingSigned_1new(JNIEnv *
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -23036,14 +26592,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingSigned_1new(JNIEnv *
        return ret_ref;
 }
 
+static inline uint64_t FundingSigned_clone_ptr(LDKFundingSigned *NONNULL_PTR arg) {
+       LDKFundingSigned ret_var = FundingSigned_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingSigned_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKFundingSigned arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = FundingSigned_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingSigned_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKFundingSigned orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKFundingSigned ret_var = FundingSigned_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -23055,6 +26634,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingLocked_1free(JNIEnv *en
        LDKFundingLocked this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        FundingLocked_free(this_obj_conv);
 }
 
@@ -23062,6 +26642,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingLocked_1get_1cha
        LDKFundingLocked this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *FundingLocked_get_channel_id(&this_ptr_conv));
        return ret_arr;
@@ -23071,6 +26652,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingLocked_1set_1channel_1i
        LDKFundingLocked this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKThirtyTwoBytes val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 32);
        (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
@@ -23081,6 +26663,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingLocked_1get_1nex
        LDKFundingLocked this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, FundingLocked_get_next_per_commitment_point(&this_ptr_conv).compressed_form);
        return ret_arr;
@@ -23090,6 +26673,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingLocked_1set_1next_1per_
        LDKFundingLocked this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKPublicKey val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 33);
        (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
@@ -23107,6 +26691,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingLocked_1new(JNIEnv *
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -23114,14 +26699,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingLocked_1new(JNIEnv *
        return ret_ref;
 }
 
+static inline uint64_t FundingLocked_clone_ptr(LDKFundingLocked *NONNULL_PTR arg) {
+       LDKFundingLocked ret_var = FundingLocked_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingLocked_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKFundingLocked arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = FundingLocked_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingLocked_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKFundingLocked orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKFundingLocked ret_var = FundingLocked_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -23133,6 +26741,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1free(JNIEnv *env, jc
        LDKShutdown this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        Shutdown_free(this_obj_conv);
 }
 
@@ -23140,6 +26749,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Shutdown_1get_1channel_
        LDKShutdown this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *Shutdown_get_channel_id(&this_ptr_conv));
        return ret_arr;
@@ -23149,6 +26759,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1set_1channel_1id(JNI
        LDKShutdown this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKThirtyTwoBytes val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 32);
        (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
@@ -23159,6 +26770,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Shutdown_1get_1scriptpu
        LDKShutdown this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKu8slice ret_var = Shutdown_get_scriptpubkey(&this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
@@ -23169,6 +26781,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1set_1scriptpubkey(JN
        LDKShutdown this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKCVec_u8Z val_ref;
        val_ref.datalen = (*env)->GetArrayLength(env, val);
        val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes");
@@ -23188,6 +26801,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Shutdown_1new(JNIEnv *env,
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -23195,14 +26809,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Shutdown_1new(JNIEnv *env,
        return ret_ref;
 }
 
+static inline uint64_t Shutdown_clone_ptr(LDKShutdown *NONNULL_PTR arg) {
+       LDKShutdown ret_var = Shutdown_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Shutdown_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKShutdown arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = Shutdown_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Shutdown_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKShutdown orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKShutdown ret_var = Shutdown_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -23214,6 +26851,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1free(JN
        LDKClosingSignedFeeRange this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        ClosingSignedFeeRange_free(this_obj_conv);
 }
 
@@ -23221,6 +26859,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1get_
        LDKClosingSignedFeeRange this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int64_t ret_val = ClosingSignedFeeRange_get_min_fee_satoshis(&this_ptr_conv);
        return ret_val;
 }
@@ -23229,6 +26868,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1set_1mi
        LDKClosingSignedFeeRange this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        ClosingSignedFeeRange_set_min_fee_satoshis(&this_ptr_conv, val);
 }
 
@@ -23236,6 +26876,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1get_
        LDKClosingSignedFeeRange this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int64_t ret_val = ClosingSignedFeeRange_get_max_fee_satoshis(&this_ptr_conv);
        return ret_val;
 }
@@ -23244,6 +26885,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1set_1ma
        LDKClosingSignedFeeRange this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        ClosingSignedFeeRange_set_max_fee_satoshis(&this_ptr_conv, val);
 }
 
@@ -23252,6 +26894,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1new(
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -23259,14 +26902,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1new(
        return ret_ref;
 }
 
+static inline uint64_t ClosingSignedFeeRange_clone_ptr(LDKClosingSignedFeeRange *NONNULL_PTR arg) {
+       LDKClosingSignedFeeRange ret_var = ClosingSignedFeeRange_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKClosingSignedFeeRange arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = ClosingSignedFeeRange_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKClosingSignedFeeRange orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKClosingSignedFeeRange ret_var = ClosingSignedFeeRange_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -23278,6 +26944,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1free(JNIEnv *en
        LDKClosingSigned this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        ClosingSigned_free(this_obj_conv);
 }
 
@@ -23285,6 +26952,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1cha
        LDKClosingSigned this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ClosingSigned_get_channel_id(&this_ptr_conv));
        return ret_arr;
@@ -23294,6 +26962,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1channel_1i
        LDKClosingSigned this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKThirtyTwoBytes val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 32);
        (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
@@ -23304,6 +26973,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1fee_1sa
        LDKClosingSigned this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int64_t ret_val = ClosingSigned_get_fee_satoshis(&this_ptr_conv);
        return ret_val;
 }
@@ -23312,6 +26982,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1fee_1satos
        LDKClosingSigned this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        ClosingSigned_set_fee_satoshis(&this_ptr_conv, val);
 }
 
@@ -23319,6 +26990,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1sig
        LDKClosingSigned this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, ClosingSigned_get_signature(&this_ptr_conv).compact_form);
        return ret_arr;
@@ -23328,6 +27000,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1signature(
        LDKClosingSigned this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKSignature val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 64);
        (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form);
@@ -23338,11 +27011,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1fee_1ra
        LDKClosingSigned this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKClosingSignedFeeRange ret_var = ClosingSigned_get_fee_range(&this_ptr_conv);
        uint64_t ret_ref = 0;
        if ((uint64_t)ret_var.inner > 4096) {
                CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
                CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
                ret_ref = (uint64_t)ret_var.inner;
                if (ret_var.is_owned) {
                        ret_ref |= 1;
@@ -23355,9 +27030,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1fee_1range
        LDKClosingSigned this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKClosingSignedFeeRange val_conv;
        val_conv.inner = (void*)(val & (~1));
        val_conv.is_owned = (val & 1) || (val == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
        val_conv = ClosingSignedFeeRange_clone(&val_conv);
        ClosingSigned_set_fee_range(&this_ptr_conv, val_conv);
 }
@@ -23372,11 +27049,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1new(JNIEnv *
        LDKClosingSignedFeeRange fee_range_arg_conv;
        fee_range_arg_conv.inner = (void*)(fee_range_arg & (~1));
        fee_range_arg_conv.is_owned = (fee_range_arg & 1) || (fee_range_arg == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(fee_range_arg_conv);
        fee_range_arg_conv = ClosingSignedFeeRange_clone(&fee_range_arg_conv);
        LDKClosingSigned ret_var = ClosingSigned_new(channel_id_arg_ref, fee_satoshis_arg, signature_arg_ref, fee_range_arg_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -23384,14 +27063,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1new(JNIEnv *
        return ret_ref;
 }
 
+static inline uint64_t ClosingSigned_clone_ptr(LDKClosingSigned *NONNULL_PTR arg) {
+       LDKClosingSigned ret_var = ClosingSigned_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKClosingSigned arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = ClosingSigned_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKClosingSigned orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKClosingSigned ret_var = ClosingSigned_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -23403,6 +27105,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1free(JNIEnv *en
        LDKUpdateAddHTLC this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        UpdateAddHTLC_free(this_obj_conv);
 }
 
@@ -23410,6 +27113,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1cha
        LDKUpdateAddHTLC this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateAddHTLC_get_channel_id(&this_ptr_conv));
        return ret_arr;
@@ -23419,6 +27123,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1channel_1i
        LDKUpdateAddHTLC this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKThirtyTwoBytes val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 32);
        (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
@@ -23429,6 +27134,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1htlc_1i
        LDKUpdateAddHTLC this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int64_t ret_val = UpdateAddHTLC_get_htlc_id(&this_ptr_conv);
        return ret_val;
 }
@@ -23437,6 +27143,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1htlc_1id(J
        LDKUpdateAddHTLC this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        UpdateAddHTLC_set_htlc_id(&this_ptr_conv, val);
 }
 
@@ -23444,6 +27151,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1amount_
        LDKUpdateAddHTLC this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int64_t ret_val = UpdateAddHTLC_get_amount_msat(&this_ptr_conv);
        return ret_val;
 }
@@ -23452,6 +27160,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1amount_1ms
        LDKUpdateAddHTLC this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        UpdateAddHTLC_set_amount_msat(&this_ptr_conv, val);
 }
 
@@ -23459,6 +27168,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1pay
        LDKUpdateAddHTLC this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateAddHTLC_get_payment_hash(&this_ptr_conv));
        return ret_arr;
@@ -23468,6 +27178,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1payment_1h
        LDKUpdateAddHTLC this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKThirtyTwoBytes val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 32);
        (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
@@ -23478,6 +27189,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1cltv_1e
        LDKUpdateAddHTLC this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int32_t ret_val = UpdateAddHTLC_get_cltv_expiry(&this_ptr_conv);
        return ret_val;
 }
@@ -23486,17 +27198,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1cltv_1expi
        LDKUpdateAddHTLC this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        UpdateAddHTLC_set_cltv_expiry(&this_ptr_conv, val);
 }
 
+static inline uint64_t UpdateAddHTLC_clone_ptr(LDKUpdateAddHTLC *NONNULL_PTR arg) {
+       LDKUpdateAddHTLC ret_var = UpdateAddHTLC_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKUpdateAddHTLC arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = UpdateAddHTLC_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKUpdateAddHTLC orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKUpdateAddHTLC ret_var = UpdateAddHTLC_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -23508,6 +27244,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1free(JNIEnv
        LDKUpdateFulfillHTLC this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        UpdateFulfillHTLC_free(this_obj_conv);
 }
 
@@ -23515,6 +27252,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_
        LDKUpdateFulfillHTLC this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateFulfillHTLC_get_channel_id(&this_ptr_conv));
        return ret_arr;
@@ -23524,6 +27262,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1set_1channe
        LDKUpdateFulfillHTLC this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKThirtyTwoBytes val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 32);
        (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
@@ -23534,6 +27273,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_1htl
        LDKUpdateFulfillHTLC this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int64_t ret_val = UpdateFulfillHTLC_get_htlc_id(&this_ptr_conv);
        return ret_val;
 }
@@ -23542,6 +27282,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1set_1htlc_1
        LDKUpdateFulfillHTLC this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        UpdateFulfillHTLC_set_htlc_id(&this_ptr_conv, val);
 }
 
@@ -23549,6 +27290,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_
        LDKUpdateFulfillHTLC this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateFulfillHTLC_get_payment_preimage(&this_ptr_conv));
        return ret_arr;
@@ -23558,6 +27300,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1set_1paymen
        LDKUpdateFulfillHTLC this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKThirtyTwoBytes val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 32);
        (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
@@ -23575,6 +27318,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1new(JNIE
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -23582,14 +27326,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1new(JNIE
        return ret_ref;
 }
 
+static inline uint64_t UpdateFulfillHTLC_clone_ptr(LDKUpdateFulfillHTLC *NONNULL_PTR arg) {
+       LDKUpdateFulfillHTLC ret_var = UpdateFulfillHTLC_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKUpdateFulfillHTLC arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = UpdateFulfillHTLC_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKUpdateFulfillHTLC orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKUpdateFulfillHTLC ret_var = UpdateFulfillHTLC_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -23601,6 +27368,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1free(JNIEnv *e
        LDKUpdateFailHTLC this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        UpdateFailHTLC_free(this_obj_conv);
 }
 
@@ -23608,6 +27376,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1get_1ch
        LDKUpdateFailHTLC this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateFailHTLC_get_channel_id(&this_ptr_conv));
        return ret_arr;
@@ -23617,6 +27386,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1set_1channel_1
        LDKUpdateFailHTLC this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKThirtyTwoBytes val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 32);
        (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
@@ -23627,6 +27397,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1get_1htlc_1
        LDKUpdateFailHTLC this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int64_t ret_val = UpdateFailHTLC_get_htlc_id(&this_ptr_conv);
        return ret_val;
 }
@@ -23635,17 +27406,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1set_1htlc_1id(
        LDKUpdateFailHTLC this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        UpdateFailHTLC_set_htlc_id(&this_ptr_conv, val);
 }
 
+static inline uint64_t UpdateFailHTLC_clone_ptr(LDKUpdateFailHTLC *NONNULL_PTR arg) {
+       LDKUpdateFailHTLC ret_var = UpdateFailHTLC_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKUpdateFailHTLC arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = UpdateFailHTLC_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKUpdateFailHTLC orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKUpdateFailHTLC ret_var = UpdateFailHTLC_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -23657,6 +27452,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1free(
        LDKUpdateFailMalformedHTLC this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        UpdateFailMalformedHTLC_free(this_obj_conv);
 }
 
@@ -23664,6 +27460,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC
        LDKUpdateFailMalformedHTLC this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateFailMalformedHTLC_get_channel_id(&this_ptr_conv));
        return ret_arr;
@@ -23673,6 +27470,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1set_1
        LDKUpdateFailMalformedHTLC this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKThirtyTwoBytes val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 32);
        (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
@@ -23683,6 +27481,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1ge
        LDKUpdateFailMalformedHTLC this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int64_t ret_val = UpdateFailMalformedHTLC_get_htlc_id(&this_ptr_conv);
        return ret_val;
 }
@@ -23691,6 +27490,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1set_1
        LDKUpdateFailMalformedHTLC this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        UpdateFailMalformedHTLC_set_htlc_id(&this_ptr_conv, val);
 }
 
@@ -23698,6 +27498,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1ge
        LDKUpdateFailMalformedHTLC this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int16_t ret_val = UpdateFailMalformedHTLC_get_failure_code(&this_ptr_conv);
        return ret_val;
 }
@@ -23706,17 +27507,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1set_1
        LDKUpdateFailMalformedHTLC this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        UpdateFailMalformedHTLC_set_failure_code(&this_ptr_conv, val);
 }
 
+static inline uint64_t UpdateFailMalformedHTLC_clone_ptr(LDKUpdateFailMalformedHTLC *NONNULL_PTR arg) {
+       LDKUpdateFailMalformedHTLC ret_var = UpdateFailMalformedHTLC_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKUpdateFailMalformedHTLC arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = UpdateFailMalformedHTLC_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKUpdateFailMalformedHTLC orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKUpdateFailMalformedHTLC ret_var = UpdateFailMalformedHTLC_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -23728,6 +27553,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1free(JNIEnv
        LDKCommitmentSigned this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        CommitmentSigned_free(this_obj_conv);
 }
 
@@ -23735,6 +27561,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1get_1
        LDKCommitmentSigned this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *CommitmentSigned_get_channel_id(&this_ptr_conv));
        return ret_arr;
@@ -23744,6 +27571,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1channel
        LDKCommitmentSigned this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKThirtyTwoBytes val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 32);
        (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
@@ -23754,6 +27582,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1get_1
        LDKCommitmentSigned this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, CommitmentSigned_get_signature(&this_ptr_conv).compact_form);
        return ret_arr;
@@ -23763,6 +27592,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1signatu
        LDKCommitmentSigned this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKSignature val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 64);
        (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form);
@@ -23773,6 +27603,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1htlc_1s
        LDKCommitmentSigned this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKCVec_SignatureZ val_constr;
        val_constr.datalen = (*env)->GetArrayLength(env, val);
        if (val_constr.datalen > 0)
@@ -23813,6 +27644,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1new(JNIEn
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -23820,14 +27652,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1new(JNIEn
        return ret_ref;
 }
 
+static inline uint64_t CommitmentSigned_clone_ptr(LDKCommitmentSigned *NONNULL_PTR arg) {
+       LDKCommitmentSigned ret_var = CommitmentSigned_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCommitmentSigned arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = CommitmentSigned_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCommitmentSigned orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKCommitmentSigned ret_var = CommitmentSigned_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -23839,6 +27694,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1free(JNIEnv *env
        LDKRevokeAndACK this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        RevokeAndACK_free(this_obj_conv);
 }
 
@@ -23846,6 +27702,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1chan
        LDKRevokeAndACK this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *RevokeAndACK_get_channel_id(&this_ptr_conv));
        return ret_arr;
@@ -23855,6 +27712,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1set_1channel_1id
        LDKRevokeAndACK this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKThirtyTwoBytes val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 32);
        (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
@@ -23865,6 +27723,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1per_
        LDKRevokeAndACK this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *RevokeAndACK_get_per_commitment_secret(&this_ptr_conv));
        return ret_arr;
@@ -23874,6 +27733,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1set_1per_1commit
        LDKRevokeAndACK this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKThirtyTwoBytes val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 32);
        (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
@@ -23884,6 +27744,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1next
        LDKRevokeAndACK this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, RevokeAndACK_get_next_per_commitment_point(&this_ptr_conv).compressed_form);
        return ret_arr;
@@ -23893,6 +27754,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1set_1next_1per_1
        LDKRevokeAndACK this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKPublicKey val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 33);
        (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
@@ -23913,6 +27775,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1new(JNIEnv *e
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -23920,14 +27783,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1new(JNIEnv *e
        return ret_ref;
 }
 
+static inline uint64_t RevokeAndACK_clone_ptr(LDKRevokeAndACK *NONNULL_PTR arg) {
+       LDKRevokeAndACK ret_var = RevokeAndACK_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKRevokeAndACK arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = RevokeAndACK_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKRevokeAndACK orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKRevokeAndACK ret_var = RevokeAndACK_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -23939,6 +27825,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFee_1free(JNIEnv *env, j
        LDKUpdateFee this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        UpdateFee_free(this_obj_conv);
 }
 
@@ -23946,6 +27833,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFee_1get_1channel
        LDKUpdateFee this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateFee_get_channel_id(&this_ptr_conv));
        return ret_arr;
@@ -23955,6 +27843,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFee_1set_1channel_1id(JN
        LDKUpdateFee this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKThirtyTwoBytes val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 32);
        (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
@@ -23965,6 +27854,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_UpdateFee_1get_1feerate_1pe
        LDKUpdateFee this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int32_t ret_val = UpdateFee_get_feerate_per_kw(&this_ptr_conv);
        return ret_val;
 }
@@ -23973,6 +27863,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFee_1set_1feerate_1per_1
        LDKUpdateFee this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        UpdateFee_set_feerate_per_kw(&this_ptr_conv, val);
 }
 
@@ -23984,6 +27875,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFee_1new(JNIEnv *env,
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -23991,14 +27883,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFee_1new(JNIEnv *env,
        return ret_ref;
 }
 
+static inline uint64_t UpdateFee_clone_ptr(LDKUpdateFee *NONNULL_PTR arg) {
+       LDKUpdateFee ret_var = UpdateFee_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFee_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKUpdateFee arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = UpdateFee_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFee_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKUpdateFee orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKUpdateFee ret_var = UpdateFee_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -24010,6 +27925,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1free(JNIEnv *
        LDKDataLossProtect this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        DataLossProtect_free(this_obj_conv);
 }
 
@@ -24017,6 +27933,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1get_1y
        LDKDataLossProtect this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *DataLossProtect_get_your_last_per_commitment_secret(&this_ptr_conv));
        return ret_arr;
@@ -24026,6 +27943,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1set_1your_1la
        LDKDataLossProtect this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKThirtyTwoBytes val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 32);
        (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
@@ -24036,6 +27954,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1get_1m
        LDKDataLossProtect this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, DataLossProtect_get_my_current_per_commitment_point(&this_ptr_conv).compressed_form);
        return ret_arr;
@@ -24045,6 +27964,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1set_1my_1curr
        LDKDataLossProtect this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKPublicKey val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 33);
        (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
@@ -24062,6 +27982,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1new(JNIEnv
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -24069,14 +27990,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1new(JNIEnv
        return ret_ref;
 }
 
+static inline uint64_t DataLossProtect_clone_ptr(LDKDataLossProtect *NONNULL_PTR arg) {
+       LDKDataLossProtect ret_var = DataLossProtect_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKDataLossProtect arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = DataLossProtect_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKDataLossProtect orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKDataLossProtect ret_var = DataLossProtect_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -24088,6 +28032,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1free(JNIEn
        LDKChannelReestablish this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        ChannelReestablish_free(this_obj_conv);
 }
 
@@ -24095,6 +28040,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1get
        LDKChannelReestablish this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ChannelReestablish_get_channel_id(&this_ptr_conv));
        return ret_arr;
@@ -24104,6 +28050,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1set_1chann
        LDKChannelReestablish this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKThirtyTwoBytes val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 32);
        (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
@@ -24114,6 +28061,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1get_1ne
        LDKChannelReestablish this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int64_t ret_val = ChannelReestablish_get_next_local_commitment_number(&this_ptr_conv);
        return ret_val;
 }
@@ -24122,6 +28070,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1set_1next_
        LDKChannelReestablish this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        ChannelReestablish_set_next_local_commitment_number(&this_ptr_conv, val);
 }
 
@@ -24129,6 +28078,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1get_1ne
        LDKChannelReestablish this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int64_t ret_val = ChannelReestablish_get_next_remote_commitment_number(&this_ptr_conv);
        return ret_val;
 }
@@ -24137,17 +28087,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1set_1next_
        LDKChannelReestablish this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        ChannelReestablish_set_next_remote_commitment_number(&this_ptr_conv, val);
 }
 
+static inline uint64_t ChannelReestablish_clone_ptr(LDKChannelReestablish *NONNULL_PTR arg) {
+       LDKChannelReestablish ret_var = ChannelReestablish_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKChannelReestablish arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = ChannelReestablish_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKChannelReestablish orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKChannelReestablish ret_var = ChannelReestablish_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -24159,6 +28133,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1free(J
        LDKAnnouncementSignatures this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        AnnouncementSignatures_free(this_obj_conv);
 }
 
@@ -24166,6 +28141,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_
        LDKAnnouncementSignatures this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *AnnouncementSignatures_get_channel_id(&this_ptr_conv));
        return ret_arr;
@@ -24175,6 +28151,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1c
        LDKAnnouncementSignatures this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKThirtyTwoBytes val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 32);
        (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
@@ -24185,6 +28162,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get
        LDKAnnouncementSignatures this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int64_t ret_val = AnnouncementSignatures_get_short_channel_id(&this_ptr_conv);
        return ret_val;
 }
@@ -24193,6 +28171,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1s
        LDKAnnouncementSignatures this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        AnnouncementSignatures_set_short_channel_id(&this_ptr_conv, val);
 }
 
@@ -24200,6 +28179,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_
        LDKAnnouncementSignatures this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, AnnouncementSignatures_get_node_signature(&this_ptr_conv).compact_form);
        return ret_arr;
@@ -24209,6 +28189,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1n
        LDKAnnouncementSignatures this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKSignature val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 64);
        (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form);
@@ -24219,6 +28200,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_
        LDKAnnouncementSignatures this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, AnnouncementSignatures_get_bitcoin_signature(&this_ptr_conv).compact_form);
        return ret_arr;
@@ -24228,6 +28210,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1b
        LDKAnnouncementSignatures this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKSignature val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 64);
        (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form);
@@ -24248,6 +28231,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1new
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -24255,14 +28239,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1new
        return ret_ref;
 }
 
+static inline uint64_t AnnouncementSignatures_clone_ptr(LDKAnnouncementSignatures *NONNULL_PTR arg) {
+       LDKAnnouncementSignatures ret_var = AnnouncementSignatures_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKAnnouncementSignatures arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = AnnouncementSignatures_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKAnnouncementSignatures orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKAnnouncementSignatures ret_var = AnnouncementSignatures_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -24279,6 +28286,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetAddress_1free(JNIEnv *env,
        NetAddress_free(this_ptr_conv);
 }
 
+static inline uint64_t NetAddress_clone_ptr(LDKNetAddress *NONNULL_PTR arg) {
+       LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
+       *ret_copy = NetAddress_clone(arg);
+uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetAddress_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKNetAddress* arg_conv = (LDKNetAddress*)arg;
+       int64_t ret_val = NetAddress_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetAddress_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKNetAddress* orig_conv = (LDKNetAddress*)orig;
        LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
@@ -24350,6 +28369,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1free
        LDKUnsignedNodeAnnouncement this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        UnsignedNodeAnnouncement_free(this_obj_conv);
 }
 
@@ -24357,10 +28377,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1g
        LDKUnsignedNodeAnnouncement this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKNodeFeatures ret_var = UnsignedNodeAnnouncement_get_features(&this_ptr_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -24372,9 +28394,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_
        LDKUnsignedNodeAnnouncement this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKNodeFeatures val_conv;
        val_conv.inner = (void*)(val & (~1));
        val_conv.is_owned = (val & 1) || (val == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
        val_conv = NodeFeatures_clone(&val_conv);
        UnsignedNodeAnnouncement_set_features(&this_ptr_conv, val_conv);
 }
@@ -24383,6 +28407,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1g
        LDKUnsignedNodeAnnouncement this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int32_t ret_val = UnsignedNodeAnnouncement_get_timestamp(&this_ptr_conv);
        return ret_val;
 }
@@ -24391,6 +28416,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_
        LDKUnsignedNodeAnnouncement this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        UnsignedNodeAnnouncement_set_timestamp(&this_ptr_conv, val);
 }
 
@@ -24398,6 +28424,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncemen
        LDKUnsignedNodeAnnouncement this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, UnsignedNodeAnnouncement_get_node_id(&this_ptr_conv).compressed_form);
        return ret_arr;
@@ -24407,6 +28434,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_
        LDKUnsignedNodeAnnouncement this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKPublicKey val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 33);
        (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
@@ -24417,6 +28445,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncemen
        LDKUnsignedNodeAnnouncement this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 3);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 3, *UnsignedNodeAnnouncement_get_rgb(&this_ptr_conv));
        return ret_arr;
@@ -24426,6 +28455,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_
        LDKUnsignedNodeAnnouncement this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKThreeBytes val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 3);
        (*env)->GetByteArrayRegion(env, val, 0, 3, val_ref.data);
@@ -24436,6 +28466,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncemen
        LDKUnsignedNodeAnnouncement this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UnsignedNodeAnnouncement_get_alias(&this_ptr_conv));
        return ret_arr;
@@ -24445,6 +28476,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_
        LDKUnsignedNodeAnnouncement this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKThirtyTwoBytes val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 32);
        (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
@@ -24455,6 +28487,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_
        LDKUnsignedNodeAnnouncement this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKCVec_NetAddressZ val_constr;
        val_constr.datalen = (*env)->GetArrayLength(env, val);
        if (val_constr.datalen > 0)
@@ -24474,14 +28507,37 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_
        UnsignedNodeAnnouncement_set_addresses(&this_ptr_conv, val_constr);
 }
 
+static inline uint64_t UnsignedNodeAnnouncement_clone_ptr(LDKUnsignedNodeAnnouncement *NONNULL_PTR arg) {
+       LDKUnsignedNodeAnnouncement ret_var = UnsignedNodeAnnouncement_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKUnsignedNodeAnnouncement arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = UnsignedNodeAnnouncement_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKUnsignedNodeAnnouncement orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKUnsignedNodeAnnouncement ret_var = UnsignedNodeAnnouncement_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -24493,6 +28549,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1free(JNIEnv
        LDKNodeAnnouncement this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        NodeAnnouncement_free(this_obj_conv);
 }
 
@@ -24500,6 +28557,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1get_1
        LDKNodeAnnouncement this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, NodeAnnouncement_get_signature(&this_ptr_conv).compact_form);
        return ret_arr;
@@ -24509,6 +28567,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1set_1signatu
        LDKNodeAnnouncement this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKSignature val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 64);
        (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form);
@@ -24519,10 +28578,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1get_1cont
        LDKNodeAnnouncement this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKUnsignedNodeAnnouncement ret_var = NodeAnnouncement_get_contents(&this_ptr_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -24534,9 +28595,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1set_1content
        LDKNodeAnnouncement this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKUnsignedNodeAnnouncement val_conv;
        val_conv.inner = (void*)(val & (~1));
        val_conv.is_owned = (val & 1) || (val == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
        val_conv = UnsignedNodeAnnouncement_clone(&val_conv);
        NodeAnnouncement_set_contents(&this_ptr_conv, val_conv);
 }
@@ -24548,11 +28611,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1new(JNIEn
        LDKUnsignedNodeAnnouncement contents_arg_conv;
        contents_arg_conv.inner = (void*)(contents_arg & (~1));
        contents_arg_conv.is_owned = (contents_arg & 1) || (contents_arg == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(contents_arg_conv);
        contents_arg_conv = UnsignedNodeAnnouncement_clone(&contents_arg_conv);
        LDKNodeAnnouncement ret_var = NodeAnnouncement_new(signature_arg_ref, contents_arg_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -24560,14 +28625,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1new(JNIEn
        return ret_ref;
 }
 
+static inline uint64_t NodeAnnouncement_clone_ptr(LDKNodeAnnouncement *NONNULL_PTR arg) {
+       LDKNodeAnnouncement ret_var = NodeAnnouncement_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKNodeAnnouncement arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = NodeAnnouncement_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKNodeAnnouncement orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKNodeAnnouncement ret_var = NodeAnnouncement_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -24579,6 +28667,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1f
        LDKUnsignedChannelAnnouncement this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        UnsignedChannelAnnouncement_free(this_obj_conv);
 }
 
@@ -24586,10 +28675,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement
        LDKUnsignedChannelAnnouncement this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKChannelFeatures ret_var = UnsignedChannelAnnouncement_get_features(&this_ptr_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -24601,9 +28692,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1s
        LDKUnsignedChannelAnnouncement this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKChannelFeatures val_conv;
        val_conv.inner = (void*)(val & (~1));
        val_conv.is_owned = (val & 1) || (val == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
        val_conv = ChannelFeatures_clone(&val_conv);
        UnsignedChannelAnnouncement_set_features(&this_ptr_conv, val_conv);
 }
@@ -24612,6 +28705,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnounce
        LDKUnsignedChannelAnnouncement this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UnsignedChannelAnnouncement_get_chain_hash(&this_ptr_conv));
        return ret_arr;
@@ -24621,6 +28715,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1s
        LDKUnsignedChannelAnnouncement this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKThirtyTwoBytes val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 32);
        (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
@@ -24631,6 +28726,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement
        LDKUnsignedChannelAnnouncement this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int64_t ret_val = UnsignedChannelAnnouncement_get_short_channel_id(&this_ptr_conv);
        return ret_val;
 }
@@ -24639,6 +28735,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1s
        LDKUnsignedChannelAnnouncement this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        UnsignedChannelAnnouncement_set_short_channel_id(&this_ptr_conv, val);
 }
 
@@ -24646,6 +28743,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnounce
        LDKUnsignedChannelAnnouncement this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, UnsignedChannelAnnouncement_get_node_id_1(&this_ptr_conv).compressed_form);
        return ret_arr;
@@ -24655,6 +28753,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1s
        LDKUnsignedChannelAnnouncement this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKPublicKey val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 33);
        (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
@@ -24665,6 +28764,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnounce
        LDKUnsignedChannelAnnouncement this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, UnsignedChannelAnnouncement_get_node_id_2(&this_ptr_conv).compressed_form);
        return ret_arr;
@@ -24674,6 +28774,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1s
        LDKUnsignedChannelAnnouncement this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKPublicKey val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 33);
        (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
@@ -24684,6 +28785,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnounce
        LDKUnsignedChannelAnnouncement this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, UnsignedChannelAnnouncement_get_bitcoin_key_1(&this_ptr_conv).compressed_form);
        return ret_arr;
@@ -24693,6 +28795,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1s
        LDKUnsignedChannelAnnouncement this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKPublicKey val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 33);
        (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
@@ -24703,6 +28806,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnounce
        LDKUnsignedChannelAnnouncement this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, UnsignedChannelAnnouncement_get_bitcoin_key_2(&this_ptr_conv).compressed_form);
        return ret_arr;
@@ -24712,20 +28816,44 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1s
        LDKUnsignedChannelAnnouncement this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKPublicKey val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 33);
        (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
        UnsignedChannelAnnouncement_set_bitcoin_key_2(&this_ptr_conv, val_ref);
 }
 
+static inline uint64_t UnsignedChannelAnnouncement_clone_ptr(LDKUnsignedChannelAnnouncement *NONNULL_PTR arg) {
+       LDKUnsignedChannelAnnouncement ret_var = UnsignedChannelAnnouncement_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKUnsignedChannelAnnouncement arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = UnsignedChannelAnnouncement_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKUnsignedChannelAnnouncement orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKUnsignedChannelAnnouncement ret_var = UnsignedChannelAnnouncement_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -24737,6 +28865,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1free(JNIE
        LDKChannelAnnouncement this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        ChannelAnnouncement_free(this_obj_conv);
 }
 
@@ -24744,6 +28873,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1ge
        LDKChannelAnnouncement this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, ChannelAnnouncement_get_node_signature_1(&this_ptr_conv).compact_form);
        return ret_arr;
@@ -24753,6 +28883,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1node
        LDKChannelAnnouncement this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKSignature val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 64);
        (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form);
@@ -24763,6 +28894,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1ge
        LDKChannelAnnouncement this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, ChannelAnnouncement_get_node_signature_2(&this_ptr_conv).compact_form);
        return ret_arr;
@@ -24772,6 +28904,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1node
        LDKChannelAnnouncement this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKSignature val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 64);
        (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form);
@@ -24782,6 +28915,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1ge
        LDKChannelAnnouncement this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, ChannelAnnouncement_get_bitcoin_signature_1(&this_ptr_conv).compact_form);
        return ret_arr;
@@ -24791,6 +28925,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1bitc
        LDKChannelAnnouncement this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKSignature val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 64);
        (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form);
@@ -24801,6 +28936,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1ge
        LDKChannelAnnouncement this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, ChannelAnnouncement_get_bitcoin_signature_2(&this_ptr_conv).compact_form);
        return ret_arr;
@@ -24810,6 +28946,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1bitc
        LDKChannelAnnouncement this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKSignature val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 64);
        (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form);
@@ -24820,10 +28957,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1c
        LDKChannelAnnouncement this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKUnsignedChannelAnnouncement ret_var = ChannelAnnouncement_get_contents(&this_ptr_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -24835,9 +28974,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1cont
        LDKChannelAnnouncement this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKUnsignedChannelAnnouncement val_conv;
        val_conv.inner = (void*)(val & (~1));
        val_conv.is_owned = (val & 1) || (val == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
        val_conv = UnsignedChannelAnnouncement_clone(&val_conv);
        ChannelAnnouncement_set_contents(&this_ptr_conv, val_conv);
 }
@@ -24858,11 +28999,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1new(JN
        LDKUnsignedChannelAnnouncement contents_arg_conv;
        contents_arg_conv.inner = (void*)(contents_arg & (~1));
        contents_arg_conv.is_owned = (contents_arg & 1) || (contents_arg == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(contents_arg_conv);
        contents_arg_conv = UnsignedChannelAnnouncement_clone(&contents_arg_conv);
        LDKChannelAnnouncement ret_var = ChannelAnnouncement_new(node_signature_1_arg_ref, node_signature_2_arg_ref, bitcoin_signature_1_arg_ref, bitcoin_signature_2_arg_ref, contents_arg_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -24870,14 +29013,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1new(JN
        return ret_ref;
 }
 
+static inline uint64_t ChannelAnnouncement_clone_ptr(LDKChannelAnnouncement *NONNULL_PTR arg) {
+       LDKChannelAnnouncement ret_var = ChannelAnnouncement_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKChannelAnnouncement arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = ChannelAnnouncement_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKChannelAnnouncement orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKChannelAnnouncement ret_var = ChannelAnnouncement_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -24889,6 +29055,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1free(JN
        LDKUnsignedChannelUpdate this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        UnsignedChannelUpdate_free(this_obj_conv);
 }
 
@@ -24896,6 +29063,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1
        LDKUnsignedChannelUpdate this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UnsignedChannelUpdate_get_chain_hash(&this_ptr_conv));
        return ret_arr;
@@ -24905,6 +29073,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1ch
        LDKUnsignedChannelUpdate this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKThirtyTwoBytes val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 32);
        (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
@@ -24915,6 +29084,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_
        LDKUnsignedChannelUpdate this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int64_t ret_val = UnsignedChannelUpdate_get_short_channel_id(&this_ptr_conv);
        return ret_val;
 }
@@ -24923,6 +29093,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1sh
        LDKUnsignedChannelUpdate this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        UnsignedChannelUpdate_set_short_channel_id(&this_ptr_conv, val);
 }
 
@@ -24930,6 +29101,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_
        LDKUnsignedChannelUpdate this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int32_t ret_val = UnsignedChannelUpdate_get_timestamp(&this_ptr_conv);
        return ret_val;
 }
@@ -24938,6 +29110,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1ti
        LDKUnsignedChannelUpdate this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        UnsignedChannelUpdate_set_timestamp(&this_ptr_conv, val);
 }
 
@@ -24945,6 +29118,7 @@ JNIEXPORT int8_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1
        LDKUnsignedChannelUpdate this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_t ret_val = UnsignedChannelUpdate_get_flags(&this_ptr_conv);
        return ret_val;
 }
@@ -24953,6 +29127,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1fl
        LDKUnsignedChannelUpdate this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        UnsignedChannelUpdate_set_flags(&this_ptr_conv, val);
 }
 
@@ -24960,6 +29135,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_
        LDKUnsignedChannelUpdate this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int16_t ret_val = UnsignedChannelUpdate_get_cltv_expiry_delta(&this_ptr_conv);
        return ret_val;
 }
@@ -24968,6 +29144,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1cl
        LDKUnsignedChannelUpdate this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        UnsignedChannelUpdate_set_cltv_expiry_delta(&this_ptr_conv, val);
 }
 
@@ -24975,6 +29152,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_
        LDKUnsignedChannelUpdate this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int64_t ret_val = UnsignedChannelUpdate_get_htlc_minimum_msat(&this_ptr_conv);
        return ret_val;
 }
@@ -24983,6 +29161,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1ht
        LDKUnsignedChannelUpdate this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        UnsignedChannelUpdate_set_htlc_minimum_msat(&this_ptr_conv, val);
 }
 
@@ -24990,6 +29169,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_
        LDKUnsignedChannelUpdate this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int32_t ret_val = UnsignedChannelUpdate_get_fee_base_msat(&this_ptr_conv);
        return ret_val;
 }
@@ -24998,6 +29178,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1fe
        LDKUnsignedChannelUpdate this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        UnsignedChannelUpdate_set_fee_base_msat(&this_ptr_conv, val);
 }
 
@@ -25005,6 +29186,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_
        LDKUnsignedChannelUpdate this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int32_t ret_val = UnsignedChannelUpdate_get_fee_proportional_millionths(&this_ptr_conv);
        return ret_val;
 }
@@ -25013,17 +29195,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1fe
        LDKUnsignedChannelUpdate this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        UnsignedChannelUpdate_set_fee_proportional_millionths(&this_ptr_conv, val);
 }
 
+static inline uint64_t UnsignedChannelUpdate_clone_ptr(LDKUnsignedChannelUpdate *NONNULL_PTR arg) {
+       LDKUnsignedChannelUpdate ret_var = UnsignedChannelUpdate_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKUnsignedChannelUpdate arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = UnsignedChannelUpdate_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKUnsignedChannelUpdate orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKUnsignedChannelUpdate ret_var = UnsignedChannelUpdate_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -25035,6 +29241,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1free(JNIEnv *en
        LDKChannelUpdate this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        ChannelUpdate_free(this_obj_conv);
 }
 
@@ -25042,6 +29249,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1get_1sig
        LDKChannelUpdate this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, ChannelUpdate_get_signature(&this_ptr_conv).compact_form);
        return ret_arr;
@@ -25051,6 +29259,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1set_1signature(
        LDKChannelUpdate this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKSignature val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 64);
        (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form);
@@ -25061,10 +29270,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1get_1content
        LDKChannelUpdate this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKUnsignedChannelUpdate ret_var = ChannelUpdate_get_contents(&this_ptr_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -25076,9 +29287,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1set_1contents(J
        LDKChannelUpdate this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKUnsignedChannelUpdate val_conv;
        val_conv.inner = (void*)(val & (~1));
        val_conv.is_owned = (val & 1) || (val == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
        val_conv = UnsignedChannelUpdate_clone(&val_conv);
        ChannelUpdate_set_contents(&this_ptr_conv, val_conv);
 }
@@ -25090,11 +29303,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1new(JNIEnv *
        LDKUnsignedChannelUpdate contents_arg_conv;
        contents_arg_conv.inner = (void*)(contents_arg & (~1));
        contents_arg_conv.is_owned = (contents_arg & 1) || (contents_arg == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(contents_arg_conv);
        contents_arg_conv = UnsignedChannelUpdate_clone(&contents_arg_conv);
        LDKChannelUpdate ret_var = ChannelUpdate_new(signature_arg_ref, contents_arg_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -25102,14 +29317,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1new(JNIEnv *
        return ret_ref;
 }
 
+static inline uint64_t ChannelUpdate_clone_ptr(LDKChannelUpdate *NONNULL_PTR arg) {
+       LDKChannelUpdate ret_var = ChannelUpdate_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKChannelUpdate arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = ChannelUpdate_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKChannelUpdate orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKChannelUpdate ret_var = ChannelUpdate_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -25121,6 +29359,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1free(JNIEnv
        LDKQueryChannelRange this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        QueryChannelRange_free(this_obj_conv);
 }
 
@@ -25128,6 +29367,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1get_
        LDKQueryChannelRange this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *QueryChannelRange_get_chain_hash(&this_ptr_conv));
        return ret_arr;
@@ -25137,6 +29377,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1set_1chain_
        LDKQueryChannelRange this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKThirtyTwoBytes val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 32);
        (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
@@ -25147,6 +29388,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1get_1fir
        LDKQueryChannelRange this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int32_t ret_val = QueryChannelRange_get_first_blocknum(&this_ptr_conv);
        return ret_val;
 }
@@ -25155,6 +29397,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1set_1first_
        LDKQueryChannelRange this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        QueryChannelRange_set_first_blocknum(&this_ptr_conv, val);
 }
 
@@ -25162,6 +29405,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1get_1num
        LDKQueryChannelRange this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int32_t ret_val = QueryChannelRange_get_number_of_blocks(&this_ptr_conv);
        return ret_val;
 }
@@ -25170,6 +29414,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1set_1number
        LDKQueryChannelRange this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        QueryChannelRange_set_number_of_blocks(&this_ptr_conv, val);
 }
 
@@ -25181,6 +29426,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1new(JNIE
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -25188,14 +29434,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1new(JNIE
        return ret_ref;
 }
 
+static inline uint64_t QueryChannelRange_clone_ptr(LDKQueryChannelRange *NONNULL_PTR arg) {
+       LDKQueryChannelRange ret_var = QueryChannelRange_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKQueryChannelRange arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = QueryChannelRange_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKQueryChannelRange orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKQueryChannelRange ret_var = QueryChannelRange_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -25207,6 +29476,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1free(JNIEnv
        LDKReplyChannelRange this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        ReplyChannelRange_free(this_obj_conv);
 }
 
@@ -25214,6 +29484,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_
        LDKReplyChannelRange this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ReplyChannelRange_get_chain_hash(&this_ptr_conv));
        return ret_arr;
@@ -25223,6 +29494,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1chain_
        LDKReplyChannelRange this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKThirtyTwoBytes val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 32);
        (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
@@ -25233,6 +29505,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1fir
        LDKReplyChannelRange this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int32_t ret_val = ReplyChannelRange_get_first_blocknum(&this_ptr_conv);
        return ret_val;
 }
@@ -25241,6 +29514,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1first_
        LDKReplyChannelRange this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        ReplyChannelRange_set_first_blocknum(&this_ptr_conv, val);
 }
 
@@ -25248,6 +29522,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1num
        LDKReplyChannelRange this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int32_t ret_val = ReplyChannelRange_get_number_of_blocks(&this_ptr_conv);
        return ret_val;
 }
@@ -25256,6 +29531,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1number
        LDKReplyChannelRange this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        ReplyChannelRange_set_number_of_blocks(&this_ptr_conv, val);
 }
 
@@ -25263,6 +29539,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1sy
        LDKReplyChannelRange this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        jboolean ret_val = ReplyChannelRange_get_sync_complete(&this_ptr_conv);
        return ret_val;
 }
@@ -25271,6 +29548,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1sync_1
        LDKReplyChannelRange this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        ReplyChannelRange_set_sync_complete(&this_ptr_conv, val);
 }
 
@@ -25278,6 +29556,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1short_
        LDKReplyChannelRange this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKCVec_u64Z val_constr;
        val_constr.datalen = (*env)->GetArrayLength(env, val);
        if (val_constr.datalen > 0)
@@ -25313,6 +29592,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1new(JNIE
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -25320,14 +29600,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1new(JNIE
        return ret_ref;
 }
 
+static inline uint64_t ReplyChannelRange_clone_ptr(LDKReplyChannelRange *NONNULL_PTR arg) {
+       LDKReplyChannelRange ret_var = ReplyChannelRange_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKReplyChannelRange arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = ReplyChannelRange_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKReplyChannelRange orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKReplyChannelRange ret_var = ReplyChannelRange_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -25339,6 +29642,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1free(JNI
        LDKQueryShortChannelIds this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        QueryShortChannelIds_free(this_obj_conv);
 }
 
@@ -25346,6 +29650,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1g
        LDKQueryShortChannelIds this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *QueryShortChannelIds_get_chain_hash(&this_ptr_conv));
        return ret_arr;
@@ -25355,6 +29660,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1set_1cha
        LDKQueryShortChannelIds this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKThirtyTwoBytes val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 32);
        (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
@@ -25365,6 +29671,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1set_1sho
        LDKQueryShortChannelIds this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKCVec_u64Z val_constr;
        val_constr.datalen = (*env)->GetArrayLength(env, val);
        if (val_constr.datalen > 0)
@@ -25400,6 +29707,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1new(J
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -25407,14 +29715,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1new(J
        return ret_ref;
 }
 
+static inline uint64_t QueryShortChannelIds_clone_ptr(LDKQueryShortChannelIds *NONNULL_PTR arg) {
+       LDKQueryShortChannelIds ret_var = QueryShortChannelIds_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKQueryShortChannelIds arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = QueryShortChannelIds_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKQueryShortChannelIds orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKQueryShortChannelIds ret_var = QueryShortChannelIds_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -25426,6 +29757,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1free(
        LDKReplyShortChannelIdsEnd this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        ReplyShortChannelIdsEnd_free(this_obj_conv);
 }
 
@@ -25433,6 +29765,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd
        LDKReplyShortChannelIdsEnd this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ReplyShortChannelIdsEnd_get_chain_hash(&this_ptr_conv));
        return ret_arr;
@@ -25442,6 +29775,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1set_1
        LDKReplyShortChannelIdsEnd this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKThirtyTwoBytes val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 32);
        (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
@@ -25452,6 +29786,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1g
        LDKReplyShortChannelIdsEnd this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        jboolean ret_val = ReplyShortChannelIdsEnd_get_full_information(&this_ptr_conv);
        return ret_val;
 }
@@ -25460,6 +29795,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1set_1
        LDKReplyShortChannelIdsEnd this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        ReplyShortChannelIdsEnd_set_full_information(&this_ptr_conv, val);
 }
 
@@ -25471,6 +29807,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1ne
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -25478,14 +29815,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1ne
        return ret_ref;
 }
 
+static inline uint64_t ReplyShortChannelIdsEnd_clone_ptr(LDKReplyShortChannelIdsEnd *NONNULL_PTR arg) {
+       LDKReplyShortChannelIdsEnd ret_var = ReplyShortChannelIdsEnd_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKReplyShortChannelIdsEnd arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = ReplyShortChannelIdsEnd_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKReplyShortChannelIdsEnd orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKReplyShortChannelIdsEnd ret_var = ReplyShortChannelIdsEnd_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -25497,6 +29857,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1free(JN
        LDKGossipTimestampFilter this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        GossipTimestampFilter_free(this_obj_conv);
 }
 
@@ -25504,6 +29865,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1
        LDKGossipTimestampFilter this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *GossipTimestampFilter_get_chain_hash(&this_ptr_conv));
        return ret_arr;
@@ -25513,6 +29875,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1set_1ch
        LDKGossipTimestampFilter this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKThirtyTwoBytes val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 32);
        (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
@@ -25523,6 +29886,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1get_
        LDKGossipTimestampFilter this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int32_t ret_val = GossipTimestampFilter_get_first_timestamp(&this_ptr_conv);
        return ret_val;
 }
@@ -25531,6 +29895,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1set_1fi
        LDKGossipTimestampFilter this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        GossipTimestampFilter_set_first_timestamp(&this_ptr_conv, val);
 }
 
@@ -25538,6 +29903,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1get_
        LDKGossipTimestampFilter this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int32_t ret_val = GossipTimestampFilter_get_timestamp_range(&this_ptr_conv);
        return ret_val;
 }
@@ -25546,6 +29912,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1set_1ti
        LDKGossipTimestampFilter this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        GossipTimestampFilter_set_timestamp_range(&this_ptr_conv, val);
 }
 
@@ -25557,6 +29924,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1new(
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -25564,14 +29932,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1new(
        return ret_ref;
 }
 
+static inline uint64_t GossipTimestampFilter_clone_ptr(LDKGossipTimestampFilter *NONNULL_PTR arg) {
+       LDKGossipTimestampFilter ret_var = GossipTimestampFilter_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKGossipTimestampFilter arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = GossipTimestampFilter_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKGossipTimestampFilter orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKGossipTimestampFilter ret_var = GossipTimestampFilter_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -25588,6 +29979,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorAction_1free(JNIEnv *env,
        ErrorAction_free(this_ptr_conv);
 }
 
+static inline uint64_t ErrorAction_clone_ptr(LDKErrorAction *NONNULL_PTR arg) {
+       LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
+       *ret_copy = ErrorAction_clone(arg);
+uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKErrorAction* arg_conv = (LDKErrorAction*)arg;
+       int64_t ret_val = ErrorAction_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKErrorAction* orig_conv = (LDKErrorAction*)orig;
        LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
@@ -25600,6 +30003,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1disconnect_1pe
        LDKErrorMessage msg_conv;
        msg_conv.inner = (void*)(msg & (~1));
        msg_conv.is_owned = (msg & 1) || (msg == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
        msg_conv = ErrorMessage_clone(&msg_conv);
        LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
        *ret_copy = ErrorAction_disconnect_peer(msg_conv);
@@ -25626,6 +30030,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1send_1error_1m
        LDKErrorMessage msg_conv;
        msg_conv.inner = (void*)(msg & (~1));
        msg_conv.is_owned = (msg & 1) || (msg == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
        msg_conv = ErrorMessage_clone(&msg_conv);
        LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
        *ret_copy = ErrorAction_send_error_message(msg_conv);
@@ -25637,6 +30042,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1free(JNIEnv *e
        LDKLightningError this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        LightningError_free(this_obj_conv);
 }
 
@@ -25644,6 +30050,7 @@ JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_LightningError_1get_1err(JN
        LDKLightningError this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKStr ret_str = LightningError_get_err(&this_ptr_conv);
        jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
        Str_free(ret_str);
@@ -25654,6 +30061,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1set_1err(JNIEn
        LDKLightningError this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKStr val_conv = java_to_owned_str(env, val);
        LightningError_set_err(&this_ptr_conv, val_conv);
 }
@@ -25662,6 +30070,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LightningError_1get_1action
        LDKLightningError this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
        *ret_copy = LightningError_get_action(&this_ptr_conv);
        uint64_t ret_ref = (uint64_t)ret_copy;
@@ -25672,6 +30081,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1set_1action(JN
        LDKLightningError this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        void* val_ptr = (void*)(((uint64_t)val) & ~1);
        CHECK_ACCESS(val_ptr);
        LDKErrorAction val_conv = *(LDKErrorAction*)(val_ptr);
@@ -25689,6 +30099,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LightningError_1new(JNIEnv
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -25696,14 +30107,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LightningError_1new(JNIEnv
        return ret_ref;
 }
 
+static inline uint64_t LightningError_clone_ptr(LDKLightningError *NONNULL_PTR arg) {
+       LDKLightningError ret_var = LightningError_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LightningError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKLightningError arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = LightningError_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LightningError_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKLightningError orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKLightningError ret_var = LightningError_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -25715,6 +30149,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1free(JNIEnv
        LDKCommitmentUpdate this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        CommitmentUpdate_free(this_obj_conv);
 }
 
@@ -25722,6 +30157,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_
        LDKCommitmentUpdate this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKCVec_UpdateAddHTLCZ ret_var = CommitmentUpdate_get_update_add_htlcs(&this_ptr_conv);
        int64_tArray ret_arr = NULL;
        ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
@@ -25731,6 +30167,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_
                uint64_t ret_conv_15_ref = 0;
                CHECK((((uint64_t)ret_conv_15_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
                CHECK((((uint64_t)&ret_conv_15_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+               CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_15_var);
                ret_conv_15_ref = (uint64_t)ret_conv_15_var.inner;
                if (ret_conv_15_var.is_owned) {
                        ret_conv_15_ref |= 1;
@@ -25746,6 +30183,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_
        LDKCommitmentUpdate this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKCVec_UpdateAddHTLCZ val_constr;
        val_constr.datalen = (*env)->GetArrayLength(env, val);
        if (val_constr.datalen > 0)
@@ -25758,6 +30196,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_
                LDKUpdateAddHTLC val_conv_15_conv;
                val_conv_15_conv.inner = (void*)(val_conv_15 & (~1));
                val_conv_15_conv.is_owned = (val_conv_15 & 1) || (val_conv_15 == 0);
+               CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_15_conv);
                val_conv_15_conv = UpdateAddHTLC_clone(&val_conv_15_conv);
                val_constr.data[p] = val_conv_15_conv;
        }
@@ -25769,6 +30208,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_
        LDKCommitmentUpdate this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKCVec_UpdateFulfillHTLCZ ret_var = CommitmentUpdate_get_update_fulfill_htlcs(&this_ptr_conv);
        int64_tArray ret_arr = NULL;
        ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
@@ -25778,6 +30218,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_
                uint64_t ret_conv_19_ref = 0;
                CHECK((((uint64_t)ret_conv_19_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
                CHECK((((uint64_t)&ret_conv_19_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+               CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_19_var);
                ret_conv_19_ref = (uint64_t)ret_conv_19_var.inner;
                if (ret_conv_19_var.is_owned) {
                        ret_conv_19_ref |= 1;
@@ -25793,6 +30234,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_
        LDKCommitmentUpdate this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKCVec_UpdateFulfillHTLCZ val_constr;
        val_constr.datalen = (*env)->GetArrayLength(env, val);
        if (val_constr.datalen > 0)
@@ -25805,6 +30247,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_
                LDKUpdateFulfillHTLC val_conv_19_conv;
                val_conv_19_conv.inner = (void*)(val_conv_19 & (~1));
                val_conv_19_conv.is_owned = (val_conv_19 & 1) || (val_conv_19 == 0);
+               CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_19_conv);
                val_conv_19_conv = UpdateFulfillHTLC_clone(&val_conv_19_conv);
                val_constr.data[t] = val_conv_19_conv;
        }
@@ -25816,6 +30259,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_
        LDKCommitmentUpdate this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKCVec_UpdateFailHTLCZ ret_var = CommitmentUpdate_get_update_fail_htlcs(&this_ptr_conv);
        int64_tArray ret_arr = NULL;
        ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
@@ -25825,6 +30269,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_
                uint64_t ret_conv_16_ref = 0;
                CHECK((((uint64_t)ret_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
                CHECK((((uint64_t)&ret_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+               CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var);
                ret_conv_16_ref = (uint64_t)ret_conv_16_var.inner;
                if (ret_conv_16_var.is_owned) {
                        ret_conv_16_ref |= 1;
@@ -25840,6 +30285,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_
        LDKCommitmentUpdate this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKCVec_UpdateFailHTLCZ val_constr;
        val_constr.datalen = (*env)->GetArrayLength(env, val);
        if (val_constr.datalen > 0)
@@ -25852,6 +30298,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_
                LDKUpdateFailHTLC val_conv_16_conv;
                val_conv_16_conv.inner = (void*)(val_conv_16 & (~1));
                val_conv_16_conv.is_owned = (val_conv_16 & 1) || (val_conv_16 == 0);
+               CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_16_conv);
                val_conv_16_conv = UpdateFailHTLC_clone(&val_conv_16_conv);
                val_constr.data[q] = val_conv_16_conv;
        }
@@ -25863,6 +30310,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_
        LDKCommitmentUpdate this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKCVec_UpdateFailMalformedHTLCZ ret_var = CommitmentUpdate_get_update_fail_malformed_htlcs(&this_ptr_conv);
        int64_tArray ret_arr = NULL;
        ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
@@ -25872,6 +30320,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_
                uint64_t ret_conv_25_ref = 0;
                CHECK((((uint64_t)ret_conv_25_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
                CHECK((((uint64_t)&ret_conv_25_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+               CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_25_var);
                ret_conv_25_ref = (uint64_t)ret_conv_25_var.inner;
                if (ret_conv_25_var.is_owned) {
                        ret_conv_25_ref |= 1;
@@ -25887,6 +30336,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_
        LDKCommitmentUpdate this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKCVec_UpdateFailMalformedHTLCZ val_constr;
        val_constr.datalen = (*env)->GetArrayLength(env, val);
        if (val_constr.datalen > 0)
@@ -25899,6 +30349,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_
                LDKUpdateFailMalformedHTLC val_conv_25_conv;
                val_conv_25_conv.inner = (void*)(val_conv_25 & (~1));
                val_conv_25_conv.is_owned = (val_conv_25 & 1) || (val_conv_25 == 0);
+               CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_25_conv);
                val_conv_25_conv = UpdateFailMalformedHTLC_clone(&val_conv_25_conv);
                val_constr.data[z] = val_conv_25_conv;
        }
@@ -25910,11 +30361,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1upda
        LDKCommitmentUpdate this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKUpdateFee ret_var = CommitmentUpdate_get_update_fee(&this_ptr_conv);
        uint64_t ret_ref = 0;
        if ((uint64_t)ret_var.inner > 4096) {
                CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
                CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
                ret_ref = (uint64_t)ret_var.inner;
                if (ret_var.is_owned) {
                        ret_ref |= 1;
@@ -25927,9 +30380,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_
        LDKCommitmentUpdate this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKUpdateFee val_conv;
        val_conv.inner = (void*)(val & (~1));
        val_conv.is_owned = (val & 1) || (val == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
        val_conv = UpdateFee_clone(&val_conv);
        CommitmentUpdate_set_update_fee(&this_ptr_conv, val_conv);
 }
@@ -25938,10 +30393,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1comm
        LDKCommitmentUpdate this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKCommitmentSigned ret_var = CommitmentUpdate_get_commitment_signed(&this_ptr_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -25953,9 +30410,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1commitm
        LDKCommitmentUpdate this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKCommitmentSigned val_conv;
        val_conv.inner = (void*)(val & (~1));
        val_conv.is_owned = (val & 1) || (val == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
        val_conv = CommitmentSigned_clone(&val_conv);
        CommitmentUpdate_set_commitment_signed(&this_ptr_conv, val_conv);
 }
@@ -25973,6 +30432,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1new(JNIEn
                LDKUpdateAddHTLC update_add_htlcs_arg_conv_15_conv;
                update_add_htlcs_arg_conv_15_conv.inner = (void*)(update_add_htlcs_arg_conv_15 & (~1));
                update_add_htlcs_arg_conv_15_conv.is_owned = (update_add_htlcs_arg_conv_15 & 1) || (update_add_htlcs_arg_conv_15 == 0);
+               CHECK_INNER_FIELD_ACCESS_OR_NULL(update_add_htlcs_arg_conv_15_conv);
                update_add_htlcs_arg_conv_15_conv = UpdateAddHTLC_clone(&update_add_htlcs_arg_conv_15_conv);
                update_add_htlcs_arg_constr.data[p] = update_add_htlcs_arg_conv_15_conv;
        }
@@ -25989,6 +30449,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1new(JNIEn
                LDKUpdateFulfillHTLC update_fulfill_htlcs_arg_conv_19_conv;
                update_fulfill_htlcs_arg_conv_19_conv.inner = (void*)(update_fulfill_htlcs_arg_conv_19 & (~1));
                update_fulfill_htlcs_arg_conv_19_conv.is_owned = (update_fulfill_htlcs_arg_conv_19 & 1) || (update_fulfill_htlcs_arg_conv_19 == 0);
+               CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fulfill_htlcs_arg_conv_19_conv);
                update_fulfill_htlcs_arg_conv_19_conv = UpdateFulfillHTLC_clone(&update_fulfill_htlcs_arg_conv_19_conv);
                update_fulfill_htlcs_arg_constr.data[t] = update_fulfill_htlcs_arg_conv_19_conv;
        }
@@ -26005,6 +30466,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1new(JNIEn
                LDKUpdateFailHTLC update_fail_htlcs_arg_conv_16_conv;
                update_fail_htlcs_arg_conv_16_conv.inner = (void*)(update_fail_htlcs_arg_conv_16 & (~1));
                update_fail_htlcs_arg_conv_16_conv.is_owned = (update_fail_htlcs_arg_conv_16 & 1) || (update_fail_htlcs_arg_conv_16 == 0);
+               CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fail_htlcs_arg_conv_16_conv);
                update_fail_htlcs_arg_conv_16_conv = UpdateFailHTLC_clone(&update_fail_htlcs_arg_conv_16_conv);
                update_fail_htlcs_arg_constr.data[q] = update_fail_htlcs_arg_conv_16_conv;
        }
@@ -26021,6 +30483,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1new(JNIEn
                LDKUpdateFailMalformedHTLC update_fail_malformed_htlcs_arg_conv_25_conv;
                update_fail_malformed_htlcs_arg_conv_25_conv.inner = (void*)(update_fail_malformed_htlcs_arg_conv_25 & (~1));
                update_fail_malformed_htlcs_arg_conv_25_conv.is_owned = (update_fail_malformed_htlcs_arg_conv_25 & 1) || (update_fail_malformed_htlcs_arg_conv_25 == 0);
+               CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fail_malformed_htlcs_arg_conv_25_conv);
                update_fail_malformed_htlcs_arg_conv_25_conv = UpdateFailMalformedHTLC_clone(&update_fail_malformed_htlcs_arg_conv_25_conv);
                update_fail_malformed_htlcs_arg_constr.data[z] = update_fail_malformed_htlcs_arg_conv_25_conv;
        }
@@ -26028,15 +30491,18 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1new(JNIEn
        LDKUpdateFee update_fee_arg_conv;
        update_fee_arg_conv.inner = (void*)(update_fee_arg & (~1));
        update_fee_arg_conv.is_owned = (update_fee_arg & 1) || (update_fee_arg == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fee_arg_conv);
        update_fee_arg_conv = UpdateFee_clone(&update_fee_arg_conv);
        LDKCommitmentSigned commitment_signed_arg_conv;
        commitment_signed_arg_conv.inner = (void*)(commitment_signed_arg & (~1));
        commitment_signed_arg_conv.is_owned = (commitment_signed_arg & 1) || (commitment_signed_arg == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_signed_arg_conv);
        commitment_signed_arg_conv = CommitmentSigned_clone(&commitment_signed_arg_conv);
        LDKCommitmentUpdate ret_var = CommitmentUpdate_new(update_add_htlcs_arg_constr, update_fulfill_htlcs_arg_constr, update_fail_htlcs_arg_constr, update_fail_malformed_htlcs_arg_constr, update_fee_arg_conv, commitment_signed_arg_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -26044,14 +30510,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1new(JNIEn
        return ret_ref;
 }
 
+static inline uint64_t CommitmentUpdate_clone_ptr(LDKCommitmentUpdate *NONNULL_PTR arg) {
+       LDKCommitmentUpdate ret_var = CommitmentUpdate_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCommitmentUpdate arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = CommitmentUpdate_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCommitmentUpdate orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKCommitmentUpdate ret_var = CommitmentUpdate_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -26081,6 +30570,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1write(JN
        LDKAcceptChannel obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
        obj_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
        LDKCVec_u8Z ret_var = AcceptChannel_write(&obj_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
@@ -26102,6 +30592,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_
        LDKAnnouncementSignatures obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
        obj_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
        LDKCVec_u8Z ret_var = AnnouncementSignatures_write(&obj_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
@@ -26123,6 +30614,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1wri
        LDKChannelReestablish obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
        obj_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
        LDKCVec_u8Z ret_var = ChannelReestablish_write(&obj_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
@@ -26144,6 +30636,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1write(JN
        LDKClosingSigned obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
        obj_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
        LDKCVec_u8Z ret_var = ClosingSigned_write(&obj_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
@@ -26165,6 +30658,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1
        LDKClosingSignedFeeRange obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
        obj_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
        LDKCVec_u8Z ret_var = ClosingSignedFeeRange_write(&obj_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
@@ -26186,6 +30680,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1write
        LDKCommitmentSigned obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
        obj_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
        LDKCVec_u8Z ret_var = CommitmentSigned_write(&obj_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
@@ -26207,6 +30702,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1write(J
        LDKFundingCreated obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
        obj_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
        LDKCVec_u8Z ret_var = FundingCreated_write(&obj_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
@@ -26228,6 +30724,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingSigned_1write(JN
        LDKFundingSigned obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
        obj_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
        LDKCVec_u8Z ret_var = FundingSigned_write(&obj_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
@@ -26249,6 +30746,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingLocked_1write(JN
        LDKFundingLocked obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
        obj_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
        LDKCVec_u8Z ret_var = FundingLocked_write(&obj_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
@@ -26270,6 +30768,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Init_1write(JNIEnv *env
        LDKInit obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
        obj_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
        LDKCVec_u8Z ret_var = Init_write(&obj_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
@@ -26291,6 +30790,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1write(JNIE
        LDKOpenChannel obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
        obj_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
        LDKCVec_u8Z ret_var = OpenChannel_write(&obj_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
@@ -26312,6 +30812,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1write(JNI
        LDKRevokeAndACK obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
        obj_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
        LDKCVec_u8Z ret_var = RevokeAndACK_write(&obj_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
@@ -26333,6 +30834,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Shutdown_1write(JNIEnv
        LDKShutdown obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
        obj_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
        LDKCVec_u8Z ret_var = Shutdown_write(&obj_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
@@ -26354,6 +30856,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1write(J
        LDKUpdateFailHTLC obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
        obj_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
        LDKCVec_u8Z ret_var = UpdateFailHTLC_write(&obj_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
@@ -26375,6 +30878,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC
        LDKUpdateFailMalformedHTLC obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
        obj_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
        LDKCVec_u8Z ret_var = UpdateFailMalformedHTLC_write(&obj_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
@@ -26396,6 +30900,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFee_1write(JNIEnv
        LDKUpdateFee obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
        obj_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
        LDKCVec_u8Z ret_var = UpdateFee_write(&obj_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
@@ -26417,6 +30922,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1writ
        LDKUpdateFulfillHTLC obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
        obj_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
        LDKCVec_u8Z ret_var = UpdateFulfillHTLC_write(&obj_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
@@ -26438,6 +30944,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1write(JN
        LDKUpdateAddHTLC obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
        obj_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
        LDKCVec_u8Z ret_var = UpdateAddHTLC_write(&obj_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
@@ -26459,6 +30966,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Ping_1write(JNIEnv *env
        LDKPing obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
        obj_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
        LDKCVec_u8Z ret_var = Ping_write(&obj_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
@@ -26480,6 +30988,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Pong_1write(JNIEnv *env
        LDKPong obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
        obj_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
        LDKCVec_u8Z ret_var = Pong_write(&obj_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
@@ -26501,6 +31010,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnounce
        LDKUnsignedChannelAnnouncement obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
        obj_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
        LDKCVec_u8Z ret_var = UnsignedChannelAnnouncement_write(&obj_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
@@ -26522,6 +31032,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1wr
        LDKChannelAnnouncement obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
        obj_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
        LDKCVec_u8Z ret_var = ChannelAnnouncement_write(&obj_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
@@ -26543,6 +31054,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1
        LDKUnsignedChannelUpdate obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
        obj_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
        LDKCVec_u8Z ret_var = UnsignedChannelUpdate_write(&obj_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
@@ -26564,6 +31076,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1write(JN
        LDKChannelUpdate obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
        obj_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
        LDKCVec_u8Z ret_var = ChannelUpdate_write(&obj_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
@@ -26585,6 +31098,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1write(JNI
        LDKErrorMessage obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
        obj_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
        LDKCVec_u8Z ret_var = ErrorMessage_write(&obj_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
@@ -26606,6 +31120,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncemen
        LDKUnsignedNodeAnnouncement obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
        obj_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
        LDKCVec_u8Z ret_var = UnsignedNodeAnnouncement_write(&obj_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
@@ -26627,6 +31142,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1write
        LDKNodeAnnouncement obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
        obj_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
        LDKCVec_u8Z ret_var = NodeAnnouncement_write(&obj_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
@@ -26658,6 +31174,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1w
        LDKQueryShortChannelIds obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
        obj_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
        LDKCVec_u8Z ret_var = QueryShortChannelIds_write(&obj_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
@@ -26669,6 +31186,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd
        LDKReplyShortChannelIdsEnd obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
        obj_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
        LDKCVec_u8Z ret_var = ReplyShortChannelIdsEnd_write(&obj_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
@@ -26690,6 +31208,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1end_1blo
        LDKQueryChannelRange this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        int32_t ret_val = QueryChannelRange_end_blocknum(&this_arg_conv);
        return ret_val;
 }
@@ -26698,6 +31217,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1writ
        LDKQueryChannelRange obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
        obj_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
        LDKCVec_u8Z ret_var = QueryChannelRange_write(&obj_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
@@ -26729,6 +31249,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1writ
        LDKReplyChannelRange obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
        obj_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
        LDKCVec_u8Z ret_var = ReplyChannelRange_write(&obj_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
@@ -26740,6 +31261,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1
        LDKGossipTimestampFilter obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
        obj_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
        LDKCVec_u8Z ret_var = GossipTimestampFilter_write(&obj_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
@@ -26770,6 +31292,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1free(J
        LDKIgnoringMessageHandler this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        IgnoringMessageHandler_free(this_obj_conv);
 }
 
@@ -26778,6 +31301,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1new
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -26789,6 +31313,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1as_
        LDKIgnoringMessageHandler this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
        *ret_ret = IgnoringMessageHandler_as_MessageSendEventsProvider(&this_arg_conv);
        return (uint64_t)ret_ret;
@@ -26798,6 +31323,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1as_
        LDKIgnoringMessageHandler this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKRoutingMessageHandler* ret_ret = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler");
        *ret_ret = IgnoringMessageHandler_as_RoutingMessageHandler(&this_arg_conv);
        return (uint64_t)ret_ret;
@@ -26807,6 +31333,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1as_
        LDKIgnoringMessageHandler this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKCustomMessageReader* ret_ret = MALLOC(sizeof(LDKCustomMessageReader), "LDKCustomMessageReader");
        *ret_ret = IgnoringMessageHandler_as_CustomMessageReader(&this_arg_conv);
        return (uint64_t)ret_ret;
@@ -26816,6 +31343,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1as_
        LDKIgnoringMessageHandler this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKCustomMessageHandler* ret_ret = MALLOC(sizeof(LDKCustomMessageHandler), "LDKCustomMessageHandler");
        *ret_ret = IgnoringMessageHandler_as_CustomMessageHandler(&this_arg_conv);
        return (uint64_t)ret_ret;
@@ -26825,6 +31353,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErroringMessageHandler_1free(J
        LDKErroringMessageHandler this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        ErroringMessageHandler_free(this_obj_conv);
 }
 
@@ -26833,6 +31362,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErroringMessageHandler_1new
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -26844,6 +31374,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErroringMessageHandler_1as_
        LDKErroringMessageHandler this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
        *ret_ret = ErroringMessageHandler_as_MessageSendEventsProvider(&this_arg_conv);
        return (uint64_t)ret_ret;
@@ -26853,6 +31384,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErroringMessageHandler_1as_
        LDKErroringMessageHandler this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKChannelMessageHandler* ret_ret = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler");
        *ret_ret = ErroringMessageHandler_as_ChannelMessageHandler(&this_arg_conv);
        return (uint64_t)ret_ret;
@@ -26862,6 +31394,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1free(JNIEnv *e
        LDKMessageHandler this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        MessageHandler_free(this_obj_conv);
 }
 
@@ -26869,6 +31402,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageHandler_1get_1chan_1
        LDKMessageHandler this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        // WARNING: This object doesn't live past this scope, needs clone!
        uint64_t ret_ret = ((uint64_t)MessageHandler_get_chan_handler(&this_ptr_conv)) | 1;
        return ret_ret;
@@ -26878,6 +31412,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1set_1chan_1han
        LDKMessageHandler this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        void* val_ptr = (void*)(((uint64_t)val) & ~1);
        CHECK_ACCESS(val_ptr);
        LDKChannelMessageHandler val_conv = *(LDKChannelMessageHandler*)(val_ptr);
@@ -26892,6 +31427,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageHandler_1get_1route_
        LDKMessageHandler this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        // WARNING: This object doesn't live past this scope, needs clone!
        uint64_t ret_ret = ((uint64_t)MessageHandler_get_route_handler(&this_ptr_conv)) | 1;
        return ret_ret;
@@ -26901,6 +31437,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1set_1route_1ha
        LDKMessageHandler this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        void* val_ptr = (void*)(((uint64_t)val) & ~1);
        CHECK_ACCESS(val_ptr);
        LDKRoutingMessageHandler val_conv = *(LDKRoutingMessageHandler*)(val_ptr);
@@ -26930,6 +31467,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageHandler_1new(JNIEnv
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -26937,6 +31475,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageHandler_1new(JNIEnv
        return ret_ref;
 }
 
+static inline uint64_t SocketDescriptor_clone_ptr(LDKSocketDescriptor *NONNULL_PTR arg) {
+       LDKSocketDescriptor* ret_ret = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor");
+       *ret_ret = SocketDescriptor_clone(arg);
+       return (uint64_t)ret_ret;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       void* arg_ptr = (void*)(((uint64_t)arg) & ~1);
+       if (!(arg & 1)) { CHECK_ACCESS(arg_ptr); }
+       LDKSocketDescriptor* arg_conv = (LDKSocketDescriptor*)arg_ptr;
+       int64_t ret_val = SocketDescriptor_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        void* orig_ptr = (void*)(((uint64_t)orig) & ~1);
        if (!(orig & 1)) { CHECK_ACCESS(orig_ptr); }
@@ -26959,6 +31510,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1free(JNIEnv *
        LDKPeerHandleError this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        PeerHandleError_free(this_obj_conv);
 }
 
@@ -26966,6 +31518,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1get_1no_1
        LDKPeerHandleError this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        jboolean ret_val = PeerHandleError_get_no_connection_possible(&this_ptr_conv);
        return ret_val;
 }
@@ -26974,6 +31527,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1set_1no_1conn
        LDKPeerHandleError this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        PeerHandleError_set_no_connection_possible(&this_ptr_conv, val);
 }
 
@@ -26982,6 +31536,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1new(JNIEnv
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -26989,14 +31544,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1new(JNIEnv
        return ret_ref;
 }
 
+static inline uint64_t PeerHandleError_clone_ptr(LDKPeerHandleError *NONNULL_PTR arg) {
+       LDKPeerHandleError ret_var = PeerHandleError_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKPeerHandleError arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = PeerHandleError_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKPeerHandleError orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKPeerHandleError ret_var = PeerHandleError_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -27008,6 +31586,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1free(JNIEnv *env,
        LDKPeerManager this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        PeerManager_free(this_obj_conv);
 }
 
@@ -27015,6 +31594,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerManager_1new(JNIEnv *en
        LDKMessageHandler message_handler_conv;
        message_handler_conv.inner = (void*)(message_handler & (~1));
        message_handler_conv.is_owned = (message_handler & 1) || (message_handler == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(message_handler_conv);
        // Warning: we need a move here but no clone is available for LDKMessageHandler
        LDKSecretKey our_node_secret_ref;
        CHECK((*env)->GetArrayLength(env, our_node_secret) == 32);
@@ -27041,6 +31621,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerManager_1new(JNIEnv *en
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -27052,6 +31633,7 @@ JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_PeerManager_1get_1peer
        LDKPeerManager this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKCVec_PublicKeyZ ret_var = PeerManager_get_peer_node_ids(&this_arg_conv);
        jobjectArray ret_arr = NULL;
        ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL);
@@ -27070,6 +31652,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerManager_1new_1outbound_
        LDKPeerManager this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKPublicKey their_node_id_ref;
        CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
        (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
@@ -27089,6 +31672,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerManager_1new_1inbound_1
        LDKPeerManager this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        void* descriptor_ptr = (void*)(((uint64_t)descriptor) & ~1);
        CHECK_ACCESS(descriptor_ptr);
        LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)(descriptor_ptr);
@@ -27105,6 +31689,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerManager_1write_1buffer_
        LDKPeerManager this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        void* descriptor_ptr = (void*)(((uint64_t)descriptor) & ~1);
        if (!(descriptor & 1)) { CHECK_ACCESS(descriptor_ptr); }
        LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor_ptr;
@@ -27117,6 +31702,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerManager_1read_1event(JN
        LDKPeerManager this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        void* peer_descriptor_ptr = (void*)(((uint64_t)peer_descriptor) & ~1);
        if (!(peer_descriptor & 1)) { CHECK_ACCESS(peer_descriptor_ptr); }
        LDKSocketDescriptor* peer_descriptor_conv = (LDKSocketDescriptor*)peer_descriptor_ptr;
@@ -27133,6 +31719,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1process_1events(J
        LDKPeerManager this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        PeerManager_process_events(&this_arg_conv);
 }
 
@@ -27140,6 +31727,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1socket_1disconnec
        LDKPeerManager this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        void* descriptor_ptr = (void*)(((uint64_t)descriptor) & ~1);
        if (!(descriptor & 1)) { CHECK_ACCESS(descriptor_ptr); }
        LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor_ptr;
@@ -27150,6 +31738,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1disconnect_1by_1n
        LDKPeerManager this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKPublicKey node_id_ref;
        CHECK((*env)->GetArrayLength(env, node_id) == 33);
        (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
@@ -27160,6 +31749,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1disconnect_1all_1
        LDKPeerManager this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        PeerManager_disconnect_all_peers(&this_arg_conv);
 }
 
@@ -27167,6 +31757,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1timer_1tick_1occu
        LDKPeerManager this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        PeerManager_timer_tick_occurred(&this_arg_conv);
 }
 
@@ -27192,6 +31783,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_build_1closing_1transac
        LDKOutPoint funding_outpoint_conv;
        funding_outpoint_conv.inner = (void*)(funding_outpoint & (~1));
        funding_outpoint_conv.is_owned = (funding_outpoint & 1) || (funding_outpoint == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_conv);
        funding_outpoint_conv = OutPoint_clone(&funding_outpoint_conv);
        LDKTransaction ret_var = build_closing_transaction(to_holder_value_sat, to_counterparty_value_sat, to_holder_script_ref, to_counterparty_script_ref, funding_outpoint_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
@@ -27255,6 +31847,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1free(JNIEnv *e
        LDKTxCreationKeys this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        TxCreationKeys_free(this_obj_conv);
 }
 
@@ -27262,6 +31855,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1pe
        LDKTxCreationKeys this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, TxCreationKeys_get_per_commitment_point(&this_ptr_conv).compressed_form);
        return ret_arr;
@@ -27271,6 +31865,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1per_1comm
        LDKTxCreationKeys this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKPublicKey val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 33);
        (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
@@ -27281,6 +31876,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1re
        LDKTxCreationKeys this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, TxCreationKeys_get_revocation_key(&this_ptr_conv).compressed_form);
        return ret_arr;
@@ -27290,6 +31886,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1revocatio
        LDKTxCreationKeys this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKPublicKey val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 33);
        (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
@@ -27300,6 +31897,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1br
        LDKTxCreationKeys this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, TxCreationKeys_get_broadcaster_htlc_key(&this_ptr_conv).compressed_form);
        return ret_arr;
@@ -27309,6 +31907,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1broadcast
        LDKTxCreationKeys this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKPublicKey val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 33);
        (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
@@ -27319,6 +31918,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1co
        LDKTxCreationKeys this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, TxCreationKeys_get_countersignatory_htlc_key(&this_ptr_conv).compressed_form);
        return ret_arr;
@@ -27328,6 +31928,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1countersi
        LDKTxCreationKeys this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKPublicKey val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 33);
        (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
@@ -27338,6 +31939,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1br
        LDKTxCreationKeys this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, TxCreationKeys_get_broadcaster_delayed_payment_key(&this_ptr_conv).compressed_form);
        return ret_arr;
@@ -27347,6 +31949,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1broadcast
        LDKTxCreationKeys this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKPublicKey val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 33);
        (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
@@ -27373,6 +31976,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1new(JNIEnv
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -27380,14 +31984,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1new(JNIEnv
        return ret_ref;
 }
 
+static inline uint64_t TxCreationKeys_clone_ptr(LDKTxCreationKeys *NONNULL_PTR arg) {
+       LDKTxCreationKeys ret_var = TxCreationKeys_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKTxCreationKeys arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = TxCreationKeys_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKTxCreationKeys orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKTxCreationKeys ret_var = TxCreationKeys_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -27399,6 +32026,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1write(J
        LDKTxCreationKeys obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
        obj_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
        LDKCVec_u8Z ret_var = TxCreationKeys_write(&obj_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
@@ -27420,6 +32048,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1free(JNIEnv
        LDKChannelPublicKeys this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        ChannelPublicKeys_free(this_obj_conv);
 }
 
@@ -27427,6 +32056,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_
        LDKChannelPublicKeys this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelPublicKeys_get_funding_pubkey(&this_ptr_conv).compressed_form);
        return ret_arr;
@@ -27436,6 +32066,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1fundin
        LDKChannelPublicKeys this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKPublicKey val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 33);
        (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
@@ -27446,6 +32077,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_
        LDKChannelPublicKeys this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelPublicKeys_get_revocation_basepoint(&this_ptr_conv).compressed_form);
        return ret_arr;
@@ -27455,6 +32087,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1revoca
        LDKChannelPublicKeys this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKPublicKey val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 33);
        (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
@@ -27465,6 +32098,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_
        LDKChannelPublicKeys this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelPublicKeys_get_payment_point(&this_ptr_conv).compressed_form);
        return ret_arr;
@@ -27474,6 +32108,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1paymen
        LDKChannelPublicKeys this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKPublicKey val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 33);
        (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
@@ -27484,6 +32119,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_
        LDKChannelPublicKeys this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelPublicKeys_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form);
        return ret_arr;
@@ -27493,6 +32129,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1delaye
        LDKChannelPublicKeys this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKPublicKey val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 33);
        (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
@@ -27503,6 +32140,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_
        LDKChannelPublicKeys this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelPublicKeys_get_htlc_basepoint(&this_ptr_conv).compressed_form);
        return ret_arr;
@@ -27512,6 +32150,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1htlc_1
        LDKChannelPublicKeys this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKPublicKey val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 33);
        (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
@@ -27538,6 +32177,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1new(JNIE
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -27545,14 +32185,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1new(JNIE
        return ret_ref;
 }
 
+static inline uint64_t ChannelPublicKeys_clone_ptr(LDKChannelPublicKeys *NONNULL_PTR arg) {
+       LDKChannelPublicKeys ret_var = ChannelPublicKeys_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKChannelPublicKeys arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = ChannelPublicKeys_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKChannelPublicKeys orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKChannelPublicKeys ret_var = ChannelPublicKeys_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -27564,6 +32227,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1writ
        LDKChannelPublicKeys obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
        obj_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
        LDKCVec_u8Z ret_var = ChannelPublicKeys_write(&obj_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
@@ -27609,9 +32273,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1from_1chann
        LDKChannelPublicKeys broadcaster_keys_conv;
        broadcaster_keys_conv.inner = (void*)(broadcaster_keys & (~1));
        broadcaster_keys_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(broadcaster_keys_conv);
        LDKChannelPublicKeys countersignatory_keys_conv;
        countersignatory_keys_conv.inner = (void*)(countersignatory_keys & (~1));
        countersignatory_keys_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(countersignatory_keys_conv);
        LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ");
        *ret_conv = TxCreationKeys_from_channel_static_keys(per_commitment_point_ref, &broadcaster_keys_conv, &countersignatory_keys_conv);
        return (uint64_t)ret_conv;
@@ -27635,6 +32301,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1free(J
        LDKHTLCOutputInCommitment this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        HTLCOutputInCommitment_free(this_obj_conv);
 }
 
@@ -27642,6 +32309,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1ge
        LDKHTLCOutputInCommitment this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        jboolean ret_val = HTLCOutputInCommitment_get_offered(&this_ptr_conv);
        return ret_val;
 }
@@ -27650,6 +32318,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1o
        LDKHTLCOutputInCommitment this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        HTLCOutputInCommitment_set_offered(&this_ptr_conv, val);
 }
 
@@ -27657,6 +32326,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get
        LDKHTLCOutputInCommitment this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int64_t ret_val = HTLCOutputInCommitment_get_amount_msat(&this_ptr_conv);
        return ret_val;
 }
@@ -27665,6 +32335,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1a
        LDKHTLCOutputInCommitment this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        HTLCOutputInCommitment_set_amount_msat(&this_ptr_conv, val);
 }
 
@@ -27672,6 +32343,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get
        LDKHTLCOutputInCommitment this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int32_t ret_val = HTLCOutputInCommitment_get_cltv_expiry(&this_ptr_conv);
        return ret_val;
 }
@@ -27680,6 +32352,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1c
        LDKHTLCOutputInCommitment this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        HTLCOutputInCommitment_set_cltv_expiry(&this_ptr_conv, val);
 }
 
@@ -27687,6 +32360,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_
        LDKHTLCOutputInCommitment this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *HTLCOutputInCommitment_get_payment_hash(&this_ptr_conv));
        return ret_arr;
@@ -27696,6 +32370,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1p
        LDKHTLCOutputInCommitment this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKThirtyTwoBytes val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 32);
        (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
@@ -27706,6 +32381,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get
        LDKHTLCOutputInCommitment this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z");
        *ret_copy = HTLCOutputInCommitment_get_transaction_output_index(&this_ptr_conv);
        uint64_t ret_ref = (uint64_t)ret_copy;
@@ -27716,6 +32392,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1t
        LDKHTLCOutputInCommitment this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        void* val_ptr = (void*)(((uint64_t)val) & ~1);
        CHECK_ACCESS(val_ptr);
        LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr);
@@ -27735,6 +32412,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1new
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -27742,14 +32420,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1new
        return ret_ref;
 }
 
+static inline uint64_t HTLCOutputInCommitment_clone_ptr(LDKHTLCOutputInCommitment *NONNULL_PTR arg) {
+       LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKHTLCOutputInCommitment arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = HTLCOutputInCommitment_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKHTLCOutputInCommitment orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -27761,6 +32462,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_
        LDKHTLCOutputInCommitment obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
        obj_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
        LDKCVec_u8Z ret_var = HTLCOutputInCommitment_write(&obj_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
@@ -27782,9 +32484,11 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_get_1htlc_1redeemscript
        LDKHTLCOutputInCommitment htlc_conv;
        htlc_conv.inner = (void*)(htlc & (~1));
        htlc_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_conv);
        LDKTxCreationKeys keys_conv;
        keys_conv.inner = (void*)(keys & (~1));
        keys_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(keys_conv);
        LDKCVec_u8Z ret_var = get_htlc_redeemscript(&htlc_conv, &keys_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
@@ -27814,6 +32518,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_build_1htlc_1transactio
        LDKHTLCOutputInCommitment htlc_conv;
        htlc_conv.inner = (void*)(htlc & (~1));
        htlc_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_conv);
        LDKPublicKey broadcaster_delayed_payment_key_ref;
        CHECK((*env)->GetArrayLength(env, broadcaster_delayed_payment_key) == 33);
        (*env)->GetByteArrayRegion(env, broadcaster_delayed_payment_key, 0, 33, broadcaster_delayed_payment_key_ref.compressed_form);
@@ -27831,6 +32536,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1
        LDKChannelTransactionParameters this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        ChannelTransactionParameters_free(this_obj_conv);
 }
 
@@ -27838,10 +32544,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameter
        LDKChannelTransactionParameters this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKChannelPublicKeys ret_var = ChannelTransactionParameters_get_holder_pubkeys(&this_ptr_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -27853,9 +32561,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1
        LDKChannelTransactionParameters this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKChannelPublicKeys val_conv;
        val_conv.inner = (void*)(val & (~1));
        val_conv.is_owned = (val & 1) || (val == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
        val_conv = ChannelPublicKeys_clone(&val_conv);
        ChannelTransactionParameters_set_holder_pubkeys(&this_ptr_conv, val_conv);
 }
@@ -27864,6 +32574,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameter
        LDKChannelTransactionParameters this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int16_t ret_val = ChannelTransactionParameters_get_holder_selected_contest_delay(&this_ptr_conv);
        return ret_val;
 }
@@ -27872,6 +32583,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1
        LDKChannelTransactionParameters this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        ChannelTransactionParameters_set_holder_selected_contest_delay(&this_ptr_conv, val);
 }
 
@@ -27879,6 +32591,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParamete
        LDKChannelTransactionParameters this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        jboolean ret_val = ChannelTransactionParameters_get_is_outbound_from_holder(&this_ptr_conv);
        return ret_val;
 }
@@ -27887,6 +32600,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1
        LDKChannelTransactionParameters this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        ChannelTransactionParameters_set_is_outbound_from_holder(&this_ptr_conv, val);
 }
 
@@ -27894,11 +32608,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameter
        LDKChannelTransactionParameters this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKCounterpartyChannelTransactionParameters ret_var = ChannelTransactionParameters_get_counterparty_parameters(&this_ptr_conv);
        uint64_t ret_ref = 0;
        if ((uint64_t)ret_var.inner > 4096) {
                CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
                CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
                ret_ref = (uint64_t)ret_var.inner;
                if (ret_var.is_owned) {
                        ret_ref |= 1;
@@ -27911,9 +32627,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1
        LDKChannelTransactionParameters this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKCounterpartyChannelTransactionParameters val_conv;
        val_conv.inner = (void*)(val & (~1));
        val_conv.is_owned = (val & 1) || (val == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
        val_conv = CounterpartyChannelTransactionParameters_clone(&val_conv);
        ChannelTransactionParameters_set_counterparty_parameters(&this_ptr_conv, val_conv);
 }
@@ -27922,11 +32640,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameter
        LDKChannelTransactionParameters this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKOutPoint ret_var = ChannelTransactionParameters_get_funding_outpoint(&this_ptr_conv);
        uint64_t ret_ref = 0;
        if ((uint64_t)ret_var.inner > 4096) {
                CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
                CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
                ret_ref = (uint64_t)ret_var.inner;
                if (ret_var.is_owned) {
                        ret_ref |= 1;
@@ -27939,9 +32659,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1
        LDKChannelTransactionParameters this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKOutPoint val_conv;
        val_conv.inner = (void*)(val & (~1));
        val_conv.is_owned = (val & 1) || (val == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
        val_conv = OutPoint_clone(&val_conv);
        ChannelTransactionParameters_set_funding_outpoint(&this_ptr_conv, val_conv);
 }
@@ -27950,19 +32672,23 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameter
        LDKChannelPublicKeys holder_pubkeys_arg_conv;
        holder_pubkeys_arg_conv.inner = (void*)(holder_pubkeys_arg & (~1));
        holder_pubkeys_arg_conv.is_owned = (holder_pubkeys_arg & 1) || (holder_pubkeys_arg == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(holder_pubkeys_arg_conv);
        holder_pubkeys_arg_conv = ChannelPublicKeys_clone(&holder_pubkeys_arg_conv);
        LDKCounterpartyChannelTransactionParameters counterparty_parameters_arg_conv;
        counterparty_parameters_arg_conv.inner = (void*)(counterparty_parameters_arg & (~1));
        counterparty_parameters_arg_conv.is_owned = (counterparty_parameters_arg & 1) || (counterparty_parameters_arg == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(counterparty_parameters_arg_conv);
        counterparty_parameters_arg_conv = CounterpartyChannelTransactionParameters_clone(&counterparty_parameters_arg_conv);
        LDKOutPoint funding_outpoint_arg_conv;
        funding_outpoint_arg_conv.inner = (void*)(funding_outpoint_arg & (~1));
        funding_outpoint_arg_conv.is_owned = (funding_outpoint_arg & 1) || (funding_outpoint_arg == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_arg_conv);
        funding_outpoint_arg_conv = OutPoint_clone(&funding_outpoint_arg_conv);
        LDKChannelTransactionParameters ret_var = ChannelTransactionParameters_new(holder_pubkeys_arg_conv, holder_selected_contest_delay_arg, is_outbound_from_holder_arg, counterparty_parameters_arg_conv, funding_outpoint_arg_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -27970,14 +32696,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameter
        return ret_ref;
 }
 
+static inline uint64_t ChannelTransactionParameters_clone_ptr(LDKChannelTransactionParameters *NONNULL_PTR arg) {
+       LDKChannelTransactionParameters ret_var = ChannelTransactionParameters_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKChannelTransactionParameters arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = ChannelTransactionParameters_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKChannelTransactionParameters orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKChannelTransactionParameters ret_var = ChannelTransactionParameters_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -27989,6 +32738,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransaction
        LDKCounterpartyChannelTransactionParameters this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        CounterpartyChannelTransactionParameters_free(this_obj_conv);
 }
 
@@ -27996,10 +32746,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransact
        LDKCounterpartyChannelTransactionParameters this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKChannelPublicKeys ret_var = CounterpartyChannelTransactionParameters_get_pubkeys(&this_ptr_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -28011,9 +32763,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransaction
        LDKCounterpartyChannelTransactionParameters this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKChannelPublicKeys val_conv;
        val_conv.inner = (void*)(val & (~1));
        val_conv.is_owned = (val & 1) || (val == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
        val_conv = ChannelPublicKeys_clone(&val_conv);
        CounterpartyChannelTransactionParameters_set_pubkeys(&this_ptr_conv, val_conv);
 }
@@ -28022,6 +32776,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransact
        LDKCounterpartyChannelTransactionParameters this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int16_t ret_val = CounterpartyChannelTransactionParameters_get_selected_contest_delay(&this_ptr_conv);
        return ret_val;
 }
@@ -28030,6 +32785,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransaction
        LDKCounterpartyChannelTransactionParameters this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        CounterpartyChannelTransactionParameters_set_selected_contest_delay(&this_ptr_conv, val);
 }
 
@@ -28037,11 +32793,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransact
        LDKChannelPublicKeys pubkeys_arg_conv;
        pubkeys_arg_conv.inner = (void*)(pubkeys_arg & (~1));
        pubkeys_arg_conv.is_owned = (pubkeys_arg & 1) || (pubkeys_arg == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(pubkeys_arg_conv);
        pubkeys_arg_conv = ChannelPublicKeys_clone(&pubkeys_arg_conv);
        LDKCounterpartyChannelTransactionParameters ret_var = CounterpartyChannelTransactionParameters_new(pubkeys_arg_conv, selected_contest_delay_arg);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -28049,14 +32807,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransact
        return ret_ref;
 }
 
+static inline uint64_t CounterpartyChannelTransactionParameters_clone_ptr(LDKCounterpartyChannelTransactionParameters *NONNULL_PTR arg) {
+       LDKCounterpartyChannelTransactionParameters ret_var = CounterpartyChannelTransactionParameters_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCounterpartyChannelTransactionParameters arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = CounterpartyChannelTransactionParameters_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCounterpartyChannelTransactionParameters orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKCounterpartyChannelTransactionParameters ret_var = CounterpartyChannelTransactionParameters_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -28068,6 +32849,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParamete
        LDKChannelTransactionParameters this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        jboolean ret_val = ChannelTransactionParameters_is_populated(&this_arg_conv);
        return ret_val;
 }
@@ -28076,10 +32858,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameter
        LDKChannelTransactionParameters this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKDirectedChannelTransactionParameters ret_var = ChannelTransactionParameters_as_holder_broadcastable(&this_arg_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -28091,10 +32875,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameter
        LDKChannelTransactionParameters this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKDirectedChannelTransactionParameters ret_var = ChannelTransactionParameters_as_counterparty_broadcastable(&this_arg_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -28106,6 +32892,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTran
        LDKCounterpartyChannelTransactionParameters obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
        obj_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
        LDKCVec_u8Z ret_var = CounterpartyChannelTransactionParameters_write(&obj_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
@@ -28127,6 +32914,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParam
        LDKChannelTransactionParameters obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
        obj_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
        LDKCVec_u8Z ret_var = ChannelTransactionParameters_write(&obj_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
@@ -28148,6 +32936,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionPara
        LDKDirectedChannelTransactionParameters this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        DirectedChannelTransactionParameters_free(this_obj_conv);
 }
 
@@ -28155,10 +32944,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionP
        LDKDirectedChannelTransactionParameters this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKChannelPublicKeys ret_var = DirectedChannelTransactionParameters_broadcaster_pubkeys(&this_arg_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -28170,10 +32961,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionP
        LDKDirectedChannelTransactionParameters this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKChannelPublicKeys ret_var = DirectedChannelTransactionParameters_countersignatory_pubkeys(&this_arg_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -28185,6 +32978,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionP
        LDKDirectedChannelTransactionParameters this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        int16_t ret_val = DirectedChannelTransactionParameters_contest_delay(&this_arg_conv);
        return ret_val;
 }
@@ -28193,6 +32987,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransaction
        LDKDirectedChannelTransactionParameters this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        jboolean ret_val = DirectedChannelTransactionParameters_is_outbound(&this_arg_conv);
        return ret_val;
 }
@@ -28201,10 +32996,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionP
        LDKDirectedChannelTransactionParameters this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKOutPoint ret_var = DirectedChannelTransactionParameters_funding_outpoint(&this_arg_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -28216,6 +33013,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1f
        LDKHolderCommitmentTransaction this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        HolderCommitmentTransaction_free(this_obj_conv);
 }
 
@@ -28223,6 +33021,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransac
        LDKHolderCommitmentTransaction this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, HolderCommitmentTransaction_get_counterparty_sig(&this_ptr_conv).compact_form);
        return ret_arr;
@@ -28232,6 +33031,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1s
        LDKHolderCommitmentTransaction this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKSignature val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 64);
        (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form);
@@ -28242,6 +33042,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1s
        LDKHolderCommitmentTransaction this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKCVec_SignatureZ val_constr;
        val_constr.datalen = (*env)->GetArrayLength(env, val);
        if (val_constr.datalen > 0)
@@ -28258,14 +33059,37 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1s
        HolderCommitmentTransaction_set_counterparty_htlc_sigs(&this_ptr_conv, val_constr);
 }
 
+static inline uint64_t HolderCommitmentTransaction_clone_ptr(LDKHolderCommitmentTransaction *NONNULL_PTR arg) {
+       LDKHolderCommitmentTransaction ret_var = HolderCommitmentTransaction_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKHolderCommitmentTransaction arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = HolderCommitmentTransaction_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKHolderCommitmentTransaction orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKHolderCommitmentTransaction ret_var = HolderCommitmentTransaction_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -28277,6 +33101,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransac
        LDKHolderCommitmentTransaction obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
        obj_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
        LDKCVec_u8Z ret_var = HolderCommitmentTransaction_write(&obj_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
@@ -28298,6 +33123,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction
        LDKCommitmentTransaction commitment_tx_conv;
        commitment_tx_conv.inner = (void*)(commitment_tx & (~1));
        commitment_tx_conv.is_owned = (commitment_tx & 1) || (commitment_tx == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_conv);
        commitment_tx_conv = CommitmentTransaction_clone(&commitment_tx_conv);
        LDKSignature counterparty_sig_ref;
        CHECK((*env)->GetArrayLength(env, counterparty_sig) == 64);
@@ -28325,6 +33151,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -28336,6 +33163,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1fr
        LDKBuiltCommitmentTransaction this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        BuiltCommitmentTransaction_free(this_obj_conv);
 }
 
@@ -28343,6 +33171,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransact
        LDKBuiltCommitmentTransaction this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKTransaction ret_var = BuiltCommitmentTransaction_get_transaction(&this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
@@ -28354,6 +33183,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1se
        LDKBuiltCommitmentTransaction this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKTransaction val_ref;
        val_ref.datalen = (*env)->GetArrayLength(env, val);
        val_ref.data = MALLOC(val_ref.datalen, "LDKTransaction Bytes");
@@ -28366,6 +33196,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransact
        LDKBuiltCommitmentTransaction this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *BuiltCommitmentTransaction_get_txid(&this_ptr_conv));
        return ret_arr;
@@ -28375,6 +33206,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1se
        LDKBuiltCommitmentTransaction this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKThirtyTwoBytes val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 32);
        (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
@@ -28394,6 +33226,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -28401,14 +33234,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_
        return ret_ref;
 }
 
+static inline uint64_t BuiltCommitmentTransaction_clone_ptr(LDKBuiltCommitmentTransaction *NONNULL_PTR arg) {
+       LDKBuiltCommitmentTransaction ret_var = BuiltCommitmentTransaction_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKBuiltCommitmentTransaction arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = BuiltCommitmentTransaction_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKBuiltCommitmentTransaction orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKBuiltCommitmentTransaction ret_var = BuiltCommitmentTransaction_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -28420,6 +33276,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransact
        LDKBuiltCommitmentTransaction obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
        obj_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
        LDKCVec_u8Z ret_var = BuiltCommitmentTransaction_write(&obj_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
@@ -28441,6 +33298,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransact
        LDKBuiltCommitmentTransaction this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKu8slice funding_redeemscript_ref;
        funding_redeemscript_ref.datalen = (*env)->GetArrayLength(env, funding_redeemscript);
        funding_redeemscript_ref.data = (*env)->GetByteArrayElements (env, funding_redeemscript, NULL);
@@ -28454,6 +33312,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransact
        LDKBuiltCommitmentTransaction this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        unsigned char funding_key_arr[32];
        CHECK((*env)->GetArrayLength(env, funding_key) == 32);
        (*env)->GetByteArrayRegion(env, funding_key, 0, 32, funding_key_arr);
@@ -28471,17 +33330,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1free(JNIEn
        LDKClosingTransaction this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        ClosingTransaction_free(this_obj_conv);
 }
 
+static inline uint64_t ClosingTransaction_clone_ptr(LDKClosingTransaction *NONNULL_PTR arg) {
+       LDKClosingTransaction ret_var = ClosingTransaction_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKClosingTransaction arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = ClosingTransaction_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKClosingTransaction orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKClosingTransaction ret_var = ClosingTransaction_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -28493,6 +33376,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1hash(JN
        LDKClosingTransaction o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        int64_t ret_val = ClosingTransaction_hash(&o_conv);
        return ret_val;
 }
@@ -28509,11 +33393,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1new(JNI
        LDKOutPoint funding_outpoint_conv;
        funding_outpoint_conv.inner = (void*)(funding_outpoint & (~1));
        funding_outpoint_conv.is_owned = (funding_outpoint & 1) || (funding_outpoint == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_conv);
        funding_outpoint_conv = OutPoint_clone(&funding_outpoint_conv);
        LDKClosingTransaction ret_var = ClosingTransaction_new(to_holder_value_sat, to_counterparty_value_sat, to_holder_script_ref, to_counterparty_script_ref, funding_outpoint_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -28525,10 +33411,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1trust(J
        LDKClosingTransaction this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKTrustedClosingTransaction ret_var = ClosingTransaction_trust(&this_arg_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -28540,9 +33428,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1verify(
        LDKClosingTransaction this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKOutPoint funding_outpoint_conv;
        funding_outpoint_conv.inner = (void*)(funding_outpoint & (~1));
        funding_outpoint_conv.is_owned = (funding_outpoint & 1) || (funding_outpoint == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_conv);
        funding_outpoint_conv = OutPoint_clone(&funding_outpoint_conv);
        LDKCResult_TrustedClosingTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedClosingTransactionNoneZ), "LDKCResult_TrustedClosingTransactionNoneZ");
        *ret_conv = ClosingTransaction_verify(&this_arg_conv, funding_outpoint_conv);
@@ -28553,6 +33443,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1to_1hol
        LDKClosingTransaction this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        int64_t ret_val = ClosingTransaction_to_holder_value_sat(&this_arg_conv);
        return ret_val;
 }
@@ -28561,6 +33452,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1to_1cou
        LDKClosingTransaction this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        int64_t ret_val = ClosingTransaction_to_counterparty_value_sat(&this_arg_conv);
        return ret_val;
 }
@@ -28569,6 +33461,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1to_
        LDKClosingTransaction this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKu8slice ret_var = ClosingTransaction_to_holder_script(&this_arg_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
@@ -28579,6 +33472,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1to_
        LDKClosingTransaction this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKu8slice ret_var = ClosingTransaction_to_counterparty_script(&this_arg_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
@@ -28589,6 +33483,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TrustedClosingTransaction_1fre
        LDKTrustedClosingTransaction this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        TrustedClosingTransaction_free(this_obj_conv);
 }
 
@@ -28596,6 +33491,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TrustedClosingTransacti
        LDKTrustedClosingTransaction this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKTransaction ret_var = TrustedClosingTransaction_built_transaction(&this_arg_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
@@ -28607,6 +33503,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TrustedClosingTransacti
        LDKTrustedClosingTransaction this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKu8slice funding_redeemscript_ref;
        funding_redeemscript_ref.datalen = (*env)->GetArrayLength(env, funding_redeemscript);
        funding_redeemscript_ref.data = (*env)->GetByteArrayElements (env, funding_redeemscript, NULL);
@@ -28620,6 +33517,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TrustedClosingTransacti
        LDKTrustedClosingTransaction this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        unsigned char funding_key_arr[32];
        CHECK((*env)->GetArrayLength(env, funding_key) == 32);
        (*env)->GetByteArrayRegion(env, funding_key, 0, 32, funding_key_arr);
@@ -28637,17 +33535,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1free(JN
        LDKCommitmentTransaction this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        CommitmentTransaction_free(this_obj_conv);
 }
 
+static inline uint64_t CommitmentTransaction_clone_ptr(LDKCommitmentTransaction *NONNULL_PTR arg) {
+       LDKCommitmentTransaction ret_var = CommitmentTransaction_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCommitmentTransaction arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = CommitmentTransaction_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKCommitmentTransaction orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKCommitmentTransaction ret_var = CommitmentTransaction_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -28659,6 +33581,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1
        LDKCommitmentTransaction obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
        obj_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
        LDKCVec_u8Z ret_var = CommitmentTransaction_write(&obj_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
@@ -28680,6 +33603,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1comm
        LDKCommitmentTransaction this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        int64_t ret_val = CommitmentTransaction_commitment_number(&this_arg_conv);
        return ret_val;
 }
@@ -28688,6 +33612,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1to_1
        LDKCommitmentTransaction this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        int64_t ret_val = CommitmentTransaction_to_broadcaster_value_sat(&this_arg_conv);
        return ret_val;
 }
@@ -28696,6 +33621,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1to_1
        LDKCommitmentTransaction this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        int64_t ret_val = CommitmentTransaction_to_countersignatory_value_sat(&this_arg_conv);
        return ret_val;
 }
@@ -28704,6 +33630,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1feer
        LDKCommitmentTransaction this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        int32_t ret_val = CommitmentTransaction_feerate_per_kw(&this_arg_conv);
        return ret_val;
 }
@@ -28712,10 +33639,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1trus
        LDKCommitmentTransaction this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKTrustedCommitmentTransaction ret_var = CommitmentTransaction_trust(&this_arg_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -28727,15 +33656,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1veri
        LDKCommitmentTransaction this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKDirectedChannelTransactionParameters channel_parameters_conv;
        channel_parameters_conv.inner = (void*)(channel_parameters & (~1));
        channel_parameters_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_parameters_conv);
        LDKChannelPublicKeys broadcaster_keys_conv;
        broadcaster_keys_conv.inner = (void*)(broadcaster_keys & (~1));
        broadcaster_keys_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(broadcaster_keys_conv);
        LDKChannelPublicKeys countersignatory_keys_conv;
        countersignatory_keys_conv.inner = (void*)(countersignatory_keys & (~1));
        countersignatory_keys_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(countersignatory_keys_conv);
        LDKCResult_TrustedCommitmentTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedCommitmentTransactionNoneZ), "LDKCResult_TrustedCommitmentTransactionNoneZ");
        *ret_conv = CommitmentTransaction_verify(&this_arg_conv, &channel_parameters_conv, &broadcaster_keys_conv, &countersignatory_keys_conv);
        return (uint64_t)ret_conv;
@@ -28745,6 +33678,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransaction_1
        LDKTrustedCommitmentTransaction this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        TrustedCommitmentTransaction_free(this_obj_conv);
 }
 
@@ -28752,6 +33686,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransa
        LDKTrustedCommitmentTransaction this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, TrustedCommitmentTransaction_txid(&this_arg_conv).data);
        return ret_arr;
@@ -28761,10 +33696,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransactio
        LDKTrustedCommitmentTransaction this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKBuiltCommitmentTransaction ret_var = TrustedCommitmentTransaction_built_transaction(&this_arg_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -28776,10 +33713,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransactio
        LDKTrustedCommitmentTransaction this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKTxCreationKeys ret_var = TrustedCommitmentTransaction_keys(&this_arg_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -28791,6 +33730,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransactio
        LDKTrustedCommitmentTransaction this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        unsigned char htlc_base_key_arr[32];
        CHECK((*env)->GetArrayLength(env, htlc_base_key) == 32);
        (*env)->GetByteArrayRegion(env, htlc_base_key, 0, 32, htlc_base_key_arr);
@@ -28798,6 +33738,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransactio
        LDKDirectedChannelTransactionParameters channel_parameters_conv;
        channel_parameters_conv.inner = (void*)(channel_parameters & (~1));
        channel_parameters_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_parameters_conv);
        LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
        *ret_conv = TrustedCommitmentTransaction_get_htlc_sigs(&this_arg_conv, htlc_base_key_ref, &channel_parameters_conv);
        return (uint64_t)ret_conv;
@@ -28818,9 +33759,11 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1eq(JNIEnv *e
        LDKInitFeatures a_conv;
        a_conv.inner = (void*)(a & (~1));
        a_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
        LDKInitFeatures b_conv;
        b_conv.inner = (void*)(b & (~1));
        b_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
        jboolean ret_val = InitFeatures_eq(&a_conv, &b_conv);
        return ret_val;
 }
@@ -28829,9 +33772,11 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1eq(JNIEnv *e
        LDKNodeFeatures a_conv;
        a_conv.inner = (void*)(a & (~1));
        a_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
        LDKNodeFeatures b_conv;
        b_conv.inner = (void*)(b & (~1));
        b_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
        jboolean ret_val = NodeFeatures_eq(&a_conv, &b_conv);
        return ret_val;
 }
@@ -28840,9 +33785,11 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1eq(JNIEnv
        LDKChannelFeatures a_conv;
        a_conv.inner = (void*)(a & (~1));
        a_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
        LDKChannelFeatures b_conv;
        b_conv.inner = (void*)(b & (~1));
        b_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
        jboolean ret_val = ChannelFeatures_eq(&a_conv, &b_conv);
        return ret_val;
 }
@@ -28851,21 +33798,46 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1eq(JNIEnv
        LDKInvoiceFeatures a_conv;
        a_conv.inner = (void*)(a & (~1));
        a_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
        LDKInvoiceFeatures b_conv;
        b_conv.inner = (void*)(b & (~1));
        b_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
        jboolean ret_val = InvoiceFeatures_eq(&a_conv, &b_conv);
        return ret_val;
 }
 
+static inline uint64_t InitFeatures_clone_ptr(LDKInitFeatures *NONNULL_PTR arg) {
+       LDKInitFeatures ret_var = InitFeatures_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKInitFeatures arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = InitFeatures_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKInitFeatures orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKInitFeatures ret_var = InitFeatures_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -28873,14 +33845,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1clone(JNIEnv
        return ret_ref;
 }
 
+static inline uint64_t NodeFeatures_clone_ptr(LDKNodeFeatures *NONNULL_PTR arg) {
+       LDKNodeFeatures ret_var = NodeFeatures_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKNodeFeatures arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = NodeFeatures_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKNodeFeatures orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKNodeFeatures ret_var = NodeFeatures_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -28888,14 +33883,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1clone(JNIEnv
        return ret_ref;
 }
 
+static inline uint64_t ChannelFeatures_clone_ptr(LDKChannelFeatures *NONNULL_PTR arg) {
+       LDKChannelFeatures ret_var = ChannelFeatures_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKChannelFeatures arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = ChannelFeatures_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKChannelFeatures orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKChannelFeatures ret_var = ChannelFeatures_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -28903,14 +33921,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1clone(JNIE
        return ret_ref;
 }
 
+static inline uint64_t InvoiceFeatures_clone_ptr(LDKInvoiceFeatures *NONNULL_PTR arg) {
+       LDKInvoiceFeatures ret_var = InvoiceFeatures_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKInvoiceFeatures arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = InvoiceFeatures_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKInvoiceFeatures orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKInvoiceFeatures ret_var = InvoiceFeatures_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -28922,6 +33963,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1free(JNIEnv *env
        LDKInitFeatures this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        InitFeatures_free(this_obj_conv);
 }
 
@@ -28929,6 +33971,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1free(JNIEnv *env
        LDKNodeFeatures this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        NodeFeatures_free(this_obj_conv);
 }
 
@@ -28936,6 +33979,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1free(JNIEnv *
        LDKChannelFeatures this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        ChannelFeatures_free(this_obj_conv);
 }
 
@@ -28943,6 +33987,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1free(JNIEnv *
        LDKInvoiceFeatures this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        InvoiceFeatures_free(this_obj_conv);
 }
 
@@ -28951,6 +33996,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1empty(JNIEnv
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -28963,6 +34009,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1known(JNIEnv
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -28974,6 +34021,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1un
        LDKInitFeatures this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        jboolean ret_val = InitFeatures_requires_unknown_bits(&this_arg_conv);
        return ret_val;
 }
@@ -28983,6 +34031,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1empty(JNIEnv
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -28995,6 +34044,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1known(JNIEnv
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -29006,6 +34056,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1un
        LDKNodeFeatures this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        jboolean ret_val = NodeFeatures_requires_unknown_bits(&this_arg_conv);
        return ret_val;
 }
@@ -29015,6 +34066,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1empty(JNIE
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -29027,6 +34079,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1known(JNIE
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -29038,6 +34091,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1requires_
        LDKChannelFeatures this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        jboolean ret_val = ChannelFeatures_requires_unknown_bits(&this_arg_conv);
        return ret_val;
 }
@@ -29047,6 +34101,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1empty(JNIE
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -29059,6 +34114,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1known(JNIE
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -29070,6 +34126,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1requires_
        LDKInvoiceFeatures this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        jboolean ret_val = InvoiceFeatures_requires_unknown_bits(&this_arg_conv);
        return ret_val;
 }
@@ -29078,6 +34135,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1pa
        LDKInitFeatures this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        jboolean ret_val = InitFeatures_supports_payment_secret(&this_arg_conv);
        return ret_val;
 }
@@ -29086,6 +34144,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1pa
        LDKNodeFeatures this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        jboolean ret_val = NodeFeatures_supports_payment_secret(&this_arg_conv);
        return ret_val;
 }
@@ -29094,6 +34153,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1supports_
        LDKInvoiceFeatures this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        jboolean ret_val = InvoiceFeatures_supports_payment_secret(&this_arg_conv);
        return ret_val;
 }
@@ -29102,6 +34162,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InitFeatures_1write(JNI
        LDKInitFeatures obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
        obj_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
        LDKCVec_u8Z ret_var = InitFeatures_write(&obj_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
@@ -29113,6 +34174,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1write(JNI
        LDKNodeFeatures obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
        obj_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
        LDKCVec_u8Z ret_var = NodeFeatures_write(&obj_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
@@ -29124,6 +34186,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1write(
        LDKChannelFeatures obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
        obj_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
        LDKCVec_u8Z ret_var = ChannelFeatures_write(&obj_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
@@ -29135,6 +34198,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1write(
        LDKInvoiceFeatures obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
        obj_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
        LDKCVec_u8Z ret_var = InvoiceFeatures_write(&obj_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
@@ -29186,17 +34250,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1free(JNIEnv *e
        LDKShutdownScript this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        ShutdownScript_free(this_obj_conv);
 }
 
+static inline uint64_t ShutdownScript_clone_ptr(LDKShutdownScript *NONNULL_PTR arg) {
+       LDKShutdownScript ret_var = ShutdownScript_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKShutdownScript arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = ShutdownScript_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKShutdownScript orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKShutdownScript ret_var = ShutdownScript_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -29208,6 +34296,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1free(JN
        LDKInvalidShutdownScript this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        InvalidShutdownScript_free(this_obj_conv);
 }
 
@@ -29215,6 +34304,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1
        LDKInvalidShutdownScript this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKu8slice ret_var = InvalidShutdownScript_get_script(&this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
@@ -29225,6 +34315,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1set_1sc
        LDKInvalidShutdownScript this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKCVec_u8Z val_ref;
        val_ref.datalen = (*env)->GetArrayLength(env, val);
        val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes");
@@ -29241,6 +34332,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1new(
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -29248,14 +34340,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1new(
        return ret_ref;
 }
 
+static inline uint64_t InvalidShutdownScript_clone_ptr(LDKInvalidShutdownScript *NONNULL_PTR arg) {
+       LDKInvalidShutdownScript ret_var = InvalidShutdownScript_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKInvalidShutdownScript arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = InvalidShutdownScript_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKInvalidShutdownScript orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKInvalidShutdownScript ret_var = InvalidShutdownScript_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -29267,6 +34382,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1write(J
        LDKShutdownScript obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
        obj_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
        LDKCVec_u8Z ret_var = ShutdownScript_write(&obj_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
@@ -29293,6 +34409,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1new_1p2wpkh
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -29309,6 +34426,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1new_1p2wsh(
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -29330,6 +34448,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1into_1i
        LDKShutdownScript this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        this_arg_conv = ShutdownScript_clone(&this_arg_conv);
        LDKCVec_u8Z ret_var = ShutdownScript_into_inner(this_arg_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
@@ -29342,6 +34461,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1as_1leg
        LDKShutdownScript this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ShutdownScript_as_legacy_pubkey(&this_arg_conv).compressed_form);
        return ret_arr;
@@ -29351,9 +34471,11 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1is_1compat
        LDKShutdownScript this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKInitFeatures features_conv;
        features_conv.inner = (void*)(features & (~1));
        features_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(features_conv);
        jboolean ret_val = ShutdownScript_is_compatible(&this_arg_conv, &features_conv);
        return ret_val;
 }
@@ -29367,6 +34489,19 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CustomMessageReader_1free(JNIE
        CustomMessageReader_free(this_ptr_conv);
 }
 
+static inline uint64_t Type_clone_ptr(LDKType *NONNULL_PTR arg) {
+       LDKType* ret_ret = MALLOC(sizeof(LDKType), "LDKType");
+       *ret_ret = Type_clone(arg);
+       return (uint64_t)ret_ret;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Type_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       void* arg_ptr = (void*)(((uint64_t)arg) & ~1);
+       if (!(arg & 1)) { CHECK_ACCESS(arg_ptr); }
+       LDKType* arg_conv = (LDKType*)arg_ptr;
+       int64_t ret_val = Type_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Type_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        void* orig_ptr = (void*)(((uint64_t)orig) & ~1);
        if (!(orig & 1)) { CHECK_ACCESS(orig_ptr); }
@@ -29398,6 +34533,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LockableScore_1free(JNIEnv *en
        LDKLockableScore this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        LockableScore_free(this_obj_conv);
 }
 
@@ -29413,6 +34549,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LockableScore_1new(JNIEnv *
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -29424,6 +34561,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_LockableScore_1write(JN
        LDKLockableScore obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
        obj_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
        LDKCVec_u8Z ret_var = LockableScore_write(&obj_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
@@ -29435,17 +34573,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeId_1free(JNIEnv *env, jcla
        LDKNodeId this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        NodeId_free(this_obj_conv);
 }
 
+static inline uint64_t NodeId_clone_ptr(LDKNodeId *NONNULL_PTR arg) {
+       LDKNodeId ret_var = NodeId_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeId_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKNodeId arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = NodeId_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeId_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKNodeId orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKNodeId ret_var = NodeId_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -29461,6 +34623,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeId_1from_1pubkey(JNIEnv
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -29472,6 +34635,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeId_1as_1slice(JNIEn
        LDKNodeId this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKu8slice ret_var = NodeId_as_slice(&this_arg_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
@@ -29482,6 +34646,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeId_1hash(JNIEnv *env, j
        LDKNodeId o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        int64_t ret_val = NodeId_hash(&o_conv);
        return ret_val;
 }
@@ -29490,6 +34655,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeId_1write(JNIEnv *e
        LDKNodeId obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
        obj_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
        LDKCVec_u8Z ret_var = NodeId_write(&obj_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
@@ -29511,17 +34677,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1free(JNIEnv *env
        LDKNetworkGraph this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        NetworkGraph_free(this_obj_conv);
 }
 
+static inline uint64_t NetworkGraph_clone_ptr(LDKNetworkGraph *NONNULL_PTR arg) {
+       LDKNetworkGraph ret_var = NetworkGraph_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKNetworkGraph arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = NetworkGraph_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKNetworkGraph orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKNetworkGraph ret_var = NetworkGraph_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -29533,6 +34723,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReadOnlyNetworkGraph_1free(JNI
        LDKReadOnlyNetworkGraph this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        ReadOnlyNetworkGraph_free(this_obj_conv);
 }
 
@@ -29545,6 +34736,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1free(JNIEnv *en
        NetworkUpdate_free(this_ptr_conv);
 }
 
+static inline uint64_t NetworkUpdate_clone_ptr(LDKNetworkUpdate *NONNULL_PTR arg) {
+       LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate");
+       *ret_copy = NetworkUpdate_clone(arg);
+uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKNetworkUpdate* arg_conv = (LDKNetworkUpdate*)arg;
+       int64_t ret_val = NetworkUpdate_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKNetworkUpdate* orig_conv = (LDKNetworkUpdate*)orig;
        LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate");
@@ -29557,6 +34760,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1channel_1upd
        LDKChannelUpdate msg_conv;
        msg_conv.inner = (void*)(msg & (~1));
        msg_conv.is_owned = (msg & 1) || (msg == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
        msg_conv = ChannelUpdate_clone(&msg_conv);
        LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate");
        *ret_copy = NetworkUpdate_channel_update_message(msg_conv);
@@ -29590,10 +34794,21 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1write(JN
        return ret_arr;
 }
 
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
+       LDKu8slice ser_ref;
+       ser_ref.datalen = (*env)->GetArrayLength(env, ser);
+       ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
+       LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ");
+       *ret_conv = NetworkUpdate_read(ser_ref);
+       (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
+       return (uint64_t)ret_conv;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1as_1EventHandler(JNIEnv *env, jclass clz, int64_t this_arg) {
        LDKNetGraphMsgHandler this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKEventHandler* ret_ret = MALLOC(sizeof(LDKEventHandler), "LDKEventHandler");
        *ret_ret = NetGraphMsgHandler_as_EventHandler(&this_arg_conv);
        return (uint64_t)ret_ret;
@@ -29603,6 +34818,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1free(JNIEn
        LDKNetGraphMsgHandler this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        NetGraphMsgHandler_free(this_obj_conv);
 }
 
@@ -29610,6 +34826,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1new(JNI
        LDKNetworkGraph network_graph_conv;
        network_graph_conv.inner = (void*)(network_graph & (~1));
        network_graph_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv);
        void* chain_access_ptr = (void*)(((uint64_t)chain_access) & ~1);
        CHECK_ACCESS(chain_access_ptr);
        LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(chain_access_ptr);
@@ -29632,6 +34849,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1new(JNI
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -29643,6 +34861,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1add_1chain
        LDKNetGraphMsgHandler this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        void* chain_access_ptr = (void*)(((uint64_t)chain_access) & ~1);
        CHECK_ACCESS(chain_access_ptr);
        LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(chain_access_ptr);
@@ -29661,6 +34880,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1as_1Rou
        LDKNetGraphMsgHandler this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKRoutingMessageHandler* ret_ret = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler");
        *ret_ret = NetGraphMsgHandler_as_RoutingMessageHandler(&this_arg_conv);
        return (uint64_t)ret_ret;
@@ -29670,6 +34890,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1as_1Mes
        LDKNetGraphMsgHandler this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
        *ret_ret = NetGraphMsgHandler_as_MessageSendEventsProvider(&this_arg_conv);
        return (uint64_t)ret_ret;
@@ -29679,6 +34900,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1free(J
        LDKDirectionalChannelInfo this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        DirectionalChannelInfo_free(this_obj_conv);
 }
 
@@ -29686,6 +34908,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get
        LDKDirectionalChannelInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int32_t ret_val = DirectionalChannelInfo_get_last_update(&this_ptr_conv);
        return ret_val;
 }
@@ -29694,6 +34917,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1l
        LDKDirectionalChannelInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        DirectionalChannelInfo_set_last_update(&this_ptr_conv, val);
 }
 
@@ -29701,6 +34925,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1ge
        LDKDirectionalChannelInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        jboolean ret_val = DirectionalChannelInfo_get_enabled(&this_ptr_conv);
        return ret_val;
 }
@@ -29709,6 +34934,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1e
        LDKDirectionalChannelInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        DirectionalChannelInfo_set_enabled(&this_ptr_conv, val);
 }
 
@@ -29716,6 +34942,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get
        LDKDirectionalChannelInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int16_t ret_val = DirectionalChannelInfo_get_cltv_expiry_delta(&this_ptr_conv);
        return ret_val;
 }
@@ -29724,6 +34951,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1c
        LDKDirectionalChannelInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        DirectionalChannelInfo_set_cltv_expiry_delta(&this_ptr_conv, val);
 }
 
@@ -29731,6 +34959,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get
        LDKDirectionalChannelInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int64_t ret_val = DirectionalChannelInfo_get_htlc_minimum_msat(&this_ptr_conv);
        return ret_val;
 }
@@ -29739,6 +34968,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1h
        LDKDirectionalChannelInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        DirectionalChannelInfo_set_htlc_minimum_msat(&this_ptr_conv, val);
 }
 
@@ -29746,6 +34976,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get
        LDKDirectionalChannelInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
        *ret_copy = DirectionalChannelInfo_get_htlc_maximum_msat(&this_ptr_conv);
        uint64_t ret_ref = (uint64_t)ret_copy;
@@ -29756,6 +34987,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1h
        LDKDirectionalChannelInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        void* val_ptr = (void*)(((uint64_t)val) & ~1);
        CHECK_ACCESS(val_ptr);
        LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
@@ -29767,10 +34999,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get
        LDKDirectionalChannelInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKRoutingFees ret_var = DirectionalChannelInfo_get_fees(&this_ptr_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -29782,9 +35016,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1f
        LDKDirectionalChannelInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKRoutingFees val_conv;
        val_conv.inner = (void*)(val & (~1));
        val_conv.is_owned = (val & 1) || (val == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
        val_conv = RoutingFees_clone(&val_conv);
        DirectionalChannelInfo_set_fees(&this_ptr_conv, val_conv);
 }
@@ -29793,11 +35029,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get
        LDKDirectionalChannelInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKChannelUpdate ret_var = DirectionalChannelInfo_get_last_update_message(&this_ptr_conv);
        uint64_t ret_ref = 0;
        if ((uint64_t)ret_var.inner > 4096) {
                CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
                CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
                ret_ref = (uint64_t)ret_var.inner;
                if (ret_var.is_owned) {
                        ret_ref |= 1;
@@ -29810,9 +35048,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1l
        LDKDirectionalChannelInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKChannelUpdate val_conv;
        val_conv.inner = (void*)(val & (~1));
        val_conv.is_owned = (val & 1) || (val == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
        val_conv = ChannelUpdate_clone(&val_conv);
        DirectionalChannelInfo_set_last_update_message(&this_ptr_conv, val_conv);
 }
@@ -29825,15 +35065,18 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1new
        LDKRoutingFees fees_arg_conv;
        fees_arg_conv.inner = (void*)(fees_arg & (~1));
        fees_arg_conv.is_owned = (fees_arg & 1) || (fees_arg == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(fees_arg_conv);
        fees_arg_conv = RoutingFees_clone(&fees_arg_conv);
        LDKChannelUpdate last_update_message_arg_conv;
        last_update_message_arg_conv.inner = (void*)(last_update_message_arg & (~1));
        last_update_message_arg_conv.is_owned = (last_update_message_arg & 1) || (last_update_message_arg == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(last_update_message_arg_conv);
        last_update_message_arg_conv = ChannelUpdate_clone(&last_update_message_arg_conv);
        LDKDirectionalChannelInfo ret_var = DirectionalChannelInfo_new(last_update_arg, enabled_arg, cltv_expiry_delta_arg, htlc_minimum_msat_arg, htlc_maximum_msat_arg_conv, fees_arg_conv, last_update_message_arg_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -29841,14 +35084,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1new
        return ret_ref;
 }
 
+static inline uint64_t DirectionalChannelInfo_clone_ptr(LDKDirectionalChannelInfo *NONNULL_PTR arg) {
+       LDKDirectionalChannelInfo ret_var = DirectionalChannelInfo_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKDirectionalChannelInfo arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = DirectionalChannelInfo_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKDirectionalChannelInfo orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKDirectionalChannelInfo ret_var = DirectionalChannelInfo_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -29860,6 +35126,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_
        LDKDirectionalChannelInfo obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
        obj_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
        LDKCVec_u8Z ret_var = DirectionalChannelInfo_write(&obj_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
@@ -29881,6 +35148,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1free(JNIEnv *env,
        LDKChannelInfo this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        ChannelInfo_free(this_obj_conv);
 }
 
@@ -29888,10 +35156,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1features(
        LDKChannelInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKChannelFeatures ret_var = ChannelInfo_get_features(&this_ptr_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -29903,9 +35173,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1features(JNI
        LDKChannelInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKChannelFeatures val_conv;
        val_conv.inner = (void*)(val & (~1));
        val_conv.is_owned = (val & 1) || (val == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
        val_conv = ChannelFeatures_clone(&val_conv);
        ChannelInfo_set_features(&this_ptr_conv, val_conv);
 }
@@ -29914,10 +35186,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1node_1one
        LDKChannelInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKNodeId ret_var = ChannelInfo_get_node_one(&this_ptr_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -29929,9 +35203,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1node_1one(JN
        LDKChannelInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKNodeId val_conv;
        val_conv.inner = (void*)(val & (~1));
        val_conv.is_owned = (val & 1) || (val == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
        val_conv = NodeId_clone(&val_conv);
        ChannelInfo_set_node_one(&this_ptr_conv, val_conv);
 }
@@ -29940,11 +35216,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1one_1to_1
        LDKChannelInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKDirectionalChannelInfo ret_var = ChannelInfo_get_one_to_two(&this_ptr_conv);
        uint64_t ret_ref = 0;
        if ((uint64_t)ret_var.inner > 4096) {
                CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
                CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
                ret_ref = (uint64_t)ret_var.inner;
                if (ret_var.is_owned) {
                        ret_ref |= 1;
@@ -29957,9 +35235,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1one_1to_1two
        LDKChannelInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKDirectionalChannelInfo val_conv;
        val_conv.inner = (void*)(val & (~1));
        val_conv.is_owned = (val & 1) || (val == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
        val_conv = DirectionalChannelInfo_clone(&val_conv);
        ChannelInfo_set_one_to_two(&this_ptr_conv, val_conv);
 }
@@ -29968,10 +35248,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1node_1two
        LDKChannelInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKNodeId ret_var = ChannelInfo_get_node_two(&this_ptr_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -29983,9 +35265,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1node_1two(JN
        LDKChannelInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKNodeId val_conv;
        val_conv.inner = (void*)(val & (~1));
        val_conv.is_owned = (val & 1) || (val == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
        val_conv = NodeId_clone(&val_conv);
        ChannelInfo_set_node_two(&this_ptr_conv, val_conv);
 }
@@ -29994,11 +35278,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1two_1to_1
        LDKChannelInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKDirectionalChannelInfo ret_var = ChannelInfo_get_two_to_one(&this_ptr_conv);
        uint64_t ret_ref = 0;
        if ((uint64_t)ret_var.inner > 4096) {
                CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
                CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
                ret_ref = (uint64_t)ret_var.inner;
                if (ret_var.is_owned) {
                        ret_ref |= 1;
@@ -30011,9 +35297,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1two_1to_1one
        LDKChannelInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKDirectionalChannelInfo val_conv;
        val_conv.inner = (void*)(val & (~1));
        val_conv.is_owned = (val & 1) || (val == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
        val_conv = DirectionalChannelInfo_clone(&val_conv);
        ChannelInfo_set_two_to_one(&this_ptr_conv, val_conv);
 }
@@ -30022,6 +35310,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1capacity_
        LDKChannelInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
        *ret_copy = ChannelInfo_get_capacity_sats(&this_ptr_conv);
        uint64_t ret_ref = (uint64_t)ret_copy;
@@ -30032,6 +35321,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1capacity_1sa
        LDKChannelInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        void* val_ptr = (void*)(((uint64_t)val) & ~1);
        CHECK_ACCESS(val_ptr);
        LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
@@ -30043,11 +35333,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1announcem
        LDKChannelInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKChannelAnnouncement ret_var = ChannelInfo_get_announcement_message(&this_ptr_conv);
        uint64_t ret_ref = 0;
        if ((uint64_t)ret_var.inner > 4096) {
                CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
                CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
                ret_ref = (uint64_t)ret_var.inner;
                if (ret_var.is_owned) {
                        ret_ref |= 1;
@@ -30060,9 +35352,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1announcement
        LDKChannelInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKChannelAnnouncement val_conv;
        val_conv.inner = (void*)(val & (~1));
        val_conv.is_owned = (val & 1) || (val == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
        val_conv = ChannelAnnouncement_clone(&val_conv);
        ChannelInfo_set_announcement_message(&this_ptr_conv, val_conv);
 }
@@ -30071,22 +35365,27 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1new(JNIEnv *en
        LDKChannelFeatures features_arg_conv;
        features_arg_conv.inner = (void*)(features_arg & (~1));
        features_arg_conv.is_owned = (features_arg & 1) || (features_arg == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv);
        features_arg_conv = ChannelFeatures_clone(&features_arg_conv);
        LDKNodeId node_one_arg_conv;
        node_one_arg_conv.inner = (void*)(node_one_arg & (~1));
        node_one_arg_conv.is_owned = (node_one_arg & 1) || (node_one_arg == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(node_one_arg_conv);
        node_one_arg_conv = NodeId_clone(&node_one_arg_conv);
        LDKDirectionalChannelInfo one_to_two_arg_conv;
        one_to_two_arg_conv.inner = (void*)(one_to_two_arg & (~1));
        one_to_two_arg_conv.is_owned = (one_to_two_arg & 1) || (one_to_two_arg == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(one_to_two_arg_conv);
        one_to_two_arg_conv = DirectionalChannelInfo_clone(&one_to_two_arg_conv);
        LDKNodeId node_two_arg_conv;
        node_two_arg_conv.inner = (void*)(node_two_arg & (~1));
        node_two_arg_conv.is_owned = (node_two_arg & 1) || (node_two_arg == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(node_two_arg_conv);
        node_two_arg_conv = NodeId_clone(&node_two_arg_conv);
        LDKDirectionalChannelInfo two_to_one_arg_conv;
        two_to_one_arg_conv.inner = (void*)(two_to_one_arg & (~1));
        two_to_one_arg_conv.is_owned = (two_to_one_arg & 1) || (two_to_one_arg == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(two_to_one_arg_conv);
        two_to_one_arg_conv = DirectionalChannelInfo_clone(&two_to_one_arg_conv);
        void* capacity_sats_arg_ptr = (void*)(((uint64_t)capacity_sats_arg) & ~1);
        CHECK_ACCESS(capacity_sats_arg_ptr);
@@ -30095,11 +35394,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1new(JNIEnv *en
        LDKChannelAnnouncement announcement_message_arg_conv;
        announcement_message_arg_conv.inner = (void*)(announcement_message_arg & (~1));
        announcement_message_arg_conv.is_owned = (announcement_message_arg & 1) || (announcement_message_arg == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(announcement_message_arg_conv);
        announcement_message_arg_conv = ChannelAnnouncement_clone(&announcement_message_arg_conv);
        LDKChannelInfo ret_var = ChannelInfo_new(features_arg_conv, node_one_arg_conv, one_to_two_arg_conv, node_two_arg_conv, two_to_one_arg_conv, capacity_sats_arg_conv, announcement_message_arg_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -30107,14 +35408,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1new(JNIEnv *en
        return ret_ref;
 }
 
+static inline uint64_t ChannelInfo_clone_ptr(LDKChannelInfo *NONNULL_PTR arg) {
+       LDKChannelInfo ret_var = ChannelInfo_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKChannelInfo arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = ChannelInfo_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKChannelInfo orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKChannelInfo ret_var = ChannelInfo_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -30126,6 +35450,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1write(JNIE
        LDKChannelInfo obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
        obj_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
        LDKCVec_u8Z ret_var = ChannelInfo_write(&obj_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
@@ -30147,6 +35472,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingFees_1free(JNIEnv *env,
        LDKRoutingFees this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        RoutingFees_free(this_obj_conv);
 }
 
@@ -30154,6 +35480,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_RoutingFees_1get_1base_1msa
        LDKRoutingFees this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int32_t ret_val = RoutingFees_get_base_msat(&this_ptr_conv);
        return ret_val;
 }
@@ -30162,6 +35489,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingFees_1set_1base_1msat(J
        LDKRoutingFees this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        RoutingFees_set_base_msat(&this_ptr_conv, val);
 }
 
@@ -30169,6 +35497,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_RoutingFees_1get_1proportio
        LDKRoutingFees this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int32_t ret_val = RoutingFees_get_proportional_millionths(&this_ptr_conv);
        return ret_val;
 }
@@ -30177,6 +35506,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingFees_1set_1proportional
        LDKRoutingFees this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        RoutingFees_set_proportional_millionths(&this_ptr_conv, val);
 }
 
@@ -30185,6 +35515,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingFees_1new(JNIEnv *en
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -30196,21 +35527,46 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RoutingFees_1eq(JNIEnv *en
        LDKRoutingFees a_conv;
        a_conv.inner = (void*)(a & (~1));
        a_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
        LDKRoutingFees b_conv;
        b_conv.inner = (void*)(b & (~1));
        b_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
        jboolean ret_val = RoutingFees_eq(&a_conv, &b_conv);
        return ret_val;
 }
 
+static inline uint64_t RoutingFees_clone_ptr(LDKRoutingFees *NONNULL_PTR arg) {
+       LDKRoutingFees ret_var = RoutingFees_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingFees_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKRoutingFees arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = RoutingFees_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingFees_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKRoutingFees orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKRoutingFees ret_var = RoutingFees_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -30222,6 +35578,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingFees_1hash(JNIEnv *e
        LDKRoutingFees o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        int64_t ret_val = RoutingFees_hash(&o_conv);
        return ret_val;
 }
@@ -30230,6 +35587,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RoutingFees_1write(JNIE
        LDKRoutingFees obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
        obj_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
        LDKCVec_u8Z ret_var = RoutingFees_write(&obj_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
@@ -30251,6 +35609,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1free(JNI
        LDKNodeAnnouncementInfo this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        NodeAnnouncementInfo_free(this_obj_conv);
 }
 
@@ -30258,10 +35617,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1
        LDKNodeAnnouncementInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKNodeFeatures ret_var = NodeAnnouncementInfo_get_features(&this_ptr_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -30273,9 +35634,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1fea
        LDKNodeAnnouncementInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKNodeFeatures val_conv;
        val_conv.inner = (void*)(val & (~1));
        val_conv.is_owned = (val & 1) || (val == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
        val_conv = NodeFeatures_clone(&val_conv);
        NodeAnnouncementInfo_set_features(&this_ptr_conv, val_conv);
 }
@@ -30284,6 +35647,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1
        LDKNodeAnnouncementInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int32_t ret_val = NodeAnnouncementInfo_get_last_update(&this_ptr_conv);
        return ret_val;
 }
@@ -30292,6 +35656,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1las
        LDKNodeAnnouncementInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        NodeAnnouncementInfo_set_last_update(&this_ptr_conv, val);
 }
 
@@ -30299,6 +35664,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1g
        LDKNodeAnnouncementInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 3);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 3, *NodeAnnouncementInfo_get_rgb(&this_ptr_conv));
        return ret_arr;
@@ -30308,6 +35674,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1rgb
        LDKNodeAnnouncementInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKThreeBytes val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 3);
        (*env)->GetByteArrayRegion(env, val, 0, 3, val_ref.data);
@@ -30318,6 +35685,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1g
        LDKNodeAnnouncementInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *NodeAnnouncementInfo_get_alias(&this_ptr_conv));
        return ret_arr;
@@ -30327,6 +35695,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1ali
        LDKNodeAnnouncementInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKThirtyTwoBytes val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 32);
        (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
@@ -30337,6 +35706,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1add
        LDKNodeAnnouncementInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKCVec_NetAddressZ val_constr;
        val_constr.datalen = (*env)->GetArrayLength(env, val);
        if (val_constr.datalen > 0)
@@ -30360,11 +35730,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1
        LDKNodeAnnouncementInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKNodeAnnouncement ret_var = NodeAnnouncementInfo_get_announcement_message(&this_ptr_conv);
        uint64_t ret_ref = 0;
        if ((uint64_t)ret_var.inner > 4096) {
                CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
                CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
                ret_ref = (uint64_t)ret_var.inner;
                if (ret_var.is_owned) {
                        ret_ref |= 1;
@@ -30377,9 +35749,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1ann
        LDKNodeAnnouncementInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKNodeAnnouncement val_conv;
        val_conv.inner = (void*)(val & (~1));
        val_conv.is_owned = (val & 1) || (val == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
        val_conv = NodeAnnouncement_clone(&val_conv);
        NodeAnnouncementInfo_set_announcement_message(&this_ptr_conv, val_conv);
 }
@@ -30388,6 +35762,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1new(J
        LDKNodeFeatures features_arg_conv;
        features_arg_conv.inner = (void*)(features_arg & (~1));
        features_arg_conv.is_owned = (features_arg & 1) || (features_arg == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv);
        features_arg_conv = NodeFeatures_clone(&features_arg_conv);
        LDKThreeBytes rgb_arg_ref;
        CHECK((*env)->GetArrayLength(env, rgb_arg) == 3);
@@ -30413,11 +35788,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1new(J
        LDKNodeAnnouncement announcement_message_arg_conv;
        announcement_message_arg_conv.inner = (void*)(announcement_message_arg & (~1));
        announcement_message_arg_conv.is_owned = (announcement_message_arg & 1) || (announcement_message_arg == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(announcement_message_arg_conv);
        announcement_message_arg_conv = NodeAnnouncement_clone(&announcement_message_arg_conv);
        LDKNodeAnnouncementInfo ret_var = NodeAnnouncementInfo_new(features_arg_conv, last_update_arg, rgb_arg_ref, alias_arg_ref, addresses_arg_constr, announcement_message_arg_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -30425,14 +35802,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1new(J
        return ret_ref;
 }
 
+static inline uint64_t NodeAnnouncementInfo_clone_ptr(LDKNodeAnnouncementInfo *NONNULL_PTR arg) {
+       LDKNodeAnnouncementInfo ret_var = NodeAnnouncementInfo_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKNodeAnnouncementInfo arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = NodeAnnouncementInfo_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKNodeAnnouncementInfo orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKNodeAnnouncementInfo ret_var = NodeAnnouncementInfo_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -30444,6 +35844,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1w
        LDKNodeAnnouncementInfo obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
        obj_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
        LDKCVec_u8Z ret_var = NodeAnnouncementInfo_write(&obj_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
@@ -30465,6 +35866,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1free(JNIEnv *env, jc
        LDKNodeInfo this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        NodeInfo_free(this_obj_conv);
 }
 
@@ -30472,6 +35874,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1set_1channels(JNIEnv
        LDKNodeInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKCVec_u64Z val_constr;
        val_constr.datalen = (*env)->GetArrayLength(env, val);
        if (val_constr.datalen > 0)
@@ -30491,11 +35894,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeInfo_1get_1lowest_1inbo
        LDKNodeInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKRoutingFees ret_var = NodeInfo_get_lowest_inbound_channel_fees(&this_ptr_conv);
        uint64_t ret_ref = 0;
        if ((uint64_t)ret_var.inner > 4096) {
                CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
                CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
                ret_ref = (uint64_t)ret_var.inner;
                if (ret_var.is_owned) {
                        ret_ref |= 1;
@@ -30508,9 +35913,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1set_1lowest_1inbound
        LDKNodeInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKRoutingFees val_conv;
        val_conv.inner = (void*)(val & (~1));
        val_conv.is_owned = (val & 1) || (val == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
        val_conv = RoutingFees_clone(&val_conv);
        NodeInfo_set_lowest_inbound_channel_fees(&this_ptr_conv, val_conv);
 }
@@ -30519,11 +35926,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeInfo_1get_1announcement
        LDKNodeInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKNodeAnnouncementInfo ret_var = NodeInfo_get_announcement_info(&this_ptr_conv);
        uint64_t ret_ref = 0;
        if ((uint64_t)ret_var.inner > 4096) {
                CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
                CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
                ret_ref = (uint64_t)ret_var.inner;
                if (ret_var.is_owned) {
                        ret_ref |= 1;
@@ -30536,9 +35945,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1set_1announcement_1i
        LDKNodeInfo this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKNodeAnnouncementInfo val_conv;
        val_conv.inner = (void*)(val & (~1));
        val_conv.is_owned = (val & 1) || (val == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
        val_conv = NodeAnnouncementInfo_clone(&val_conv);
        NodeInfo_set_announcement_info(&this_ptr_conv, val_conv);
 }
@@ -30559,15 +35970,18 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeInfo_1new(JNIEnv *env,
        LDKRoutingFees lowest_inbound_channel_fees_arg_conv;
        lowest_inbound_channel_fees_arg_conv.inner = (void*)(lowest_inbound_channel_fees_arg & (~1));
        lowest_inbound_channel_fees_arg_conv.is_owned = (lowest_inbound_channel_fees_arg & 1) || (lowest_inbound_channel_fees_arg == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(lowest_inbound_channel_fees_arg_conv);
        lowest_inbound_channel_fees_arg_conv = RoutingFees_clone(&lowest_inbound_channel_fees_arg_conv);
        LDKNodeAnnouncementInfo announcement_info_arg_conv;
        announcement_info_arg_conv.inner = (void*)(announcement_info_arg & (~1));
        announcement_info_arg_conv.is_owned = (announcement_info_arg & 1) || (announcement_info_arg == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(announcement_info_arg_conv);
        announcement_info_arg_conv = NodeAnnouncementInfo_clone(&announcement_info_arg_conv);
        LDKNodeInfo ret_var = NodeInfo_new(channels_arg_constr, lowest_inbound_channel_fees_arg_conv, announcement_info_arg_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -30575,14 +35989,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeInfo_1new(JNIEnv *env,
        return ret_ref;
 }
 
+static inline uint64_t NodeInfo_clone_ptr(LDKNodeInfo *NONNULL_PTR arg) {
+       LDKNodeInfo ret_var = NodeInfo_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeInfo_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKNodeInfo arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = NodeInfo_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeInfo_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKNodeInfo orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKNodeInfo ret_var = NodeInfo_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -30594,6 +36031,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeInfo_1write(JNIEnv
        LDKNodeInfo obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
        obj_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
        LDKCVec_u8Z ret_var = NodeInfo_write(&obj_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
@@ -30615,6 +36053,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1write(JNI
        LDKNetworkGraph obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
        obj_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
        LDKCVec_u8Z ret_var = NetworkGraph_write(&obj_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
@@ -30640,6 +36079,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1new(JNIEnv *e
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -30651,10 +36091,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1read_1only(JN
        LDKNetworkGraph this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKReadOnlyNetworkGraph ret_var = NetworkGraph_read_only(&this_arg_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -30666,9 +36108,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1node_
        LDKNetworkGraph this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKNodeAnnouncement msg_conv;
        msg_conv.inner = (void*)(msg & (~1));
        msg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
        LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
        *ret_conv = NetworkGraph_update_node_from_announcement(&this_arg_conv, &msg_conv);
        return (uint64_t)ret_conv;
@@ -30678,9 +36122,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1node_
        LDKNetworkGraph this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKUnsignedNodeAnnouncement msg_conv;
        msg_conv.inner = (void*)(msg & (~1));
        msg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
        LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
        *ret_conv = NetworkGraph_update_node_from_unsigned_announcement(&this_arg_conv, &msg_conv);
        return (uint64_t)ret_conv;
@@ -30690,9 +36136,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1chann
        LDKNetworkGraph this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKChannelAnnouncement msg_conv;
        msg_conv.inner = (void*)(msg & (~1));
        msg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
        void* chain_access_ptr = (void*)(((uint64_t)chain_access) & ~1);
        CHECK_ACCESS(chain_access_ptr);
        LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(chain_access_ptr);
@@ -30713,9 +36161,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1chann
        LDKNetworkGraph this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKUnsignedChannelAnnouncement msg_conv;
        msg_conv.inner = (void*)(msg & (~1));
        msg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
        void* chain_access_ptr = (void*)(((uint64_t)chain_access) & ~1);
        CHECK_ACCESS(chain_access_ptr);
        LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(chain_access_ptr);
@@ -30736,6 +36186,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1close_1channel_1
        LDKNetworkGraph this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        NetworkGraph_close_channel_from_update(&this_arg_conv, short_channel_id, is_permanent);
 }
 
@@ -30743,6 +36194,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1fail_1node(JNIEn
        LDKNetworkGraph this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKPublicKey _node_id_ref;
        CHECK((*env)->GetArrayLength(env, _node_id) == 33);
        (*env)->GetByteArrayRegion(env, _node_id, 0, 33, _node_id_ref.compressed_form);
@@ -30753,9 +36205,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1chann
        LDKNetworkGraph this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKChannelUpdate msg_conv;
        msg_conv.inner = (void*)(msg & (~1));
        msg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
        LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
        *ret_conv = NetworkGraph_update_channel(&this_arg_conv, &msg_conv);
        return (uint64_t)ret_conv;
@@ -30765,9 +36219,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1chann
        LDKNetworkGraph this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKUnsignedChannelUpdate msg_conv;
        msg_conv.inner = (void*)(msg & (~1));
        msg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
        LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
        *ret_conv = NetworkGraph_update_channel_unsigned(&this_arg_conv, &msg_conv);
        return (uint64_t)ret_conv;
@@ -30777,6 +36233,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReadOnlyNetworkGraph_1get_1
        LDKReadOnlyNetworkGraph this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKPublicKey pubkey_ref;
        CHECK((*env)->GetArrayLength(env, pubkey) == 33);
        (*env)->GetByteArrayRegion(env, pubkey, 0, 33, pubkey_ref.compressed_form);
@@ -30790,6 +36247,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1free(JNIEnv *env, jc
        LDKRouteHop this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        RouteHop_free(this_obj_conv);
 }
 
@@ -30797,6 +36255,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1pubkey(J
        LDKRouteHop this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, RouteHop_get_pubkey(&this_ptr_conv).compressed_form);
        return ret_arr;
@@ -30806,6 +36265,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1pubkey(JNIEnv *
        LDKRouteHop this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKPublicKey val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 33);
        (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
@@ -30816,10 +36276,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1node_1featur
        LDKRouteHop this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKNodeFeatures ret_var = RouteHop_get_node_features(&this_ptr_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -30831,9 +36293,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1node_1features(
        LDKRouteHop this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKNodeFeatures val_conv;
        val_conv.inner = (void*)(val & (~1));
        val_conv.is_owned = (val & 1) || (val == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
        val_conv = NodeFeatures_clone(&val_conv);
        RouteHop_set_node_features(&this_ptr_conv, val_conv);
 }
@@ -30842,6 +36306,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1short_1chann
        LDKRouteHop this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int64_t ret_val = RouteHop_get_short_channel_id(&this_ptr_conv);
        return ret_val;
 }
@@ -30850,6 +36315,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1short_1channel_
        LDKRouteHop this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        RouteHop_set_short_channel_id(&this_ptr_conv, val);
 }
 
@@ -30857,10 +36323,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1channel_1fea
        LDKRouteHop this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKChannelFeatures ret_var = RouteHop_get_channel_features(&this_ptr_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -30872,9 +36340,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1channel_1featur
        LDKRouteHop this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKChannelFeatures val_conv;
        val_conv.inner = (void*)(val & (~1));
        val_conv.is_owned = (val & 1) || (val == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
        val_conv = ChannelFeatures_clone(&val_conv);
        RouteHop_set_channel_features(&this_ptr_conv, val_conv);
 }
@@ -30883,6 +36353,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1fee_1msat(JN
        LDKRouteHop this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int64_t ret_val = RouteHop_get_fee_msat(&this_ptr_conv);
        return ret_val;
 }
@@ -30891,6 +36362,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1fee_1msat(JNIEn
        LDKRouteHop this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        RouteHop_set_fee_msat(&this_ptr_conv, val);
 }
 
@@ -30898,6 +36370,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1cltv_1expiry
        LDKRouteHop this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int32_t ret_val = RouteHop_get_cltv_expiry_delta(&this_ptr_conv);
        return ret_val;
 }
@@ -30906,6 +36379,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1cltv_1expiry_1d
        LDKRouteHop this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        RouteHop_set_cltv_expiry_delta(&this_ptr_conv, val);
 }
 
@@ -30916,15 +36390,18 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1new(JNIEnv *env,
        LDKNodeFeatures node_features_arg_conv;
        node_features_arg_conv.inner = (void*)(node_features_arg & (~1));
        node_features_arg_conv.is_owned = (node_features_arg & 1) || (node_features_arg == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(node_features_arg_conv);
        node_features_arg_conv = NodeFeatures_clone(&node_features_arg_conv);
        LDKChannelFeatures channel_features_arg_conv;
        channel_features_arg_conv.inner = (void*)(channel_features_arg & (~1));
        channel_features_arg_conv.is_owned = (channel_features_arg & 1) || (channel_features_arg == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_features_arg_conv);
        channel_features_arg_conv = ChannelFeatures_clone(&channel_features_arg_conv);
        LDKRouteHop ret_var = RouteHop_new(pubkey_arg_ref, node_features_arg_conv, short_channel_id_arg, channel_features_arg_conv, fee_msat_arg, cltv_expiry_delta_arg);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -30932,14 +36409,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1new(JNIEnv *env,
        return ret_ref;
 }
 
+static inline uint64_t RouteHop_clone_ptr(LDKRouteHop *NONNULL_PTR arg) {
+       LDKRouteHop ret_var = RouteHop_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKRouteHop arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = RouteHop_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKRouteHop orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKRouteHop ret_var = RouteHop_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -30951,6 +36451,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1hash(JNIEnv *env,
        LDKRouteHop o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        int64_t ret_val = RouteHop_hash(&o_conv);
        return ret_val;
 }
@@ -30959,9 +36460,11 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RouteHop_1eq(JNIEnv *env,
        LDKRouteHop a_conv;
        a_conv.inner = (void*)(a & (~1));
        a_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
        LDKRouteHop b_conv;
        b_conv.inner = (void*)(b & (~1));
        b_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
        jboolean ret_val = RouteHop_eq(&a_conv, &b_conv);
        return ret_val;
 }
@@ -30970,6 +36473,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RouteHop_1write(JNIEnv
        LDKRouteHop obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
        obj_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
        LDKCVec_u8Z ret_var = RouteHop_write(&obj_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
@@ -30991,6 +36495,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Route_1free(JNIEnv *env, jclas
        LDKRoute this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        Route_free(this_obj_conv);
 }
 
@@ -30998,6 +36503,7 @@ JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_Route_1get_1paths(JNIE
        LDKRoute this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKCVec_CVec_RouteHopZZ ret_var = Route_get_paths(&this_ptr_conv);
        jobjectArray ret_arr = NULL;
        ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_J_clz, NULL);
@@ -31012,6 +36518,7 @@ JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_Route_1get_1paths(JNIE
                        uint64_t ret_conv_12_conv_10_ref = 0;
                        CHECK((((uint64_t)ret_conv_12_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
                        CHECK((((uint64_t)&ret_conv_12_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+                       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_12_conv_10_var);
                        ret_conv_12_conv_10_ref = (uint64_t)ret_conv_12_conv_10_var.inner;
                        if (ret_conv_12_conv_10_var.is_owned) {
                                ret_conv_12_conv_10_ref |= 1;
@@ -31031,6 +36538,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Route_1set_1paths(JNIEnv *env,
        LDKRoute this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKCVec_CVec_RouteHopZZ val_constr;
        val_constr.datalen = (*env)->GetArrayLength(env, val);
        if (val_constr.datalen > 0)
@@ -31051,6 +36559,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Route_1set_1paths(JNIEnv *env,
                        LDKRouteHop val_conv_12_conv_10_conv;
                        val_conv_12_conv_10_conv.inner = (void*)(val_conv_12_conv_10 & (~1));
                        val_conv_12_conv_10_conv.is_owned = (val_conv_12_conv_10 & 1) || (val_conv_12_conv_10 == 0);
+                       CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_12_conv_10_conv);
                        val_conv_12_conv_10_conv = RouteHop_clone(&val_conv_12_conv_10_conv);
                        val_conv_12_constr.data[k] = val_conv_12_conv_10_conv;
                }
@@ -31064,11 +36573,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1get_1payee(JNIEnv *e
        LDKRoute this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKPayee ret_var = Route_get_payee(&this_ptr_conv);
        uint64_t ret_ref = 0;
        if ((uint64_t)ret_var.inner > 4096) {
                CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
                CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
                ret_ref = (uint64_t)ret_var.inner;
                if (ret_var.is_owned) {
                        ret_ref |= 1;
@@ -31081,9 +36592,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Route_1set_1payee(JNIEnv *env,
        LDKRoute this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKPayee val_conv;
        val_conv.inner = (void*)(val & (~1));
        val_conv.is_owned = (val & 1) || (val == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
        val_conv = Payee_clone(&val_conv);
        Route_set_payee(&this_ptr_conv, val_conv);
 }
@@ -31109,6 +36622,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1new(JNIEnv *env, jcl
                        LDKRouteHop paths_arg_conv_12_conv_10_conv;
                        paths_arg_conv_12_conv_10_conv.inner = (void*)(paths_arg_conv_12_conv_10 & (~1));
                        paths_arg_conv_12_conv_10_conv.is_owned = (paths_arg_conv_12_conv_10 & 1) || (paths_arg_conv_12_conv_10 == 0);
+                       CHECK_INNER_FIELD_ACCESS_OR_NULL(paths_arg_conv_12_conv_10_conv);
                        paths_arg_conv_12_conv_10_conv = RouteHop_clone(&paths_arg_conv_12_conv_10_conv);
                        paths_arg_conv_12_constr.data[k] = paths_arg_conv_12_conv_10_conv;
                }
@@ -31118,11 +36632,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1new(JNIEnv *env, jcl
        LDKPayee payee_arg_conv;
        payee_arg_conv.inner = (void*)(payee_arg & (~1));
        payee_arg_conv.is_owned = (payee_arg & 1) || (payee_arg == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(payee_arg_conv);
        payee_arg_conv = Payee_clone(&payee_arg_conv);
        LDKRoute ret_var = Route_new(paths_arg_constr, payee_arg_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -31130,14 +36646,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1new(JNIEnv *env, jcl
        return ret_ref;
 }
 
+static inline uint64_t Route_clone_ptr(LDKRoute *NONNULL_PTR arg) {
+       LDKRoute ret_var = Route_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKRoute arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = Route_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKRoute orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKRoute ret_var = Route_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -31149,6 +36688,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1hash(JNIEnv *env, jc
        LDKRoute o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        int64_t ret_val = Route_hash(&o_conv);
        return ret_val;
 }
@@ -31157,9 +36697,11 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Route_1eq(JNIEnv *env, jcl
        LDKRoute a_conv;
        a_conv.inner = (void*)(a & (~1));
        a_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
        LDKRoute b_conv;
        b_conv.inner = (void*)(b & (~1));
        b_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
        jboolean ret_val = Route_eq(&a_conv, &b_conv);
        return ret_val;
 }
@@ -31168,6 +36710,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1get_1total_1fees(JNI
        LDKRoute this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        int64_t ret_val = Route_get_total_fees(&this_arg_conv);
        return ret_val;
 }
@@ -31176,6 +36719,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1get_1total_1amount(J
        LDKRoute this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        int64_t ret_val = Route_get_total_amount(&this_arg_conv);
        return ret_val;
 }
@@ -31184,6 +36728,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Route_1write(JNIEnv *en
        LDKRoute obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
        obj_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
        LDKCVec_u8Z ret_var = Route_write(&obj_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
@@ -31205,6 +36750,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteParameters_1free(JNIEnv *
        LDKRouteParameters this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        RouteParameters_free(this_obj_conv);
 }
 
@@ -31212,10 +36758,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1get_1payee
        LDKRouteParameters this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKPayee ret_var = RouteParameters_get_payee(&this_ptr_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -31227,9 +36775,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteParameters_1set_1payee(JN
        LDKRouteParameters this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKPayee val_conv;
        val_conv.inner = (void*)(val & (~1));
        val_conv.is_owned = (val & 1) || (val == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
        val_conv = Payee_clone(&val_conv);
        RouteParameters_set_payee(&this_ptr_conv, val_conv);
 }
@@ -31238,6 +36788,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1get_1final
        LDKRouteParameters this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int64_t ret_val = RouteParameters_get_final_value_msat(&this_ptr_conv);
        return ret_val;
 }
@@ -31246,6 +36797,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteParameters_1set_1final_1v
        LDKRouteParameters this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        RouteParameters_set_final_value_msat(&this_ptr_conv, val);
 }
 
@@ -31253,6 +36805,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1get_1final
        LDKRouteParameters this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int32_t ret_val = RouteParameters_get_final_cltv_expiry_delta(&this_ptr_conv);
        return ret_val;
 }
@@ -31261,6 +36814,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteParameters_1set_1final_1c
        LDKRouteParameters this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        RouteParameters_set_final_cltv_expiry_delta(&this_ptr_conv, val);
 }
 
@@ -31268,11 +36822,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1new(JNIEnv
        LDKPayee payee_arg_conv;
        payee_arg_conv.inner = (void*)(payee_arg & (~1));
        payee_arg_conv.is_owned = (payee_arg & 1) || (payee_arg == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(payee_arg_conv);
        payee_arg_conv = Payee_clone(&payee_arg_conv);
        LDKRouteParameters ret_var = RouteParameters_new(payee_arg_conv, final_value_msat_arg, final_cltv_expiry_delta_arg);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -31280,14 +36836,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1new(JNIEnv
        return ret_ref;
 }
 
+static inline uint64_t RouteParameters_clone_ptr(LDKRouteParameters *NONNULL_PTR arg) {
+       LDKRouteParameters ret_var = RouteParameters_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKRouteParameters arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = RouteParameters_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKRouteParameters orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKRouteParameters ret_var = RouteParameters_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -31299,6 +36878,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RouteParameters_1write(
        LDKRouteParameters obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
        obj_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
        LDKCVec_u8Z ret_var = RouteParameters_write(&obj_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
@@ -31320,6 +36900,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Payee_1free(JNIEnv *env, jclas
        LDKPayee this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        Payee_free(this_obj_conv);
 }
 
@@ -31327,6 +36908,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Payee_1get_1pubkey(JNIE
        LDKPayee this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, Payee_get_pubkey(&this_ptr_conv).compressed_form);
        return ret_arr;
@@ -31336,6 +36918,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Payee_1set_1pubkey(JNIEnv *env
        LDKPayee this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKPublicKey val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 33);
        (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
@@ -31346,11 +36929,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payee_1get_1features(JNIEnv
        LDKPayee this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKInvoiceFeatures ret_var = Payee_get_features(&this_ptr_conv);
        uint64_t ret_ref = 0;
        if ((uint64_t)ret_var.inner > 4096) {
                CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
                CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
                ret_ref = (uint64_t)ret_var.inner;
                if (ret_var.is_owned) {
                        ret_ref |= 1;
@@ -31363,9 +36948,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Payee_1set_1features(JNIEnv *e
        LDKPayee this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKInvoiceFeatures val_conv;
        val_conv.inner = (void*)(val & (~1));
        val_conv.is_owned = (val & 1) || (val == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
        val_conv = InvoiceFeatures_clone(&val_conv);
        Payee_set_features(&this_ptr_conv, val_conv);
 }
@@ -31374,6 +36961,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Payee_1get_1route_1hin
        LDKPayee this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKCVec_RouteHintZ ret_var = Payee_get_route_hints(&this_ptr_conv);
        int64_tArray ret_arr = NULL;
        ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
@@ -31383,6 +36971,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Payee_1get_1route_1hin
                uint64_t ret_conv_11_ref = 0;
                CHECK((((uint64_t)ret_conv_11_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
                CHECK((((uint64_t)&ret_conv_11_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+               CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_11_var);
                ret_conv_11_ref = (uint64_t)ret_conv_11_var.inner;
                if (ret_conv_11_var.is_owned) {
                        ret_conv_11_ref |= 1;
@@ -31398,6 +36987,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Payee_1set_1route_1hints(JNIEn
        LDKPayee this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKCVec_RouteHintZ val_constr;
        val_constr.datalen = (*env)->GetArrayLength(env, val);
        if (val_constr.datalen > 0)
@@ -31410,6 +37000,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Payee_1set_1route_1hints(JNIEn
                LDKRouteHint val_conv_11_conv;
                val_conv_11_conv.inner = (void*)(val_conv_11 & (~1));
                val_conv_11_conv.is_owned = (val_conv_11 & 1) || (val_conv_11 == 0);
+               CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_11_conv);
                val_conv_11_conv = RouteHint_clone(&val_conv_11_conv);
                val_constr.data[l] = val_conv_11_conv;
        }
@@ -31421,6 +37012,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payee_1get_1expiry_1time(JN
        LDKPayee this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
        *ret_copy = Payee_get_expiry_time(&this_ptr_conv);
        uint64_t ret_ref = (uint64_t)ret_copy;
@@ -31431,6 +37023,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Payee_1set_1expiry_1time(JNIEn
        LDKPayee this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        void* val_ptr = (void*)(((uint64_t)val) & ~1);
        CHECK_ACCESS(val_ptr);
        LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
@@ -31445,6 +37038,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payee_1new(JNIEnv *env, jcl
        LDKInvoiceFeatures features_arg_conv;
        features_arg_conv.inner = (void*)(features_arg & (~1));
        features_arg_conv.is_owned = (features_arg & 1) || (features_arg == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv);
        features_arg_conv = InvoiceFeatures_clone(&features_arg_conv);
        LDKCVec_RouteHintZ route_hints_arg_constr;
        route_hints_arg_constr.datalen = (*env)->GetArrayLength(env, route_hints_arg);
@@ -31458,6 +37052,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payee_1new(JNIEnv *env, jcl
                LDKRouteHint route_hints_arg_conv_11_conv;
                route_hints_arg_conv_11_conv.inner = (void*)(route_hints_arg_conv_11 & (~1));
                route_hints_arg_conv_11_conv.is_owned = (route_hints_arg_conv_11 & 1) || (route_hints_arg_conv_11 == 0);
+               CHECK_INNER_FIELD_ACCESS_OR_NULL(route_hints_arg_conv_11_conv);
                route_hints_arg_conv_11_conv = RouteHint_clone(&route_hints_arg_conv_11_conv);
                route_hints_arg_constr.data[l] = route_hints_arg_conv_11_conv;
        }
@@ -31470,6 +37065,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payee_1new(JNIEnv *env, jcl
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -31477,14 +37073,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payee_1new(JNIEnv *env, jcl
        return ret_ref;
 }
 
+static inline uint64_t Payee_clone_ptr(LDKPayee *NONNULL_PTR arg) {
+       LDKPayee ret_var = Payee_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payee_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKPayee arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = Payee_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payee_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKPayee orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKPayee ret_var = Payee_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -31496,6 +37115,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payee_1hash(JNIEnv *env, jc
        LDKPayee o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        int64_t ret_val = Payee_hash(&o_conv);
        return ret_val;
 }
@@ -31504,9 +37124,11 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Payee_1eq(JNIEnv *env, jcl
        LDKPayee a_conv;
        a_conv.inner = (void*)(a & (~1));
        a_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
        LDKPayee b_conv;
        b_conv.inner = (void*)(b & (~1));
        b_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
        jboolean ret_val = Payee_eq(&a_conv, &b_conv);
        return ret_val;
 }
@@ -31515,6 +37137,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Payee_1write(JNIEnv *en
        LDKPayee obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
        obj_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
        LDKCVec_u8Z ret_var = Payee_write(&obj_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
@@ -31540,6 +37163,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payee_1from_1node_1id(JNIEn
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -31555,6 +37179,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payee_1for_1keysend(JNIEnv
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -31566,6 +37191,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1free(JNIEnv *env, j
        LDKRouteHint this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        RouteHint_free(this_obj_conv);
 }
 
@@ -31573,6 +37199,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1a(JNIE
        LDKRouteHint this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKCVec_RouteHintHopZ ret_var = RouteHint_get_a(&this_ptr_conv);
        int64_tArray ret_arr = NULL;
        ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
@@ -31582,6 +37209,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1a(JNIE
                uint64_t ret_conv_14_ref = 0;
                CHECK((((uint64_t)ret_conv_14_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
                CHECK((((uint64_t)&ret_conv_14_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+               CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_14_var);
                ret_conv_14_ref = (uint64_t)ret_conv_14_var.inner;
                if (ret_conv_14_var.is_owned) {
                        ret_conv_14_ref |= 1;
@@ -31597,6 +37225,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1a(JNIEnv *env,
        LDKRouteHint this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKCVec_RouteHintHopZ val_constr;
        val_constr.datalen = (*env)->GetArrayLength(env, val);
        if (val_constr.datalen > 0)
@@ -31609,6 +37238,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1a(JNIEnv *env,
                LDKRouteHintHop val_conv_14_conv;
                val_conv_14_conv.inner = (void*)(val_conv_14 & (~1));
                val_conv_14_conv.is_owned = (val_conv_14 & 1) || (val_conv_14 == 0);
+               CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_14_conv);
                val_conv_14_conv = RouteHintHop_clone(&val_conv_14_conv);
                val_constr.data[o] = val_conv_14_conv;
        }
@@ -31629,6 +37259,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHint_1new(JNIEnv *env,
                LDKRouteHintHop a_arg_conv_14_conv;
                a_arg_conv_14_conv.inner = (void*)(a_arg_conv_14 & (~1));
                a_arg_conv_14_conv.is_owned = (a_arg_conv_14 & 1) || (a_arg_conv_14 == 0);
+               CHECK_INNER_FIELD_ACCESS_OR_NULL(a_arg_conv_14_conv);
                a_arg_conv_14_conv = RouteHintHop_clone(&a_arg_conv_14_conv);
                a_arg_constr.data[o] = a_arg_conv_14_conv;
        }
@@ -31637,6 +37268,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHint_1new(JNIEnv *env,
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -31644,14 +37276,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHint_1new(JNIEnv *env,
        return ret_ref;
 }
 
+static inline uint64_t RouteHint_clone_ptr(LDKRouteHint *NONNULL_PTR arg) {
+       LDKRouteHint ret_var = RouteHint_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHint_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKRouteHint arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = RouteHint_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHint_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKRouteHint orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKRouteHint ret_var = RouteHint_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -31663,6 +37318,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHint_1hash(JNIEnv *env
        LDKRouteHint o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        int64_t ret_val = RouteHint_hash(&o_conv);
        return ret_val;
 }
@@ -31671,9 +37327,11 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RouteHint_1eq(JNIEnv *env,
        LDKRouteHint a_conv;
        a_conv.inner = (void*)(a & (~1));
        a_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
        LDKRouteHint b_conv;
        b_conv.inner = (void*)(b & (~1));
        b_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
        jboolean ret_val = RouteHint_eq(&a_conv, &b_conv);
        return ret_val;
 }
@@ -31682,6 +37340,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RouteHint_1write(JNIEnv
        LDKRouteHint obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
        obj_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
        LDKCVec_u8Z ret_var = RouteHint_write(&obj_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
@@ -31703,6 +37362,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1free(JNIEnv *env
        LDKRouteHintHop this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        RouteHintHop_free(this_obj_conv);
 }
 
@@ -31710,6 +37370,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1src_
        LDKRouteHintHop this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, RouteHintHop_get_src_node_id(&this_ptr_conv).compressed_form);
        return ret_arr;
@@ -31719,6 +37380,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1src_1node_1
        LDKRouteHintHop this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKPublicKey val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 33);
        (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
@@ -31729,6 +37391,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1short_1c
        LDKRouteHintHop this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int64_t ret_val = RouteHintHop_get_short_channel_id(&this_ptr_conv);
        return ret_val;
 }
@@ -31737,6 +37400,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1short_1chan
        LDKRouteHintHop this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        RouteHintHop_set_short_channel_id(&this_ptr_conv, val);
 }
 
@@ -31744,10 +37408,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1fees(JNI
        LDKRouteHintHop this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKRoutingFees ret_var = RouteHintHop_get_fees(&this_ptr_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -31759,9 +37425,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1fees(JNIEnv
        LDKRouteHintHop this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKRoutingFees val_conv;
        val_conv.inner = (void*)(val & (~1));
        val_conv.is_owned = (val & 1) || (val == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
        val_conv = RoutingFees_clone(&val_conv);
        RouteHintHop_set_fees(&this_ptr_conv, val_conv);
 }
@@ -31770,6 +37438,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1cltv_1ex
        LDKRouteHintHop this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int16_t ret_val = RouteHintHop_get_cltv_expiry_delta(&this_ptr_conv);
        return ret_val;
 }
@@ -31778,6 +37447,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1cltv_1expir
        LDKRouteHintHop this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        RouteHintHop_set_cltv_expiry_delta(&this_ptr_conv, val);
 }
 
@@ -31785,6 +37455,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1htlc_1mi
        LDKRouteHintHop this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
        *ret_copy = RouteHintHop_get_htlc_minimum_msat(&this_ptr_conv);
        uint64_t ret_ref = (uint64_t)ret_copy;
@@ -31795,6 +37466,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1htlc_1minim
        LDKRouteHintHop this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        void* val_ptr = (void*)(((uint64_t)val) & ~1);
        CHECK_ACCESS(val_ptr);
        LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
@@ -31806,6 +37478,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1htlc_1ma
        LDKRouteHintHop this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
        *ret_copy = RouteHintHop_get_htlc_maximum_msat(&this_ptr_conv);
        uint64_t ret_ref = (uint64_t)ret_copy;
@@ -31816,6 +37489,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1htlc_1maxim
        LDKRouteHintHop this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        void* val_ptr = (void*)(((uint64_t)val) & ~1);
        CHECK_ACCESS(val_ptr);
        LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
@@ -31830,6 +37504,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1new(JNIEnv *e
        LDKRoutingFees fees_arg_conv;
        fees_arg_conv.inner = (void*)(fees_arg & (~1));
        fees_arg_conv.is_owned = (fees_arg & 1) || (fees_arg == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(fees_arg_conv);
        fees_arg_conv = RoutingFees_clone(&fees_arg_conv);
        void* htlc_minimum_msat_arg_ptr = (void*)(((uint64_t)htlc_minimum_msat_arg) & ~1);
        CHECK_ACCESS(htlc_minimum_msat_arg_ptr);
@@ -31843,6 +37518,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1new(JNIEnv *e
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -31850,14 +37526,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1new(JNIEnv *e
        return ret_ref;
 }
 
+static inline uint64_t RouteHintHop_clone_ptr(LDKRouteHintHop *NONNULL_PTR arg) {
+       LDKRouteHintHop ret_var = RouteHintHop_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKRouteHintHop arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = RouteHintHop_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKRouteHintHop orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKRouteHintHop ret_var = RouteHintHop_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -31869,6 +37568,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1hash(JNIEnv *
        LDKRouteHintHop o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        int64_t ret_val = RouteHintHop_hash(&o_conv);
        return ret_val;
 }
@@ -31877,9 +37577,11 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1eq(JNIEnv *e
        LDKRouteHintHop a_conv;
        a_conv.inner = (void*)(a & (~1));
        a_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
        LDKRouteHintHop b_conv;
        b_conv.inner = (void*)(b & (~1));
        b_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
        jboolean ret_val = RouteHintHop_eq(&a_conv, &b_conv);
        return ret_val;
 }
@@ -31888,6 +37590,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1write(JNI
        LDKRouteHintHop obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
        obj_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
        LDKCVec_u8Z ret_var = RouteHintHop_write(&obj_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
@@ -31912,9 +37615,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_find_1route(JNIEnv *env, jc
        LDKRouteParameters params_conv;
        params_conv.inner = (void*)(params & (~1));
        params_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(params_conv);
        LDKNetworkGraph network_conv;
        network_conv.inner = (void*)(network & (~1));
        network_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(network_conv);
        LDKCVec_ChannelDetailsZ first_hops_constr;
        LDKCVec_ChannelDetailsZ *first_hops_ptr = NULL;
        if (first_hops != NULL) {
@@ -31929,6 +37634,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_find_1route(JNIEnv *env, jc
                        LDKChannelDetails first_hops_conv_16_conv;
                        first_hops_conv_16_conv.inner = (void*)(first_hops_conv_16 & (~1));
                        first_hops_conv_16_conv.is_owned = (first_hops_conv_16 & 1) || (first_hops_conv_16 == 0);
+                       CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_conv);
                        first_hops_constr.data[q] = first_hops_conv_16_conv;
                }
                (*env)->ReleaseLongArrayElements(env, first_hops, first_hops_vals, 0);
@@ -31954,6 +37660,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Scorer_1free(JNIEnv *env, jcla
        LDKScorer this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        Scorer_free(this_obj_conv);
 }
 
@@ -31961,6 +37668,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1free(JNIEnv
        LDKScoringParameters this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        ScoringParameters_free(this_obj_conv);
 }
 
@@ -31968,6 +37676,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1get_1bas
        LDKScoringParameters this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int64_t ret_val = ScoringParameters_get_base_penalty_msat(&this_ptr_conv);
        return ret_val;
 }
@@ -31976,6 +37685,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1set_1base_1
        LDKScoringParameters this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        ScoringParameters_set_base_penalty_msat(&this_ptr_conv, val);
 }
 
@@ -31983,6 +37693,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1get_1fai
        LDKScoringParameters this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int64_t ret_val = ScoringParameters_get_failure_penalty_msat(&this_ptr_conv);
        return ret_val;
 }
@@ -31991,6 +37702,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1set_1failur
        LDKScoringParameters this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        ScoringParameters_set_failure_penalty_msat(&this_ptr_conv, val);
 }
 
@@ -31998,6 +37710,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1get_1fai
        LDKScoringParameters this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int64_t ret_val = ScoringParameters_get_failure_penalty_half_life(&this_ptr_conv);
        return ret_val;
 }
@@ -32006,6 +37719,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1set_1failur
        LDKScoringParameters this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        ScoringParameters_set_failure_penalty_half_life(&this_ptr_conv, val);
 }
 
@@ -32014,6 +37728,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1new(JNIE
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -32025,6 +37740,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1writ
        LDKScoringParameters obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
        obj_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
        LDKCVec_u8Z ret_var = ScoringParameters_write(&obj_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
@@ -32046,11 +37762,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Scorer_1new(JNIEnv *env, jc
        LDKScoringParameters params_conv;
        params_conv.inner = (void*)(params & (~1));
        params_conv.is_owned = (params & 1) || (params == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(params_conv);
        // Warning: we need a move here but no clone is available for LDKScoringParameters
        LDKScorer ret_var = Scorer_new(params_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -32063,6 +37781,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Scorer_1default(JNIEnv *env
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -32075,6 +37794,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1default(
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -32086,6 +37806,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Scorer_1as_1Score(JNIEnv *e
        LDKScorer this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKScore* ret_ret = MALLOC(sizeof(LDKScore), "LDKScore");
        *ret_ret = Scorer_as_Score(&this_arg_conv);
        return (uint64_t)ret_ret;
@@ -32095,6 +37816,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Scorer_1write(JNIEnv *e
        LDKScorer obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
        obj_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
        LDKCVec_u8Z ret_var = Scorer_write(&obj_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
@@ -32116,6 +37838,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FilesystemPersister_1free(JNIE
        LDKFilesystemPersister this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        FilesystemPersister_free(this_obj_conv);
 }
 
@@ -32125,6 +37848,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FilesystemPersister_1new(JN
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -32136,6 +37860,7 @@ JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_FilesystemPersister_1get_1d
        LDKFilesystemPersister this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKStr ret_str = FilesystemPersister_get_data_dir(&this_arg_conv);
        jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
        Str_free(ret_str);
@@ -32147,6 +37872,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FilesystemPersister_1persis
        LDKChannelManager manager_conv;
        manager_conv.inner = (void*)(manager & (~1));
        manager_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(manager_conv);
        LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
        *ret_conv = FilesystemPersister_persist_manager(data_dir_conv, &manager_conv);
        return (uint64_t)ret_conv;
@@ -32156,6 +37882,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FilesystemPersister_1read_1
        LDKFilesystemPersister this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        void* keys_manager_ptr = (void*)(((uint64_t)keys_manager) & ~1);
        CHECK_ACCESS(keys_manager_ptr);
        LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr);
@@ -32172,6 +37899,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FilesystemPersister_1as_1Pe
        LDKFilesystemPersister this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKPersist* ret_ret = MALLOC(sizeof(LDKPersist), "LDKPersist");
        *ret_ret = FilesystemPersister_as_Persist(&this_arg_conv);
        return (uint64_t)ret_ret;
@@ -32181,6 +37909,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BackgroundProcessor_1free(JNIE
        LDKBackgroundProcessor this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        BackgroundProcessor_free(this_obj_conv);
 }
 
@@ -32211,15 +37940,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BackgroundProcessor_1start(
        LDKChainMonitor chain_monitor_conv;
        chain_monitor_conv.inner = (void*)(chain_monitor & (~1));
        chain_monitor_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(chain_monitor_conv);
        LDKChannelManager channel_manager_conv;
        channel_manager_conv.inner = (void*)(channel_manager & (~1));
        channel_manager_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_manager_conv);
        LDKNetGraphMsgHandler net_graph_msg_handler_conv;
        net_graph_msg_handler_conv.inner = (void*)(net_graph_msg_handler & (~1));
        net_graph_msg_handler_conv.is_owned = (net_graph_msg_handler & 1) || (net_graph_msg_handler == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(net_graph_msg_handler_conv);
        LDKPeerManager peer_manager_conv;
        peer_manager_conv.inner = (void*)(peer_manager & (~1));
        peer_manager_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(peer_manager_conv);
        void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
        CHECK_ACCESS(logger_ptr);
        LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
@@ -32231,6 +37964,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BackgroundProcessor_1start(
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -32242,6 +37976,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BackgroundProcessor_1join(J
        LDKBackgroundProcessor this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        // Warning: we need a move here but no clone is available for LDKBackgroundProcessor
        LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
        *ret_conv = BackgroundProcessor_join(this_arg_conv);
@@ -32252,6 +37987,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BackgroundProcessor_1stop(J
        LDKBackgroundProcessor this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        // Warning: we need a move here but no clone is available for LDKBackgroundProcessor
        LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
        *ret_conv = BackgroundProcessor_stop(this_arg_conv);
@@ -32266,6 +38002,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Invoice_1free(JNIEnv *env, jcl
        LDKInvoice this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        Invoice_free(this_obj_conv);
 }
 
@@ -32273,21 +38010,46 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Invoice_1eq(JNIEnv *env, j
        LDKInvoice a_conv;
        a_conv.inner = (void*)(a & (~1));
        a_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
        LDKInvoice b_conv;
        b_conv.inner = (void*)(b & (~1));
        b_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
        jboolean ret_val = Invoice_eq(&a_conv, &b_conv);
        return ret_val;
 }
 
+static inline uint64_t Invoice_clone_ptr(LDKInvoice *NONNULL_PTR arg) {
+       LDKInvoice ret_var = Invoice_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKInvoice arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = Invoice_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKInvoice orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKInvoice ret_var = Invoice_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -32299,6 +38061,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1free(JNIEnv
        LDKSignedRawInvoice this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        SignedRawInvoice_free(this_obj_conv);
 }
 
@@ -32306,21 +38069,46 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1eq(JNIEn
        LDKSignedRawInvoice a_conv;
        a_conv.inner = (void*)(a & (~1));
        a_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
        LDKSignedRawInvoice b_conv;
        b_conv.inner = (void*)(b & (~1));
        b_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
        jboolean ret_val = SignedRawInvoice_eq(&a_conv, &b_conv);
        return ret_val;
 }
 
+static inline uint64_t SignedRawInvoice_clone_ptr(LDKSignedRawInvoice *NONNULL_PTR arg) {
+       LDKSignedRawInvoice ret_var = SignedRawInvoice_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKSignedRawInvoice arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = SignedRawInvoice_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKSignedRawInvoice orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKSignedRawInvoice ret_var = SignedRawInvoice_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -32332,6 +38120,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RawInvoice_1free(JNIEnv *env,
        LDKRawInvoice this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        RawInvoice_free(this_obj_conv);
 }
 
@@ -32339,10 +38128,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1get_1data(JNIEn
        LDKRawInvoice this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKRawDataPart ret_var = RawInvoice_get_data(&this_ptr_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -32354,9 +38145,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RawInvoice_1set_1data(JNIEnv *
        LDKRawInvoice this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKRawDataPart val_conv;
        val_conv.inner = (void*)(val & (~1));
        val_conv.is_owned = (val & 1) || (val == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
        val_conv = RawDataPart_clone(&val_conv);
        RawInvoice_set_data(&this_ptr_conv, val_conv);
 }
@@ -32365,21 +38158,46 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RawInvoice_1eq(JNIEnv *env
        LDKRawInvoice a_conv;
        a_conv.inner = (void*)(a & (~1));
        a_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
        LDKRawInvoice b_conv;
        b_conv.inner = (void*)(b & (~1));
        b_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
        jboolean ret_val = RawInvoice_eq(&a_conv, &b_conv);
        return ret_val;
 }
 
+static inline uint64_t RawInvoice_clone_ptr(LDKRawInvoice *NONNULL_PTR arg) {
+       LDKRawInvoice ret_var = RawInvoice_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKRawInvoice arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = RawInvoice_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKRawInvoice orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKRawInvoice ret_var = RawInvoice_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -32391,6 +38209,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RawDataPart_1free(JNIEnv *env,
        LDKRawDataPart this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        RawDataPart_free(this_obj_conv);
 }
 
@@ -32398,10 +38217,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawDataPart_1get_1timestamp
        LDKRawDataPart this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKPositiveTimestamp ret_var = RawDataPart_get_timestamp(&this_ptr_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -32413,9 +38234,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RawDataPart_1set_1timestamp(JN
        LDKRawDataPart this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKPositiveTimestamp val_conv;
        val_conv.inner = (void*)(val & (~1));
        val_conv.is_owned = (val & 1) || (val == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
        val_conv = PositiveTimestamp_clone(&val_conv);
        RawDataPart_set_timestamp(&this_ptr_conv, val_conv);
 }
@@ -32424,21 +38247,46 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RawDataPart_1eq(JNIEnv *en
        LDKRawDataPart a_conv;
        a_conv.inner = (void*)(a & (~1));
        a_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
        LDKRawDataPart b_conv;
        b_conv.inner = (void*)(b & (~1));
        b_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
        jboolean ret_val = RawDataPart_eq(&a_conv, &b_conv);
        return ret_val;
 }
 
+static inline uint64_t RawDataPart_clone_ptr(LDKRawDataPart *NONNULL_PTR arg) {
+       LDKRawDataPart ret_var = RawDataPart_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawDataPart_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKRawDataPart arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = RawDataPart_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawDataPart_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKRawDataPart orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKRawDataPart ret_var = RawDataPart_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -32450,6 +38298,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PositiveTimestamp_1free(JNIEnv
        LDKPositiveTimestamp this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        PositiveTimestamp_free(this_obj_conv);
 }
 
@@ -32457,21 +38306,46 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PositiveTimestamp_1eq(JNIE
        LDKPositiveTimestamp a_conv;
        a_conv.inner = (void*)(a & (~1));
        a_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
        LDKPositiveTimestamp b_conv;
        b_conv.inner = (void*)(b & (~1));
        b_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
        jboolean ret_val = PositiveTimestamp_eq(&a_conv, &b_conv);
        return ret_val;
 }
 
+static inline uint64_t PositiveTimestamp_clone_ptr(LDKPositiveTimestamp *NONNULL_PTR arg) {
+       LDKPositiveTimestamp ret_var = PositiveTimestamp_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PositiveTimestamp_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKPositiveTimestamp arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = PositiveTimestamp_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PositiveTimestamp_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKPositiveTimestamp orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKPositiveTimestamp ret_var = PositiveTimestamp_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -32566,17 +38440,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Sha256_1free(JNIEnv *env, jcla
        LDKSha256 this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        Sha256_free(this_obj_conv);
 }
 
+static inline uint64_t Sha256_clone_ptr(LDKSha256 *NONNULL_PTR arg) {
+       LDKSha256 ret_var = Sha256_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Sha256_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKSha256 arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = Sha256_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Sha256_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKSha256 orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKSha256 ret_var = Sha256_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -32588,6 +38486,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Sha256_1hash(JNIEnv *env, j
        LDKSha256 o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        int64_t ret_val = Sha256_hash(&o_conv);
        return ret_val;
 }
@@ -32596,9 +38495,11 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Sha256_1eq(JNIEnv *env, jc
        LDKSha256 a_conv;
        a_conv.inner = (void*)(a & (~1));
        a_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
        LDKSha256 b_conv;
        b_conv.inner = (void*)(b & (~1));
        b_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
        jboolean ret_val = Sha256_eq(&a_conv, &b_conv);
        return ret_val;
 }
@@ -32607,17 +38508,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Description_1free(JNIEnv *env,
        LDKDescription this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        Description_free(this_obj_conv);
 }
 
+static inline uint64_t Description_clone_ptr(LDKDescription *NONNULL_PTR arg) {
+       LDKDescription ret_var = Description_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Description_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKDescription arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = Description_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Description_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKDescription orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKDescription ret_var = Description_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -32629,6 +38554,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Description_1hash(JNIEnv *e
        LDKDescription o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        int64_t ret_val = Description_hash(&o_conv);
        return ret_val;
 }
@@ -32637,9 +38563,11 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Description_1eq(JNIEnv *en
        LDKDescription a_conv;
        a_conv.inner = (void*)(a & (~1));
        a_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
        LDKDescription b_conv;
        b_conv.inner = (void*)(b & (~1));
        b_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
        jboolean ret_val = Description_eq(&a_conv, &b_conv);
        return ret_val;
 }
@@ -32648,6 +38576,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PayeePubKey_1free(JNIEnv *env,
        LDKPayeePubKey this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        PayeePubKey_free(this_obj_conv);
 }
 
@@ -32655,6 +38584,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PayeePubKey_1get_1a(JNI
        LDKPayeePubKey this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, PayeePubKey_get_a(&this_ptr_conv).compressed_form);
        return ret_arr;
@@ -32664,6 +38594,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PayeePubKey_1set_1a(JNIEnv *en
        LDKPayeePubKey this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        LDKPublicKey val_ref;
        CHECK((*env)->GetArrayLength(env, val) == 33);
        (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
@@ -32678,6 +38609,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PayeePubKey_1new(JNIEnv *en
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -32685,14 +38617,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PayeePubKey_1new(JNIEnv *en
        return ret_ref;
 }
 
+static inline uint64_t PayeePubKey_clone_ptr(LDKPayeePubKey *NONNULL_PTR arg) {
+       LDKPayeePubKey ret_var = PayeePubKey_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PayeePubKey_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKPayeePubKey arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = PayeePubKey_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PayeePubKey_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKPayeePubKey orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKPayeePubKey ret_var = PayeePubKey_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -32704,6 +38659,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PayeePubKey_1hash(JNIEnv *e
        LDKPayeePubKey o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        int64_t ret_val = PayeePubKey_hash(&o_conv);
        return ret_val;
 }
@@ -32712,9 +38668,11 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PayeePubKey_1eq(JNIEnv *en
        LDKPayeePubKey a_conv;
        a_conv.inner = (void*)(a & (~1));
        a_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
        LDKPayeePubKey b_conv;
        b_conv.inner = (void*)(b & (~1));
        b_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
        jboolean ret_val = PayeePubKey_eq(&a_conv, &b_conv);
        return ret_val;
 }
@@ -32723,17 +38681,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ExpiryTime_1free(JNIEnv *env,
        LDKExpiryTime this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        ExpiryTime_free(this_obj_conv);
 }
 
+static inline uint64_t ExpiryTime_clone_ptr(LDKExpiryTime *NONNULL_PTR arg) {
+       LDKExpiryTime ret_var = ExpiryTime_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ExpiryTime_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKExpiryTime arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = ExpiryTime_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ExpiryTime_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKExpiryTime orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKExpiryTime ret_var = ExpiryTime_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -32745,6 +38727,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ExpiryTime_1hash(JNIEnv *en
        LDKExpiryTime o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        int64_t ret_val = ExpiryTime_hash(&o_conv);
        return ret_val;
 }
@@ -32753,9 +38736,11 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ExpiryTime_1eq(JNIEnv *env
        LDKExpiryTime a_conv;
        a_conv.inner = (void*)(a & (~1));
        a_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
        LDKExpiryTime b_conv;
        b_conv.inner = (void*)(b & (~1));
        b_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
        jboolean ret_val = ExpiryTime_eq(&a_conv, &b_conv);
        return ret_val;
 }
@@ -32764,6 +38749,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MinFinalCltvExpiry_1free(JNIEn
        LDKMinFinalCltvExpiry this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        MinFinalCltvExpiry_free(this_obj_conv);
 }
 
@@ -32771,6 +38757,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MinFinalCltvExpiry_1get_1a(
        LDKMinFinalCltvExpiry this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int64_t ret_val = MinFinalCltvExpiry_get_a(&this_ptr_conv);
        return ret_val;
 }
@@ -32779,6 +38766,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MinFinalCltvExpiry_1set_1a(JNI
        LDKMinFinalCltvExpiry this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        MinFinalCltvExpiry_set_a(&this_ptr_conv, val);
 }
 
@@ -32787,6 +38775,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MinFinalCltvExpiry_1new(JNI
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -32794,14 +38783,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MinFinalCltvExpiry_1new(JNI
        return ret_ref;
 }
 
+static inline uint64_t MinFinalCltvExpiry_clone_ptr(LDKMinFinalCltvExpiry *NONNULL_PTR arg) {
+       LDKMinFinalCltvExpiry ret_var = MinFinalCltvExpiry_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MinFinalCltvExpiry_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKMinFinalCltvExpiry arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = MinFinalCltvExpiry_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MinFinalCltvExpiry_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKMinFinalCltvExpiry orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKMinFinalCltvExpiry ret_var = MinFinalCltvExpiry_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -32813,6 +38825,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MinFinalCltvExpiry_1hash(JN
        LDKMinFinalCltvExpiry o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        int64_t ret_val = MinFinalCltvExpiry_hash(&o_conv);
        return ret_val;
 }
@@ -32821,9 +38834,11 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_MinFinalCltvExpiry_1eq(JNI
        LDKMinFinalCltvExpiry a_conv;
        a_conv.inner = (void*)(a & (~1));
        a_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
        LDKMinFinalCltvExpiry b_conv;
        b_conv.inner = (void*)(b & (~1));
        b_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
        jboolean ret_val = MinFinalCltvExpiry_eq(&a_conv, &b_conv);
        return ret_val;
 }
@@ -32837,6 +38852,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Fallback_1free(JNIEnv *env, jc
        Fallback_free(this_ptr_conv);
 }
 
+static inline uint64_t Fallback_clone_ptr(LDKFallback *NONNULL_PTR arg) {
+       LDKFallback *ret_copy = MALLOC(sizeof(LDKFallback), "LDKFallback");
+       *ret_copy = Fallback_clone(arg);
+uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Fallback_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKFallback* arg_conv = (LDKFallback*)arg;
+       int64_t ret_val = Fallback_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Fallback_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKFallback* orig_conv = (LDKFallback*)orig;
        LDKFallback *ret_copy = MALLOC(sizeof(LDKFallback), "LDKFallback");
@@ -32894,17 +38921,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceSignature_1free(JNIEnv
        LDKInvoiceSignature this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        InvoiceSignature_free(this_obj_conv);
 }
 
+static inline uint64_t InvoiceSignature_clone_ptr(LDKInvoiceSignature *NONNULL_PTR arg) {
+       LDKInvoiceSignature ret_var = InvoiceSignature_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceSignature_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKInvoiceSignature arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = InvoiceSignature_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceSignature_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKInvoiceSignature orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKInvoiceSignature ret_var = InvoiceSignature_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -32916,9 +38967,11 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceSignature_1eq(JNIEn
        LDKInvoiceSignature a_conv;
        a_conv.inner = (void*)(a & (~1));
        a_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
        LDKInvoiceSignature b_conv;
        b_conv.inner = (void*)(b & (~1));
        b_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
        jboolean ret_val = InvoiceSignature_eq(&a_conv, &b_conv);
        return ret_val;
 }
@@ -32927,17 +38980,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PrivateRoute_1free(JNIEnv *env
        LDKPrivateRoute this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        PrivateRoute_free(this_obj_conv);
 }
 
+static inline uint64_t PrivateRoute_clone_ptr(LDKPrivateRoute *NONNULL_PTR arg) {
+       LDKPrivateRoute ret_var = PrivateRoute_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PrivateRoute_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKPrivateRoute arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = PrivateRoute_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PrivateRoute_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKPrivateRoute orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKPrivateRoute ret_var = PrivateRoute_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -32949,6 +39026,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PrivateRoute_1hash(JNIEnv *
        LDKPrivateRoute o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        int64_t ret_val = PrivateRoute_hash(&o_conv);
        return ret_val;
 }
@@ -32957,9 +39035,11 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PrivateRoute_1eq(JNIEnv *e
        LDKPrivateRoute a_conv;
        a_conv.inner = (void*)(a & (~1));
        a_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
        LDKPrivateRoute b_conv;
        b_conv.inner = (void*)(b & (~1));
        b_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
        jboolean ret_val = PrivateRoute_eq(&a_conv, &b_conv);
        return ret_val;
 }
@@ -32968,6 +39048,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1into_1par
        LDKSignedRawInvoice this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        this_arg_conv = SignedRawInvoice_clone(&this_arg_conv);
        LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ");
        *ret_conv = SignedRawInvoice_into_parts(this_arg_conv);
@@ -32978,10 +39059,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1raw_1invo
        LDKSignedRawInvoice this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKRawInvoice ret_var = SignedRawInvoice_raw_invoice(&this_arg_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -32993,6 +39076,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1hash(
        LDKSignedRawInvoice this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *SignedRawInvoice_hash(&this_arg_conv));
        return ret_arr;
@@ -33002,10 +39086,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1signature
        LDKSignedRawInvoice this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKInvoiceSignature ret_var = SignedRawInvoice_signature(&this_arg_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -33017,6 +39103,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1recover_1
        LDKSignedRawInvoice this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ");
        *ret_conv = SignedRawInvoice_recover_payee_pub_key(&this_arg_conv);
        return (uint64_t)ret_conv;
@@ -33026,6 +39113,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1check_1s
        LDKSignedRawInvoice this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        jboolean ret_val = SignedRawInvoice_check_signature(&this_arg_conv);
        return ret_val;
 }
@@ -33034,6 +39122,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RawInvoice_1hash(JNIEnv
        LDKRawInvoice this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, RawInvoice_hash(&this_arg_conv).data);
        return ret_arr;
@@ -33043,11 +39132,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1payment_1hash(J
        LDKRawInvoice this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKSha256 ret_var = RawInvoice_payment_hash(&this_arg_conv);
        uint64_t ret_ref = 0;
        if ((uint64_t)ret_var.inner > 4096) {
                CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
                CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
                ret_ref = (uint64_t)ret_var.inner;
                if (ret_var.is_owned) {
                        ret_ref |= 1;
@@ -33060,11 +39151,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1description(JNI
        LDKRawInvoice this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKDescription ret_var = RawInvoice_description(&this_arg_conv);
        uint64_t ret_ref = 0;
        if ((uint64_t)ret_var.inner > 4096) {
                CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
                CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
                ret_ref = (uint64_t)ret_var.inner;
                if (ret_var.is_owned) {
                        ret_ref |= 1;
@@ -33077,11 +39170,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1payee_1pub_1key
        LDKRawInvoice this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKPayeePubKey ret_var = RawInvoice_payee_pub_key(&this_arg_conv);
        uint64_t ret_ref = 0;
        if ((uint64_t)ret_var.inner > 4096) {
                CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
                CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
                ret_ref = (uint64_t)ret_var.inner;
                if (ret_var.is_owned) {
                        ret_ref |= 1;
@@ -33094,11 +39189,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1description_1ha
        LDKRawInvoice this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKSha256 ret_var = RawInvoice_description_hash(&this_arg_conv);
        uint64_t ret_ref = 0;
        if ((uint64_t)ret_var.inner > 4096) {
                CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
                CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
                ret_ref = (uint64_t)ret_var.inner;
                if (ret_var.is_owned) {
                        ret_ref |= 1;
@@ -33111,11 +39208,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1expiry_1time(JN
        LDKRawInvoice this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKExpiryTime ret_var = RawInvoice_expiry_time(&this_arg_conv);
        uint64_t ret_ref = 0;
        if ((uint64_t)ret_var.inner > 4096) {
                CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
                CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
                ret_ref = (uint64_t)ret_var.inner;
                if (ret_var.is_owned) {
                        ret_ref |= 1;
@@ -33128,11 +39227,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1min_1final_1clt
        LDKRawInvoice this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKMinFinalCltvExpiry ret_var = RawInvoice_min_final_cltv_expiry(&this_arg_conv);
        uint64_t ret_ref = 0;
        if ((uint64_t)ret_var.inner > 4096) {
                CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
                CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
                ret_ref = (uint64_t)ret_var.inner;
                if (ret_var.is_owned) {
                        ret_ref |= 1;
@@ -33145,6 +39246,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RawInvoice_1payment_1se
        LDKRawInvoice this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, RawInvoice_payment_secret(&this_arg_conv).data);
        return ret_arr;
@@ -33154,11 +39256,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1features(JNIEnv
        LDKRawInvoice this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKInvoiceFeatures ret_var = RawInvoice_features(&this_arg_conv);
        uint64_t ret_ref = 0;
        if ((uint64_t)ret_var.inner > 4096) {
                CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
                CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
                ret_ref = (uint64_t)ret_var.inner;
                if (ret_var.is_owned) {
                        ret_ref |= 1;
@@ -33171,6 +39275,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_RawInvoice_1private_1r
        LDKRawInvoice this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKCVec_PrivateRouteZ ret_var = RawInvoice_private_routes(&this_arg_conv);
        int64_tArray ret_arr = NULL;
        ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
@@ -33180,6 +39285,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_RawInvoice_1private_1r
                uint64_t ret_conv_14_ref = 0;
                CHECK((((uint64_t)ret_conv_14_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
                CHECK((((uint64_t)&ret_conv_14_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+               CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_14_var);
                ret_conv_14_ref = (uint64_t)ret_conv_14_var.inner;
                if (ret_conv_14_var.is_owned) {
                        ret_conv_14_ref |= 1;
@@ -33195,6 +39301,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1amount_1pico_1b
        LDKRawInvoice this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
        *ret_copy = RawInvoice_amount_pico_btc(&this_arg_conv);
        uint64_t ret_ref = (uint64_t)ret_copy;
@@ -33205,6 +39312,7 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_RawInvoice_1currency(JNIEnv
        LDKRawInvoice this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        jclass ret_conv = LDKCurrency_to_java(env, RawInvoice_currency(&this_arg_conv));
        return ret_conv;
 }
@@ -33225,6 +39333,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PositiveTimestamp_1as_1unix
        LDKPositiveTimestamp this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        int64_t ret_val = PositiveTimestamp_as_unix_timestamp(&this_arg_conv);
        return ret_val;
 }
@@ -33233,6 +39342,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PositiveTimestamp_1as_1time
        LDKPositiveTimestamp this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        int64_t ret_val = PositiveTimestamp_as_time(&this_arg_conv);
        return ret_val;
 }
@@ -33241,11 +39351,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1into_1signed_1raw(
        LDKInvoice this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        this_arg_conv = Invoice_clone(&this_arg_conv);
        LDKSignedRawInvoice ret_var = Invoice_into_signed_raw(this_arg_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -33257,6 +39369,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1check_1signature(J
        LDKInvoice this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ");
        *ret_conv = Invoice_check_signature(&this_arg_conv);
        return (uint64_t)ret_conv;
@@ -33266,6 +39379,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1from_1signed(JNIEn
        LDKSignedRawInvoice signed_invoice_conv;
        signed_invoice_conv.inner = (void*)(signed_invoice & (~1));
        signed_invoice_conv.is_owned = (signed_invoice & 1) || (signed_invoice == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(signed_invoice_conv);
        signed_invoice_conv = SignedRawInvoice_clone(&signed_invoice_conv);
        LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ");
        *ret_conv = Invoice_from_signed(signed_invoice_conv);
@@ -33276,6 +39390,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1timestamp(JNIEnv *
        LDKInvoice this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        int64_t ret_val = Invoice_timestamp(&this_arg_conv);
        return ret_val;
 }
@@ -33284,6 +39399,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Invoice_1payment_1hash(
        LDKInvoice this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *Invoice_payment_hash(&this_arg_conv));
        return ret_arr;
@@ -33293,6 +39409,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Invoice_1payee_1pub_1ke
        LDKInvoice this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, Invoice_payee_pub_key(&this_arg_conv).compressed_form);
        return ret_arr;
@@ -33302,6 +39419,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Invoice_1payment_1secre
        LDKInvoice this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *Invoice_payment_secret(&this_arg_conv));
        return ret_arr;
@@ -33311,11 +39429,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1features(JNIEnv *e
        LDKInvoice this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKInvoiceFeatures ret_var = Invoice_features(&this_arg_conv);
        uint64_t ret_ref = 0;
        if ((uint64_t)ret_var.inner > 4096) {
                CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
                CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
                ret_ref = (uint64_t)ret_var.inner;
                if (ret_var.is_owned) {
                        ret_ref |= 1;
@@ -33328,6 +39448,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Invoice_1recover_1payee
        LDKInvoice this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
        (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, Invoice_recover_payee_pub_key(&this_arg_conv).compressed_form);
        return ret_arr;
@@ -33337,6 +39458,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1expiry_1time(JNIEn
        LDKInvoice this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        int64_t ret_val = Invoice_expiry_time(&this_arg_conv);
        return ret_val;
 }
@@ -33345,6 +39467,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Invoice_1is_1expired(JNIEn
        LDKInvoice this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        jboolean ret_val = Invoice_is_expired(&this_arg_conv);
        return ret_val;
 }
@@ -33353,6 +39476,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1min_1final_1cltv_1
        LDKInvoice this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        int64_t ret_val = Invoice_min_final_cltv_expiry(&this_arg_conv);
        return ret_val;
 }
@@ -33361,6 +39485,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Invoice_1private_1rout
        LDKInvoice this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKCVec_PrivateRouteZ ret_var = Invoice_private_routes(&this_arg_conv);
        int64_tArray ret_arr = NULL;
        ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
@@ -33370,6 +39495,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Invoice_1private_1rout
                uint64_t ret_conv_14_ref = 0;
                CHECK((((uint64_t)ret_conv_14_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
                CHECK((((uint64_t)&ret_conv_14_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+               CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_14_var);
                ret_conv_14_ref = (uint64_t)ret_conv_14_var.inner;
                if (ret_conv_14_var.is_owned) {
                        ret_conv_14_ref |= 1;
@@ -33385,6 +39511,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Invoice_1route_1hints(
        LDKInvoice this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKCVec_RouteHintZ ret_var = Invoice_route_hints(&this_arg_conv);
        int64_tArray ret_arr = NULL;
        ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
@@ -33394,6 +39521,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Invoice_1route_1hints(
                uint64_t ret_conv_11_ref = 0;
                CHECK((((uint64_t)ret_conv_11_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
                CHECK((((uint64_t)&ret_conv_11_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+               CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_11_var);
                ret_conv_11_ref = (uint64_t)ret_conv_11_var.inner;
                if (ret_conv_11_var.is_owned) {
                        ret_conv_11_ref |= 1;
@@ -33409,6 +39537,7 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Invoice_1currency(JNIEnv *en
        LDKInvoice this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        jclass ret_conv = LDKCurrency_to_java(env, Invoice_currency(&this_arg_conv));
        return ret_conv;
 }
@@ -33417,6 +39546,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1amount_1milli_1sat
        LDKInvoice this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
        *ret_copy = Invoice_amount_milli_satoshis(&this_arg_conv);
        uint64_t ret_ref = (uint64_t)ret_copy;
@@ -33434,6 +39564,7 @@ JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Description_1into_1inner(JN
        LDKDescription this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        this_arg_conv = Description_clone(&this_arg_conv);
        LDKStr ret_str = Description_into_inner(this_arg_conv);
        jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
@@ -33457,6 +39588,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ExpiryTime_1as_1seconds(JNI
        LDKExpiryTime this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        int64_t ret_val = ExpiryTime_as_seconds(&this_arg_conv);
        return ret_val;
 }
@@ -33465,6 +39597,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ExpiryTime_1as_1duration(JN
        LDKExpiryTime this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        int64_t ret_val = ExpiryTime_as_duration(&this_arg_conv);
        return ret_val;
 }
@@ -33473,6 +39606,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PrivateRoute_1new(JNIEnv *e
        LDKRouteHint hops_conv;
        hops_conv.inner = (void*)(hops & (~1));
        hops_conv.is_owned = (hops & 1) || (hops == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(hops_conv);
        hops_conv = RouteHint_clone(&hops_conv);
        LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ");
        *ret_conv = PrivateRoute_new(hops_conv);
@@ -33483,11 +39617,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PrivateRoute_1into_1inner(J
        LDKPrivateRoute this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        this_arg_conv = PrivateRoute_clone(&this_arg_conv);
        LDKRouteHint ret_var = PrivateRoute_into_inner(this_arg_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -33616,6 +39752,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SignOrCreationError_1free(JNIE
        SignOrCreationError_free(this_ptr_conv);
 }
 
+static inline uint64_t SignOrCreationError_clone_ptr(LDKSignOrCreationError *NONNULL_PTR arg) {
+       LDKSignOrCreationError *ret_copy = MALLOC(sizeof(LDKSignOrCreationError), "LDKSignOrCreationError");
+       *ret_copy = SignOrCreationError_clone(arg);
+uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignOrCreationError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKSignOrCreationError* arg_conv = (LDKSignOrCreationError*)arg;
+       int64_t ret_val = SignOrCreationError_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignOrCreationError_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKSignOrCreationError* orig_conv = (LDKSignOrCreationError*)orig;
        LDKSignOrCreationError *ret_copy = MALLOC(sizeof(LDKSignOrCreationError), "LDKSignOrCreationError");
@@ -33658,6 +39806,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1free(JNIEnv *env
        LDKInvoicePayer this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        InvoicePayer_free(this_obj_conv);
 }
 
@@ -33683,6 +39832,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RetryAttempts_1free(JNIEnv *en
        LDKRetryAttempts this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        RetryAttempts_free(this_obj_conv);
 }
 
@@ -33690,6 +39840,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RetryAttempts_1get_1a(JNIEn
        LDKRetryAttempts this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        int64_t ret_val = RetryAttempts_get_a(&this_ptr_conv);
        return ret_val;
 }
@@ -33698,6 +39849,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RetryAttempts_1set_1a(JNIEnv *
        LDKRetryAttempts this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
        RetryAttempts_set_a(&this_ptr_conv, val);
 }
 
@@ -33706,6 +39858,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RetryAttempts_1new(JNIEnv *
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -33713,14 +39866,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RetryAttempts_1new(JNIEnv *
        return ret_ref;
 }
 
+static inline uint64_t RetryAttempts_clone_ptr(LDKRetryAttempts *NONNULL_PTR arg) {
+       LDKRetryAttempts ret_var = RetryAttempts_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+       ret_ref |= 1;
+}
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RetryAttempts_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKRetryAttempts arg_conv;
+       arg_conv.inner = (void*)(arg & (~1));
+       arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+       int64_t ret_val = RetryAttempts_clone_ptr(&arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RetryAttempts_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKRetryAttempts orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
        LDKRetryAttempts ret_var = RetryAttempts_clone(&orig_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -33732,9 +39908,11 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RetryAttempts_1eq(JNIEnv *
        LDKRetryAttempts a_conv;
        a_conv.inner = (void*)(a & (~1));
        a_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
        LDKRetryAttempts b_conv;
        b_conv.inner = (void*)(b & (~1));
        b_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
        jboolean ret_val = RetryAttempts_eq(&a_conv, &b_conv);
        return ret_val;
 }
@@ -33743,6 +39921,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RetryAttempts_1hash(JNIEnv
        LDKRetryAttempts o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        int64_t ret_val = RetryAttempts_hash(&o_conv);
        return ret_val;
 }
@@ -33756,6 +39935,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentError_1free(JNIEnv *env
        PaymentError_free(this_ptr_conv);
 }
 
+static inline uint64_t PaymentError_clone_ptr(LDKPaymentError *NONNULL_PTR arg) {
+       LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError");
+       *ret_copy = PaymentError_clone(arg);
+uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKPaymentError* arg_conv = (LDKPaymentError*)arg;
+       int64_t ret_val = PaymentError_clone_ptr(arg_conv);
+       return ret_val;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentError_1clone(JNIEnv *env, jclass clz, int64_t orig) {
        LDKPaymentError* orig_conv = (LDKPaymentError*)orig;
        LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError");
@@ -33776,6 +39967,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentError_1routing(JNIEn
        LDKLightningError a_conv;
        a_conv.inner = (void*)(a & (~1));
        a_conv.is_owned = (a & 1) || (a == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
        a_conv = LightningError_clone(&a_conv);
        LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError");
        *ret_copy = PaymentError_routing(a_conv);
@@ -33812,6 +40004,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1new(JNIEnv *e
        LDKLockableScore scorer_conv;
        scorer_conv.inner = (void*)(scorer & (~1));
        scorer_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(scorer_conv);
        void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
        CHECK_ACCESS(logger_ptr);
        LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
@@ -33829,11 +40022,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1new(JNIEnv *e
        LDKRetryAttempts retry_attempts_conv;
        retry_attempts_conv.inner = (void*)(retry_attempts & (~1));
        retry_attempts_conv.is_owned = (retry_attempts & 1) || (retry_attempts == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(retry_attempts_conv);
        retry_attempts_conv = RetryAttempts_clone(&retry_attempts_conv);
        LDKInvoicePayer ret_var = InvoicePayer_new(payer_conv, router_conv, &scorer_conv, logger_conv, event_handler_conv, retry_attempts_conv);
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -33845,9 +40040,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1pay_1invoice(
        LDKInvoicePayer this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKInvoice invoice_conv;
        invoice_conv.inner = (void*)(invoice & (~1));
        invoice_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_conv);
        LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
        *ret_conv = InvoicePayer_pay_invoice(&this_arg_conv, &invoice_conv);
        return (uint64_t)ret_conv;
@@ -33857,9 +40054,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1pay_1zero_1va
        LDKInvoicePayer this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKInvoice invoice_conv;
        invoice_conv.inner = (void*)(invoice & (~1));
        invoice_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_conv);
        LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
        *ret_conv = InvoicePayer_pay_zero_value_invoice(&this_arg_conv, &invoice_conv, amount_msats);
        return (uint64_t)ret_conv;
@@ -33869,6 +40068,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1remove_1cached_1
        LDKInvoicePayer this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        unsigned char payment_hash_arr[32];
        CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
        (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_arr);
@@ -33880,6 +40080,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1as_1EventHand
        LDKInvoicePayer this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKEventHandler* ret_ret = MALLOC(sizeof(LDKEventHandler), "LDKEventHandler");
        *ret_ret = InvoicePayer_as_EventHandler(&this_arg_conv);
        return (uint64_t)ret_ret;
@@ -33889,6 +40090,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1chan
        LDKChannelManager channelmanager_conv;
        channelmanager_conv.inner = (void*)(channelmanager & (~1));
        channelmanager_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv);
        void* keys_manager_ptr = (void*)(((uint64_t)keys_manager) & ~1);
        CHECK_ACCESS(keys_manager_ptr);
        LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr);
@@ -33911,6 +40113,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DefaultRouter_1free(JNIEnv *en
        LDKDefaultRouter this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
        DefaultRouter_free(this_obj_conv);
 }
 
@@ -33918,6 +40121,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DefaultRouter_1new(JNIEnv *
        LDKNetworkGraph network_graph_conv;
        network_graph_conv.inner = (void*)(network_graph & (~1));
        network_graph_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv);
        void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
        CHECK_ACCESS(logger_ptr);
        LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
@@ -33929,6 +40133,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DefaultRouter_1new(JNIEnv *
        uint64_t ret_ref = 0;
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
        ret_ref = (uint64_t)ret_var.inner;
        if (ret_var.is_owned) {
                ret_ref |= 1;
@@ -33940,6 +40145,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DefaultRouter_1as_1Router(J
        LDKDefaultRouter this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKRouter* ret_ret = MALLOC(sizeof(LDKRouter), "LDKRouter");
        *ret_ret = DefaultRouter_as_Router(&this_arg_conv);
        return (uint64_t)ret_ret;
@@ -33949,6 +40155,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1Payer(J
        LDKChannelManager this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
        this_arg_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
        LDKPayer* ret_ret = MALLOC(sizeof(LDKPayer), "LDKPayer");
        *ret_ret = ChannelManager_as_Payer(&this_arg_conv);
        return (uint64_t)ret_ret;
@@ -33979,6 +40186,7 @@ JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Invoice_1to_1str(JNIEnv *en
        LDKInvoice o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        LDKStr ret_str = Invoice_to_str(&o_conv);
        jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
        Str_free(ret_str);
@@ -33989,6 +40197,7 @@ JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1to_1str(J
        LDKSignedRawInvoice o_conv;
        o_conv.inner = (void*)(o & (~1));
        o_conv.is_owned = false;
+       CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
        LDKStr ret_str = SignedRawInvoice_to_str(&o_conv);
        jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
        Str_free(ret_str);