+void __attribute__((visibility("default"))) TS_DirectionalChannelInfo_set_fees(uint32_t this_ptr, uint32_t val) {
+ 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);
+}
+
+uint32_t __attribute__((visibility("default"))) TS_DirectionalChannelInfo_get_last_update_message(uint32_t this_ptr) {
+ 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;
+ }
+ }
+ return ret_ref;
+}
+
+void __attribute__((visibility("default"))) TS_DirectionalChannelInfo_set_last_update_message(uint32_t this_ptr, uint32_t val) {
+ 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);
+}
+
+uint32_t __attribute__((visibility("default"))) TS_DirectionalChannelInfo_new(int32_t last_update_arg, jboolean enabled_arg, int16_t cltv_expiry_delta_arg, int64_t htlc_minimum_msat_arg, uint32_t htlc_maximum_msat_arg, uint32_t fees_arg, uint32_t last_update_message_arg) {
+ void* htlc_maximum_msat_arg_ptr = (void*)(((uint64_t)htlc_maximum_msat_arg) & ~1);
+ CHECK_ACCESS(htlc_maximum_msat_arg_ptr);
+ LDKCOption_u64Z htlc_maximum_msat_arg_conv = *(LDKCOption_u64Z*)(htlc_maximum_msat_arg_ptr);
+ htlc_maximum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)htlc_maximum_msat_arg) & ~1));
+ 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;
+ }
+ 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;
+}
+int64_t __attribute__((visibility("default"))) TS_DirectionalChannelInfo_clone_ptr(uint32_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;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_DirectionalChannelInfo_clone(uint32_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;
+ }
+ return ret_ref;
+}
+
+int8_tArray __attribute__((visibility("default"))) TS_DirectionalChannelInfo_write(uint32_t obj) {
+ 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 = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_DirectionalChannelInfo_read(int8_tArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.datalen = *((uint32_t*)ser);
+ ser_ref.data = (int8_t*)(ser + 4);
+ LDKCResult_DirectionalChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DirectionalChannelInfoDecodeErrorZ), "LDKCResult_DirectionalChannelInfoDecodeErrorZ");
+ *ret_conv = DirectionalChannelInfo_read(ser_ref);
+ return (uint64_t)ret_conv;
+}
+
+void __attribute__((visibility("default"))) TS_ChannelInfo_free(uint32_t this_obj) {
+ 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);
+}
+
+uint32_t __attribute__((visibility("default"))) TS_ChannelInfo_get_features(uint32_t this_ptr) {
+ 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;
+ }
+ return ret_ref;
+}
+
+void __attribute__((visibility("default"))) TS_ChannelInfo_set_features(uint32_t this_ptr, uint32_t val) {
+ 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);
+}
+
+uint32_t __attribute__((visibility("default"))) TS_ChannelInfo_get_node_one(uint32_t this_ptr) {
+ 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;
+ }
+ return ret_ref;
+}
+
+void __attribute__((visibility("default"))) TS_ChannelInfo_set_node_one(uint32_t this_ptr, uint32_t val) {
+ 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);
+}
+
+uint32_t __attribute__((visibility("default"))) TS_ChannelInfo_get_one_to_two(uint32_t this_ptr) {
+ 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;
+ }
+ }
+ return ret_ref;
+}
+
+void __attribute__((visibility("default"))) TS_ChannelInfo_set_one_to_two(uint32_t this_ptr, uint32_t val) {
+ 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);
+}
+
+uint32_t __attribute__((visibility("default"))) TS_ChannelInfo_get_node_two(uint32_t this_ptr) {
+ 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;
+ }
+ return ret_ref;
+}
+
+void __attribute__((visibility("default"))) TS_ChannelInfo_set_node_two(uint32_t this_ptr, uint32_t val) {
+ 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);
+}
+
+uint32_t __attribute__((visibility("default"))) TS_ChannelInfo_get_two_to_one(uint32_t this_ptr) {
+ 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;
+ }
+ }
+ return ret_ref;
+}
+
+void __attribute__((visibility("default"))) TS_ChannelInfo_set_two_to_one(uint32_t this_ptr, uint32_t val) {
+ 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);
+}
+
+uint32_t __attribute__((visibility("default"))) TS_ChannelInfo_get_capacity_sats(uint32_t this_ptr) {
+ 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;
+ return ret_ref;
+}
+
+void __attribute__((visibility("default"))) TS_ChannelInfo_set_capacity_sats(uint32_t this_ptr, uint32_t val) {
+ 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);
+ val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)val) & ~1));
+ ChannelInfo_set_capacity_sats(&this_ptr_conv, val_conv);
+}
+
+uint32_t __attribute__((visibility("default"))) TS_ChannelInfo_get_announcement_message(uint32_t this_ptr) {
+ 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;
+ }
+ }
+ return ret_ref;
+}
+
+void __attribute__((visibility("default"))) TS_ChannelInfo_set_announcement_message(uint32_t this_ptr, uint32_t val) {
+ 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);
+}
+
+uint32_t __attribute__((visibility("default"))) TS_ChannelInfo_new(uint32_t features_arg, uint32_t node_one_arg, uint32_t one_to_two_arg, uint32_t node_two_arg, uint32_t two_to_one_arg, uint32_t capacity_sats_arg, uint32_t announcement_message_arg) {
+ 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);
+ LDKCOption_u64Z capacity_sats_arg_conv = *(LDKCOption_u64Z*)(capacity_sats_arg_ptr);
+ capacity_sats_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)capacity_sats_arg) & ~1));
+ 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;
+ }
+ 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;
+}
+int64_t __attribute__((visibility("default"))) TS_ChannelInfo_clone_ptr(uint32_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;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_ChannelInfo_clone(uint32_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;
+ }
+ return ret_ref;
+}
+
+int8_tArray __attribute__((visibility("default"))) TS_ChannelInfo_write(uint32_t obj) {
+ 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 = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_ChannelInfo_read(int8_tArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.datalen = *((uint32_t*)ser);
+ ser_ref.data = (int8_t*)(ser + 4);
+ LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ");
+ *ret_conv = ChannelInfo_read(ser_ref);
+ return (uint64_t)ret_conv;
+}
+
+void __attribute__((visibility("default"))) TS_RoutingFees_free(uint32_t this_obj) {
+ 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);
+}
+
+int32_t __attribute__((visibility("default"))) TS_RoutingFees_get_base_msat(uint32_t this_ptr) {
+ 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;
+}
+
+void __attribute__((visibility("default"))) TS_RoutingFees_set_base_msat(uint32_t this_ptr, int32_t val) {
+ 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);
+}
+
+int32_t __attribute__((visibility("default"))) TS_RoutingFees_get_proportional_millionths(uint32_t this_ptr) {
+ 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;
+}
+
+void __attribute__((visibility("default"))) TS_RoutingFees_set_proportional_millionths(uint32_t this_ptr, int32_t val) {
+ 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);
+}
+
+uint32_t __attribute__((visibility("default"))) TS_RoutingFees_new(int32_t base_msat_arg, int32_t proportional_millionths_arg) {
+ LDKRoutingFees ret_var = RoutingFees_new(base_msat_arg, proportional_millionths_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;
+}
+
+jboolean __attribute__((visibility("default"))) TS_RoutingFees_eq(uint32_t a, uint32_t b) {
+ 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;
+}
+int64_t __attribute__((visibility("default"))) TS_RoutingFees_clone_ptr(uint32_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;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_RoutingFees_clone(uint32_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;
+ }
+ return ret_ref;
+}
+
+int64_t __attribute__((visibility("default"))) TS_RoutingFees_hash(uint32_t o) {
+ 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;
+}
+
+int8_tArray __attribute__((visibility("default"))) TS_RoutingFees_write(uint32_t obj) {
+ 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 = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_RoutingFees_read(int8_tArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.datalen = *((uint32_t*)ser);
+ ser_ref.data = (int8_t*)(ser + 4);
+ LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ");
+ *ret_conv = RoutingFees_read(ser_ref);
+ return (uint64_t)ret_conv;
+}
+
+void __attribute__((visibility("default"))) TS_NodeAnnouncementInfo_free(uint32_t this_obj) {
+ 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);
+}
+
+uint32_t __attribute__((visibility("default"))) TS_NodeAnnouncementInfo_get_features(uint32_t this_ptr) {
+ 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;
+ }
+ return ret_ref;
+}
+
+void __attribute__((visibility("default"))) TS_NodeAnnouncementInfo_set_features(uint32_t this_ptr, uint32_t val) {
+ 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);
+}
+
+int32_t __attribute__((visibility("default"))) TS_NodeAnnouncementInfo_get_last_update(uint32_t this_ptr) {
+ 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;
+}
+
+void __attribute__((visibility("default"))) TS_NodeAnnouncementInfo_set_last_update(uint32_t this_ptr, int32_t val) {
+ 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);
+}
+
+int8_tArray __attribute__((visibility("default"))) TS_NodeAnnouncementInfo_get_rgb(uint32_t this_ptr) {
+ 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 = init_arr(3, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), *NodeAnnouncementInfo_get_rgb(&this_ptr_conv), 3);
+ return ret_arr;
+}
+
+void __attribute__((visibility("default"))) TS_NodeAnnouncementInfo_set_rgb(uint32_t this_ptr, int8_tArray val) {
+ 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(*((uint32_t*)val) == 3);
+ memcpy(val_ref.data, (uint8_t*)(val + 4), 3);
+ NodeAnnouncementInfo_set_rgb(&this_ptr_conv, val_ref);
+}
+
+int8_tArray __attribute__((visibility("default"))) TS_NodeAnnouncementInfo_get_alias(uint32_t this_ptr) {
+ 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 = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), *NodeAnnouncementInfo_get_alias(&this_ptr_conv), 32);
+ return ret_arr;
+}
+
+void __attribute__((visibility("default"))) TS_NodeAnnouncementInfo_set_alias(uint32_t this_ptr, int8_tArray val) {
+ 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(*((uint32_t*)val) == 32);
+ memcpy(val_ref.data, (uint8_t*)(val + 4), 32);
+ NodeAnnouncementInfo_set_alias(&this_ptr_conv, val_ref);
+}
+
+void __attribute__((visibility("default"))) TS_NodeAnnouncementInfo_set_addresses(uint32_t this_ptr, uint32_tArray val) {
+ 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 = *((uint32_t*)val);
+ if (val_constr.datalen > 0)
+ val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements");
+ else
+ val_constr.data = NULL;
+ uint32_t* val_vals = (uint32_t*)(val + 4);
+ for (size_t m = 0; m < val_constr.datalen; m++) {
+ uint32_t val_conv_12 = val_vals[m];
+ void* val_conv_12_ptr = (void*)(((uint64_t)val_conv_12) & ~1);
+ CHECK_ACCESS(val_conv_12_ptr);
+ LDKNetAddress val_conv_12_conv = *(LDKNetAddress*)(val_conv_12_ptr);
+ val_conv_12_conv = NetAddress_clone((LDKNetAddress*)(((uint64_t)val_conv_12) & ~1));
+ val_constr.data[m] = val_conv_12_conv;
+ }
+ NodeAnnouncementInfo_set_addresses(&this_ptr_conv, val_constr);
+}
+
+uint32_t __attribute__((visibility("default"))) TS_NodeAnnouncementInfo_get_announcement_message(uint32_t this_ptr) {
+ 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;
+ }
+ }
+ return ret_ref;
+}
+
+void __attribute__((visibility("default"))) TS_NodeAnnouncementInfo_set_announcement_message(uint32_t this_ptr, uint32_t val) {
+ 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);
+}
+
+uint32_t __attribute__((visibility("default"))) TS_NodeAnnouncementInfo_new(uint32_t features_arg, int32_t last_update_arg, int8_tArray rgb_arg, int8_tArray alias_arg, uint32_tArray addresses_arg, uint32_t announcement_message_arg) {
+ 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(*((uint32_t*)rgb_arg) == 3);
+ memcpy(rgb_arg_ref.data, (uint8_t*)(rgb_arg + 4), 3);
+ LDKThirtyTwoBytes alias_arg_ref;
+ CHECK(*((uint32_t*)alias_arg) == 32);
+ memcpy(alias_arg_ref.data, (uint8_t*)(alias_arg + 4), 32);
+ LDKCVec_NetAddressZ addresses_arg_constr;
+ addresses_arg_constr.datalen = *((uint32_t*)addresses_arg);
+ if (addresses_arg_constr.datalen > 0)
+ addresses_arg_constr.data = MALLOC(addresses_arg_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements");
+ else
+ addresses_arg_constr.data = NULL;
+ uint32_t* addresses_arg_vals = (uint32_t*)(addresses_arg + 4);
+ for (size_t m = 0; m < addresses_arg_constr.datalen; m++) {
+ uint32_t addresses_arg_conv_12 = addresses_arg_vals[m];
+ void* addresses_arg_conv_12_ptr = (void*)(((uint64_t)addresses_arg_conv_12) & ~1);
+ CHECK_ACCESS(addresses_arg_conv_12_ptr);
+ LDKNetAddress addresses_arg_conv_12_conv = *(LDKNetAddress*)(addresses_arg_conv_12_ptr);
+ addresses_arg_constr.data[m] = addresses_arg_conv_12_conv;
+ }
+ 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;
+ }
+ 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;
+}
+int64_t __attribute__((visibility("default"))) TS_NodeAnnouncementInfo_clone_ptr(uint32_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;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_NodeAnnouncementInfo_clone(uint32_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;
+ }
+ return ret_ref;
+}
+
+int8_tArray __attribute__((visibility("default"))) TS_NodeAnnouncementInfo_write(uint32_t obj) {
+ 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 = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_NodeAnnouncementInfo_read(int8_tArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.datalen = *((uint32_t*)ser);
+ ser_ref.data = (int8_t*)(ser + 4);
+ LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ");
+ *ret_conv = NodeAnnouncementInfo_read(ser_ref);
+ return (uint64_t)ret_conv;
+}
+
+void __attribute__((visibility("default"))) TS_NodeInfo_free(uint32_t this_obj) {
+ 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);
+}
+
+void __attribute__((visibility("default"))) TS_NodeInfo_set_channels(uint32_t this_ptr, int64_tArray val) {
+ 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 = *((uint32_t*)val);
+ if (val_constr.datalen > 0)
+ val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
+ else
+ val_constr.data = NULL;
+ int64_t* val_vals = (int64_t*)(val + 4);
+ for (size_t i = 0; i < val_constr.datalen; i++) {
+ int64_t val_conv_8 = val_vals[i];
+ val_constr.data[i] = val_conv_8;
+ }
+ NodeInfo_set_channels(&this_ptr_conv, val_constr);
+}
+
+uint32_t __attribute__((visibility("default"))) TS_NodeInfo_get_lowest_inbound_channel_fees(uint32_t this_ptr) {
+ 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;
+ }
+ }
+ return ret_ref;
+}
+
+void __attribute__((visibility("default"))) TS_NodeInfo_set_lowest_inbound_channel_fees(uint32_t this_ptr, uint32_t val) {
+ 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);
+}
+
+uint32_t __attribute__((visibility("default"))) TS_NodeInfo_get_announcement_info(uint32_t this_ptr) {
+ 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;
+ }
+ }
+ return ret_ref;
+}
+
+void __attribute__((visibility("default"))) TS_NodeInfo_set_announcement_info(uint32_t this_ptr, uint32_t val) {
+ 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);
+}
+
+uint32_t __attribute__((visibility("default"))) TS_NodeInfo_new(int64_tArray channels_arg, uint32_t lowest_inbound_channel_fees_arg, uint32_t announcement_info_arg) {
+ LDKCVec_u64Z channels_arg_constr;
+ channels_arg_constr.datalen = *((uint32_t*)channels_arg);
+ if (channels_arg_constr.datalen > 0)
+ channels_arg_constr.data = MALLOC(channels_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
+ else
+ channels_arg_constr.data = NULL;
+ int64_t* channels_arg_vals = (int64_t*)(channels_arg + 4);
+ for (size_t i = 0; i < channels_arg_constr.datalen; i++) {
+ int64_t channels_arg_conv_8 = channels_arg_vals[i];
+ channels_arg_constr.data[i] = channels_arg_conv_8;
+ }
+ 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;
+ }
+ 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;
+}
+int64_t __attribute__((visibility("default"))) TS_NodeInfo_clone_ptr(uint32_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;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_NodeInfo_clone(uint32_t orig) {
+ LDKNodeInfo orig_conv;