- return RoutingMessageHandler_free(this_ptr_conv);
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1write(JNIEnv * _env, jclass _b, jlong obj) {
- LDKAcceptChannel* obj_conv = (LDKAcceptChannel*)obj;
- LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
- *ret = AcceptChannel_write(obj_conv);
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1read(JNIEnv * _env, jclass _b, jlong ser) {
- LDKu8slice ser_conv = *(LDKu8slice*)ser;
- FREE((void*)ser);
- LDKAcceptChannel* ret = MALLOC(sizeof(LDKAcceptChannel), "LDKAcceptChannel");
- *ret = AcceptChannel_read(ser_conv);
- assert(!ret->_underlying_ref);
- ret->_underlying_ref = true;
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1write(JNIEnv * _env, jclass _b, jlong obj) {
- LDKAnnouncementSignatures* obj_conv = (LDKAnnouncementSignatures*)obj;
- LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
- *ret = AnnouncementSignatures_write(obj_conv);
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1read(JNIEnv * _env, jclass _b, jlong ser) {
- LDKu8slice ser_conv = *(LDKu8slice*)ser;
- FREE((void*)ser);
- LDKAnnouncementSignatures* ret = MALLOC(sizeof(LDKAnnouncementSignatures), "LDKAnnouncementSignatures");
- *ret = AnnouncementSignatures_read(ser_conv);
- assert(!ret->_underlying_ref);
- ret->_underlying_ref = true;
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1write(JNIEnv * _env, jclass _b, jlong obj) {
- LDKChannelReestablish* obj_conv = (LDKChannelReestablish*)obj;
- LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
- *ret = ChannelReestablish_write(obj_conv);
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1read(JNIEnv * _env, jclass _b, jlong ser) {
- LDKu8slice ser_conv = *(LDKu8slice*)ser;
- FREE((void*)ser);
- LDKChannelReestablish* ret = MALLOC(sizeof(LDKChannelReestablish), "LDKChannelReestablish");
- *ret = ChannelReestablish_read(ser_conv);
- assert(!ret->_underlying_ref);
- ret->_underlying_ref = true;
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1write(JNIEnv * _env, jclass _b, jlong obj) {
- LDKClosingSigned* obj_conv = (LDKClosingSigned*)obj;
- LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
- *ret = ClosingSigned_write(obj_conv);
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1read(JNIEnv * _env, jclass _b, jlong ser) {
- LDKu8slice ser_conv = *(LDKu8slice*)ser;
- FREE((void*)ser);
- LDKClosingSigned* ret = MALLOC(sizeof(LDKClosingSigned), "LDKClosingSigned");
- *ret = ClosingSigned_read(ser_conv);
- assert(!ret->_underlying_ref);
- ret->_underlying_ref = true;
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1write(JNIEnv * _env, jclass _b, jlong obj) {
- LDKCommitmentSigned* obj_conv = (LDKCommitmentSigned*)obj;
- LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
- *ret = CommitmentSigned_write(obj_conv);
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1read(JNIEnv * _env, jclass _b, jlong ser) {
- LDKu8slice ser_conv = *(LDKu8slice*)ser;
- FREE((void*)ser);
- LDKCommitmentSigned* ret = MALLOC(sizeof(LDKCommitmentSigned), "LDKCommitmentSigned");
- *ret = CommitmentSigned_read(ser_conv);
- assert(!ret->_underlying_ref);
- ret->_underlying_ref = true;
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingCreated_1write(JNIEnv * _env, jclass _b, jlong obj) {
- LDKFundingCreated* obj_conv = (LDKFundingCreated*)obj;
- LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
- *ret = FundingCreated_write(obj_conv);
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingCreated_1read(JNIEnv * _env, jclass _b, jlong ser) {
- LDKu8slice ser_conv = *(LDKu8slice*)ser;
- FREE((void*)ser);
- LDKFundingCreated* ret = MALLOC(sizeof(LDKFundingCreated), "LDKFundingCreated");
- *ret = FundingCreated_read(ser_conv);
- assert(!ret->_underlying_ref);
- ret->_underlying_ref = true;
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingSigned_1write(JNIEnv * _env, jclass _b, jlong obj) {
- LDKFundingSigned* obj_conv = (LDKFundingSigned*)obj;
- LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
- *ret = FundingSigned_write(obj_conv);
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingSigned_1read(JNIEnv * _env, jclass _b, jlong ser) {
- LDKu8slice ser_conv = *(LDKu8slice*)ser;
- FREE((void*)ser);
- LDKFundingSigned* ret = MALLOC(sizeof(LDKFundingSigned), "LDKFundingSigned");
- *ret = FundingSigned_read(ser_conv);
- assert(!ret->_underlying_ref);
- ret->_underlying_ref = true;
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingLocked_1write(JNIEnv * _env, jclass _b, jlong obj) {
- LDKFundingLocked* obj_conv = (LDKFundingLocked*)obj;
- LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
- *ret = FundingLocked_write(obj_conv);
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingLocked_1read(JNIEnv * _env, jclass _b, jlong ser) {
- LDKu8slice ser_conv = *(LDKu8slice*)ser;
- FREE((void*)ser);
- LDKFundingLocked* ret = MALLOC(sizeof(LDKFundingLocked), "LDKFundingLocked");
- *ret = FundingLocked_read(ser_conv);
- assert(!ret->_underlying_ref);
- ret->_underlying_ref = true;
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Init_1write(JNIEnv * _env, jclass _b, jlong obj) {
- LDKInit* obj_conv = (LDKInit*)obj;
- LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
- *ret = Init_write(obj_conv);
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Init_1read(JNIEnv * _env, jclass _b, jlong ser) {
- LDKu8slice ser_conv = *(LDKu8slice*)ser;
- FREE((void*)ser);
- LDKInit* ret = MALLOC(sizeof(LDKInit), "LDKInit");
- *ret = Init_read(ser_conv);
- assert(!ret->_underlying_ref);
- ret->_underlying_ref = true;
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1write(JNIEnv * _env, jclass _b, jlong obj) {
- LDKOpenChannel* obj_conv = (LDKOpenChannel*)obj;
- LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
- *ret = OpenChannel_write(obj_conv);
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1read(JNIEnv * _env, jclass _b, jlong ser) {
- LDKu8slice ser_conv = *(LDKu8slice*)ser;
- FREE((void*)ser);
- LDKOpenChannel* ret = MALLOC(sizeof(LDKOpenChannel), "LDKOpenChannel");
- *ret = OpenChannel_read(ser_conv);
- assert(!ret->_underlying_ref);
- ret->_underlying_ref = true;
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1write(JNIEnv * _env, jclass _b, jlong obj) {
- LDKRevokeAndACK* obj_conv = (LDKRevokeAndACK*)obj;
- LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
- *ret = RevokeAndACK_write(obj_conv);
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1read(JNIEnv * _env, jclass _b, jlong ser) {
- LDKu8slice ser_conv = *(LDKu8slice*)ser;
- FREE((void*)ser);
- LDKRevokeAndACK* ret = MALLOC(sizeof(LDKRevokeAndACK), "LDKRevokeAndACK");
- *ret = RevokeAndACK_read(ser_conv);
- assert(!ret->_underlying_ref);
- ret->_underlying_ref = true;
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Shutdown_1write(JNIEnv * _env, jclass _b, jlong obj) {
- LDKShutdown* obj_conv = (LDKShutdown*)obj;
- LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
- *ret = Shutdown_write(obj_conv);
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Shutdown_1read(JNIEnv * _env, jclass _b, jlong ser) {
- LDKu8slice ser_conv = *(LDKu8slice*)ser;
- FREE((void*)ser);
- LDKShutdown* ret = MALLOC(sizeof(LDKShutdown), "LDKShutdown");
- *ret = Shutdown_read(ser_conv);
- assert(!ret->_underlying_ref);
- ret->_underlying_ref = true;
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1write(JNIEnv * _env, jclass _b, jlong obj) {
- LDKUpdateFailHTLC* obj_conv = (LDKUpdateFailHTLC*)obj;
- LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
- *ret = UpdateFailHTLC_write(obj_conv);
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1read(JNIEnv * _env, jclass _b, jlong ser) {
- LDKu8slice ser_conv = *(LDKu8slice*)ser;
- FREE((void*)ser);
- LDKUpdateFailHTLC* ret = MALLOC(sizeof(LDKUpdateFailHTLC), "LDKUpdateFailHTLC");
- *ret = UpdateFailHTLC_read(ser_conv);
- assert(!ret->_underlying_ref);
- ret->_underlying_ref = true;
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1write(JNIEnv * _env, jclass _b, jlong obj) {
- LDKUpdateFailMalformedHTLC* obj_conv = (LDKUpdateFailMalformedHTLC*)obj;
- LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
- *ret = UpdateFailMalformedHTLC_write(obj_conv);
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1read(JNIEnv * _env, jclass _b, jlong ser) {
- LDKu8slice ser_conv = *(LDKu8slice*)ser;
- FREE((void*)ser);
- LDKUpdateFailMalformedHTLC* ret = MALLOC(sizeof(LDKUpdateFailMalformedHTLC), "LDKUpdateFailMalformedHTLC");
- *ret = UpdateFailMalformedHTLC_read(ser_conv);
- assert(!ret->_underlying_ref);
- ret->_underlying_ref = true;
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFee_1write(JNIEnv * _env, jclass _b, jlong obj) {
- LDKUpdateFee* obj_conv = (LDKUpdateFee*)obj;
- LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
- *ret = UpdateFee_write(obj_conv);
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFee_1read(JNIEnv * _env, jclass _b, jlong ser) {
- LDKu8slice ser_conv = *(LDKu8slice*)ser;
- FREE((void*)ser);
- LDKUpdateFee* ret = MALLOC(sizeof(LDKUpdateFee), "LDKUpdateFee");
- *ret = UpdateFee_read(ser_conv);
- assert(!ret->_underlying_ref);
- ret->_underlying_ref = true;
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1write(JNIEnv * _env, jclass _b, jlong obj) {
- LDKUpdateFulfillHTLC* obj_conv = (LDKUpdateFulfillHTLC*)obj;
- LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
- *ret = UpdateFulfillHTLC_write(obj_conv);
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1read(JNIEnv * _env, jclass _b, jlong ser) {
- LDKu8slice ser_conv = *(LDKu8slice*)ser;
- FREE((void*)ser);
- LDKUpdateFulfillHTLC* ret = MALLOC(sizeof(LDKUpdateFulfillHTLC), "LDKUpdateFulfillHTLC");
- *ret = UpdateFulfillHTLC_read(ser_conv);
- assert(!ret->_underlying_ref);
- ret->_underlying_ref = true;
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1write(JNIEnv * _env, jclass _b, jlong obj) {
- LDKUpdateAddHTLC* obj_conv = (LDKUpdateAddHTLC*)obj;
- LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
- *ret = UpdateAddHTLC_write(obj_conv);
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1read(JNIEnv * _env, jclass _b, jlong ser) {
- LDKu8slice ser_conv = *(LDKu8slice*)ser;
- FREE((void*)ser);
- LDKUpdateAddHTLC* ret = MALLOC(sizeof(LDKUpdateAddHTLC), "LDKUpdateAddHTLC");
- *ret = UpdateAddHTLC_read(ser_conv);
- assert(!ret->_underlying_ref);
- ret->_underlying_ref = true;
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Ping_1write(JNIEnv * _env, jclass _b, jlong obj) {
- LDKPing* obj_conv = (LDKPing*)obj;
- LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
- *ret = Ping_write(obj_conv);
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Ping_1read(JNIEnv * _env, jclass _b, jlong ser) {
- LDKu8slice ser_conv = *(LDKu8slice*)ser;
- FREE((void*)ser);
- LDKPing* ret = MALLOC(sizeof(LDKPing), "LDKPing");
- *ret = Ping_read(ser_conv);
- assert(!ret->_underlying_ref);
- ret->_underlying_ref = true;
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Pong_1write(JNIEnv * _env, jclass _b, jlong obj) {
- LDKPong* obj_conv = (LDKPong*)obj;
- LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
- *ret = Pong_write(obj_conv);
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Pong_1read(JNIEnv * _env, jclass _b, jlong ser) {
- LDKu8slice ser_conv = *(LDKu8slice*)ser;
- FREE((void*)ser);
- LDKPong* ret = MALLOC(sizeof(LDKPong), "LDKPong");
- *ret = Pong_read(ser_conv);
- assert(!ret->_underlying_ref);
- ret->_underlying_ref = true;
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1write(JNIEnv * _env, jclass _b, jlong obj) {
- LDKUnsignedChannelAnnouncement* obj_conv = (LDKUnsignedChannelAnnouncement*)obj;
- LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
- *ret = UnsignedChannelAnnouncement_write(obj_conv);
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1read(JNIEnv * _env, jclass _b, jlong ser) {
- LDKu8slice ser_conv = *(LDKu8slice*)ser;
- FREE((void*)ser);
- LDKUnsignedChannelAnnouncement* ret = MALLOC(sizeof(LDKUnsignedChannelAnnouncement), "LDKUnsignedChannelAnnouncement");
- *ret = UnsignedChannelAnnouncement_read(ser_conv);
- assert(!ret->_underlying_ref);
- ret->_underlying_ref = true;
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1write(JNIEnv * _env, jclass _b, jlong obj) {
- LDKChannelAnnouncement* obj_conv = (LDKChannelAnnouncement*)obj;
- LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
- *ret = ChannelAnnouncement_write(obj_conv);
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1read(JNIEnv * _env, jclass _b, jlong ser) {
- LDKu8slice ser_conv = *(LDKu8slice*)ser;
- FREE((void*)ser);
- LDKChannelAnnouncement* ret = MALLOC(sizeof(LDKChannelAnnouncement), "LDKChannelAnnouncement");
- *ret = ChannelAnnouncement_read(ser_conv);
- assert(!ret->_underlying_ref);
- ret->_underlying_ref = true;
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1write(JNIEnv * _env, jclass _b, jlong obj) {
- LDKUnsignedChannelUpdate* obj_conv = (LDKUnsignedChannelUpdate*)obj;
- LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
- *ret = UnsignedChannelUpdate_write(obj_conv);
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1read(JNIEnv * _env, jclass _b, jlong ser) {
- LDKu8slice ser_conv = *(LDKu8slice*)ser;
- FREE((void*)ser);
- LDKUnsignedChannelUpdate* ret = MALLOC(sizeof(LDKUnsignedChannelUpdate), "LDKUnsignedChannelUpdate");
- *ret = UnsignedChannelUpdate_read(ser_conv);
- assert(!ret->_underlying_ref);
- ret->_underlying_ref = true;
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1write(JNIEnv * _env, jclass _b, jlong obj) {
- LDKChannelUpdate* obj_conv = (LDKChannelUpdate*)obj;
- LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
- *ret = ChannelUpdate_write(obj_conv);
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1read(JNIEnv * _env, jclass _b, jlong ser) {
- LDKu8slice ser_conv = *(LDKu8slice*)ser;
- FREE((void*)ser);
- LDKChannelUpdate* ret = MALLOC(sizeof(LDKChannelUpdate), "LDKChannelUpdate");
- *ret = ChannelUpdate_read(ser_conv);
- assert(!ret->_underlying_ref);
- ret->_underlying_ref = true;
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1write(JNIEnv * _env, jclass _b, jlong obj) {
- LDKErrorMessage* obj_conv = (LDKErrorMessage*)obj;
- LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
- *ret = ErrorMessage_write(obj_conv);
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1read(JNIEnv * _env, jclass _b, jlong ser) {
- LDKu8slice ser_conv = *(LDKu8slice*)ser;
- FREE((void*)ser);
- LDKErrorMessage* ret = MALLOC(sizeof(LDKErrorMessage), "LDKErrorMessage");
- *ret = ErrorMessage_read(ser_conv);
- assert(!ret->_underlying_ref);
- ret->_underlying_ref = true;
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1write(JNIEnv * _env, jclass _b, jlong obj) {
- LDKUnsignedNodeAnnouncement* obj_conv = (LDKUnsignedNodeAnnouncement*)obj;
- LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
- *ret = UnsignedNodeAnnouncement_write(obj_conv);
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1read(JNIEnv * _env, jclass _b, jlong ser) {
- LDKu8slice ser_conv = *(LDKu8slice*)ser;
- FREE((void*)ser);
- LDKUnsignedNodeAnnouncement* ret = MALLOC(sizeof(LDKUnsignedNodeAnnouncement), "LDKUnsignedNodeAnnouncement");
- *ret = UnsignedNodeAnnouncement_read(ser_conv);
- assert(!ret->_underlying_ref);
- ret->_underlying_ref = true;
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1write(JNIEnv * _env, jclass _b, jlong obj) {
- LDKNodeAnnouncement* obj_conv = (LDKNodeAnnouncement*)obj;
- LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
- *ret = NodeAnnouncement_write(obj_conv);
- return (long)ret;
+ RoutingMessageHandler_free(this_ptr_conv);
+}
+
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1write(JNIEnv * _env, jclass _b, jlong obj) {
+ LDKAcceptChannel obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z arg_var = AcceptChannel_write(&obj_conv);
+ jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
+ (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
+ CVec_u8Z_free(arg_var);
+ return arg_arr;
+}
+
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
+ ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+ LDKAcceptChannel ret_var = AcceptChannel_read(ser_ref);
+ CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ long ret_ref = (long)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0);
+ return ret_ref;
+}
+
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1write(JNIEnv * _env, jclass _b, jlong obj) {
+ LDKAnnouncementSignatures obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z arg_var = AnnouncementSignatures_write(&obj_conv);
+ jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
+ (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
+ CVec_u8Z_free(arg_var);
+ return arg_arr;
+}
+
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
+ ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+ LDKAnnouncementSignatures ret_var = AnnouncementSignatures_read(ser_ref);
+ CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ long ret_ref = (long)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0);
+ return ret_ref;
+}
+
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1write(JNIEnv * _env, jclass _b, jlong obj) {
+ LDKChannelReestablish obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z arg_var = ChannelReestablish_write(&obj_conv);
+ jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
+ (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
+ CVec_u8Z_free(arg_var);
+ return arg_arr;
+}
+
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
+ ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+ LDKChannelReestablish ret_var = ChannelReestablish_read(ser_ref);
+ CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ long ret_ref = (long)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0);
+ return ret_ref;
+}
+
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1write(JNIEnv * _env, jclass _b, jlong obj) {
+ LDKClosingSigned obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z arg_var = ClosingSigned_write(&obj_conv);
+ jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
+ (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
+ CVec_u8Z_free(arg_var);
+ return arg_arr;
+}
+
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
+ ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+ LDKClosingSigned ret_var = ClosingSigned_read(ser_ref);
+ CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ long ret_ref = (long)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0);
+ return ret_ref;
+}
+
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1write(JNIEnv * _env, jclass _b, jlong obj) {
+ LDKCommitmentSigned obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z arg_var = CommitmentSigned_write(&obj_conv);
+ jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
+ (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
+ CVec_u8Z_free(arg_var);
+ return arg_arr;
+}
+
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
+ ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+ LDKCommitmentSigned ret_var = CommitmentSigned_read(ser_ref);
+ CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ long ret_ref = (long)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0);
+ return ret_ref;
+}
+
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1write(JNIEnv * _env, jclass _b, jlong obj) {
+ LDKFundingCreated obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z arg_var = FundingCreated_write(&obj_conv);
+ jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
+ (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
+ CVec_u8Z_free(arg_var);
+ return arg_arr;
+}
+
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingCreated_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
+ ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+ LDKFundingCreated ret_var = FundingCreated_read(ser_ref);
+ CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ long ret_ref = (long)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0);
+ return ret_ref;
+}
+
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingSigned_1write(JNIEnv * _env, jclass _b, jlong obj) {
+ LDKFundingSigned obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z arg_var = FundingSigned_write(&obj_conv);
+ jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
+ (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
+ CVec_u8Z_free(arg_var);
+ return arg_arr;
+}
+
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingSigned_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
+ ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+ LDKFundingSigned ret_var = FundingSigned_read(ser_ref);
+ CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ long ret_ref = (long)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0);
+ return ret_ref;
+}
+
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingLocked_1write(JNIEnv * _env, jclass _b, jlong obj) {
+ LDKFundingLocked obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z arg_var = FundingLocked_write(&obj_conv);
+ jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
+ (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
+ CVec_u8Z_free(arg_var);
+ return arg_arr;
+}
+
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingLocked_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
+ ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+ LDKFundingLocked ret_var = FundingLocked_read(ser_ref);
+ CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ long ret_ref = (long)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0);
+ return ret_ref;
+}
+
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Init_1write(JNIEnv * _env, jclass _b, jlong obj) {
+ LDKInit obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z arg_var = Init_write(&obj_conv);
+ jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
+ (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
+ CVec_u8Z_free(arg_var);
+ return arg_arr;
+}
+
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Init_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
+ ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+ LDKInit ret_var = Init_read(ser_ref);
+ CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ long ret_ref = (long)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0);
+ return ret_ref;
+}
+
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1write(JNIEnv * _env, jclass _b, jlong obj) {
+ LDKOpenChannel obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z arg_var = OpenChannel_write(&obj_conv);
+ jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
+ (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
+ CVec_u8Z_free(arg_var);
+ return arg_arr;
+}
+
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
+ ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+ LDKOpenChannel ret_var = OpenChannel_read(ser_ref);
+ CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ long ret_ref = (long)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0);
+ return ret_ref;
+}
+
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1write(JNIEnv * _env, jclass _b, jlong obj) {
+ LDKRevokeAndACK obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z arg_var = RevokeAndACK_write(&obj_conv);
+ jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
+ (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
+ CVec_u8Z_free(arg_var);
+ return arg_arr;
+}
+
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
+ ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+ LDKRevokeAndACK ret_var = RevokeAndACK_read(ser_ref);
+ CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ long ret_ref = (long)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0);
+ return ret_ref;
+}
+
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Shutdown_1write(JNIEnv * _env, jclass _b, jlong obj) {
+ LDKShutdown obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z arg_var = Shutdown_write(&obj_conv);
+ jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
+ (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
+ CVec_u8Z_free(arg_var);
+ return arg_arr;
+}
+
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Shutdown_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
+ ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+ LDKShutdown ret_var = Shutdown_read(ser_ref);
+ CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ long ret_ref = (long)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0);
+ return ret_ref;
+}
+
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1write(JNIEnv * _env, jclass _b, jlong obj) {
+ LDKUpdateFailHTLC obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z arg_var = UpdateFailHTLC_write(&obj_conv);
+ jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
+ (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
+ CVec_u8Z_free(arg_var);
+ return arg_arr;
+}
+
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
+ ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+ LDKUpdateFailHTLC ret_var = UpdateFailHTLC_read(ser_ref);
+ CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ long ret_ref = (long)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0);
+ return ret_ref;
+}
+
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1write(JNIEnv * _env, jclass _b, jlong obj) {
+ LDKUpdateFailMalformedHTLC obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z arg_var = UpdateFailMalformedHTLC_write(&obj_conv);
+ jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
+ (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
+ CVec_u8Z_free(arg_var);
+ return arg_arr;
+}
+
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
+ ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+ LDKUpdateFailMalformedHTLC ret_var = UpdateFailMalformedHTLC_read(ser_ref);
+ CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ long ret_ref = (long)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0);
+ return ret_ref;
+}
+
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFee_1write(JNIEnv * _env, jclass _b, jlong obj) {
+ LDKUpdateFee obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z arg_var = UpdateFee_write(&obj_conv);
+ jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
+ (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
+ CVec_u8Z_free(arg_var);
+ return arg_arr;
+}
+
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFee_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
+ ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+ LDKUpdateFee ret_var = UpdateFee_read(ser_ref);
+ CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ long ret_ref = (long)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0);
+ return ret_ref;
+}
+
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1write(JNIEnv * _env, jclass _b, jlong obj) {
+ LDKUpdateFulfillHTLC obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z arg_var = UpdateFulfillHTLC_write(&obj_conv);
+ jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
+ (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
+ CVec_u8Z_free(arg_var);
+ return arg_arr;
+}
+
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
+ ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+ LDKUpdateFulfillHTLC ret_var = UpdateFulfillHTLC_read(ser_ref);
+ CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ long ret_ref = (long)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0);
+ return ret_ref;
+}
+
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1write(JNIEnv * _env, jclass _b, jlong obj) {
+ LDKUpdateAddHTLC obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z arg_var = UpdateAddHTLC_write(&obj_conv);
+ jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
+ (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
+ CVec_u8Z_free(arg_var);
+ return arg_arr;
+}
+
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
+ ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+ LDKUpdateAddHTLC ret_var = UpdateAddHTLC_read(ser_ref);
+ CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ long ret_ref = (long)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0);
+ return ret_ref;
+}
+
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Ping_1write(JNIEnv * _env, jclass _b, jlong obj) {
+ LDKPing obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z arg_var = Ping_write(&obj_conv);
+ jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
+ (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
+ CVec_u8Z_free(arg_var);
+ return arg_arr;
+}
+
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Ping_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
+ ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+ LDKPing ret_var = Ping_read(ser_ref);
+ CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ long ret_ref = (long)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0);
+ return ret_ref;
+}
+
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Pong_1write(JNIEnv * _env, jclass _b, jlong obj) {
+ LDKPong obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z arg_var = Pong_write(&obj_conv);
+ jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
+ (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
+ CVec_u8Z_free(arg_var);
+ return arg_arr;
+}
+
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Pong_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
+ ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+ LDKPong ret_var = Pong_read(ser_ref);
+ CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ long ret_ref = (long)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0);
+ return ret_ref;
+}
+
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1write(JNIEnv * _env, jclass _b, jlong obj) {
+ LDKUnsignedChannelAnnouncement obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z arg_var = UnsignedChannelAnnouncement_write(&obj_conv);
+ jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
+ (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
+ CVec_u8Z_free(arg_var);
+ return arg_arr;
+}
+
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
+ ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+ LDKUnsignedChannelAnnouncement ret_var = UnsignedChannelAnnouncement_read(ser_ref);
+ CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ long ret_ref = (long)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0);
+ return ret_ref;
+}
+
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1write(JNIEnv * _env, jclass _b, jlong obj) {
+ LDKChannelAnnouncement obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z arg_var = ChannelAnnouncement_write(&obj_conv);
+ jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
+ (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
+ CVec_u8Z_free(arg_var);
+ return arg_arr;
+}
+
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
+ ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+ LDKChannelAnnouncement ret_var = ChannelAnnouncement_read(ser_ref);
+ CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ long ret_ref = (long)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0);
+ return ret_ref;
+}
+
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1write(JNIEnv * _env, jclass _b, jlong obj) {
+ LDKUnsignedChannelUpdate obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z arg_var = UnsignedChannelUpdate_write(&obj_conv);
+ jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
+ (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
+ CVec_u8Z_free(arg_var);
+ return arg_arr;
+}
+
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
+ ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+ LDKUnsignedChannelUpdate ret_var = UnsignedChannelUpdate_read(ser_ref);
+ CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ long ret_ref = (long)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0);
+ return ret_ref;
+}
+
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1write(JNIEnv * _env, jclass _b, jlong obj) {
+ LDKChannelUpdate obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z arg_var = ChannelUpdate_write(&obj_conv);
+ jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
+ (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
+ CVec_u8Z_free(arg_var);
+ return arg_arr;
+}
+
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
+ ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+ LDKChannelUpdate ret_var = ChannelUpdate_read(ser_ref);
+ CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ long ret_ref = (long)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0);
+ return ret_ref;
+}
+
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1write(JNIEnv * _env, jclass _b, jlong obj) {
+ LDKErrorMessage obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z arg_var = ErrorMessage_write(&obj_conv);
+ jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
+ (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
+ CVec_u8Z_free(arg_var);
+ return arg_arr;
+}
+
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
+ ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+ LDKErrorMessage ret_var = ErrorMessage_read(ser_ref);
+ CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ long ret_ref = (long)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0);
+ return ret_ref;
+}
+
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1write(JNIEnv * _env, jclass _b, jlong obj) {
+ LDKUnsignedNodeAnnouncement obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z arg_var = UnsignedNodeAnnouncement_write(&obj_conv);
+ jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
+ (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
+ CVec_u8Z_free(arg_var);
+ return arg_arr;
+}
+
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
+ ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+ LDKUnsignedNodeAnnouncement ret_var = UnsignedNodeAnnouncement_read(ser_ref);
+ CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ long ret_ref = (long)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0);
+ return ret_ref;
+}
+
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1write(JNIEnv * _env, jclass _b, jlong obj) {
+ LDKNodeAnnouncement obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z arg_var = NodeAnnouncement_write(&obj_conv);
+ jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
+ (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
+ CVec_u8Z_free(arg_var);
+ return arg_arr;
+}
+
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
+ ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+ LDKNodeAnnouncement ret_var = NodeAnnouncement_read(ser_ref);
+ CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ long ret_ref = (long)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0);
+ return ret_ref;
+}
+
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
+ ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+ LDKQueryShortChannelIds ret_var = QueryShortChannelIds_read(ser_ref);
+ CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ long ret_ref = (long)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0);
+ return ret_ref;
+}
+
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1write(JNIEnv * _env, jclass _b, jlong obj) {
+ LDKQueryShortChannelIds obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z arg_var = QueryShortChannelIds_write(&obj_conv);
+ jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
+ (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
+ CVec_u8Z_free(arg_var);
+ return arg_arr;
+}
+
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
+ ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+ LDKReplyShortChannelIdsEnd ret_var = ReplyShortChannelIdsEnd_read(ser_ref);
+ CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ long ret_ref = (long)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0);
+ return ret_ref;
+}
+
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1write(JNIEnv * _env, jclass _b, jlong obj) {
+ LDKReplyShortChannelIdsEnd obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z arg_var = ReplyShortChannelIdsEnd_write(&obj_conv);
+ jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
+ (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
+ CVec_u8Z_free(arg_var);
+ return arg_arr;
+}
+
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
+ ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+ LDKQueryChannelRange ret_var = QueryChannelRange_read(ser_ref);
+ CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ long ret_ref = (long)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0);
+ return ret_ref;
+}
+
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1write(JNIEnv * _env, jclass _b, jlong obj) {
+ LDKQueryChannelRange obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z arg_var = QueryChannelRange_write(&obj_conv);
+ jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
+ (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
+ CVec_u8Z_free(arg_var);
+ return arg_arr;
+}
+
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
+ ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+ LDKReplyChannelRange ret_var = ReplyChannelRange_read(ser_ref);
+ CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ long ret_ref = (long)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0);
+ return ret_ref;
+}
+
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1write(JNIEnv * _env, jclass _b, jlong obj) {
+ LDKReplyChannelRange obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z arg_var = ReplyChannelRange_write(&obj_conv);
+ jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
+ (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
+ CVec_u8Z_free(arg_var);
+ return arg_arr;
+}
+
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
+ ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+ LDKGossipTimestampFilter ret_var = GossipTimestampFilter_read(ser_ref);
+ CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ long ret_ref = (long)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0);
+ return ret_ref;