Pull out type mapping
[ldk-java] / src / main / jni / bindings.c
1 #include "org_ldk_impl_bindings.h"
2 #include <rust_types.h>
3 #include <lightning.h>
4 #include <assert.h>
5
6 #include <string.h>
7
8 typedef struct LDKMessageSendEventsProvider_JCalls {
9         JNIEnv *env;
10         jobject o;
11         jmethodID get_and_clear_pending_msg_events_meth;
12 } LDKMessageSendEventsProvider_JCalls;
13 void get_and_clear_pending_msg_events_jcall(void* this_arg/* TODO + rtype */) {
14         LDKMessageSendEventsProvider_JCalls *arg = (LDKMessageSendEventsProvider_JCalls*) this_arg;
15         (*arg->env)->CallObjectMethod(arg->env, arg->o, arg->get_and_clear_pending_msg_events_meth);
16 }
17 void LDKMessageSendEventsProvider_JCalls_free(void* this_arg) {
18         LDKMessageSendEventsProvider_JCalls *arg = (LDKMessageSendEventsProvider_JCalls*) this_arg;
19         (*arg->env)->DeleteGlobalRef(arg->env, arg->o);
20         free(arg);
21 }
22 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEventsProvider_1new (JNIEnv * env, jclass _a, jobject o) {
23         jclass c = (*env)->GetObjectClass(env, o);
24         assert(c != NULL);
25         LDKMessageSendEventsProvider_JCalls *calls = malloc(sizeof(LDKMessageSendEventsProvider_JCalls));
26         calls->env = env;
27         calls->o = (*env)->NewGlobalRef(env, o);
28         calls->get_and_clear_pending_msg_events_meth = (*env)->GetMethodID(env, c, "get_and_clear_pending_msg_events", "TODO");
29         assert(calls->get_and_clear_pending_msg_events_meth != NULL);
30
31         LDKMessageSendEventsProvider *ret = malloc(sizeof(LDKMessageSendEventsProvider));
32         ret->this_arg = (void*) calls;
33         ret->get_and_clear_pending_msg_events = get_and_clear_pending_msg_events_jcall;
34         ret->free = LDKMessageSendEventsProvider_JCalls_free;
35         return (long)ret;
36 }
37
38 typedef struct LDKEventsProvider_JCalls {
39         JNIEnv *env;
40         jobject o;
41         jmethodID get_and_clear_pending_events_meth;
42 } LDKEventsProvider_JCalls;
43 void get_and_clear_pending_events_jcall(void* this_arg/* TODO + rtype */) {
44         LDKEventsProvider_JCalls *arg = (LDKEventsProvider_JCalls*) this_arg;
45         (*arg->env)->CallObjectMethod(arg->env, arg->o, arg->get_and_clear_pending_events_meth);
46 }
47 void LDKEventsProvider_JCalls_free(void* this_arg) {
48         LDKEventsProvider_JCalls *arg = (LDKEventsProvider_JCalls*) this_arg;
49         (*arg->env)->DeleteGlobalRef(arg->env, arg->o);
50         free(arg);
51 }
52 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKEventsProvider_1new (JNIEnv * env, jclass _a, jobject o) {
53         jclass c = (*env)->GetObjectClass(env, o);
54         assert(c != NULL);
55         LDKEventsProvider_JCalls *calls = malloc(sizeof(LDKEventsProvider_JCalls));
56         calls->env = env;
57         calls->o = (*env)->NewGlobalRef(env, o);
58         calls->get_and_clear_pending_events_meth = (*env)->GetMethodID(env, c, "get_and_clear_pending_events", "TODO");
59         assert(calls->get_and_clear_pending_events_meth != NULL);
60
61         LDKEventsProvider *ret = malloc(sizeof(LDKEventsProvider));
62         ret->this_arg = (void*) calls;
63         ret->get_and_clear_pending_events = get_and_clear_pending_events_jcall;
64         ret->free = LDKEventsProvider_JCalls_free;
65         return (long)ret;
66 }
67
68 typedef struct LDKLogger_JCalls {
69         JNIEnv *env;
70         jobject o;
71         jmethodID log_meth;
72 } LDKLogger_JCalls;
73 void log_jcall(void* this_arg/* TODO + rtype */) {
74         LDKLogger_JCalls *arg = (LDKLogger_JCalls*) this_arg;
75         (*arg->env)->CallObjectMethod(arg->env, arg->o, arg->log_meth);
76 }
77 void LDKLogger_JCalls_free(void* this_arg) {
78         LDKLogger_JCalls *arg = (LDKLogger_JCalls*) this_arg;
79         (*arg->env)->DeleteGlobalRef(arg->env, arg->o);
80         free(arg);
81 }
82 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKLogger_1new (JNIEnv * env, jclass _a, jobject o) {
83         jclass c = (*env)->GetObjectClass(env, o);
84         assert(c != NULL);
85         LDKLogger_JCalls *calls = malloc(sizeof(LDKLogger_JCalls));
86         calls->env = env;
87         calls->o = (*env)->NewGlobalRef(env, o);
88         calls->log_meth = (*env)->GetMethodID(env, c, "log", "TODO");
89         assert(calls->log_meth != NULL);
90
91         LDKLogger *ret = malloc(sizeof(LDKLogger));
92         ret->this_arg = (void*) calls;
93         ret->log = log_jcall;
94         ret->free = LDKLogger_JCalls_free;
95         return (long)ret;
96 }
97
98 typedef struct LDKChainWatchInterface_JCalls {
99         JNIEnv *env;
100         jobject o;
101         jmethodID install_watch_tx_meth;
102         jmethodID install_watch_outpoint_meth;
103         jmethodID watch_all_txn_meth;
104         jmethodID get_chain_utxo_meth;
105         jmethodID filter_block_meth;
106         jmethodID reentered_meth;
107 } LDKChainWatchInterface_JCalls;
108 void install_watch_tx_jcall(void* this_arg/* TODO + rtype */) {
109         LDKChainWatchInterface_JCalls *arg = (LDKChainWatchInterface_JCalls*) this_arg;
110         (*arg->env)->CallObjectMethod(arg->env, arg->o, arg->install_watch_tx_meth);
111 }
112 void install_watch_outpoint_jcall(void* this_arg/* TODO + rtype */) {
113         LDKChainWatchInterface_JCalls *arg = (LDKChainWatchInterface_JCalls*) this_arg;
114         (*arg->env)->CallObjectMethod(arg->env, arg->o, arg->install_watch_outpoint_meth);
115 }
116 void watch_all_txn_jcall(void* this_arg/* TODO + rtype */) {
117         LDKChainWatchInterface_JCalls *arg = (LDKChainWatchInterface_JCalls*) this_arg;
118         (*arg->env)->CallObjectMethod(arg->env, arg->o, arg->watch_all_txn_meth);
119 }
120 void get_chain_utxo_jcall(void* this_arg/* TODO + rtype */) {
121         LDKChainWatchInterface_JCalls *arg = (LDKChainWatchInterface_JCalls*) this_arg;
122         (*arg->env)->CallObjectMethod(arg->env, arg->o, arg->get_chain_utxo_meth);
123 }
124 void filter_block_jcall(void* this_arg/* TODO + rtype */) {
125         LDKChainWatchInterface_JCalls *arg = (LDKChainWatchInterface_JCalls*) this_arg;
126         (*arg->env)->CallObjectMethod(arg->env, arg->o, arg->filter_block_meth);
127 }
128 void reentered_jcall(void* this_arg/* TODO + rtype */) {
129         LDKChainWatchInterface_JCalls *arg = (LDKChainWatchInterface_JCalls*) this_arg;
130         (*arg->env)->CallObjectMethod(arg->env, arg->o, arg->reentered_meth);
131 }
132 void LDKChainWatchInterface_JCalls_free(void* this_arg) {
133         LDKChainWatchInterface_JCalls *arg = (LDKChainWatchInterface_JCalls*) this_arg;
134         (*arg->env)->DeleteGlobalRef(arg->env, arg->o);
135         free(arg);
136 }
137 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKChainWatchInterface_1new (JNIEnv * env, jclass _a, jobject o) {
138         jclass c = (*env)->GetObjectClass(env, o);
139         assert(c != NULL);
140         LDKChainWatchInterface_JCalls *calls = malloc(sizeof(LDKChainWatchInterface_JCalls));
141         calls->env = env;
142         calls->o = (*env)->NewGlobalRef(env, o);
143         calls->install_watch_tx_meth = (*env)->GetMethodID(env, c, "install_watch_tx", "TODO");
144         assert(calls->install_watch_tx_meth != NULL);
145         calls->install_watch_outpoint_meth = (*env)->GetMethodID(env, c, "install_watch_outpoint", "TODO");
146         assert(calls->install_watch_outpoint_meth != NULL);
147         calls->watch_all_txn_meth = (*env)->GetMethodID(env, c, "watch_all_txn", "TODO");
148         assert(calls->watch_all_txn_meth != NULL);
149         calls->get_chain_utxo_meth = (*env)->GetMethodID(env, c, "get_chain_utxo", "TODO");
150         assert(calls->get_chain_utxo_meth != NULL);
151         calls->filter_block_meth = (*env)->GetMethodID(env, c, "filter_block", "TODO");
152         assert(calls->filter_block_meth != NULL);
153         calls->reentered_meth = (*env)->GetMethodID(env, c, "reentered", "TODO");
154         assert(calls->reentered_meth != NULL);
155
156         LDKChainWatchInterface *ret = malloc(sizeof(LDKChainWatchInterface));
157         ret->this_arg = (void*) calls;
158         ret->install_watch_tx = install_watch_tx_jcall;
159         ret->install_watch_outpoint = install_watch_outpoint_jcall;
160         ret->watch_all_txn = watch_all_txn_jcall;
161         ret->get_chain_utxo = get_chain_utxo_jcall;
162         ret->filter_block = filter_block_jcall;
163         ret->reentered = reentered_jcall;
164         ret->free = LDKChainWatchInterface_JCalls_free;
165         return (long)ret;
166 }
167
168 typedef struct LDKBroadcasterInterface_JCalls {
169         JNIEnv *env;
170         jobject o;
171         jmethodID broadcast_transaction_meth;
172 } LDKBroadcasterInterface_JCalls;
173 void broadcast_transaction_jcall(void* this_arg/* TODO + rtype */) {
174         LDKBroadcasterInterface_JCalls *arg = (LDKBroadcasterInterface_JCalls*) this_arg;
175         (*arg->env)->CallObjectMethod(arg->env, arg->o, arg->broadcast_transaction_meth);
176 }
177 void LDKBroadcasterInterface_JCalls_free(void* this_arg) {
178         LDKBroadcasterInterface_JCalls *arg = (LDKBroadcasterInterface_JCalls*) this_arg;
179         (*arg->env)->DeleteGlobalRef(arg->env, arg->o);
180         free(arg);
181 }
182 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKBroadcasterInterface_1new (JNIEnv * env, jclass _a, jobject o) {
183         jclass c = (*env)->GetObjectClass(env, o);
184         assert(c != NULL);
185         LDKBroadcasterInterface_JCalls *calls = malloc(sizeof(LDKBroadcasterInterface_JCalls));
186         calls->env = env;
187         calls->o = (*env)->NewGlobalRef(env, o);
188         calls->broadcast_transaction_meth = (*env)->GetMethodID(env, c, "broadcast_transaction", "TODO");
189         assert(calls->broadcast_transaction_meth != NULL);
190
191         LDKBroadcasterInterface *ret = malloc(sizeof(LDKBroadcasterInterface));
192         ret->this_arg = (void*) calls;
193         ret->broadcast_transaction = broadcast_transaction_jcall;
194         ret->free = LDKBroadcasterInterface_JCalls_free;
195         return (long)ret;
196 }
197
198 typedef struct LDKChainListener_JCalls {
199         JNIEnv *env;
200         jobject o;
201         jmethodID block_connected_meth;
202         jmethodID block_disconnected_meth;
203 } LDKChainListener_JCalls;
204 void block_connected_jcall(void* this_arg/* TODO + rtype */) {
205         LDKChainListener_JCalls *arg = (LDKChainListener_JCalls*) this_arg;
206         (*arg->env)->CallObjectMethod(arg->env, arg->o, arg->block_connected_meth);
207 }
208 void block_disconnected_jcall(void* this_arg/* TODO + rtype */) {
209         LDKChainListener_JCalls *arg = (LDKChainListener_JCalls*) this_arg;
210         (*arg->env)->CallObjectMethod(arg->env, arg->o, arg->block_disconnected_meth);
211 }
212 void LDKChainListener_JCalls_free(void* this_arg) {
213         LDKChainListener_JCalls *arg = (LDKChainListener_JCalls*) this_arg;
214         (*arg->env)->DeleteGlobalRef(arg->env, arg->o);
215         free(arg);
216 }
217 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKChainListener_1new (JNIEnv * env, jclass _a, jobject o) {
218         jclass c = (*env)->GetObjectClass(env, o);
219         assert(c != NULL);
220         LDKChainListener_JCalls *calls = malloc(sizeof(LDKChainListener_JCalls));
221         calls->env = env;
222         calls->o = (*env)->NewGlobalRef(env, o);
223         calls->block_connected_meth = (*env)->GetMethodID(env, c, "block_connected", "TODO");
224         assert(calls->block_connected_meth != NULL);
225         calls->block_disconnected_meth = (*env)->GetMethodID(env, c, "block_disconnected", "TODO");
226         assert(calls->block_disconnected_meth != NULL);
227
228         LDKChainListener *ret = malloc(sizeof(LDKChainListener));
229         ret->this_arg = (void*) calls;
230         ret->block_connected = block_connected_jcall;
231         ret->block_disconnected = block_disconnected_jcall;
232         ret->free = LDKChainListener_JCalls_free;
233         return (long)ret;
234 }
235
236 typedef struct LDKFeeEstimator_JCalls {
237         JNIEnv *env;
238         jobject o;
239         jmethodID get_est_sat_per_1000_weight_meth;
240 } LDKFeeEstimator_JCalls;
241 void get_est_sat_per_1000_weight_jcall(void* this_arg/* TODO + rtype */) {
242         LDKFeeEstimator_JCalls *arg = (LDKFeeEstimator_JCalls*) this_arg;
243         (*arg->env)->CallObjectMethod(arg->env, arg->o, arg->get_est_sat_per_1000_weight_meth);
244 }
245 void LDKFeeEstimator_JCalls_free(void* this_arg) {
246         LDKFeeEstimator_JCalls *arg = (LDKFeeEstimator_JCalls*) this_arg;
247         (*arg->env)->DeleteGlobalRef(arg->env, arg->o);
248         free(arg);
249 }
250 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKFeeEstimator_1new (JNIEnv * env, jclass _a, jobject o) {
251         jclass c = (*env)->GetObjectClass(env, o);
252         assert(c != NULL);
253         LDKFeeEstimator_JCalls *calls = malloc(sizeof(LDKFeeEstimator_JCalls));
254         calls->env = env;
255         calls->o = (*env)->NewGlobalRef(env, o);
256         calls->get_est_sat_per_1000_weight_meth = (*env)->GetMethodID(env, c, "get_est_sat_per_1000_weight", "TODO");
257         assert(calls->get_est_sat_per_1000_weight_meth != NULL);
258
259         LDKFeeEstimator *ret = malloc(sizeof(LDKFeeEstimator));
260         ret->this_arg = (void*) calls;
261         ret->get_est_sat_per_1000_weight = get_est_sat_per_1000_weight_jcall;
262         ret->free = LDKFeeEstimator_JCalls_free;
263         return (long)ret;
264 }
265
266 typedef struct LDKChannelKeys_JCalls {
267         JNIEnv *env;
268         jobject o;
269         jmethodID get_per_commitment_point_meth;
270         jmethodID release_commitment_secret_meth;
271         jmethodID key_derivation_params_meth;
272         jmethodID sign_remote_commitment_meth;
273         jmethodID sign_local_commitment_meth;
274         jmethodID sign_local_commitment_htlc_transactions_meth;
275         jmethodID sign_justice_transaction_meth;
276         jmethodID sign_remote_htlc_transaction_meth;
277         jmethodID sign_closing_transaction_meth;
278         jmethodID sign_channel_announcement_meth;
279         jmethodID on_accept_meth;
280 } LDKChannelKeys_JCalls;
281 void get_per_commitment_point_jcall(void* this_arg/* TODO + rtype */) {
282         LDKChannelKeys_JCalls *arg = (LDKChannelKeys_JCalls*) this_arg;
283         (*arg->env)->CallObjectMethod(arg->env, arg->o, arg->get_per_commitment_point_meth);
284 }
285 void release_commitment_secret_jcall(void* this_arg/* TODO + rtype */) {
286         LDKChannelKeys_JCalls *arg = (LDKChannelKeys_JCalls*) this_arg;
287         (*arg->env)->CallObjectMethod(arg->env, arg->o, arg->release_commitment_secret_meth);
288 }
289 void key_derivation_params_jcall(void* this_arg/* TODO + rtype */) {
290         LDKChannelKeys_JCalls *arg = (LDKChannelKeys_JCalls*) this_arg;
291         (*arg->env)->CallObjectMethod(arg->env, arg->o, arg->key_derivation_params_meth);
292 }
293 void sign_remote_commitment_jcall(void* this_arg/* TODO + rtype */) {
294         LDKChannelKeys_JCalls *arg = (LDKChannelKeys_JCalls*) this_arg;
295         (*arg->env)->CallObjectMethod(arg->env, arg->o, arg->sign_remote_commitment_meth);
296 }
297 void sign_local_commitment_jcall(void* this_arg/* TODO + rtype */) {
298         LDKChannelKeys_JCalls *arg = (LDKChannelKeys_JCalls*) this_arg;
299         (*arg->env)->CallObjectMethod(arg->env, arg->o, arg->sign_local_commitment_meth);
300 }
301 void sign_local_commitment_htlc_transactions_jcall(void* this_arg/* TODO + rtype */) {
302         LDKChannelKeys_JCalls *arg = (LDKChannelKeys_JCalls*) this_arg;
303         (*arg->env)->CallObjectMethod(arg->env, arg->o, arg->sign_local_commitment_htlc_transactions_meth);
304 }
305 void sign_justice_transaction_jcall(void* this_arg/* TODO + rtype */) {
306         LDKChannelKeys_JCalls *arg = (LDKChannelKeys_JCalls*) this_arg;
307         (*arg->env)->CallObjectMethod(arg->env, arg->o, arg->sign_justice_transaction_meth);
308 }
309 void sign_remote_htlc_transaction_jcall(void* this_arg/* TODO + rtype */) {
310         LDKChannelKeys_JCalls *arg = (LDKChannelKeys_JCalls*) this_arg;
311         (*arg->env)->CallObjectMethod(arg->env, arg->o, arg->sign_remote_htlc_transaction_meth);
312 }
313 void sign_closing_transaction_jcall(void* this_arg/* TODO + rtype */) {
314         LDKChannelKeys_JCalls *arg = (LDKChannelKeys_JCalls*) this_arg;
315         (*arg->env)->CallObjectMethod(arg->env, arg->o, arg->sign_closing_transaction_meth);
316 }
317 void sign_channel_announcement_jcall(void* this_arg/* TODO + rtype */) {
318         LDKChannelKeys_JCalls *arg = (LDKChannelKeys_JCalls*) this_arg;
319         (*arg->env)->CallObjectMethod(arg->env, arg->o, arg->sign_channel_announcement_meth);
320 }
321 void on_accept_jcall(void* this_arg/* TODO + rtype */) {
322         LDKChannelKeys_JCalls *arg = (LDKChannelKeys_JCalls*) this_arg;
323         (*arg->env)->CallObjectMethod(arg->env, arg->o, arg->on_accept_meth);
324 }
325 void* LDKChannelKeys_JCalls_clone(void* this_arg) {
326         LDKChannelKeys_JCalls *ret = malloc(sizeof(LDKChannelKeys_JCalls));
327         memcpy(ret, this_arg, sizeof(LDKChannelKeys_JCalls));
328         return ret;
329 }
330 void LDKChannelKeys_JCalls_free(void* this_arg) {
331         LDKChannelKeys_JCalls *arg = (LDKChannelKeys_JCalls*) this_arg;
332         (*arg->env)->DeleteGlobalRef(arg->env, arg->o);
333         free(arg);
334 }
335 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKChannelKeys_1new (JNIEnv * env, jclass _a, jobject o) {
336         jclass c = (*env)->GetObjectClass(env, o);
337         assert(c != NULL);
338         LDKChannelKeys_JCalls *calls = malloc(sizeof(LDKChannelKeys_JCalls));
339         calls->env = env;
340         calls->o = (*env)->NewGlobalRef(env, o);
341         calls->get_per_commitment_point_meth = (*env)->GetMethodID(env, c, "get_per_commitment_point", "TODO");
342         assert(calls->get_per_commitment_point_meth != NULL);
343         calls->release_commitment_secret_meth = (*env)->GetMethodID(env, c, "release_commitment_secret", "TODO");
344         assert(calls->release_commitment_secret_meth != NULL);
345         calls->key_derivation_params_meth = (*env)->GetMethodID(env, c, "key_derivation_params", "TODO");
346         assert(calls->key_derivation_params_meth != NULL);
347         calls->sign_remote_commitment_meth = (*env)->GetMethodID(env, c, "sign_remote_commitment", "TODO");
348         assert(calls->sign_remote_commitment_meth != NULL);
349         calls->sign_local_commitment_meth = (*env)->GetMethodID(env, c, "sign_local_commitment", "TODO");
350         assert(calls->sign_local_commitment_meth != NULL);
351         calls->sign_local_commitment_htlc_transactions_meth = (*env)->GetMethodID(env, c, "sign_local_commitment_htlc_transactions", "TODO");
352         assert(calls->sign_local_commitment_htlc_transactions_meth != NULL);
353         calls->sign_justice_transaction_meth = (*env)->GetMethodID(env, c, "sign_justice_transaction", "TODO");
354         assert(calls->sign_justice_transaction_meth != NULL);
355         calls->sign_remote_htlc_transaction_meth = (*env)->GetMethodID(env, c, "sign_remote_htlc_transaction", "TODO");
356         assert(calls->sign_remote_htlc_transaction_meth != NULL);
357         calls->sign_closing_transaction_meth = (*env)->GetMethodID(env, c, "sign_closing_transaction", "TODO");
358         assert(calls->sign_closing_transaction_meth != NULL);
359         calls->sign_channel_announcement_meth = (*env)->GetMethodID(env, c, "sign_channel_announcement", "TODO");
360         assert(calls->sign_channel_announcement_meth != NULL);
361         calls->on_accept_meth = (*env)->GetMethodID(env, c, "on_accept", "TODO");
362         assert(calls->on_accept_meth != NULL);
363
364         LDKChannelKeys *ret = malloc(sizeof(LDKChannelKeys));
365         ret->this_arg = (void*) calls;
366         ret->get_per_commitment_point = get_per_commitment_point_jcall;
367         ret->release_commitment_secret = release_commitment_secret_jcall;
368         ret->key_derivation_params = key_derivation_params_jcall;
369         ret->sign_remote_commitment = sign_remote_commitment_jcall;
370         ret->sign_local_commitment = sign_local_commitment_jcall;
371         ret->sign_local_commitment_htlc_transactions = sign_local_commitment_htlc_transactions_jcall;
372         ret->sign_justice_transaction = sign_justice_transaction_jcall;
373         ret->sign_remote_htlc_transaction = sign_remote_htlc_transaction_jcall;
374         ret->sign_closing_transaction = sign_closing_transaction_jcall;
375         ret->sign_channel_announcement = sign_channel_announcement_jcall;
376         ret->on_accept = on_accept_jcall;
377         ret->clone = LDKChannelKeys_JCalls_clone;
378         ret->free = LDKChannelKeys_JCalls_free;
379         return (long)ret;
380 }
381
382 typedef struct LDKKeysInterface_JCalls {
383         JNIEnv *env;
384         jobject o;
385         jmethodID get_node_secret_meth;
386         jmethodID get_destination_script_meth;
387         jmethodID get_shutdown_pubkey_meth;
388         jmethodID get_channel_keys_meth;
389         jmethodID get_secure_random_bytes_meth;
390 } LDKKeysInterface_JCalls;
391 void get_node_secret_jcall(void* this_arg/* TODO + rtype */) {
392         LDKKeysInterface_JCalls *arg = (LDKKeysInterface_JCalls*) this_arg;
393         (*arg->env)->CallObjectMethod(arg->env, arg->o, arg->get_node_secret_meth);
394 }
395 void get_destination_script_jcall(void* this_arg/* TODO + rtype */) {
396         LDKKeysInterface_JCalls *arg = (LDKKeysInterface_JCalls*) this_arg;
397         (*arg->env)->CallObjectMethod(arg->env, arg->o, arg->get_destination_script_meth);
398 }
399 void get_shutdown_pubkey_jcall(void* this_arg/* TODO + rtype */) {
400         LDKKeysInterface_JCalls *arg = (LDKKeysInterface_JCalls*) this_arg;
401         (*arg->env)->CallObjectMethod(arg->env, arg->o, arg->get_shutdown_pubkey_meth);
402 }
403 void get_channel_keys_jcall(void* this_arg/* TODO + rtype */) {
404         LDKKeysInterface_JCalls *arg = (LDKKeysInterface_JCalls*) this_arg;
405         (*arg->env)->CallObjectMethod(arg->env, arg->o, arg->get_channel_keys_meth);
406 }
407 void get_secure_random_bytes_jcall(void* this_arg/* TODO + rtype */) {
408         LDKKeysInterface_JCalls *arg = (LDKKeysInterface_JCalls*) this_arg;
409         (*arg->env)->CallObjectMethod(arg->env, arg->o, arg->get_secure_random_bytes_meth);
410 }
411 void LDKKeysInterface_JCalls_free(void* this_arg) {
412         LDKKeysInterface_JCalls *arg = (LDKKeysInterface_JCalls*) this_arg;
413         (*arg->env)->DeleteGlobalRef(arg->env, arg->o);
414         free(arg);
415 }
416 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKKeysInterface_1new (JNIEnv * env, jclass _a, jobject o) {
417         jclass c = (*env)->GetObjectClass(env, o);
418         assert(c != NULL);
419         LDKKeysInterface_JCalls *calls = malloc(sizeof(LDKKeysInterface_JCalls));
420         calls->env = env;
421         calls->o = (*env)->NewGlobalRef(env, o);
422         calls->get_node_secret_meth = (*env)->GetMethodID(env, c, "get_node_secret", "TODO");
423         assert(calls->get_node_secret_meth != NULL);
424         calls->get_destination_script_meth = (*env)->GetMethodID(env, c, "get_destination_script", "TODO");
425         assert(calls->get_destination_script_meth != NULL);
426         calls->get_shutdown_pubkey_meth = (*env)->GetMethodID(env, c, "get_shutdown_pubkey", "TODO");
427         assert(calls->get_shutdown_pubkey_meth != NULL);
428         calls->get_channel_keys_meth = (*env)->GetMethodID(env, c, "get_channel_keys", "TODO");
429         assert(calls->get_channel_keys_meth != NULL);
430         calls->get_secure_random_bytes_meth = (*env)->GetMethodID(env, c, "get_secure_random_bytes", "TODO");
431         assert(calls->get_secure_random_bytes_meth != NULL);
432
433         LDKKeysInterface *ret = malloc(sizeof(LDKKeysInterface));
434         ret->this_arg = (void*) calls;
435         ret->get_node_secret = get_node_secret_jcall;
436         ret->get_destination_script = get_destination_script_jcall;
437         ret->get_shutdown_pubkey = get_shutdown_pubkey_jcall;
438         ret->get_channel_keys = get_channel_keys_jcall;
439         ret->get_secure_random_bytes = get_secure_random_bytes_jcall;
440         ret->free = LDKKeysInterface_JCalls_free;
441         return (long)ret;
442 }
443
444 typedef struct LDKManyChannelMonitor_JCalls {
445         JNIEnv *env;
446         jobject o;
447         jmethodID add_monitor_meth;
448         jmethodID update_monitor_meth;
449         jmethodID get_and_clear_pending_monitor_events_meth;
450 } LDKManyChannelMonitor_JCalls;
451 void add_monitor_jcall(void* this_arg/* TODO + rtype */) {
452         LDKManyChannelMonitor_JCalls *arg = (LDKManyChannelMonitor_JCalls*) this_arg;
453         (*arg->env)->CallObjectMethod(arg->env, arg->o, arg->add_monitor_meth);
454 }
455 void update_monitor_jcall(void* this_arg/* TODO + rtype */) {
456         LDKManyChannelMonitor_JCalls *arg = (LDKManyChannelMonitor_JCalls*) this_arg;
457         (*arg->env)->CallObjectMethod(arg->env, arg->o, arg->update_monitor_meth);
458 }
459 void get_and_clear_pending_monitor_events_jcall(void* this_arg/* TODO + rtype */) {
460         LDKManyChannelMonitor_JCalls *arg = (LDKManyChannelMonitor_JCalls*) this_arg;
461         (*arg->env)->CallObjectMethod(arg->env, arg->o, arg->get_and_clear_pending_monitor_events_meth);
462 }
463 void LDKManyChannelMonitor_JCalls_free(void* this_arg) {
464         LDKManyChannelMonitor_JCalls *arg = (LDKManyChannelMonitor_JCalls*) this_arg;
465         (*arg->env)->DeleteGlobalRef(arg->env, arg->o);
466         free(arg);
467 }
468 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKManyChannelMonitor_1new (JNIEnv * env, jclass _a, jobject o) {
469         jclass c = (*env)->GetObjectClass(env, o);
470         assert(c != NULL);
471         LDKManyChannelMonitor_JCalls *calls = malloc(sizeof(LDKManyChannelMonitor_JCalls));
472         calls->env = env;
473         calls->o = (*env)->NewGlobalRef(env, o);
474         calls->add_monitor_meth = (*env)->GetMethodID(env, c, "add_monitor", "TODO");
475         assert(calls->add_monitor_meth != NULL);
476         calls->update_monitor_meth = (*env)->GetMethodID(env, c, "update_monitor", "TODO");
477         assert(calls->update_monitor_meth != NULL);
478         calls->get_and_clear_pending_monitor_events_meth = (*env)->GetMethodID(env, c, "get_and_clear_pending_monitor_events", "TODO");
479         assert(calls->get_and_clear_pending_monitor_events_meth != NULL);
480
481         LDKManyChannelMonitor *ret = malloc(sizeof(LDKManyChannelMonitor));
482         ret->this_arg = (void*) calls;
483         ret->add_monitor = add_monitor_jcall;
484         ret->update_monitor = update_monitor_jcall;
485         ret->get_and_clear_pending_monitor_events = get_and_clear_pending_monitor_events_jcall;
486         ret->free = LDKManyChannelMonitor_JCalls_free;
487         return (long)ret;
488 }
489
490 typedef struct LDKChannelMessageHandler_JCalls {
491         JNIEnv *env;
492         jobject o;
493         jmethodID handle_open_channel_meth;
494         jmethodID handle_accept_channel_meth;
495         jmethodID handle_funding_created_meth;
496         jmethodID handle_funding_signed_meth;
497         jmethodID handle_funding_locked_meth;
498         jmethodID handle_shutdown_meth;
499         jmethodID handle_closing_signed_meth;
500         jmethodID handle_update_add_htlc_meth;
501         jmethodID handle_update_fulfill_htlc_meth;
502         jmethodID handle_update_fail_htlc_meth;
503         jmethodID handle_update_fail_malformed_htlc_meth;
504         jmethodID handle_commitment_signed_meth;
505         jmethodID handle_revoke_and_ack_meth;
506         jmethodID handle_update_fee_meth;
507         jmethodID handle_announcement_signatures_meth;
508         jmethodID peer_disconnected_meth;
509         jmethodID peer_connected_meth;
510         jmethodID handle_channel_reestablish_meth;
511         jmethodID handle_error_meth;
512 } LDKChannelMessageHandler_JCalls;
513 void handle_open_channel_jcall(void* this_arg/* TODO + rtype */) {
514         LDKChannelMessageHandler_JCalls *arg = (LDKChannelMessageHandler_JCalls*) this_arg;
515         (*arg->env)->CallObjectMethod(arg->env, arg->o, arg->handle_open_channel_meth);
516 }
517 void handle_accept_channel_jcall(void* this_arg/* TODO + rtype */) {
518         LDKChannelMessageHandler_JCalls *arg = (LDKChannelMessageHandler_JCalls*) this_arg;
519         (*arg->env)->CallObjectMethod(arg->env, arg->o, arg->handle_accept_channel_meth);
520 }
521 void handle_funding_created_jcall(void* this_arg/* TODO + rtype */) {
522         LDKChannelMessageHandler_JCalls *arg = (LDKChannelMessageHandler_JCalls*) this_arg;
523         (*arg->env)->CallObjectMethod(arg->env, arg->o, arg->handle_funding_created_meth);
524 }
525 void handle_funding_signed_jcall(void* this_arg/* TODO + rtype */) {
526         LDKChannelMessageHandler_JCalls *arg = (LDKChannelMessageHandler_JCalls*) this_arg;
527         (*arg->env)->CallObjectMethod(arg->env, arg->o, arg->handle_funding_signed_meth);
528 }
529 void handle_funding_locked_jcall(void* this_arg/* TODO + rtype */) {
530         LDKChannelMessageHandler_JCalls *arg = (LDKChannelMessageHandler_JCalls*) this_arg;
531         (*arg->env)->CallObjectMethod(arg->env, arg->o, arg->handle_funding_locked_meth);
532 }
533 void handle_shutdown_jcall(void* this_arg/* TODO + rtype */) {
534         LDKChannelMessageHandler_JCalls *arg = (LDKChannelMessageHandler_JCalls*) this_arg;
535         (*arg->env)->CallObjectMethod(arg->env, arg->o, arg->handle_shutdown_meth);
536 }
537 void handle_closing_signed_jcall(void* this_arg/* TODO + rtype */) {
538         LDKChannelMessageHandler_JCalls *arg = (LDKChannelMessageHandler_JCalls*) this_arg;
539         (*arg->env)->CallObjectMethod(arg->env, arg->o, arg->handle_closing_signed_meth);
540 }
541 void handle_update_add_htlc_jcall(void* this_arg/* TODO + rtype */) {
542         LDKChannelMessageHandler_JCalls *arg = (LDKChannelMessageHandler_JCalls*) this_arg;
543         (*arg->env)->CallObjectMethod(arg->env, arg->o, arg->handle_update_add_htlc_meth);
544 }
545 void handle_update_fulfill_htlc_jcall(void* this_arg/* TODO + rtype */) {
546         LDKChannelMessageHandler_JCalls *arg = (LDKChannelMessageHandler_JCalls*) this_arg;
547         (*arg->env)->CallObjectMethod(arg->env, arg->o, arg->handle_update_fulfill_htlc_meth);
548 }
549 void handle_update_fail_htlc_jcall(void* this_arg/* TODO + rtype */) {
550         LDKChannelMessageHandler_JCalls *arg = (LDKChannelMessageHandler_JCalls*) this_arg;
551         (*arg->env)->CallObjectMethod(arg->env, arg->o, arg->handle_update_fail_htlc_meth);
552 }
553 void handle_update_fail_malformed_htlc_jcall(void* this_arg/* TODO + rtype */) {
554         LDKChannelMessageHandler_JCalls *arg = (LDKChannelMessageHandler_JCalls*) this_arg;
555         (*arg->env)->CallObjectMethod(arg->env, arg->o, arg->handle_update_fail_malformed_htlc_meth);
556 }
557 void handle_commitment_signed_jcall(void* this_arg/* TODO + rtype */) {
558         LDKChannelMessageHandler_JCalls *arg = (LDKChannelMessageHandler_JCalls*) this_arg;
559         (*arg->env)->CallObjectMethod(arg->env, arg->o, arg->handle_commitment_signed_meth);
560 }
561 void handle_revoke_and_ack_jcall(void* this_arg/* TODO + rtype */) {
562         LDKChannelMessageHandler_JCalls *arg = (LDKChannelMessageHandler_JCalls*) this_arg;
563         (*arg->env)->CallObjectMethod(arg->env, arg->o, arg->handle_revoke_and_ack_meth);
564 }
565 void handle_update_fee_jcall(void* this_arg/* TODO + rtype */) {
566         LDKChannelMessageHandler_JCalls *arg = (LDKChannelMessageHandler_JCalls*) this_arg;
567         (*arg->env)->CallObjectMethod(arg->env, arg->o, arg->handle_update_fee_meth);
568 }
569 void handle_announcement_signatures_jcall(void* this_arg/* TODO + rtype */) {
570         LDKChannelMessageHandler_JCalls *arg = (LDKChannelMessageHandler_JCalls*) this_arg;
571         (*arg->env)->CallObjectMethod(arg->env, arg->o, arg->handle_announcement_signatures_meth);
572 }
573 void peer_disconnected_jcall(void* this_arg/* TODO + rtype */) {
574         LDKChannelMessageHandler_JCalls *arg = (LDKChannelMessageHandler_JCalls*) this_arg;
575         (*arg->env)->CallObjectMethod(arg->env, arg->o, arg->peer_disconnected_meth);
576 }
577 void peer_connected_jcall(void* this_arg/* TODO + rtype */) {
578         LDKChannelMessageHandler_JCalls *arg = (LDKChannelMessageHandler_JCalls*) this_arg;
579         (*arg->env)->CallObjectMethod(arg->env, arg->o, arg->peer_connected_meth);
580 }
581 void handle_channel_reestablish_jcall(void* this_arg/* TODO + rtype */) {
582         LDKChannelMessageHandler_JCalls *arg = (LDKChannelMessageHandler_JCalls*) this_arg;
583         (*arg->env)->CallObjectMethod(arg->env, arg->o, arg->handle_channel_reestablish_meth);
584 }
585 void handle_error_jcall(void* this_arg/* TODO + rtype */) {
586         LDKChannelMessageHandler_JCalls *arg = (LDKChannelMessageHandler_JCalls*) this_arg;
587         (*arg->env)->CallObjectMethod(arg->env, arg->o, arg->handle_error_meth);
588 }
589 void LDKChannelMessageHandler_JCalls_free(void* this_arg) {
590         LDKChannelMessageHandler_JCalls *arg = (LDKChannelMessageHandler_JCalls*) this_arg;
591         (*arg->env)->DeleteGlobalRef(arg->env, arg->o);
592         free(arg);
593 }
594 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1new (JNIEnv * env, jclass _a, jobject o) {
595         jclass c = (*env)->GetObjectClass(env, o);
596         assert(c != NULL);
597         LDKChannelMessageHandler_JCalls *calls = malloc(sizeof(LDKChannelMessageHandler_JCalls));
598         calls->env = env;
599         calls->o = (*env)->NewGlobalRef(env, o);
600         calls->handle_open_channel_meth = (*env)->GetMethodID(env, c, "handle_open_channel", "TODO");
601         assert(calls->handle_open_channel_meth != NULL);
602         calls->handle_accept_channel_meth = (*env)->GetMethodID(env, c, "handle_accept_channel", "TODO");
603         assert(calls->handle_accept_channel_meth != NULL);
604         calls->handle_funding_created_meth = (*env)->GetMethodID(env, c, "handle_funding_created", "TODO");
605         assert(calls->handle_funding_created_meth != NULL);
606         calls->handle_funding_signed_meth = (*env)->GetMethodID(env, c, "handle_funding_signed", "TODO");
607         assert(calls->handle_funding_signed_meth != NULL);
608         calls->handle_funding_locked_meth = (*env)->GetMethodID(env, c, "handle_funding_locked", "TODO");
609         assert(calls->handle_funding_locked_meth != NULL);
610         calls->handle_shutdown_meth = (*env)->GetMethodID(env, c, "handle_shutdown", "TODO");
611         assert(calls->handle_shutdown_meth != NULL);
612         calls->handle_closing_signed_meth = (*env)->GetMethodID(env, c, "handle_closing_signed", "TODO");
613         assert(calls->handle_closing_signed_meth != NULL);
614         calls->handle_update_add_htlc_meth = (*env)->GetMethodID(env, c, "handle_update_add_htlc", "TODO");
615         assert(calls->handle_update_add_htlc_meth != NULL);
616         calls->handle_update_fulfill_htlc_meth = (*env)->GetMethodID(env, c, "handle_update_fulfill_htlc", "TODO");
617         assert(calls->handle_update_fulfill_htlc_meth != NULL);
618         calls->handle_update_fail_htlc_meth = (*env)->GetMethodID(env, c, "handle_update_fail_htlc", "TODO");
619         assert(calls->handle_update_fail_htlc_meth != NULL);
620         calls->handle_update_fail_malformed_htlc_meth = (*env)->GetMethodID(env, c, "handle_update_fail_malformed_htlc", "TODO");
621         assert(calls->handle_update_fail_malformed_htlc_meth != NULL);
622         calls->handle_commitment_signed_meth = (*env)->GetMethodID(env, c, "handle_commitment_signed", "TODO");
623         assert(calls->handle_commitment_signed_meth != NULL);
624         calls->handle_revoke_and_ack_meth = (*env)->GetMethodID(env, c, "handle_revoke_and_ack", "TODO");
625         assert(calls->handle_revoke_and_ack_meth != NULL);
626         calls->handle_update_fee_meth = (*env)->GetMethodID(env, c, "handle_update_fee", "TODO");
627         assert(calls->handle_update_fee_meth != NULL);
628         calls->handle_announcement_signatures_meth = (*env)->GetMethodID(env, c, "handle_announcement_signatures", "TODO");
629         assert(calls->handle_announcement_signatures_meth != NULL);
630         calls->peer_disconnected_meth = (*env)->GetMethodID(env, c, "peer_disconnected", "TODO");
631         assert(calls->peer_disconnected_meth != NULL);
632         calls->peer_connected_meth = (*env)->GetMethodID(env, c, "peer_connected", "TODO");
633         assert(calls->peer_connected_meth != NULL);
634         calls->handle_channel_reestablish_meth = (*env)->GetMethodID(env, c, "handle_channel_reestablish", "TODO");
635         assert(calls->handle_channel_reestablish_meth != NULL);
636         calls->handle_error_meth = (*env)->GetMethodID(env, c, "handle_error", "TODO");
637         assert(calls->handle_error_meth != NULL);
638
639         LDKChannelMessageHandler *ret = malloc(sizeof(LDKChannelMessageHandler));
640         ret->this_arg = (void*) calls;
641         ret->handle_open_channel = handle_open_channel_jcall;
642         ret->handle_accept_channel = handle_accept_channel_jcall;
643         ret->handle_funding_created = handle_funding_created_jcall;
644         ret->handle_funding_signed = handle_funding_signed_jcall;
645         ret->handle_funding_locked = handle_funding_locked_jcall;
646         ret->handle_shutdown = handle_shutdown_jcall;
647         ret->handle_closing_signed = handle_closing_signed_jcall;
648         ret->handle_update_add_htlc = handle_update_add_htlc_jcall;
649         ret->handle_update_fulfill_htlc = handle_update_fulfill_htlc_jcall;
650         ret->handle_update_fail_htlc = handle_update_fail_htlc_jcall;
651         ret->handle_update_fail_malformed_htlc = handle_update_fail_malformed_htlc_jcall;
652         ret->handle_commitment_signed = handle_commitment_signed_jcall;
653         ret->handle_revoke_and_ack = handle_revoke_and_ack_jcall;
654         ret->handle_update_fee = handle_update_fee_jcall;
655         ret->handle_announcement_signatures = handle_announcement_signatures_jcall;
656         ret->peer_disconnected = peer_disconnected_jcall;
657         ret->peer_connected = peer_connected_jcall;
658         ret->handle_channel_reestablish = handle_channel_reestablish_jcall;
659         ret->handle_error = handle_error_jcall;
660         ret->free = LDKChannelMessageHandler_JCalls_free;
661         return (long)ret;
662 }
663
664 typedef struct LDKRoutingMessageHandler_JCalls {
665         JNIEnv *env;
666         jobject o;
667         jmethodID handle_node_announcement_meth;
668         jmethodID handle_channel_announcement_meth;
669         jmethodID handle_channel_update_meth;
670         jmethodID handle_htlc_fail_channel_update_meth;
671         jmethodID get_next_channel_announcements_meth;
672         jmethodID get_next_node_announcements_meth;
673         jmethodID should_request_full_sync_meth;
674 } LDKRoutingMessageHandler_JCalls;
675 void handle_node_announcement_jcall(void* this_arg/* TODO + rtype */) {
676         LDKRoutingMessageHandler_JCalls *arg = (LDKRoutingMessageHandler_JCalls*) this_arg;
677         (*arg->env)->CallObjectMethod(arg->env, arg->o, arg->handle_node_announcement_meth);
678 }
679 void handle_channel_announcement_jcall(void* this_arg/* TODO + rtype */) {
680         LDKRoutingMessageHandler_JCalls *arg = (LDKRoutingMessageHandler_JCalls*) this_arg;
681         (*arg->env)->CallObjectMethod(arg->env, arg->o, arg->handle_channel_announcement_meth);
682 }
683 void handle_channel_update_jcall(void* this_arg/* TODO + rtype */) {
684         LDKRoutingMessageHandler_JCalls *arg = (LDKRoutingMessageHandler_JCalls*) this_arg;
685         (*arg->env)->CallObjectMethod(arg->env, arg->o, arg->handle_channel_update_meth);
686 }
687 void handle_htlc_fail_channel_update_jcall(void* this_arg/* TODO + rtype */) {
688         LDKRoutingMessageHandler_JCalls *arg = (LDKRoutingMessageHandler_JCalls*) this_arg;
689         (*arg->env)->CallObjectMethod(arg->env, arg->o, arg->handle_htlc_fail_channel_update_meth);
690 }
691 void get_next_channel_announcements_jcall(void* this_arg/* TODO + rtype */) {
692         LDKRoutingMessageHandler_JCalls *arg = (LDKRoutingMessageHandler_JCalls*) this_arg;
693         (*arg->env)->CallObjectMethod(arg->env, arg->o, arg->get_next_channel_announcements_meth);
694 }
695 void get_next_node_announcements_jcall(void* this_arg/* TODO + rtype */) {
696         LDKRoutingMessageHandler_JCalls *arg = (LDKRoutingMessageHandler_JCalls*) this_arg;
697         (*arg->env)->CallObjectMethod(arg->env, arg->o, arg->get_next_node_announcements_meth);
698 }
699 void should_request_full_sync_jcall(void* this_arg/* TODO + rtype */) {
700         LDKRoutingMessageHandler_JCalls *arg = (LDKRoutingMessageHandler_JCalls*) this_arg;
701         (*arg->env)->CallObjectMethod(arg->env, arg->o, arg->should_request_full_sync_meth);
702 }
703 void LDKRoutingMessageHandler_JCalls_free(void* this_arg) {
704         LDKRoutingMessageHandler_JCalls *arg = (LDKRoutingMessageHandler_JCalls*) this_arg;
705         (*arg->env)->DeleteGlobalRef(arg->env, arg->o);
706         free(arg);
707 }
708 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKRoutingMessageHandler_1new (JNIEnv * env, jclass _a, jobject o) {
709         jclass c = (*env)->GetObjectClass(env, o);
710         assert(c != NULL);
711         LDKRoutingMessageHandler_JCalls *calls = malloc(sizeof(LDKRoutingMessageHandler_JCalls));
712         calls->env = env;
713         calls->o = (*env)->NewGlobalRef(env, o);
714         calls->handle_node_announcement_meth = (*env)->GetMethodID(env, c, "handle_node_announcement", "TODO");
715         assert(calls->handle_node_announcement_meth != NULL);
716         calls->handle_channel_announcement_meth = (*env)->GetMethodID(env, c, "handle_channel_announcement", "TODO");
717         assert(calls->handle_channel_announcement_meth != NULL);
718         calls->handle_channel_update_meth = (*env)->GetMethodID(env, c, "handle_channel_update", "TODO");
719         assert(calls->handle_channel_update_meth != NULL);
720         calls->handle_htlc_fail_channel_update_meth = (*env)->GetMethodID(env, c, "handle_htlc_fail_channel_update", "TODO");
721         assert(calls->handle_htlc_fail_channel_update_meth != NULL);
722         calls->get_next_channel_announcements_meth = (*env)->GetMethodID(env, c, "get_next_channel_announcements", "TODO");
723         assert(calls->get_next_channel_announcements_meth != NULL);
724         calls->get_next_node_announcements_meth = (*env)->GetMethodID(env, c, "get_next_node_announcements", "TODO");
725         assert(calls->get_next_node_announcements_meth != NULL);
726         calls->should_request_full_sync_meth = (*env)->GetMethodID(env, c, "should_request_full_sync", "TODO");
727         assert(calls->should_request_full_sync_meth != NULL);
728
729         LDKRoutingMessageHandler *ret = malloc(sizeof(LDKRoutingMessageHandler));
730         ret->this_arg = (void*) calls;
731         ret->handle_node_announcement = handle_node_announcement_jcall;
732         ret->handle_channel_announcement = handle_channel_announcement_jcall;
733         ret->handle_channel_update = handle_channel_update_jcall;
734         ret->handle_htlc_fail_channel_update = handle_htlc_fail_channel_update_jcall;
735         ret->get_next_channel_announcements = get_next_channel_announcements_jcall;
736         ret->get_next_node_announcements = get_next_node_announcements_jcall;
737         ret->should_request_full_sync = should_request_full_sync_jcall;
738         ret->free = LDKRoutingMessageHandler_JCalls_free;
739         return (long)ret;
740 }
741
742 typedef struct LDKSocketDescriptor_JCalls {
743         JNIEnv *env;
744         jobject o;
745         jmethodID send_data_meth;
746         jmethodID disconnect_socket_meth;
747         jmethodID eq_meth;
748         jmethodID hash_meth;
749 } LDKSocketDescriptor_JCalls;
750 void send_data_jcall(void* this_arg/* TODO + rtype */) {
751         LDKSocketDescriptor_JCalls *arg = (LDKSocketDescriptor_JCalls*) this_arg;
752         (*arg->env)->CallObjectMethod(arg->env, arg->o, arg->send_data_meth);
753 }
754 void disconnect_socket_jcall(void* this_arg/* TODO + rtype */) {
755         LDKSocketDescriptor_JCalls *arg = (LDKSocketDescriptor_JCalls*) this_arg;
756         (*arg->env)->CallObjectMethod(arg->env, arg->o, arg->disconnect_socket_meth);
757 }
758 void eq_jcall(void* this_arg/* TODO + rtype */) {
759         LDKSocketDescriptor_JCalls *arg = (LDKSocketDescriptor_JCalls*) this_arg;
760         (*arg->env)->CallObjectMethod(arg->env, arg->o, arg->eq_meth);
761 }
762 void hash_jcall(void* this_arg/* TODO + rtype */) {
763         LDKSocketDescriptor_JCalls *arg = (LDKSocketDescriptor_JCalls*) this_arg;
764         (*arg->env)->CallObjectMethod(arg->env, arg->o, arg->hash_meth);
765 }
766 void* LDKSocketDescriptor_JCalls_clone(void* this_arg) {
767         LDKSocketDescriptor_JCalls *ret = malloc(sizeof(LDKSocketDescriptor_JCalls));
768         memcpy(ret, this_arg, sizeof(LDKSocketDescriptor_JCalls));
769         return ret;
770 }
771 void LDKSocketDescriptor_JCalls_free(void* this_arg) {
772         LDKSocketDescriptor_JCalls *arg = (LDKSocketDescriptor_JCalls*) this_arg;
773         (*arg->env)->DeleteGlobalRef(arg->env, arg->o);
774         free(arg);
775 }
776 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKSocketDescriptor_1new (JNIEnv * env, jclass _a, jobject o) {
777         jclass c = (*env)->GetObjectClass(env, o);
778         assert(c != NULL);
779         LDKSocketDescriptor_JCalls *calls = malloc(sizeof(LDKSocketDescriptor_JCalls));
780         calls->env = env;
781         calls->o = (*env)->NewGlobalRef(env, o);
782         calls->send_data_meth = (*env)->GetMethodID(env, c, "send_data", "TODO");
783         assert(calls->send_data_meth != NULL);
784         calls->disconnect_socket_meth = (*env)->GetMethodID(env, c, "disconnect_socket", "TODO");
785         assert(calls->disconnect_socket_meth != NULL);
786         calls->eq_meth = (*env)->GetMethodID(env, c, "eq", "TODO");
787         assert(calls->eq_meth != NULL);
788         calls->hash_meth = (*env)->GetMethodID(env, c, "hash", "TODO");
789         assert(calls->hash_meth != NULL);
790
791         LDKSocketDescriptor *ret = malloc(sizeof(LDKSocketDescriptor));
792         ret->this_arg = (void*) calls;
793         ret->send_data = send_data_jcall;
794         ret->disconnect_socket = disconnect_socket_jcall;
795         ret->eq = eq_jcall;
796         ret->hash = hash_jcall;
797         ret->clone = LDKSocketDescriptor_JCalls_clone;
798         ret->free = LDKSocketDescriptor_JCalls_free;
799         return (long)ret;
800 }
801
802 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1HTLCOutputInCommitmentSignatureZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
803         LDKC2Tuple_HTLCOutputInCommitmentSignatureZ arg_conv = *(LDKC2Tuple_HTLCOutputInCommitmentSignatureZ*)arg;
804         free((void*)arg);
805         return C2Tuple_HTLCOutputInCommitmentSignatureZ_free(arg_conv);
806 }
807
808 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
809         LDKC2Tuple_OutPointScriptZ arg_conv = *(LDKC2Tuple_OutPointScriptZ*)arg;
810         free((void*)arg);
811         return C2Tuple_OutPointScriptZ_free(arg_conv);
812 }
813
814 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1Scriptu64Z_1free(JNIEnv * _env, jclass _b, jlong arg) {
815         LDKC2Tuple_Scriptu64Z arg_conv = *(LDKC2Tuple_Scriptu64Z*)arg;
816         free((void*)arg);
817         return C2Tuple_Scriptu64Z_free(arg_conv);
818 }
819
820 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
821         LDKC2Tuple_SignatureCVec_SignatureZZ arg_conv = *(LDKC2Tuple_SignatureCVec_SignatureZZ*)arg;
822         free((void*)arg);
823         return C2Tuple_SignatureCVec_SignatureZZ_free(arg_conv);
824 }
825
826 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1Txidu32Z_1free(JNIEnv * _env, jclass _b, jlong arg) {
827         LDKC2Tuple_Txidu32Z arg_conv = *(LDKC2Tuple_Txidu32Z*)arg;
828         free((void*)arg);
829         return C2Tuple_Txidu32Z_free(arg_conv);
830 }
831
832 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u64u64Z_1free(JNIEnv * _env, jclass _b, jlong arg) {
833         LDKC2Tuple_u64u64Z arg_conv = *(LDKC2Tuple_u64u64Z*)arg;
834         free((void*)arg);
835         return C2Tuple_u64u64Z_free(arg_conv);
836 }
837
838 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
839         LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ arg_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)arg;
840         free((void*)arg);
841         return C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(arg_conv);
842 }
843
844 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1Scriptu64ZChainErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
845         LDKChainError arg_conv = *(LDKChainError*)arg;
846         free((void*)arg);
847         LDKCResult_C2Tuple_Scriptu64ZChainErrorZ* ret = malloc(sizeof(LDKCResult_C2Tuple_Scriptu64ZChainErrorZ));
848         *ret = CResult_C2Tuple_Scriptu64ZChainErrorZ_err(arg_conv);
849         return (long)ret;
850 }
851
852 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1Scriptu64ZChainErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
853         LDKCResult_C2Tuple_Scriptu64ZChainErrorZ arg_conv = *(LDKCResult_C2Tuple_Scriptu64ZChainErrorZ*)arg;
854         free((void*)arg);
855         return CResult_C2Tuple_Scriptu64ZChainErrorZ_free(arg_conv);
856 }
857
858 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1Scriptu64ZChainErrorZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
859         LDKC2Tuple_Scriptu64Z arg_conv = *(LDKC2Tuple_Scriptu64Z*)arg;
860         free((void*)arg);
861         LDKCResult_C2Tuple_Scriptu64ZChainErrorZ* ret = malloc(sizeof(LDKCResult_C2Tuple_Scriptu64ZChainErrorZ));
862         *ret = CResult_C2Tuple_Scriptu64ZChainErrorZ_ok(arg_conv);
863         return (long)ret;
864 }
865
866 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
867         LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ arg_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)arg;
868         free((void*)arg);
869         return CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(arg_conv);
870 }
871
872 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
873         LDKC2Tuple_SignatureCVec_SignatureZZ arg_conv = *(LDKC2Tuple_SignatureCVec_SignatureZZ*)arg;
874         free((void*)arg);
875         LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret = malloc(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ));
876         *ret = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(arg_conv);
877         return (long)ret;
878 }
879
880 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
881         LDKCResult_CVec_SignatureZNoneZ arg_conv = *(LDKCResult_CVec_SignatureZNoneZ*)arg;
882         free((void*)arg);
883         return CResult_CVec_SignatureZNoneZ_free(arg_conv);
884 }
885
886 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
887         LDKCVec_SignatureZ arg_conv = *(LDKCVec_SignatureZ*)arg;
888         free((void*)arg);
889         LDKCResult_CVec_SignatureZNoneZ* ret = malloc(sizeof(LDKCResult_CVec_SignatureZNoneZ));
890         *ret = CResult_CVec_SignatureZNoneZ_ok(arg_conv);
891         return (long)ret;
892 }
893
894 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
895         LDKPeerHandleError arg_conv = *(LDKPeerHandleError*)arg;
896         free((void*)arg);
897         LDKCResult_CVec_u8ZPeerHandleErrorZ* ret = malloc(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ));
898         *ret = CResult_CVec_u8ZPeerHandleErrorZ_err(arg_conv);
899         return (long)ret;
900 }
901
902 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
903         LDKCResult_CVec_u8ZPeerHandleErrorZ arg_conv = *(LDKCResult_CVec_u8ZPeerHandleErrorZ*)arg;
904         free((void*)arg);
905         return CResult_CVec_u8ZPeerHandleErrorZ_free(arg_conv);
906 }
907
908 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
909         LDKCVec_u8Z arg_conv = *(LDKCVec_u8Z*)arg;
910         free((void*)arg);
911         LDKCResult_CVec_u8ZPeerHandleErrorZ* ret = malloc(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ));
912         *ret = CResult_CVec_u8ZPeerHandleErrorZ_ok(arg_conv);
913         return (long)ret;
914 }
915
916 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
917         LDKAPIError arg_conv = *(LDKAPIError*)arg;
918         free((void*)arg);
919         LDKCResult_NoneAPIErrorZ* ret = malloc(sizeof(LDKCResult_NoneAPIErrorZ));
920         *ret = CResult_NoneAPIErrorZ_err(arg_conv);
921         return (long)ret;
922 }
923
924 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
925         LDKCResult_NoneAPIErrorZ arg_conv = *(LDKCResult_NoneAPIErrorZ*)arg;
926         free((void*)arg);
927         return CResult_NoneAPIErrorZ_free(arg_conv);
928 }
929
930 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
931         LDKChannelMonitorUpdateErr arg_conv = *(LDKChannelMonitorUpdateErr*)arg;
932         free((void*)arg);
933         LDKCResult_NoneChannelMonitorUpdateErrZ* ret = malloc(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ));
934         *ret = CResult_NoneChannelMonitorUpdateErrZ_err(arg_conv);
935         return (long)ret;
936 }
937
938 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
939         LDKCResult_NoneChannelMonitorUpdateErrZ arg_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)arg;
940         free((void*)arg);
941         return CResult_NoneChannelMonitorUpdateErrZ_free(arg_conv);
942 }
943
944 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
945         LDKMonitorUpdateError arg_conv = *(LDKMonitorUpdateError*)arg;
946         free((void*)arg);
947         LDKCResult_NoneMonitorUpdateErrorZ* ret = malloc(sizeof(LDKCResult_NoneMonitorUpdateErrorZ));
948         *ret = CResult_NoneMonitorUpdateErrorZ_err(arg_conv);
949         return (long)ret;
950 }
951
952 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
953         LDKCResult_NoneMonitorUpdateErrorZ arg_conv = *(LDKCResult_NoneMonitorUpdateErrorZ*)arg;
954         free((void*)arg);
955         return CResult_NoneMonitorUpdateErrorZ_free(arg_conv);
956 }
957
958 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
959         LDKPaymentSendFailure arg_conv = *(LDKPaymentSendFailure*)arg;
960         free((void*)arg);
961         LDKCResult_NonePaymentSendFailureZ* ret = malloc(sizeof(LDKCResult_NonePaymentSendFailureZ));
962         *ret = CResult_NonePaymentSendFailureZ_err(arg_conv);
963         return (long)ret;
964 }
965
966 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
967         LDKCResult_NonePaymentSendFailureZ arg_conv = *(LDKCResult_NonePaymentSendFailureZ*)arg;
968         free((void*)arg);
969         return CResult_NonePaymentSendFailureZ_free(arg_conv);
970 }
971
972 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
973         LDKPeerHandleError arg_conv = *(LDKPeerHandleError*)arg;
974         free((void*)arg);
975         LDKCResult_NonePeerHandleErrorZ* ret = malloc(sizeof(LDKCResult_NonePeerHandleErrorZ));
976         *ret = CResult_NonePeerHandleErrorZ_err(arg_conv);
977         return (long)ret;
978 }
979
980 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
981         LDKCResult_NonePeerHandleErrorZ arg_conv = *(LDKCResult_NonePeerHandleErrorZ*)arg;
982         free((void*)arg);
983         return CResult_NonePeerHandleErrorZ_free(arg_conv);
984 }
985
986 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
987         LDKLightningError arg_conv = *(LDKLightningError*)arg;
988         free((void*)arg);
989         LDKCResult_RouteLightningErrorZ* ret = malloc(sizeof(LDKCResult_RouteLightningErrorZ));
990         *ret = CResult_RouteLightningErrorZ_err(arg_conv);
991         return (long)ret;
992 }
993
994 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
995         LDKCResult_RouteLightningErrorZ arg_conv = *(LDKCResult_RouteLightningErrorZ*)arg;
996         free((void*)arg);
997         return CResult_RouteLightningErrorZ_free(arg_conv);
998 }
999
1000 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
1001         LDKRoute arg_conv = *(LDKRoute*)arg;
1002         free((void*)arg);
1003         LDKCResult_RouteLightningErrorZ* ret = malloc(sizeof(LDKCResult_RouteLightningErrorZ));
1004         *ret = CResult_RouteLightningErrorZ_ok(arg_conv);
1005         return (long)ret;
1006 }
1007
1008 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1009         LDKCResult_SignatureNoneZ arg_conv = *(LDKCResult_SignatureNoneZ*)arg;
1010         free((void*)arg);
1011         return CResult_SignatureNoneZ_free(arg_conv);
1012 }
1013
1014 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
1015         LDKSignature arg_conv = *(LDKSignature*)arg;
1016         free((void*)arg);
1017         LDKCResult_SignatureNoneZ* ret = malloc(sizeof(LDKCResult_SignatureNoneZ));
1018         *ret = CResult_SignatureNoneZ_ok(arg_conv);
1019         return (long)ret;
1020 }
1021
1022 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysSecpErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
1023         LDKSecp256k1Error arg_conv = *(LDKSecp256k1Error*)arg;
1024         free((void*)arg);
1025         LDKCResult_TxCreationKeysSecpErrorZ* ret = malloc(sizeof(LDKCResult_TxCreationKeysSecpErrorZ));
1026         *ret = CResult_TxCreationKeysSecpErrorZ_err(arg_conv);
1027         return (long)ret;
1028 }
1029
1030 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysSecpErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1031         LDKCResult_TxCreationKeysSecpErrorZ arg_conv = *(LDKCResult_TxCreationKeysSecpErrorZ*)arg;
1032         free((void*)arg);
1033         return CResult_TxCreationKeysSecpErrorZ_free(arg_conv);
1034 }
1035
1036 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysSecpErrorZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
1037         LDKTxCreationKeys arg_conv = *(LDKTxCreationKeys*)arg;
1038         free((void*)arg);
1039         LDKCResult_TxCreationKeysSecpErrorZ* ret = malloc(sizeof(LDKCResult_TxCreationKeysSecpErrorZ));
1040         *ret = CResult_TxCreationKeysSecpErrorZ_ok(arg_conv);
1041         return (long)ret;
1042 }
1043
1044 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
1045         LDKLightningError arg_conv = *(LDKLightningError*)arg;
1046         free((void*)arg);
1047         LDKCResult_boolLightningErrorZ* ret = malloc(sizeof(LDKCResult_boolLightningErrorZ));
1048         *ret = CResult_boolLightningErrorZ_err(arg_conv);
1049         return (long)ret;
1050 }
1051
1052 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1053         LDKCResult_boolLightningErrorZ arg_conv = *(LDKCResult_boolLightningErrorZ*)arg;
1054         free((void*)arg);
1055         return CResult_boolLightningErrorZ_free(arg_conv);
1056 }
1057
1058 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1ok(JNIEnv * _env, jclass _b, jboolean arg) {
1059         LDKCResult_boolLightningErrorZ* ret = malloc(sizeof(LDKCResult_boolLightningErrorZ));
1060         *ret = CResult_boolLightningErrorZ_ok(arg);
1061         return (long)ret;
1062 }
1063
1064 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
1065         LDKPeerHandleError arg_conv = *(LDKPeerHandleError*)arg;
1066         free((void*)arg);
1067         LDKCResult_boolPeerHandleErrorZ* ret = malloc(sizeof(LDKCResult_boolPeerHandleErrorZ));
1068         *ret = CResult_boolPeerHandleErrorZ_err(arg_conv);
1069         return (long)ret;
1070 }
1071
1072 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1073         LDKCResult_boolPeerHandleErrorZ arg_conv = *(LDKCResult_boolPeerHandleErrorZ*)arg;
1074         free((void*)arg);
1075         return CResult_boolPeerHandleErrorZ_free(arg_conv);
1076 }
1077
1078 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1ok(JNIEnv * _env, jclass _b, jboolean arg) {
1079         LDKCResult_boolPeerHandleErrorZ* ret = malloc(sizeof(LDKCResult_boolPeerHandleErrorZ));
1080         *ret = CResult_boolPeerHandleErrorZ_ok(arg);
1081         return (long)ret;
1082 }
1083
1084 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1HTLCOutputInCommitmentSignatureZZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1085         LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ arg_conv = *(LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ*)arg;
1086         free((void*)arg);
1087         return CVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ_free(arg_conv);
1088 }
1089
1090 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1091         LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ arg_conv = *(LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ*)arg;
1092         free((void*)arg);
1093         return CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(arg_conv);
1094 }
1095
1096 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1CVec_1RouteHopZZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1097         LDKCVec_CVec_RouteHopZZ arg_conv = *(LDKCVec_CVec_RouteHopZZ*)arg;
1098         free((void*)arg);
1099         return CVec_CVec_RouteHopZZ_free(arg_conv);
1100 }
1101
1102 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ChannelDetailsZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1103         LDKCVec_ChannelDetailsZ arg_conv = *(LDKCVec_ChannelDetailsZ*)arg;
1104         free((void*)arg);
1105         return CVec_ChannelDetailsZ_free(arg_conv);
1106 }
1107
1108 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ChannelMonitorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1109         LDKCVec_ChannelMonitorZ arg_conv = *(LDKCVec_ChannelMonitorZ*)arg;
1110         free((void*)arg);
1111         return CVec_ChannelMonitorZ_free(arg_conv);
1112 }
1113
1114 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1EventZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1115         LDKCVec_EventZ arg_conv = *(LDKCVec_EventZ*)arg;
1116         free((void*)arg);
1117         return CVec_EventZ_free(arg_conv);
1118 }
1119
1120 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1HTLCOutputInCommitmentZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1121         LDKCVec_HTLCOutputInCommitmentZ arg_conv = *(LDKCVec_HTLCOutputInCommitmentZ*)arg;
1122         free((void*)arg);
1123         return CVec_HTLCOutputInCommitmentZ_free(arg_conv);
1124 }
1125
1126 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1MessageSendEventZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1127         LDKCVec_MessageSendEventZ arg_conv = *(LDKCVec_MessageSendEventZ*)arg;
1128         free((void*)arg);
1129         return CVec_MessageSendEventZ_free(arg_conv);
1130 }
1131
1132 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1MonitorEventZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1133         LDKCVec_MonitorEventZ arg_conv = *(LDKCVec_MonitorEventZ*)arg;
1134         free((void*)arg);
1135         return CVec_MonitorEventZ_free(arg_conv);
1136 }
1137
1138 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1NetAddressZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1139         LDKCVec_NetAddressZ arg_conv = *(LDKCVec_NetAddressZ*)arg;
1140         free((void*)arg);
1141         return CVec_NetAddressZ_free(arg_conv);
1142 }
1143
1144 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1NodeAnnouncementZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1145         LDKCVec_NodeAnnouncementZ arg_conv = *(LDKCVec_NodeAnnouncementZ*)arg;
1146         free((void*)arg);
1147         return CVec_NodeAnnouncementZ_free(arg_conv);
1148 }
1149
1150 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1PublicKeyZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1151         LDKCVec_PublicKeyZ arg_conv = *(LDKCVec_PublicKeyZ*)arg;
1152         free((void*)arg);
1153         return CVec_PublicKeyZ_free(arg_conv);
1154 }
1155
1156 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHintZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1157         LDKCVec_RouteHintZ arg_conv = *(LDKCVec_RouteHintZ*)arg;
1158         free((void*)arg);
1159         return CVec_RouteHintZ_free(arg_conv);
1160 }
1161
1162 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHopZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1163         LDKCVec_RouteHopZ arg_conv = *(LDKCVec_RouteHopZ*)arg;
1164         free((void*)arg);
1165         return CVec_RouteHopZ_free(arg_conv);
1166 }
1167
1168 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1SignatureZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1169         LDKCVec_SignatureZ arg_conv = *(LDKCVec_SignatureZ*)arg;
1170         free((void*)arg);
1171         return CVec_SignatureZ_free(arg_conv);
1172 }
1173
1174 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1SpendableOutputDescriptorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1175         LDKCVec_SpendableOutputDescriptorZ arg_conv = *(LDKCVec_SpendableOutputDescriptorZ*)arg;
1176         free((void*)arg);
1177         return CVec_SpendableOutputDescriptorZ_free(arg_conv);
1178 }
1179
1180 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1TransactionZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1181         LDKCVec_TransactionZ arg_conv = *(LDKCVec_TransactionZ*)arg;
1182         free((void*)arg);
1183         return CVec_TransactionZ_free(arg_conv);
1184 }
1185
1186 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateAddHTLCZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1187         LDKCVec_UpdateAddHTLCZ arg_conv = *(LDKCVec_UpdateAddHTLCZ*)arg;
1188         free((void*)arg);
1189         return CVec_UpdateAddHTLCZ_free(arg_conv);
1190 }
1191
1192 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateFailHTLCZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1193         LDKCVec_UpdateFailHTLCZ arg_conv = *(LDKCVec_UpdateFailHTLCZ*)arg;
1194         free((void*)arg);
1195         return CVec_UpdateFailHTLCZ_free(arg_conv);
1196 }
1197
1198 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateFailMalformedHTLCZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1199         LDKCVec_UpdateFailMalformedHTLCZ arg_conv = *(LDKCVec_UpdateFailMalformedHTLCZ*)arg;
1200         free((void*)arg);
1201         return CVec_UpdateFailMalformedHTLCZ_free(arg_conv);
1202 }
1203
1204 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateFulfillHTLCZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1205         LDKCVec_UpdateFulfillHTLCZ arg_conv = *(LDKCVec_UpdateFulfillHTLCZ*)arg;
1206         free((void*)arg);
1207         return CVec_UpdateFulfillHTLCZ_free(arg_conv);
1208 }
1209
1210 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1u64Z_1free(JNIEnv * _env, jclass _b, jlong arg) {
1211         LDKCVec_u64Z arg_conv = *(LDKCVec_u64Z*)arg;
1212         free((void*)arg);
1213         return CVec_u64Z_free(arg_conv);
1214 }
1215
1216 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1u8Z_1free(JNIEnv * _env, jclass _b, jlong arg) {
1217         LDKCVec_u8Z arg_conv = *(LDKCVec_u8Z*)arg;
1218         free((void*)arg);
1219         return CVec_u8Z_free(arg_conv);
1220 }
1221
1222 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1usizeZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1223         LDKCVec_usizeZ arg_conv = *(LDKCVec_usizeZ*)arg;
1224         free((void*)arg);
1225         return CVec_usizeZ_free(arg_conv);
1226 }
1227
1228 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxOut_1free(JNIEnv * _env, jclass _b, jlong _res) {
1229         LDKTxOut _res_conv = *(LDKTxOut*)_res;
1230         free((void*)_res);
1231         return TxOut_free(_res_conv);
1232 }
1233
1234 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1Txidu32Z_1new(JNIEnv * _env, jclass _b, jlong a, jint b) {
1235         LDKThirtyTwoBytes a_conv = *(LDKThirtyTwoBytes*)a;
1236         free((void*)a);
1237         LDKC2Tuple_Txidu32Z* ret = malloc(sizeof(LDKC2Tuple_Txidu32Z));
1238         *ret = C2Tuple_Txidu32Z_new(a_conv, b);
1239         return (long)ret;
1240 }
1241
1242 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1Scriptu64Z_1new(JNIEnv * _env, jclass _b, jlong a, jlong b) {
1243         LDKCVec_u8Z a_conv = *(LDKCVec_u8Z*)a;
1244         free((void*)a);
1245         LDKC2Tuple_Scriptu64Z* ret = malloc(sizeof(LDKC2Tuple_Scriptu64Z));
1246         *ret = C2Tuple_Scriptu64Z_new(a_conv, b);
1247         return (long)ret;
1248 }
1249
1250 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u64u64Z_1new(JNIEnv * _env, jclass _b, jlong a, jlong b) {
1251         LDKC2Tuple_u64u64Z* ret = malloc(sizeof(LDKC2Tuple_u64u64Z));
1252         *ret = C2Tuple_u64u64Z_new(a, b);
1253         return (long)ret;
1254 }
1255
1256 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1new(JNIEnv * _env, jclass _b, jlong a, jlong b) {
1257         LDKSignature a_conv = *(LDKSignature*)a;
1258         free((void*)a);
1259         LDKCVec_SignatureZ b_conv = *(LDKCVec_SignatureZ*)b;
1260         free((void*)b);
1261         LDKC2Tuple_SignatureCVec_SignatureZZ* ret = malloc(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ));
1262         *ret = C2Tuple_SignatureCVec_SignatureZZ_new(a_conv, b_conv);
1263         return (long)ret;
1264 }
1265
1266 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1err(JNIEnv * _env, jclass _b) {
1267         LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret = malloc(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ));
1268         *ret = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err();
1269         return (long)ret;
1270 }
1271
1272 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1err(JNIEnv * _env, jclass _b) {
1273         LDKCResult_SignatureNoneZ* ret = malloc(sizeof(LDKCResult_SignatureNoneZ));
1274         *ret = CResult_SignatureNoneZ_err();
1275         return (long)ret;
1276 }
1277
1278 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1err(JNIEnv * _env, jclass _b) {
1279         LDKCResult_CVec_SignatureZNoneZ* ret = malloc(sizeof(LDKCResult_CVec_SignatureZNoneZ));
1280         *ret = CResult_CVec_SignatureZNoneZ_err();
1281         return (long)ret;
1282 }
1283
1284 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1ok(JNIEnv * _env, jclass _b) {
1285         LDKCResult_NoneAPIErrorZ* ret = malloc(sizeof(LDKCResult_NoneAPIErrorZ));
1286         *ret = CResult_NoneAPIErrorZ_ok();
1287         return (long)ret;
1288 }
1289
1290 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1ok(JNIEnv * _env, jclass _b) {
1291         LDKCResult_NonePaymentSendFailureZ* ret = malloc(sizeof(LDKCResult_NonePaymentSendFailureZ));
1292         *ret = CResult_NonePaymentSendFailureZ_ok();
1293         return (long)ret;
1294 }
1295
1296 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1ok(JNIEnv * _env, jclass _b) {
1297         LDKCResult_NoneChannelMonitorUpdateErrZ* ret = malloc(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ));
1298         *ret = CResult_NoneChannelMonitorUpdateErrZ_ok();
1299         return (long)ret;
1300 }
1301
1302 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1ok(JNIEnv * _env, jclass _b) {
1303         LDKCResult_NoneMonitorUpdateErrorZ* ret = malloc(sizeof(LDKCResult_NoneMonitorUpdateErrorZ));
1304         *ret = CResult_NoneMonitorUpdateErrorZ_ok();
1305         return (long)ret;
1306 }
1307
1308 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1new(JNIEnv * _env, jclass _b, jlong a, jlong b) {
1309         LDKOutPoint a_conv = *(LDKOutPoint*)a;
1310         free((void*)a);
1311         a_conv._underlying_ref = false;
1312         LDKCVec_u8Z b_conv = *(LDKCVec_u8Z*)b;
1313         free((void*)b);
1314         LDKC2Tuple_OutPointScriptZ* ret = malloc(sizeof(LDKC2Tuple_OutPointScriptZ));
1315         *ret = C2Tuple_OutPointScriptZ_new(a_conv, b_conv);
1316         return (long)ret;
1317 }
1318
1319 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1new(JNIEnv * _env, jclass _b, jlong a, jlong b, jlong c) {
1320         LDKChannelAnnouncement a_conv = *(LDKChannelAnnouncement*)a;
1321         free((void*)a);
1322         a_conv._underlying_ref = false;
1323         LDKChannelUpdate b_conv = *(LDKChannelUpdate*)b;
1324         free((void*)b);
1325         b_conv._underlying_ref = false;
1326         LDKChannelUpdate c_conv = *(LDKChannelUpdate*)c;
1327         free((void*)c);
1328         c_conv._underlying_ref = false;
1329         LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret = malloc(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ));
1330         *ret = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(a_conv, b_conv, c_conv);
1331         return (long)ret;
1332 }
1333
1334 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1ok(JNIEnv * _env, jclass _b) {
1335         LDKCResult_NonePeerHandleErrorZ* ret = malloc(sizeof(LDKCResult_NonePeerHandleErrorZ));
1336         *ret = CResult_NonePeerHandleErrorZ_ok();
1337         return (long)ret;
1338 }
1339
1340 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1HTLCOutputInCommitmentSignatureZ_1new(JNIEnv * _env, jclass _b, jlong a, jlong b) {
1341         LDKHTLCOutputInCommitment a_conv = *(LDKHTLCOutputInCommitment*)a;
1342         free((void*)a);
1343         a_conv._underlying_ref = false;
1344         LDKSignature b_conv = *(LDKSignature*)b;
1345         free((void*)b);
1346         LDKC2Tuple_HTLCOutputInCommitmentSignatureZ* ret = malloc(sizeof(LDKC2Tuple_HTLCOutputInCommitmentSignatureZ));
1347         *ret = C2Tuple_HTLCOutputInCommitmentSignatureZ_new(a_conv, b_conv);
1348         return (long)ret;
1349 }
1350
1351 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Event_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
1352         LDKEvent this_ptr_conv = *(LDKEvent*)this_ptr;
1353         free((void*)this_ptr);
1354         return Event_free(this_ptr_conv);
1355 }
1356
1357 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
1358         LDKMessageSendEvent this_ptr_conv = *(LDKMessageSendEvent*)this_ptr;
1359         free((void*)this_ptr);
1360         return MessageSendEvent_free(this_ptr_conv);
1361 }
1362
1363 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageSendEventsProvider_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
1364         LDKMessageSendEventsProvider this_ptr_conv = *(LDKMessageSendEventsProvider*)this_ptr;
1365         free((void*)this_ptr);
1366         return MessageSendEventsProvider_free(this_ptr_conv);
1367 }
1368
1369 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EventsProvider_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
1370         LDKEventsProvider this_ptr_conv = *(LDKEventsProvider*)this_ptr;
1371         free((void*)this_ptr);
1372         return EventsProvider_free(this_ptr_conv);
1373 }
1374
1375 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_APIError_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
1376         LDKAPIError this_ptr_conv = *(LDKAPIError*)this_ptr;
1377         free((void*)this_ptr);
1378         return APIError_free(this_ptr_conv);
1379 }
1380
1381 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Level_1max(JNIEnv * _env, jclass _b) {
1382         LDKLevel* ret = malloc(sizeof(LDKLevel));
1383         *ret = Level_max();
1384         return (long)ret;
1385 }
1386
1387 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Logger_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
1388         LDKLogger this_ptr_conv = *(LDKLogger*)this_ptr;
1389         free((void*)this_ptr);
1390         return Logger_free(this_ptr_conv);
1391 }
1392
1393 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
1394         LDKChannelHandshakeConfig this_ptr_conv = *(LDKChannelHandshakeConfig*)this_ptr;
1395         free((void*)this_ptr);
1396         this_ptr_conv._underlying_ref = false;
1397         return ChannelHandshakeConfig_free(this_ptr_conv);
1398 }
1399
1400 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1minimum_1depth(JNIEnv * _env, jclass _b, jlong this_ptr) {
1401         LDKChannelHandshakeConfig* this_ptr_conv = (LDKChannelHandshakeConfig*)this_ptr;
1402         return ChannelHandshakeConfig_get_minimum_depth(this_ptr_conv);
1403 }
1404
1405 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1minimum_1depth(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
1406         LDKChannelHandshakeConfig* this_ptr_conv = (LDKChannelHandshakeConfig*)this_ptr;
1407         return ChannelHandshakeConfig_set_minimum_depth(this_ptr_conv, val);
1408 }
1409
1410 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1our_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr) {
1411         LDKChannelHandshakeConfig* this_ptr_conv = (LDKChannelHandshakeConfig*)this_ptr;
1412         uint16_t* ret = malloc(sizeof(uint16_t));
1413         *ret = ChannelHandshakeConfig_get_our_to_self_delay(this_ptr_conv);
1414         return (long)ret;
1415 }
1416
1417 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1our_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
1418         LDKChannelHandshakeConfig* this_ptr_conv = (LDKChannelHandshakeConfig*)this_ptr;
1419         uint16_t val_conv = *(uint16_t*)val;
1420         free((void*)val);
1421         return ChannelHandshakeConfig_set_our_to_self_delay(this_ptr_conv, val_conv);
1422 }
1423
1424 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1our_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
1425         LDKChannelHandshakeConfig* this_ptr_conv = (LDKChannelHandshakeConfig*)this_ptr;
1426         return ChannelHandshakeConfig_get_our_htlc_minimum_msat(this_ptr_conv);
1427 }
1428
1429 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1our_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
1430         LDKChannelHandshakeConfig* this_ptr_conv = (LDKChannelHandshakeConfig*)this_ptr;
1431         return ChannelHandshakeConfig_set_our_htlc_minimum_msat(this_ptr_conv, val);
1432 }
1433
1434 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1new(JNIEnv * _env, jclass _b, jint minimum_depth_arg, jlong our_to_self_delay_arg, jlong our_htlc_minimum_msat_arg) {
1435         uint16_t our_to_self_delay_arg_conv = *(uint16_t*)our_to_self_delay_arg;
1436         free((void*)our_to_self_delay_arg);
1437         LDKChannelHandshakeConfig* ret = malloc(sizeof(LDKChannelHandshakeConfig));
1438         *ret = ChannelHandshakeConfig_new(minimum_depth_arg, our_to_self_delay_arg_conv, our_htlc_minimum_msat_arg);
1439         assert(!ret->_underlying_ref);
1440         ret->_underlying_ref = true;
1441         return (long)ret;
1442 }
1443
1444 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1default(JNIEnv * _env, jclass _b) {
1445         LDKChannelHandshakeConfig* ret = malloc(sizeof(LDKChannelHandshakeConfig));
1446         *ret = ChannelHandshakeConfig_default();
1447         assert(!ret->_underlying_ref);
1448         ret->_underlying_ref = true;
1449         return (long)ret;
1450 }
1451
1452 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
1453         LDKChannelHandshakeLimits this_ptr_conv = *(LDKChannelHandshakeLimits*)this_ptr;
1454         free((void*)this_ptr);
1455         this_ptr_conv._underlying_ref = false;
1456         return ChannelHandshakeLimits_free(this_ptr_conv);
1457 }
1458
1459 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1min_1funding_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
1460         LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
1461         return ChannelHandshakeLimits_get_min_funding_satoshis(this_ptr_conv);
1462 }
1463
1464 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1min_1funding_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
1465         LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
1466         return ChannelHandshakeLimits_set_min_funding_satoshis(this_ptr_conv, val);
1467 }
1468
1469 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1max_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
1470         LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
1471         return ChannelHandshakeLimits_get_max_htlc_minimum_msat(this_ptr_conv);
1472 }
1473
1474 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1max_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
1475         LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
1476         return ChannelHandshakeLimits_set_max_htlc_minimum_msat(this_ptr_conv, val);
1477 }
1478
1479 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1min_1max_1htlc_1value_1in_1flight_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
1480         LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
1481         return ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(this_ptr_conv);
1482 }
1483
1484 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1min_1max_1htlc_1value_1in_1flight_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
1485         LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
1486         return ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(this_ptr_conv, val);
1487 }
1488
1489 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1max_1channel_1reserve_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
1490         LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
1491         return ChannelHandshakeLimits_get_max_channel_reserve_satoshis(this_ptr_conv);
1492 }
1493
1494 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1max_1channel_1reserve_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
1495         LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
1496         return ChannelHandshakeLimits_set_max_channel_reserve_satoshis(this_ptr_conv, val);
1497 }
1498
1499 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1min_1max_1accepted_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr) {
1500         LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
1501         uint16_t* ret = malloc(sizeof(uint16_t));
1502         *ret = ChannelHandshakeLimits_get_min_max_accepted_htlcs(this_ptr_conv);
1503         return (long)ret;
1504 }
1505
1506 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1min_1max_1accepted_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
1507         LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
1508         uint16_t val_conv = *(uint16_t*)val;
1509         free((void*)val);
1510         return ChannelHandshakeLimits_set_min_max_accepted_htlcs(this_ptr_conv, val_conv);
1511 }
1512
1513 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1min_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
1514         LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
1515         return ChannelHandshakeLimits_get_min_dust_limit_satoshis(this_ptr_conv);
1516 }
1517
1518 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1min_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
1519         LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
1520         return ChannelHandshakeLimits_set_min_dust_limit_satoshis(this_ptr_conv, val);
1521 }
1522
1523 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1max_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
1524         LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
1525         return ChannelHandshakeLimits_get_max_dust_limit_satoshis(this_ptr_conv);
1526 }
1527
1528 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1max_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
1529         LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
1530         return ChannelHandshakeLimits_set_max_dust_limit_satoshis(this_ptr_conv, val);
1531 }
1532
1533 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1max_1minimum_1depth(JNIEnv * _env, jclass _b, jlong this_ptr) {
1534         LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
1535         return ChannelHandshakeLimits_get_max_minimum_depth(this_ptr_conv);
1536 }
1537
1538 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1max_1minimum_1depth(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
1539         LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
1540         return ChannelHandshakeLimits_set_max_minimum_depth(this_ptr_conv, val);
1541 }
1542
1543 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1force_1announced_1channel_1preference(JNIEnv * _env, jclass _b, jlong this_ptr) {
1544         LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
1545         return ChannelHandshakeLimits_get_force_announced_channel_preference(this_ptr_conv);
1546 }
1547
1548 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1force_1announced_1channel_1preference(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
1549         LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
1550         return ChannelHandshakeLimits_set_force_announced_channel_preference(this_ptr_conv, val);
1551 }
1552
1553 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1their_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr) {
1554         LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
1555         uint16_t* ret = malloc(sizeof(uint16_t));
1556         *ret = ChannelHandshakeLimits_get_their_to_self_delay(this_ptr_conv);
1557         return (long)ret;
1558 }
1559
1560 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1their_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
1561         LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
1562         uint16_t val_conv = *(uint16_t*)val;
1563         free((void*)val);
1564         return ChannelHandshakeLimits_set_their_to_self_delay(this_ptr_conv, val_conv);
1565 }
1566
1567 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1new(JNIEnv * _env, jclass _b, jlong min_funding_satoshis_arg, jlong max_htlc_minimum_msat_arg, jlong min_max_htlc_value_in_flight_msat_arg, jlong max_channel_reserve_satoshis_arg, jlong min_max_accepted_htlcs_arg, jlong min_dust_limit_satoshis_arg, jlong max_dust_limit_satoshis_arg, jint max_minimum_depth_arg, jboolean force_announced_channel_preference_arg, jlong their_to_self_delay_arg) {
1568         uint16_t min_max_accepted_htlcs_arg_conv = *(uint16_t*)min_max_accepted_htlcs_arg;
1569         free((void*)min_max_accepted_htlcs_arg);
1570         uint16_t their_to_self_delay_arg_conv = *(uint16_t*)their_to_self_delay_arg;
1571         free((void*)their_to_self_delay_arg);
1572         LDKChannelHandshakeLimits* ret = malloc(sizeof(LDKChannelHandshakeLimits));
1573         *ret = ChannelHandshakeLimits_new(min_funding_satoshis_arg, max_htlc_minimum_msat_arg, min_max_htlc_value_in_flight_msat_arg, max_channel_reserve_satoshis_arg, min_max_accepted_htlcs_arg_conv, min_dust_limit_satoshis_arg, max_dust_limit_satoshis_arg, max_minimum_depth_arg, force_announced_channel_preference_arg, their_to_self_delay_arg_conv);
1574         assert(!ret->_underlying_ref);
1575         ret->_underlying_ref = true;
1576         return (long)ret;
1577 }
1578
1579 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1default(JNIEnv * _env, jclass _b) {
1580         LDKChannelHandshakeLimits* ret = malloc(sizeof(LDKChannelHandshakeLimits));
1581         *ret = ChannelHandshakeLimits_default();
1582         assert(!ret->_underlying_ref);
1583         ret->_underlying_ref = true;
1584         return (long)ret;
1585 }
1586
1587 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
1588         LDKChannelConfig this_ptr_conv = *(LDKChannelConfig*)this_ptr;
1589         free((void*)this_ptr);
1590         this_ptr_conv._underlying_ref = false;
1591         return ChannelConfig_free(this_ptr_conv);
1592 }
1593
1594 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1fee_1proportional_1millionths(JNIEnv * _env, jclass _b, jlong this_ptr) {
1595         LDKChannelConfig* this_ptr_conv = (LDKChannelConfig*)this_ptr;
1596         return ChannelConfig_get_fee_proportional_millionths(this_ptr_conv);
1597 }
1598
1599 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1fee_1proportional_1millionths(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
1600         LDKChannelConfig* this_ptr_conv = (LDKChannelConfig*)this_ptr;
1601         return ChannelConfig_set_fee_proportional_millionths(this_ptr_conv, val);
1602 }
1603
1604 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1announced_1channel(JNIEnv * _env, jclass _b, jlong this_ptr) {
1605         LDKChannelConfig* this_ptr_conv = (LDKChannelConfig*)this_ptr;
1606         return ChannelConfig_get_announced_channel(this_ptr_conv);
1607 }
1608
1609 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1announced_1channel(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
1610         LDKChannelConfig* this_ptr_conv = (LDKChannelConfig*)this_ptr;
1611         return ChannelConfig_set_announced_channel(this_ptr_conv, val);
1612 }
1613
1614 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1commit_1upfront_1shutdown_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr) {
1615         LDKChannelConfig* this_ptr_conv = (LDKChannelConfig*)this_ptr;
1616         return ChannelConfig_get_commit_upfront_shutdown_pubkey(this_ptr_conv);
1617 }
1618
1619 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1commit_1upfront_1shutdown_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
1620         LDKChannelConfig* this_ptr_conv = (LDKChannelConfig*)this_ptr;
1621         return ChannelConfig_set_commit_upfront_shutdown_pubkey(this_ptr_conv, val);
1622 }
1623
1624 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1new(JNIEnv * _env, jclass _b, jint fee_proportional_millionths_arg, jboolean announced_channel_arg, jboolean commit_upfront_shutdown_pubkey_arg) {
1625         LDKChannelConfig* ret = malloc(sizeof(LDKChannelConfig));
1626         *ret = ChannelConfig_new(fee_proportional_millionths_arg, announced_channel_arg, commit_upfront_shutdown_pubkey_arg);
1627         assert(!ret->_underlying_ref);
1628         ret->_underlying_ref = true;
1629         return (long)ret;
1630 }
1631
1632 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1default(JNIEnv * _env, jclass _b) {
1633         LDKChannelConfig* ret = malloc(sizeof(LDKChannelConfig));
1634         *ret = ChannelConfig_default();
1635         assert(!ret->_underlying_ref);
1636         ret->_underlying_ref = true;
1637         return (long)ret;
1638 }
1639
1640 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1write(JNIEnv * _env, jclass _b, jlong obj) {
1641         LDKChannelConfig* obj_conv = (LDKChannelConfig*)obj;
1642         LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
1643         *ret = ChannelConfig_write(obj_conv);
1644         return (long)ret;
1645 }
1646
1647 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1read(JNIEnv * _env, jclass _b, jlong ser) {
1648         LDKu8slice ser_conv = *(LDKu8slice*)ser;
1649         free((void*)ser);
1650         LDKChannelConfig* ret = malloc(sizeof(LDKChannelConfig));
1651         *ret = ChannelConfig_read(ser_conv);
1652         assert(!ret->_underlying_ref);
1653         ret->_underlying_ref = true;
1654         return (long)ret;
1655 }
1656
1657 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
1658         LDKUserConfig this_ptr_conv = *(LDKUserConfig*)this_ptr;
1659         free((void*)this_ptr);
1660         this_ptr_conv._underlying_ref = false;
1661         return UserConfig_free(this_ptr_conv);
1662 }
1663
1664 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1own_1channel_1config(JNIEnv * _env, jclass _b, jlong this_ptr) {
1665         LDKUserConfig* this_ptr_conv = (LDKUserConfig*)this_ptr;
1666         LDKChannelHandshakeConfig* ret = malloc(sizeof(LDKChannelHandshakeConfig));
1667         *ret = UserConfig_get_own_channel_config(this_ptr_conv);
1668         assert(!ret->_underlying_ref);
1669         ret->_underlying_ref = true;
1670         return (long)ret;
1671 }
1672
1673 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1own_1channel_1config(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
1674         LDKUserConfig* this_ptr_conv = (LDKUserConfig*)this_ptr;
1675         LDKChannelHandshakeConfig val_conv = *(LDKChannelHandshakeConfig*)val;
1676         free((void*)val);
1677         val_conv._underlying_ref = false;
1678         return UserConfig_set_own_channel_config(this_ptr_conv, val_conv);
1679 }
1680
1681 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1peer_1channel_1config_1limits(JNIEnv * _env, jclass _b, jlong this_ptr) {
1682         LDKUserConfig* this_ptr_conv = (LDKUserConfig*)this_ptr;
1683         LDKChannelHandshakeLimits* ret = malloc(sizeof(LDKChannelHandshakeLimits));
1684         *ret = UserConfig_get_peer_channel_config_limits(this_ptr_conv);
1685         assert(!ret->_underlying_ref);
1686         ret->_underlying_ref = true;
1687         return (long)ret;
1688 }
1689
1690 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1peer_1channel_1config_1limits(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
1691         LDKUserConfig* this_ptr_conv = (LDKUserConfig*)this_ptr;
1692         LDKChannelHandshakeLimits val_conv = *(LDKChannelHandshakeLimits*)val;
1693         free((void*)val);
1694         val_conv._underlying_ref = false;
1695         return UserConfig_set_peer_channel_config_limits(this_ptr_conv, val_conv);
1696 }
1697
1698 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1channel_1options(JNIEnv * _env, jclass _b, jlong this_ptr) {
1699         LDKUserConfig* this_ptr_conv = (LDKUserConfig*)this_ptr;
1700         LDKChannelConfig* ret = malloc(sizeof(LDKChannelConfig));
1701         *ret = UserConfig_get_channel_options(this_ptr_conv);
1702         assert(!ret->_underlying_ref);
1703         ret->_underlying_ref = true;
1704         return (long)ret;
1705 }
1706
1707 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1channel_1options(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
1708         LDKUserConfig* this_ptr_conv = (LDKUserConfig*)this_ptr;
1709         LDKChannelConfig val_conv = *(LDKChannelConfig*)val;
1710         free((void*)val);
1711         val_conv._underlying_ref = false;
1712         return UserConfig_set_channel_options(this_ptr_conv, val_conv);
1713 }
1714
1715 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UserConfig_1new(JNIEnv * _env, jclass _b, jlong own_channel_config_arg, jlong peer_channel_config_limits_arg, jlong channel_options_arg) {
1716         LDKChannelHandshakeConfig own_channel_config_arg_conv = *(LDKChannelHandshakeConfig*)own_channel_config_arg;
1717         free((void*)own_channel_config_arg);
1718         own_channel_config_arg_conv._underlying_ref = false;
1719         LDKChannelHandshakeLimits peer_channel_config_limits_arg_conv = *(LDKChannelHandshakeLimits*)peer_channel_config_limits_arg;
1720         free((void*)peer_channel_config_limits_arg);
1721         peer_channel_config_limits_arg_conv._underlying_ref = false;
1722         LDKChannelConfig channel_options_arg_conv = *(LDKChannelConfig*)channel_options_arg;
1723         free((void*)channel_options_arg);
1724         channel_options_arg_conv._underlying_ref = false;
1725         LDKUserConfig* ret = malloc(sizeof(LDKUserConfig));
1726         *ret = UserConfig_new(own_channel_config_arg_conv, peer_channel_config_limits_arg_conv, channel_options_arg_conv);
1727         assert(!ret->_underlying_ref);
1728         ret->_underlying_ref = true;
1729         return (long)ret;
1730 }
1731
1732 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UserConfig_1default(JNIEnv * _env, jclass _b) {
1733         LDKUserConfig* ret = malloc(sizeof(LDKUserConfig));
1734         *ret = UserConfig_default();
1735         assert(!ret->_underlying_ref);
1736         ret->_underlying_ref = true;
1737         return (long)ret;
1738 }
1739
1740 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainWatchInterface_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
1741         LDKChainWatchInterface this_ptr_conv = *(LDKChainWatchInterface*)this_ptr;
1742         free((void*)this_ptr);
1743         return ChainWatchInterface_free(this_ptr_conv);
1744 }
1745
1746 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BroadcasterInterface_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
1747         LDKBroadcasterInterface this_ptr_conv = *(LDKBroadcasterInterface*)this_ptr;
1748         free((void*)this_ptr);
1749         return BroadcasterInterface_free(this_ptr_conv);
1750 }
1751
1752 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainListener_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
1753         LDKChainListener this_ptr_conv = *(LDKChainListener*)this_ptr;
1754         free((void*)this_ptr);
1755         return ChainListener_free(this_ptr_conv);
1756 }
1757
1758 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FeeEstimator_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
1759         LDKFeeEstimator this_ptr_conv = *(LDKFeeEstimator*)this_ptr;
1760         free((void*)this_ptr);
1761         return FeeEstimator_free(this_ptr_conv);
1762 }
1763
1764 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainWatchedUtil_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
1765         LDKChainWatchedUtil this_ptr_conv = *(LDKChainWatchedUtil*)this_ptr;
1766         free((void*)this_ptr);
1767         this_ptr_conv._underlying_ref = false;
1768         return ChainWatchedUtil_free(this_ptr_conv);
1769 }
1770
1771 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChainWatchedUtil_1new(JNIEnv * _env, jclass _b) {
1772         LDKChainWatchedUtil* ret = malloc(sizeof(LDKChainWatchedUtil));
1773         *ret = ChainWatchedUtil_new();
1774         assert(!ret->_underlying_ref);
1775         ret->_underlying_ref = true;
1776         return (long)ret;
1777 }
1778
1779 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChainWatchedUtil_1register_1tx(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray txid, jlong script_pub_key) {
1780         LDKChainWatchedUtil* this_arg_conv = (LDKChainWatchedUtil*)this_arg;
1781         unsigned char txid_arr[32];
1782         (*_env)->GetByteArrayRegion (_env, txid, 0, 32, txid_arr);
1783         unsigned char (*txid_ref)[32] = &txid_arr;
1784         LDKu8slice script_pub_key_conv = *(LDKu8slice*)script_pub_key;
1785         free((void*)script_pub_key);
1786         return ChainWatchedUtil_register_tx(this_arg_conv, txid_ref, script_pub_key_conv);
1787 }
1788
1789 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChainWatchedUtil_1register_1outpoint(JNIEnv * _env, jclass _b, jlong this_arg, jlong outpoint, jlong _script_pub_key) {
1790         LDKChainWatchedUtil* this_arg_conv = (LDKChainWatchedUtil*)this_arg;
1791         LDKC2Tuple_Txidu32Z outpoint_conv = *(LDKC2Tuple_Txidu32Z*)outpoint;
1792         free((void*)outpoint);
1793         LDKu8slice _script_pub_key_conv = *(LDKu8slice*)_script_pub_key;
1794         free((void*)_script_pub_key);
1795         return ChainWatchedUtil_register_outpoint(this_arg_conv, outpoint_conv, _script_pub_key_conv);
1796 }
1797
1798 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChainWatchedUtil_1watch_1all(JNIEnv * _env, jclass _b, jlong this_arg) {
1799         LDKChainWatchedUtil* this_arg_conv = (LDKChainWatchedUtil*)this_arg;
1800         return ChainWatchedUtil_watch_all(this_arg_conv);
1801 }
1802
1803 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChainWatchedUtil_1does_1match_1tx(JNIEnv * _env, jclass _b, jlong this_arg, jlong tx) {
1804         LDKChainWatchedUtil* this_arg_conv = (LDKChainWatchedUtil*)this_arg;
1805         LDKTransaction tx_conv = *(LDKTransaction*)tx;
1806         free((void*)tx);
1807         return ChainWatchedUtil_does_match_tx(this_arg_conv, tx_conv);
1808 }
1809
1810 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlockNotifier_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
1811         LDKBlockNotifier this_ptr_conv = *(LDKBlockNotifier*)this_ptr;
1812         free((void*)this_ptr);
1813         this_ptr_conv._underlying_ref = false;
1814         return BlockNotifier_free(this_ptr_conv);
1815 }
1816
1817 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlockNotifier_1new(JNIEnv * _env, jclass _b, jlong chain_monitor) {
1818         LDKChainWatchInterface chain_monitor_conv = *(LDKChainWatchInterface*)chain_monitor;
1819         free((void*)chain_monitor);
1820         LDKBlockNotifier* ret = malloc(sizeof(LDKBlockNotifier));
1821         *ret = BlockNotifier_new(chain_monitor_conv);
1822         assert(!ret->_underlying_ref);
1823         ret->_underlying_ref = true;
1824         return (long)ret;
1825 }
1826
1827 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlockNotifier_1register_1listener(JNIEnv * _env, jclass _b, jlong this_arg, jlong listener) {
1828         LDKBlockNotifier* this_arg_conv = (LDKBlockNotifier*)this_arg;
1829         LDKChainListener listener_conv = *(LDKChainListener*)listener;
1830         free((void*)listener);
1831         return BlockNotifier_register_listener(this_arg_conv, listener_conv);
1832 }
1833
1834 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlockNotifier_1block_1connected(JNIEnv * _env, jclass _b, jlong this_arg, jlong block, jint height) {
1835         LDKBlockNotifier* this_arg_conv = (LDKBlockNotifier*)this_arg;
1836         LDKu8slice block_conv = *(LDKu8slice*)block;
1837         free((void*)block);
1838         return BlockNotifier_block_connected(this_arg_conv, block_conv, height);
1839 }
1840
1841 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_BlockNotifier_1block_1connected_1checked(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray header, jint height, jlong txn_matched, jlong indexes_of_txn_matched) {
1842         LDKBlockNotifier* this_arg_conv = (LDKBlockNotifier*)this_arg;
1843         unsigned char header_arr[80];
1844         (*_env)->GetByteArrayRegion (_env, header, 0, 80, header_arr);
1845         unsigned char (*header_ref)[80] = &header_arr;
1846         LDKCVec_TransactionZ txn_matched_conv = *(LDKCVec_TransactionZ*)txn_matched;
1847         free((void*)txn_matched);
1848         LDKusizeslice indexes_of_txn_matched_conv = *(LDKusizeslice*)indexes_of_txn_matched;
1849         free((void*)indexes_of_txn_matched);
1850         return BlockNotifier_block_connected_checked(this_arg_conv, header_ref, height, txn_matched_conv, indexes_of_txn_matched_conv);
1851 }
1852
1853 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlockNotifier_1block_1disconnected(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray header, jint disconnected_height) {
1854         LDKBlockNotifier* this_arg_conv = (LDKBlockNotifier*)this_arg;
1855         unsigned char header_arr[80];
1856         (*_env)->GetByteArrayRegion (_env, header, 0, 80, header_arr);
1857         unsigned char (*header_ref)[80] = &header_arr;
1858         return BlockNotifier_block_disconnected(this_arg_conv, header_ref, disconnected_height);
1859 }
1860
1861 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainWatchInterfaceUtil_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
1862         LDKChainWatchInterfaceUtil this_ptr_conv = *(LDKChainWatchInterfaceUtil*)this_ptr;
1863         free((void*)this_ptr);
1864         this_ptr_conv._underlying_ref = false;
1865         return ChainWatchInterfaceUtil_free(this_ptr_conv);
1866 }
1867
1868 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChainWatchInterfaceUtil_1as_1ChainWatchInterface(JNIEnv * _env, jclass _b, jlong this_arg) {
1869         LDKChainWatchInterfaceUtil* this_arg_conv = (LDKChainWatchInterfaceUtil*)this_arg;
1870         LDKChainWatchInterface* ret = malloc(sizeof(LDKChainWatchInterface));
1871         *ret = ChainWatchInterfaceUtil_as_ChainWatchInterface(this_arg_conv);
1872         return (long)ret;
1873 }
1874
1875 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChainWatchInterfaceUtil_1new(JNIEnv * _env, jclass _b, jlong network) {
1876         LDKNetwork network_conv = *(LDKNetwork*)network;
1877         free((void*)network);
1878         LDKChainWatchInterfaceUtil* ret = malloc(sizeof(LDKChainWatchInterfaceUtil));
1879         *ret = ChainWatchInterfaceUtil_new(network_conv);
1880         assert(!ret->_underlying_ref);
1881         ret->_underlying_ref = true;
1882         return (long)ret;
1883 }
1884
1885 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChainWatchInterfaceUtil_1does_1match_1tx(JNIEnv * _env, jclass _b, jlong this_arg, jlong tx) {
1886         LDKChainWatchInterfaceUtil* this_arg_conv = (LDKChainWatchInterfaceUtil*)this_arg;
1887         LDKTransaction tx_conv = *(LDKTransaction*)tx;
1888         free((void*)tx);
1889         return ChainWatchInterfaceUtil_does_match_tx(this_arg_conv, tx_conv);
1890 }
1891
1892 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
1893         LDKOutPoint this_ptr_conv = *(LDKOutPoint*)this_ptr;
1894         free((void*)this_ptr);
1895         this_ptr_conv._underlying_ref = false;
1896         return OutPoint_free(this_ptr_conv);
1897 }
1898
1899 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OutPoint_1get_1txid(JNIEnv * _env, jclass _b, jlong this_ptr) {
1900         LDKOutPoint* this_ptr_conv = (LDKOutPoint*)this_ptr;
1901         jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
1902         (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *OutPoint_get_txid(this_ptr_conv));
1903         return ret_arr;
1904 }
1905
1906 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1set_1txid(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
1907         LDKOutPoint* this_ptr_conv = (LDKOutPoint*)this_ptr;
1908         LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
1909         free((void*)val);
1910         return OutPoint_set_txid(this_ptr_conv, val_conv);
1911 }
1912
1913 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OutPoint_1get_1index(JNIEnv * _env, jclass _b, jlong this_ptr) {
1914         LDKOutPoint* this_ptr_conv = (LDKOutPoint*)this_ptr;
1915         uint16_t* ret = malloc(sizeof(uint16_t));
1916         *ret = OutPoint_get_index(this_ptr_conv);
1917         return (long)ret;
1918 }
1919
1920 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1set_1index(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
1921         LDKOutPoint* this_ptr_conv = (LDKOutPoint*)this_ptr;
1922         uint16_t val_conv = *(uint16_t*)val;
1923         free((void*)val);
1924         return OutPoint_set_index(this_ptr_conv, val_conv);
1925 }
1926
1927 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OutPoint_1new(JNIEnv * _env, jclass _b, jlong txid_arg, jlong index_arg) {
1928         LDKThirtyTwoBytes txid_arg_conv = *(LDKThirtyTwoBytes*)txid_arg;
1929         free((void*)txid_arg);
1930         uint16_t index_arg_conv = *(uint16_t*)index_arg;
1931         free((void*)index_arg);
1932         LDKOutPoint* ret = malloc(sizeof(LDKOutPoint));
1933         *ret = OutPoint_new(txid_arg_conv, index_arg_conv);
1934         assert(!ret->_underlying_ref);
1935         ret->_underlying_ref = true;
1936         return (long)ret;
1937 }
1938
1939 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OutPoint_1to_1channel_1id(JNIEnv * _env, jclass _b, jlong this_arg) {
1940         LDKOutPoint* this_arg_conv = (LDKOutPoint*)this_arg;
1941         LDKThirtyTwoBytes* ret = malloc(sizeof(LDKThirtyTwoBytes));
1942         *ret = OutPoint_to_channel_id(this_arg_conv);
1943         return (long)ret;
1944 }
1945
1946 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OutPoint_1write(JNIEnv * _env, jclass _b, jlong obj) {
1947         LDKOutPoint* obj_conv = (LDKOutPoint*)obj;
1948         LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
1949         *ret = OutPoint_write(obj_conv);
1950         return (long)ret;
1951 }
1952
1953 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OutPoint_1read(JNIEnv * _env, jclass _b, jlong ser) {
1954         LDKu8slice ser_conv = *(LDKu8slice*)ser;
1955         free((void*)ser);
1956         LDKOutPoint* ret = malloc(sizeof(LDKOutPoint));
1957         *ret = OutPoint_read(ser_conv);
1958         assert(!ret->_underlying_ref);
1959         ret->_underlying_ref = true;
1960         return (long)ret;
1961 }
1962
1963 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
1964         LDKSpendableOutputDescriptor this_ptr_conv = *(LDKSpendableOutputDescriptor*)this_ptr;
1965         free((void*)this_ptr);
1966         return SpendableOutputDescriptor_free(this_ptr_conv);
1967 }
1968
1969 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
1970         LDKChannelKeys this_ptr_conv = *(LDKChannelKeys*)this_ptr;
1971         free((void*)this_ptr);
1972         return ChannelKeys_free(this_ptr_conv);
1973 }
1974
1975 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_KeysInterface_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
1976         LDKKeysInterface this_ptr_conv = *(LDKKeysInterface*)this_ptr;
1977         free((void*)this_ptr);
1978         return KeysInterface_free(this_ptr_conv);
1979 }
1980
1981 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
1982         LDKInMemoryChannelKeys this_ptr_conv = *(LDKInMemoryChannelKeys*)this_ptr;
1983         free((void*)this_ptr);
1984         this_ptr_conv._underlying_ref = false;
1985         return InMemoryChannelKeys_free(this_ptr_conv);
1986 }
1987
1988 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1funding_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
1989         LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
1990         jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
1991         (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *InMemoryChannelKeys_get_funding_key(this_ptr_conv));
1992         return ret_arr;
1993 }
1994
1995 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1funding_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
1996         LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
1997         LDKSecretKey val_conv = *(LDKSecretKey*)val;
1998         free((void*)val);
1999         return InMemoryChannelKeys_set_funding_key(this_ptr_conv, val_conv);
2000 }
2001
2002 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1revocation_1base_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
2003         LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
2004         jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
2005         (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *InMemoryChannelKeys_get_revocation_base_key(this_ptr_conv));
2006         return ret_arr;
2007 }
2008
2009 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1revocation_1base_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2010         LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
2011         LDKSecretKey val_conv = *(LDKSecretKey*)val;
2012         free((void*)val);
2013         return InMemoryChannelKeys_set_revocation_base_key(this_ptr_conv, val_conv);
2014 }
2015
2016 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1payment_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
2017         LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
2018         jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
2019         (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *InMemoryChannelKeys_get_payment_key(this_ptr_conv));
2020         return ret_arr;
2021 }
2022
2023 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1payment_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2024         LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
2025         LDKSecretKey val_conv = *(LDKSecretKey*)val;
2026         free((void*)val);
2027         return InMemoryChannelKeys_set_payment_key(this_ptr_conv, val_conv);
2028 }
2029
2030 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1delayed_1payment_1base_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
2031         LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
2032         jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
2033         (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *InMemoryChannelKeys_get_delayed_payment_base_key(this_ptr_conv));
2034         return ret_arr;
2035 }
2036
2037 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1delayed_1payment_1base_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2038         LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
2039         LDKSecretKey val_conv = *(LDKSecretKey*)val;
2040         free((void*)val);
2041         return InMemoryChannelKeys_set_delayed_payment_base_key(this_ptr_conv, val_conv);
2042 }
2043
2044 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1htlc_1base_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
2045         LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
2046         jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
2047         (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *InMemoryChannelKeys_get_htlc_base_key(this_ptr_conv));
2048         return ret_arr;
2049 }
2050
2051 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1htlc_1base_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2052         LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
2053         LDKSecretKey val_conv = *(LDKSecretKey*)val;
2054         free((void*)val);
2055         return InMemoryChannelKeys_set_htlc_base_key(this_ptr_conv, val_conv);
2056 }
2057
2058 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1commitment_1seed(JNIEnv * _env, jclass _b, jlong this_ptr) {
2059         LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
2060         jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
2061         (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *InMemoryChannelKeys_get_commitment_seed(this_ptr_conv));
2062         return ret_arr;
2063 }
2064
2065 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1commitment_1seed(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2066         LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
2067         LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
2068         free((void*)val);
2069         return InMemoryChannelKeys_set_commitment_seed(this_ptr_conv, val_conv);
2070 }
2071
2072 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1new(JNIEnv * _env, jclass _b, jlong funding_key, jlong revocation_base_key, jlong payment_key, jlong delayed_payment_base_key, jlong htlc_base_key, jlong commitment_seed, jlong channel_value_satoshis, jlong key_derivation_params) {
2073         LDKSecretKey funding_key_conv = *(LDKSecretKey*)funding_key;
2074         free((void*)funding_key);
2075         LDKSecretKey revocation_base_key_conv = *(LDKSecretKey*)revocation_base_key;
2076         free((void*)revocation_base_key);
2077         LDKSecretKey payment_key_conv = *(LDKSecretKey*)payment_key;
2078         free((void*)payment_key);
2079         LDKSecretKey delayed_payment_base_key_conv = *(LDKSecretKey*)delayed_payment_base_key;
2080         free((void*)delayed_payment_base_key);
2081         LDKSecretKey htlc_base_key_conv = *(LDKSecretKey*)htlc_base_key;
2082         free((void*)htlc_base_key);
2083         LDKThirtyTwoBytes commitment_seed_conv = *(LDKThirtyTwoBytes*)commitment_seed;
2084         free((void*)commitment_seed);
2085         LDKC2Tuple_u64u64Z key_derivation_params_conv = *(LDKC2Tuple_u64u64Z*)key_derivation_params;
2086         free((void*)key_derivation_params);
2087         LDKInMemoryChannelKeys* ret = malloc(sizeof(LDKInMemoryChannelKeys));
2088         *ret = InMemoryChannelKeys_new(funding_key_conv, revocation_base_key_conv, payment_key_conv, delayed_payment_base_key_conv, htlc_base_key_conv, commitment_seed_conv, channel_value_satoshis, key_derivation_params_conv);
2089         assert(!ret->_underlying_ref);
2090         ret->_underlying_ref = true;
2091         return (long)ret;
2092 }
2093
2094 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1remote_1pubkeys(JNIEnv * _env, jclass _b, jlong this_arg) {
2095         LDKInMemoryChannelKeys* this_arg_conv = (LDKInMemoryChannelKeys*)this_arg;
2096         LDKChannelPublicKeys* ret = malloc(sizeof(LDKChannelPublicKeys));
2097         *ret = InMemoryChannelKeys_remote_pubkeys(this_arg_conv);
2098         assert(!ret->_underlying_ref);
2099         ret->_underlying_ref = true;
2100         return (long)ret;
2101 }
2102
2103 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1remote_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_arg) {
2104         LDKInMemoryChannelKeys* this_arg_conv = (LDKInMemoryChannelKeys*)this_arg;
2105         uint16_t* ret = malloc(sizeof(uint16_t));
2106         *ret = InMemoryChannelKeys_remote_to_self_delay(this_arg_conv);
2107         return (long)ret;
2108 }
2109
2110 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1local_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_arg) {
2111         LDKInMemoryChannelKeys* this_arg_conv = (LDKInMemoryChannelKeys*)this_arg;
2112         uint16_t* ret = malloc(sizeof(uint16_t));
2113         *ret = InMemoryChannelKeys_local_to_self_delay(this_arg_conv);
2114         return (long)ret;
2115 }
2116
2117 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1as_1ChannelKeys(JNIEnv * _env, jclass _b, jlong this_arg) {
2118         LDKInMemoryChannelKeys* this_arg_conv = (LDKInMemoryChannelKeys*)this_arg;
2119         LDKChannelKeys* ret = malloc(sizeof(LDKChannelKeys));
2120         *ret = InMemoryChannelKeys_as_ChannelKeys(this_arg_conv);
2121         return (long)ret;
2122 }
2123
2124 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1write(JNIEnv * _env, jclass _b, jlong obj) {
2125         LDKInMemoryChannelKeys* obj_conv = (LDKInMemoryChannelKeys*)obj;
2126         LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
2127         *ret = InMemoryChannelKeys_write(obj_conv);
2128         return (long)ret;
2129 }
2130
2131 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1read(JNIEnv * _env, jclass _b, jlong ser) {
2132         LDKu8slice ser_conv = *(LDKu8slice*)ser;
2133         free((void*)ser);
2134         LDKInMemoryChannelKeys* ret = malloc(sizeof(LDKInMemoryChannelKeys));
2135         *ret = InMemoryChannelKeys_read(ser_conv);
2136         assert(!ret->_underlying_ref);
2137         ret->_underlying_ref = true;
2138         return (long)ret;
2139 }
2140
2141 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_KeysManager_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2142         LDKKeysManager this_ptr_conv = *(LDKKeysManager*)this_ptr;
2143         free((void*)this_ptr);
2144         this_ptr_conv._underlying_ref = false;
2145         return KeysManager_free(this_ptr_conv);
2146 }
2147
2148 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_KeysManager_1new(JNIEnv * _env, jclass _b, jbyteArray seed, jlong network, jlong starting_time_secs, jint starting_time_nanos) {
2149         unsigned char seed_arr[32];
2150         (*_env)->GetByteArrayRegion (_env, seed, 0, 32, seed_arr);
2151         unsigned char (*seed_ref)[32] = &seed_arr;
2152         LDKNetwork network_conv = *(LDKNetwork*)network;
2153         free((void*)network);
2154         LDKKeysManager* ret = malloc(sizeof(LDKKeysManager));
2155         *ret = KeysManager_new(seed_ref, network_conv, starting_time_secs, starting_time_nanos);
2156         assert(!ret->_underlying_ref);
2157         ret->_underlying_ref = true;
2158         return (long)ret;
2159 }
2160
2161 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_KeysManager_1derive_1channel_1keys(JNIEnv * _env, jclass _b, jlong this_arg, jlong channel_value_satoshis, jlong params_1, jlong params_2) {
2162         LDKKeysManager* this_arg_conv = (LDKKeysManager*)this_arg;
2163         LDKInMemoryChannelKeys* ret = malloc(sizeof(LDKInMemoryChannelKeys));
2164         *ret = KeysManager_derive_channel_keys(this_arg_conv, channel_value_satoshis, params_1, params_2);
2165         assert(!ret->_underlying_ref);
2166         ret->_underlying_ref = true;
2167         return (long)ret;
2168 }
2169
2170 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_KeysManager_1as_1KeysInterface(JNIEnv * _env, jclass _b, jlong this_arg) {
2171         LDKKeysManager* this_arg_conv = (LDKKeysManager*)this_arg;
2172         LDKKeysInterface* ret = malloc(sizeof(LDKKeysInterface));
2173         *ret = KeysManager_as_KeysInterface(this_arg_conv);
2174         return (long)ret;
2175 }
2176
2177 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2178         LDKChannelManager this_ptr_conv = *(LDKChannelManager*)this_ptr;
2179         free((void*)this_ptr);
2180         this_ptr_conv._underlying_ref = false;
2181         return ChannelManager_free(this_ptr_conv);
2182 }
2183
2184 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2185         LDKChannelDetails this_ptr_conv = *(LDKChannelDetails*)this_ptr;
2186         free((void*)this_ptr);
2187         this_ptr_conv._underlying_ref = false;
2188         return ChannelDetails_free(this_ptr_conv);
2189 }
2190
2191 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
2192         LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
2193         jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
2194         (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *ChannelDetails_get_channel_id(this_ptr_conv));
2195         return ret_arr;
2196 }
2197
2198 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2199         LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
2200         LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
2201         free((void*)val);
2202         return ChannelDetails_set_channel_id(this_ptr_conv, val_conv);
2203 }
2204
2205 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1remote_1network_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
2206         LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
2207         LDKPublicKey* ret = malloc(sizeof(LDKPublicKey));
2208         *ret = ChannelDetails_get_remote_network_id(this_ptr_conv);
2209         return (long)ret;
2210 }
2211
2212 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1remote_1network_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2213         LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
2214         LDKPublicKey val_conv = *(LDKPublicKey*)val;
2215         free((void*)val);
2216         return ChannelDetails_set_remote_network_id(this_ptr_conv, val_conv);
2217 }
2218
2219 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1counterparty_1features(JNIEnv * _env, jclass _b, jlong this_ptr) {
2220         LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
2221         LDKInitFeatures* ret = malloc(sizeof(LDKInitFeatures));
2222         *ret = ChannelDetails_get_counterparty_features(this_ptr_conv);
2223         assert(!ret->_underlying_ref);
2224         ret->_underlying_ref = true;
2225         return (long)ret;
2226 }
2227
2228 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1counterparty_1features(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2229         LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
2230         LDKInitFeatures val_conv = *(LDKInitFeatures*)val;
2231         free((void*)val);
2232         val_conv._underlying_ref = false;
2233         return ChannelDetails_set_counterparty_features(this_ptr_conv, val_conv);
2234 }
2235
2236 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1channel_1value_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
2237         LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
2238         return ChannelDetails_get_channel_value_satoshis(this_ptr_conv);
2239 }
2240
2241 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1channel_1value_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2242         LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
2243         return ChannelDetails_set_channel_value_satoshis(this_ptr_conv, val);
2244 }
2245
2246 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1user_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
2247         LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
2248         return ChannelDetails_get_user_id(this_ptr_conv);
2249 }
2250
2251 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1user_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2252         LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
2253         return ChannelDetails_set_user_id(this_ptr_conv, val);
2254 }
2255
2256 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1outbound_1capacity_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
2257         LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
2258         return ChannelDetails_get_outbound_capacity_msat(this_ptr_conv);
2259 }
2260
2261 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1outbound_1capacity_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2262         LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
2263         return ChannelDetails_set_outbound_capacity_msat(this_ptr_conv, val);
2264 }
2265
2266 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1inbound_1capacity_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
2267         LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
2268         return ChannelDetails_get_inbound_capacity_msat(this_ptr_conv);
2269 }
2270
2271 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1inbound_1capacity_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2272         LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
2273         return ChannelDetails_set_inbound_capacity_msat(this_ptr_conv, val);
2274 }
2275
2276 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1is_1live(JNIEnv * _env, jclass _b, jlong this_ptr) {
2277         LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
2278         return ChannelDetails_get_is_live(this_ptr_conv);
2279 }
2280
2281 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1is_1live(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
2282         LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
2283         return ChannelDetails_set_is_live(this_ptr_conv, val);
2284 }
2285
2286 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2287         LDKPaymentSendFailure this_ptr_conv = *(LDKPaymentSendFailure*)this_ptr;
2288         free((void*)this_ptr);
2289         this_ptr_conv._underlying_ref = false;
2290         return PaymentSendFailure_free(this_ptr_conv);
2291 }
2292
2293 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1new(JNIEnv * _env, jclass _b, jlong network, jlong fee_est, jlong monitor, jlong tx_broadcaster, jlong logger, jlong keys_manager, jlong config, jlong current_blockchain_height) {
2294         LDKNetwork network_conv = *(LDKNetwork*)network;
2295         free((void*)network);
2296         LDKFeeEstimator fee_est_conv = *(LDKFeeEstimator*)fee_est;
2297         free((void*)fee_est);
2298         LDKManyChannelMonitor monitor_conv = *(LDKManyChannelMonitor*)monitor;
2299         free((void*)monitor);
2300         LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)tx_broadcaster;
2301         free((void*)tx_broadcaster);
2302         LDKLogger logger_conv = *(LDKLogger*)logger;
2303         free((void*)logger);
2304         LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)keys_manager;
2305         free((void*)keys_manager);
2306         LDKUserConfig config_conv = *(LDKUserConfig*)config;
2307         free((void*)config);
2308         config_conv._underlying_ref = false;
2309         uintptr_t current_blockchain_height_conv = *(uintptr_t*)current_blockchain_height;
2310         free((void*)current_blockchain_height);
2311         LDKChannelManager* ret = malloc(sizeof(LDKChannelManager));
2312         *ret = ChannelManager_new(network_conv, fee_est_conv, monitor_conv, tx_broadcaster_conv, logger_conv, keys_manager_conv, config_conv, current_blockchain_height_conv);
2313         assert(!ret->_underlying_ref);
2314         ret->_underlying_ref = true;
2315         return (long)ret;
2316 }
2317
2318 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1create_1channel(JNIEnv * _env, jclass _b, jlong this_arg, jlong their_network_key, jlong channel_value_satoshis, jlong push_msat, jlong user_id, jlong override_config) {
2319         LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
2320         LDKPublicKey their_network_key_conv = *(LDKPublicKey*)their_network_key;
2321         free((void*)their_network_key);
2322         LDKUserConfig override_config_conv = *(LDKUserConfig*)override_config;
2323         free((void*)override_config);
2324         override_config_conv._underlying_ref = false;
2325         LDKCResult_NoneAPIErrorZ* ret = malloc(sizeof(LDKCResult_NoneAPIErrorZ));
2326         *ret = ChannelManager_create_channel(this_arg_conv, their_network_key_conv, channel_value_satoshis, push_msat, user_id, override_config_conv);
2327         return (long)ret;
2328 }
2329
2330 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1list_1channels(JNIEnv * _env, jclass _b, jlong this_arg) {
2331         LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
2332         LDKCVec_ChannelDetailsZ* ret = malloc(sizeof(LDKCVec_ChannelDetailsZ));
2333         *ret = ChannelManager_list_channels(this_arg_conv);
2334         return (long)ret;
2335 }
2336
2337 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1list_1usable_1channels(JNIEnv * _env, jclass _b, jlong this_arg) {
2338         LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
2339         LDKCVec_ChannelDetailsZ* ret = malloc(sizeof(LDKCVec_ChannelDetailsZ));
2340         *ret = ChannelManager_list_usable_channels(this_arg_conv);
2341         return (long)ret;
2342 }
2343
2344 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1close_1channel(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray channel_id) {
2345         LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
2346         unsigned char channel_id_arr[32];
2347         (*_env)->GetByteArrayRegion (_env, channel_id, 0, 32, channel_id_arr);
2348         unsigned char (*channel_id_ref)[32] = &channel_id_arr;
2349         LDKCResult_NoneAPIErrorZ* ret = malloc(sizeof(LDKCResult_NoneAPIErrorZ));
2350         *ret = ChannelManager_close_channel(this_arg_conv, channel_id_ref);
2351         return (long)ret;
2352 }
2353
2354 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1close_1channel(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray channel_id) {
2355         LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
2356         unsigned char channel_id_arr[32];
2357         (*_env)->GetByteArrayRegion (_env, channel_id, 0, 32, channel_id_arr);
2358         unsigned char (*channel_id_ref)[32] = &channel_id_arr;
2359         return ChannelManager_force_close_channel(this_arg_conv, channel_id_ref);
2360 }
2361
2362 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1close_1all_1channels(JNIEnv * _env, jclass _b, jlong this_arg) {
2363         LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
2364         return ChannelManager_force_close_all_channels(this_arg_conv);
2365 }
2366
2367 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1send_1payment(JNIEnv * _env, jclass _b, jlong this_arg, jlong route, jlong payment_hash, jlong payment_secret) {
2368         LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
2369         LDKRoute* route_conv = (LDKRoute*)route;
2370         LDKThirtyTwoBytes payment_hash_conv = *(LDKThirtyTwoBytes*)payment_hash;
2371         free((void*)payment_hash);
2372         LDKThirtyTwoBytes payment_secret_conv = *(LDKThirtyTwoBytes*)payment_secret;
2373         free((void*)payment_secret);
2374         LDKCResult_NonePaymentSendFailureZ* ret = malloc(sizeof(LDKCResult_NonePaymentSendFailureZ));
2375         *ret = ChannelManager_send_payment(this_arg_conv, route_conv, payment_hash_conv, payment_secret_conv);
2376         return (long)ret;
2377 }
2378
2379 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1funding_1transaction_1generated(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray temporary_channel_id, jlong funding_txo) {
2380         LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
2381         unsigned char temporary_channel_id_arr[32];
2382         (*_env)->GetByteArrayRegion (_env, temporary_channel_id, 0, 32, temporary_channel_id_arr);
2383         unsigned char (*temporary_channel_id_ref)[32] = &temporary_channel_id_arr;
2384         LDKOutPoint funding_txo_conv = *(LDKOutPoint*)funding_txo;
2385         free((void*)funding_txo);
2386         funding_txo_conv._underlying_ref = false;
2387         return ChannelManager_funding_transaction_generated(this_arg_conv, temporary_channel_id_ref, funding_txo_conv);
2388 }
2389
2390 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1broadcast_1node_1announcement(JNIEnv * _env, jclass _b, jlong this_arg, jlong rgb, jlong alias, jlong addresses) {
2391         LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
2392         LDKThreeBytes rgb_conv = *(LDKThreeBytes*)rgb;
2393         free((void*)rgb);
2394         LDKThirtyTwoBytes alias_conv = *(LDKThirtyTwoBytes*)alias;
2395         free((void*)alias);
2396         LDKCVec_NetAddressZ addresses_conv = *(LDKCVec_NetAddressZ*)addresses;
2397         free((void*)addresses);
2398         return ChannelManager_broadcast_node_announcement(this_arg_conv, rgb_conv, alias_conv, addresses_conv);
2399 }
2400
2401 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1process_1pending_1htlc_1forwards(JNIEnv * _env, jclass _b, jlong this_arg) {
2402         LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
2403         return ChannelManager_process_pending_htlc_forwards(this_arg_conv);
2404 }
2405
2406 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1timer_1chan_1freshness_1every_1min(JNIEnv * _env, jclass _b, jlong this_arg) {
2407         LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
2408         return ChannelManager_timer_chan_freshness_every_min(this_arg_conv);
2409 }
2410
2411 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelManager_1fail_1htlc_1backwards(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray payment_hash, jlong payment_secret) {
2412         LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
2413         unsigned char payment_hash_arr[32];
2414         (*_env)->GetByteArrayRegion (_env, payment_hash, 0, 32, payment_hash_arr);
2415         unsigned char (*payment_hash_ref)[32] = &payment_hash_arr;
2416         LDKThirtyTwoBytes payment_secret_conv = *(LDKThirtyTwoBytes*)payment_secret;
2417         free((void*)payment_secret);
2418         return ChannelManager_fail_htlc_backwards(this_arg_conv, payment_hash_ref, payment_secret_conv);
2419 }
2420
2421 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelManager_1claim_1funds(JNIEnv * _env, jclass _b, jlong this_arg, jlong payment_preimage, jlong payment_secret, jlong expected_amount) {
2422         LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
2423         LDKThirtyTwoBytes payment_preimage_conv = *(LDKThirtyTwoBytes*)payment_preimage;
2424         free((void*)payment_preimage);
2425         LDKThirtyTwoBytes payment_secret_conv = *(LDKThirtyTwoBytes*)payment_secret;
2426         free((void*)payment_secret);
2427         return ChannelManager_claim_funds(this_arg_conv, payment_preimage_conv, payment_secret_conv, expected_amount);
2428 }
2429
2430 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1our_1node_1id(JNIEnv * _env, jclass _b, jlong this_arg) {
2431         LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
2432         LDKPublicKey* ret = malloc(sizeof(LDKPublicKey));
2433         *ret = ChannelManager_get_our_node_id(this_arg_conv);
2434         return (long)ret;
2435 }
2436
2437 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1channel_1monitor_1updated(JNIEnv * _env, jclass _b, jlong this_arg, jlong funding_txo, jlong highest_applied_update_id) {
2438         LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
2439         LDKOutPoint* funding_txo_conv = (LDKOutPoint*)funding_txo;
2440         return ChannelManager_channel_monitor_updated(this_arg_conv, funding_txo_conv, highest_applied_update_id);
2441 }
2442
2443 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1MessageSendEventsProvider(JNIEnv * _env, jclass _b, jlong this_arg) {
2444         LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
2445         LDKMessageSendEventsProvider* ret = malloc(sizeof(LDKMessageSendEventsProvider));
2446         *ret = ChannelManager_as_MessageSendEventsProvider(this_arg_conv);
2447         return (long)ret;
2448 }
2449
2450 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1EventsProvider(JNIEnv * _env, jclass _b, jlong this_arg) {
2451         LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
2452         LDKEventsProvider* ret = malloc(sizeof(LDKEventsProvider));
2453         *ret = ChannelManager_as_EventsProvider(this_arg_conv);
2454         return (long)ret;
2455 }
2456
2457 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1ChainListener(JNIEnv * _env, jclass _b, jlong this_arg) {
2458         LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
2459         LDKChainListener* ret = malloc(sizeof(LDKChainListener));
2460         *ret = ChannelManager_as_ChainListener(this_arg_conv);
2461         return (long)ret;
2462 }
2463
2464 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1ChannelMessageHandler(JNIEnv * _env, jclass _b, jlong this_arg) {
2465         LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
2466         LDKChannelMessageHandler* ret = malloc(sizeof(LDKChannelMessageHandler));
2467         *ret = ChannelManager_as_ChannelMessageHandler(this_arg_conv);
2468         return (long)ret;
2469 }
2470
2471 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2472         LDKChannelManagerReadArgs this_ptr_conv = *(LDKChannelManagerReadArgs*)this_ptr;
2473         free((void*)this_ptr);
2474         this_ptr_conv._underlying_ref = false;
2475         return ChannelManagerReadArgs_free(this_ptr_conv);
2476 }
2477
2478 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1keys_1manager(JNIEnv * _env, jclass _b, jlong this_ptr) {
2479         LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
2480         return (long) ChannelManagerReadArgs_get_keys_manager(this_ptr_conv);
2481 }
2482
2483 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1keys_1manager(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2484         LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
2485         LDKKeysInterface val_conv = *(LDKKeysInterface*)val;
2486         free((void*)val);
2487         return ChannelManagerReadArgs_set_keys_manager(this_ptr_conv, val_conv);
2488 }
2489
2490 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1fee_1estimator(JNIEnv * _env, jclass _b, jlong this_ptr) {
2491         LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
2492         return (long) ChannelManagerReadArgs_get_fee_estimator(this_ptr_conv);
2493 }
2494
2495 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1fee_1estimator(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2496         LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
2497         LDKFeeEstimator val_conv = *(LDKFeeEstimator*)val;
2498         free((void*)val);
2499         return ChannelManagerReadArgs_set_fee_estimator(this_ptr_conv, val_conv);
2500 }
2501
2502 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1monitor(JNIEnv * _env, jclass _b, jlong this_ptr) {
2503         LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
2504         return (long) ChannelManagerReadArgs_get_monitor(this_ptr_conv);
2505 }
2506
2507 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1monitor(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2508         LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
2509         LDKManyChannelMonitor val_conv = *(LDKManyChannelMonitor*)val;
2510         free((void*)val);
2511         return ChannelManagerReadArgs_set_monitor(this_ptr_conv, val_conv);
2512 }
2513
2514 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1tx_1broadcaster(JNIEnv * _env, jclass _b, jlong this_ptr) {
2515         LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
2516         return (long) ChannelManagerReadArgs_get_tx_broadcaster(this_ptr_conv);
2517 }
2518
2519 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1tx_1broadcaster(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2520         LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
2521         LDKBroadcasterInterface val_conv = *(LDKBroadcasterInterface*)val;
2522         free((void*)val);
2523         return ChannelManagerReadArgs_set_tx_broadcaster(this_ptr_conv, val_conv);
2524 }
2525
2526 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1logger(JNIEnv * _env, jclass _b, jlong this_ptr) {
2527         LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
2528         return (long) ChannelManagerReadArgs_get_logger(this_ptr_conv);
2529 }
2530
2531 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1logger(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2532         LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
2533         LDKLogger val_conv = *(LDKLogger*)val;
2534         free((void*)val);
2535         return ChannelManagerReadArgs_set_logger(this_ptr_conv, val_conv);
2536 }
2537
2538 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1default_1config(JNIEnv * _env, jclass _b, jlong this_ptr) {
2539         LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
2540         LDKUserConfig* ret = malloc(sizeof(LDKUserConfig));
2541         *ret = ChannelManagerReadArgs_get_default_config(this_ptr_conv);
2542         assert(!ret->_underlying_ref);
2543         ret->_underlying_ref = true;
2544         return (long)ret;
2545 }
2546
2547 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1default_1config(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2548         LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
2549         LDKUserConfig val_conv = *(LDKUserConfig*)val;
2550         free((void*)val);
2551         val_conv._underlying_ref = false;
2552         return ChannelManagerReadArgs_set_default_config(this_ptr_conv, val_conv);
2553 }
2554
2555 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1new(JNIEnv * _env, jclass _b, jlong keys_manager, jlong fee_estimator, jlong monitor, jlong tx_broadcaster, jlong logger, jlong default_config, jlong channel_monitors) {
2556         LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)keys_manager;
2557         free((void*)keys_manager);
2558         LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)fee_estimator;
2559         free((void*)fee_estimator);
2560         LDKManyChannelMonitor monitor_conv = *(LDKManyChannelMonitor*)monitor;
2561         free((void*)monitor);
2562         LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)tx_broadcaster;
2563         free((void*)tx_broadcaster);
2564         LDKLogger logger_conv = *(LDKLogger*)logger;
2565         free((void*)logger);
2566         LDKUserConfig default_config_conv = *(LDKUserConfig*)default_config;
2567         free((void*)default_config);
2568         default_config_conv._underlying_ref = false;
2569         LDKCVec_ChannelMonitorZ channel_monitors_conv = *(LDKCVec_ChannelMonitorZ*)channel_monitors;
2570         free((void*)channel_monitors);
2571         LDKChannelManagerReadArgs* ret = malloc(sizeof(LDKChannelManagerReadArgs));
2572         *ret = ChannelManagerReadArgs_new(keys_manager_conv, fee_estimator_conv, monitor_conv, tx_broadcaster_conv, logger_conv, default_config_conv, channel_monitors_conv);
2573         assert(!ret->_underlying_ref);
2574         ret->_underlying_ref = true;
2575         return (long)ret;
2576 }
2577
2578 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2579         LDKChannelMonitorUpdate this_ptr_conv = *(LDKChannelMonitorUpdate*)this_ptr;
2580         free((void*)this_ptr);
2581         this_ptr_conv._underlying_ref = false;
2582         return ChannelMonitorUpdate_free(this_ptr_conv);
2583 }
2584
2585 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1get_1update_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
2586         LDKChannelMonitorUpdate* this_ptr_conv = (LDKChannelMonitorUpdate*)this_ptr;
2587         return ChannelMonitorUpdate_get_update_id(this_ptr_conv);
2588 }
2589
2590 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1set_1update_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2591         LDKChannelMonitorUpdate* this_ptr_conv = (LDKChannelMonitorUpdate*)this_ptr;
2592         return ChannelMonitorUpdate_set_update_id(this_ptr_conv, val);
2593 }
2594
2595 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1write(JNIEnv * _env, jclass _b, jlong obj) {
2596         LDKChannelMonitorUpdate* obj_conv = (LDKChannelMonitorUpdate*)obj;
2597         LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
2598         *ret = ChannelMonitorUpdate_write(obj_conv);
2599         return (long)ret;
2600 }
2601
2602 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1read(JNIEnv * _env, jclass _b, jlong ser) {
2603         LDKu8slice ser_conv = *(LDKu8slice*)ser;
2604         free((void*)ser);
2605         LDKChannelMonitorUpdate* ret = malloc(sizeof(LDKChannelMonitorUpdate));
2606         *ret = ChannelMonitorUpdate_read(ser_conv);
2607         assert(!ret->_underlying_ref);
2608         ret->_underlying_ref = true;
2609         return (long)ret;
2610 }
2611
2612 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorUpdateError_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2613         LDKMonitorUpdateError this_ptr_conv = *(LDKMonitorUpdateError*)this_ptr;
2614         free((void*)this_ptr);
2615         this_ptr_conv._underlying_ref = false;
2616         return MonitorUpdateError_free(this_ptr_conv);
2617 }
2618
2619 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2620         LDKMonitorEvent this_ptr_conv = *(LDKMonitorEvent*)this_ptr;
2621         free((void*)this_ptr);
2622         this_ptr_conv._underlying_ref = false;
2623         return MonitorEvent_free(this_ptr_conv);
2624 }
2625
2626 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2627         LDKHTLCUpdate this_ptr_conv = *(LDKHTLCUpdate*)this_ptr;
2628         free((void*)this_ptr);
2629         this_ptr_conv._underlying_ref = false;
2630         return HTLCUpdate_free(this_ptr_conv);
2631 }
2632
2633 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1write(JNIEnv * _env, jclass _b, jlong obj) {
2634         LDKHTLCUpdate* obj_conv = (LDKHTLCUpdate*)obj;
2635         LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
2636         *ret = HTLCUpdate_write(obj_conv);
2637         return (long)ret;
2638 }
2639
2640 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1read(JNIEnv * _env, jclass _b, jlong ser) {
2641         LDKu8slice ser_conv = *(LDKu8slice*)ser;
2642         free((void*)ser);
2643         LDKHTLCUpdate* ret = malloc(sizeof(LDKHTLCUpdate));
2644         *ret = HTLCUpdate_read(ser_conv);
2645         assert(!ret->_underlying_ref);
2646         ret->_underlying_ref = true;
2647         return (long)ret;
2648 }
2649
2650 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2651         LDKChannelMonitor this_ptr_conv = *(LDKChannelMonitor*)this_ptr;
2652         free((void*)this_ptr);
2653         this_ptr_conv._underlying_ref = false;
2654         return ChannelMonitor_free(this_ptr_conv);
2655 }
2656
2657 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ManyChannelMonitor_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2658         LDKManyChannelMonitor this_ptr_conv = *(LDKManyChannelMonitor*)this_ptr;
2659         free((void*)this_ptr);
2660         return ManyChannelMonitor_free(this_ptr_conv);
2661 }
2662
2663 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1update_1monitor(JNIEnv * _env, jclass _b, jlong this_arg, jlong updates, jlong broadcaster, jlong logger) {
2664         LDKChannelMonitor* this_arg_conv = (LDKChannelMonitor*)this_arg;
2665         LDKChannelMonitorUpdate updates_conv = *(LDKChannelMonitorUpdate*)updates;
2666         free((void*)updates);
2667         updates_conv._underlying_ref = false;
2668         LDKBroadcasterInterface* broadcaster_conv = (LDKBroadcasterInterface*)broadcaster;
2669         LDKLogger* logger_conv = (LDKLogger*)logger;
2670         LDKCResult_NoneMonitorUpdateErrorZ* ret = malloc(sizeof(LDKCResult_NoneMonitorUpdateErrorZ));
2671         *ret = ChannelMonitor_update_monitor(this_arg_conv, updates_conv, broadcaster_conv, logger_conv);
2672         return (long)ret;
2673 }
2674
2675 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1latest_1update_1id(JNIEnv * _env, jclass _b, jlong this_arg) {
2676         LDKChannelMonitor* this_arg_conv = (LDKChannelMonitor*)this_arg;
2677         return ChannelMonitor_get_latest_update_id(this_arg_conv);
2678 }
2679
2680 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1funding_1txo(JNIEnv * _env, jclass _b, jlong this_arg) {
2681         LDKChannelMonitor* this_arg_conv = (LDKChannelMonitor*)this_arg;
2682         LDKC2Tuple_OutPointScriptZ* ret = malloc(sizeof(LDKC2Tuple_OutPointScriptZ));
2683         *ret = ChannelMonitor_get_funding_txo(this_arg_conv);
2684         return (long)ret;
2685 }
2686
2687 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1and_1clear_1pending_1monitor_1events(JNIEnv * _env, jclass _b, jlong this_arg) {
2688         LDKChannelMonitor* this_arg_conv = (LDKChannelMonitor*)this_arg;
2689         LDKCVec_MonitorEventZ* ret = malloc(sizeof(LDKCVec_MonitorEventZ));
2690         *ret = ChannelMonitor_get_and_clear_pending_monitor_events(this_arg_conv);
2691         return (long)ret;
2692 }
2693
2694 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1and_1clear_1pending_1events(JNIEnv * _env, jclass _b, jlong this_arg) {
2695         LDKChannelMonitor* this_arg_conv = (LDKChannelMonitor*)this_arg;
2696         LDKCVec_EventZ* ret = malloc(sizeof(LDKCVec_EventZ));
2697         *ret = ChannelMonitor_get_and_clear_pending_events(this_arg_conv);
2698         return (long)ret;
2699 }
2700
2701 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1latest_1local_1commitment_1txn(JNIEnv * _env, jclass _b, jlong this_arg, jlong logger) {
2702         LDKChannelMonitor* this_arg_conv = (LDKChannelMonitor*)this_arg;
2703         LDKLogger* logger_conv = (LDKLogger*)logger;
2704         LDKCVec_TransactionZ* ret = malloc(sizeof(LDKCVec_TransactionZ));
2705         *ret = ChannelMonitor_get_latest_local_commitment_txn(this_arg_conv, logger_conv);
2706         return (long)ret;
2707 }
2708
2709 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DecodeError_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2710         LDKDecodeError this_ptr_conv = *(LDKDecodeError*)this_ptr;
2711         free((void*)this_ptr);
2712         this_ptr_conv._underlying_ref = false;
2713         return DecodeError_free(this_ptr_conv);
2714 }
2715
2716 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Init_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2717         LDKInit this_ptr_conv = *(LDKInit*)this_ptr;
2718         free((void*)this_ptr);
2719         this_ptr_conv._underlying_ref = false;
2720         return Init_free(this_ptr_conv);
2721 }
2722
2723 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2724         LDKErrorMessage this_ptr_conv = *(LDKErrorMessage*)this_ptr;
2725         free((void*)this_ptr);
2726         this_ptr_conv._underlying_ref = false;
2727         return ErrorMessage_free(this_ptr_conv);
2728 }
2729
2730 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
2731         LDKErrorMessage* this_ptr_conv = (LDKErrorMessage*)this_ptr;
2732         jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
2733         (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *ErrorMessage_get_channel_id(this_ptr_conv));
2734         return ret_arr;
2735 }
2736
2737 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2738         LDKErrorMessage* this_ptr_conv = (LDKErrorMessage*)this_ptr;
2739         LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
2740         free((void*)val);
2741         return ErrorMessage_set_channel_id(this_ptr_conv, val_conv);
2742 }
2743
2744 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1get_1data(JNIEnv * _env, jclass _b, jlong this_ptr) {
2745         LDKErrorMessage* this_ptr_conv = (LDKErrorMessage*)this_ptr;
2746         LDKStr* ret = malloc(sizeof(LDKStr));
2747         *ret = ErrorMessage_get_data(this_ptr_conv);
2748         return (long)ret;
2749 }
2750
2751 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1set_1data(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2752         LDKErrorMessage* this_ptr_conv = (LDKErrorMessage*)this_ptr;
2753         LDKCVec_u8Z val_conv = *(LDKCVec_u8Z*)val;
2754         free((void*)val);
2755         return ErrorMessage_set_data(this_ptr_conv, val_conv);
2756 }
2757
2758 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1new(JNIEnv * _env, jclass _b, jlong channel_id_arg, jlong data_arg) {
2759         LDKThirtyTwoBytes channel_id_arg_conv = *(LDKThirtyTwoBytes*)channel_id_arg;
2760         free((void*)channel_id_arg);
2761         LDKCVec_u8Z data_arg_conv = *(LDKCVec_u8Z*)data_arg;
2762         free((void*)data_arg);
2763         LDKErrorMessage* ret = malloc(sizeof(LDKErrorMessage));
2764         *ret = ErrorMessage_new(channel_id_arg_conv, data_arg_conv);
2765         assert(!ret->_underlying_ref);
2766         ret->_underlying_ref = true;
2767         return (long)ret;
2768 }
2769
2770 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Ping_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2771         LDKPing this_ptr_conv = *(LDKPing*)this_ptr;
2772         free((void*)this_ptr);
2773         this_ptr_conv._underlying_ref = false;
2774         return Ping_free(this_ptr_conv);
2775 }
2776
2777 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Ping_1get_1ponglen(JNIEnv * _env, jclass _b, jlong this_ptr) {
2778         LDKPing* this_ptr_conv = (LDKPing*)this_ptr;
2779         uint16_t* ret = malloc(sizeof(uint16_t));
2780         *ret = Ping_get_ponglen(this_ptr_conv);
2781         return (long)ret;
2782 }
2783
2784 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Ping_1set_1ponglen(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2785         LDKPing* this_ptr_conv = (LDKPing*)this_ptr;
2786         uint16_t val_conv = *(uint16_t*)val;
2787         free((void*)val);
2788         return Ping_set_ponglen(this_ptr_conv, val_conv);
2789 }
2790
2791 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Ping_1get_1byteslen(JNIEnv * _env, jclass _b, jlong this_ptr) {
2792         LDKPing* this_ptr_conv = (LDKPing*)this_ptr;
2793         uint16_t* ret = malloc(sizeof(uint16_t));
2794         *ret = Ping_get_byteslen(this_ptr_conv);
2795         return (long)ret;
2796 }
2797
2798 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Ping_1set_1byteslen(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2799         LDKPing* this_ptr_conv = (LDKPing*)this_ptr;
2800         uint16_t val_conv = *(uint16_t*)val;
2801         free((void*)val);
2802         return Ping_set_byteslen(this_ptr_conv, val_conv);
2803 }
2804
2805 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Ping_1new(JNIEnv * _env, jclass _b, jlong ponglen_arg, jlong byteslen_arg) {
2806         uint16_t ponglen_arg_conv = *(uint16_t*)ponglen_arg;
2807         free((void*)ponglen_arg);
2808         uint16_t byteslen_arg_conv = *(uint16_t*)byteslen_arg;
2809         free((void*)byteslen_arg);
2810         LDKPing* ret = malloc(sizeof(LDKPing));
2811         *ret = Ping_new(ponglen_arg_conv, byteslen_arg_conv);
2812         assert(!ret->_underlying_ref);
2813         ret->_underlying_ref = true;
2814         return (long)ret;
2815 }
2816
2817 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Pong_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2818         LDKPong this_ptr_conv = *(LDKPong*)this_ptr;
2819         free((void*)this_ptr);
2820         this_ptr_conv._underlying_ref = false;
2821         return Pong_free(this_ptr_conv);
2822 }
2823
2824 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Pong_1get_1byteslen(JNIEnv * _env, jclass _b, jlong this_ptr) {
2825         LDKPong* this_ptr_conv = (LDKPong*)this_ptr;
2826         uint16_t* ret = malloc(sizeof(uint16_t));
2827         *ret = Pong_get_byteslen(this_ptr_conv);
2828         return (long)ret;
2829 }
2830
2831 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Pong_1set_1byteslen(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2832         LDKPong* this_ptr_conv = (LDKPong*)this_ptr;
2833         uint16_t val_conv = *(uint16_t*)val;
2834         free((void*)val);
2835         return Pong_set_byteslen(this_ptr_conv, val_conv);
2836 }
2837
2838 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Pong_1new(JNIEnv * _env, jclass _b, jlong byteslen_arg) {
2839         uint16_t byteslen_arg_conv = *(uint16_t*)byteslen_arg;
2840         free((void*)byteslen_arg);
2841         LDKPong* ret = malloc(sizeof(LDKPong));
2842         *ret = Pong_new(byteslen_arg_conv);
2843         assert(!ret->_underlying_ref);
2844         ret->_underlying_ref = true;
2845         return (long)ret;
2846 }
2847
2848 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2849         LDKOpenChannel this_ptr_conv = *(LDKOpenChannel*)this_ptr;
2850         free((void*)this_ptr);
2851         this_ptr_conv._underlying_ref = false;
2852         return OpenChannel_free(this_ptr_conv);
2853 }
2854
2855 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
2856         LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
2857         jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
2858         (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *OpenChannel_get_chain_hash(this_ptr_conv));
2859         return ret_arr;
2860 }
2861
2862 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2863         LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
2864         LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
2865         free((void*)val);
2866         return OpenChannel_set_chain_hash(this_ptr_conv, val_conv);
2867 }
2868
2869 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1temporary_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
2870         LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
2871         jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
2872         (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *OpenChannel_get_temporary_channel_id(this_ptr_conv));
2873         return ret_arr;
2874 }
2875
2876 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1temporary_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2877         LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
2878         LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
2879         free((void*)val);
2880         return OpenChannel_set_temporary_channel_id(this_ptr_conv, val_conv);
2881 }
2882
2883 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1funding_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
2884         LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
2885         return OpenChannel_get_funding_satoshis(this_ptr_conv);
2886 }
2887
2888 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1funding_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2889         LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
2890         return OpenChannel_set_funding_satoshis(this_ptr_conv, val);
2891 }
2892
2893 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1push_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
2894         LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
2895         return OpenChannel_get_push_msat(this_ptr_conv);
2896 }
2897
2898 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1push_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2899         LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
2900         return OpenChannel_set_push_msat(this_ptr_conv, val);
2901 }
2902
2903 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
2904         LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
2905         return OpenChannel_get_dust_limit_satoshis(this_ptr_conv);
2906 }
2907
2908 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2909         LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
2910         return OpenChannel_set_dust_limit_satoshis(this_ptr_conv, val);
2911 }
2912
2913 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1max_1htlc_1value_1in_1flight_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
2914         LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
2915         return OpenChannel_get_max_htlc_value_in_flight_msat(this_ptr_conv);
2916 }
2917
2918 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1max_1htlc_1value_1in_1flight_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2919         LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
2920         return OpenChannel_set_max_htlc_value_in_flight_msat(this_ptr_conv, val);
2921 }
2922
2923 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1channel_1reserve_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
2924         LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
2925         return OpenChannel_get_channel_reserve_satoshis(this_ptr_conv);
2926 }
2927
2928 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1channel_1reserve_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2929         LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
2930         return OpenChannel_set_channel_reserve_satoshis(this_ptr_conv, val);
2931 }
2932
2933 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
2934         LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
2935         return OpenChannel_get_htlc_minimum_msat(this_ptr_conv);
2936 }
2937
2938 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2939         LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
2940         return OpenChannel_set_htlc_minimum_msat(this_ptr_conv, val);
2941 }
2942
2943 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1feerate_1per_1kw(JNIEnv * _env, jclass _b, jlong this_ptr) {
2944         LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
2945         return OpenChannel_get_feerate_per_kw(this_ptr_conv);
2946 }
2947
2948 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1feerate_1per_1kw(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
2949         LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
2950         return OpenChannel_set_feerate_per_kw(this_ptr_conv, val);
2951 }
2952
2953 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr) {
2954         LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
2955         uint16_t* ret = malloc(sizeof(uint16_t));
2956         *ret = OpenChannel_get_to_self_delay(this_ptr_conv);
2957         return (long)ret;
2958 }
2959
2960 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2961         LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
2962         uint16_t val_conv = *(uint16_t*)val;
2963         free((void*)val);
2964         return OpenChannel_set_to_self_delay(this_ptr_conv, val_conv);
2965 }
2966
2967 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1max_1accepted_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr) {
2968         LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
2969         uint16_t* ret = malloc(sizeof(uint16_t));
2970         *ret = OpenChannel_get_max_accepted_htlcs(this_ptr_conv);
2971         return (long)ret;
2972 }
2973
2974 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1max_1accepted_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2975         LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
2976         uint16_t val_conv = *(uint16_t*)val;
2977         free((void*)val);
2978         return OpenChannel_set_max_accepted_htlcs(this_ptr_conv, val_conv);
2979 }
2980
2981 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1funding_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr) {
2982         LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
2983         LDKPublicKey* ret = malloc(sizeof(LDKPublicKey));
2984         *ret = OpenChannel_get_funding_pubkey(this_ptr_conv);
2985         return (long)ret;
2986 }
2987
2988 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1funding_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2989         LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
2990         LDKPublicKey val_conv = *(LDKPublicKey*)val;
2991         free((void*)val);
2992         return OpenChannel_set_funding_pubkey(this_ptr_conv, val_conv);
2993 }
2994
2995 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1revocation_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
2996         LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
2997         LDKPublicKey* ret = malloc(sizeof(LDKPublicKey));
2998         *ret = OpenChannel_get_revocation_basepoint(this_ptr_conv);
2999         return (long)ret;
3000 }
3001
3002 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1revocation_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3003         LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3004         LDKPublicKey val_conv = *(LDKPublicKey*)val;
3005         free((void*)val);
3006         return OpenChannel_set_revocation_basepoint(this_ptr_conv, val_conv);
3007 }
3008
3009 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1payment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
3010         LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3011         LDKPublicKey* ret = malloc(sizeof(LDKPublicKey));
3012         *ret = OpenChannel_get_payment_point(this_ptr_conv);
3013         return (long)ret;
3014 }
3015
3016 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1payment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3017         LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3018         LDKPublicKey val_conv = *(LDKPublicKey*)val;
3019         free((void*)val);
3020         return OpenChannel_set_payment_point(this_ptr_conv, val_conv);
3021 }
3022
3023 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1delayed_1payment_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
3024         LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3025         LDKPublicKey* ret = malloc(sizeof(LDKPublicKey));
3026         *ret = OpenChannel_get_delayed_payment_basepoint(this_ptr_conv);
3027         return (long)ret;
3028 }
3029
3030 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1delayed_1payment_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3031         LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3032         LDKPublicKey val_conv = *(LDKPublicKey*)val;
3033         free((void*)val);
3034         return OpenChannel_set_delayed_payment_basepoint(this_ptr_conv, val_conv);
3035 }
3036
3037 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1htlc_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
3038         LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3039         LDKPublicKey* ret = malloc(sizeof(LDKPublicKey));
3040         *ret = OpenChannel_get_htlc_basepoint(this_ptr_conv);
3041         return (long)ret;
3042 }
3043
3044 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1htlc_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3045         LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3046         LDKPublicKey val_conv = *(LDKPublicKey*)val;
3047         free((void*)val);
3048         return OpenChannel_set_htlc_basepoint(this_ptr_conv, val_conv);
3049 }
3050
3051 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1first_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
3052         LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3053         LDKPublicKey* ret = malloc(sizeof(LDKPublicKey));
3054         *ret = OpenChannel_get_first_per_commitment_point(this_ptr_conv);
3055         return (long)ret;
3056 }
3057
3058 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1first_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3059         LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3060         LDKPublicKey val_conv = *(LDKPublicKey*)val;
3061         free((void*)val);
3062         return OpenChannel_set_first_per_commitment_point(this_ptr_conv, val_conv);
3063 }
3064
3065 JNIEXPORT jbyte JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1channel_1flags(JNIEnv * _env, jclass _b, jlong this_ptr) {
3066         LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3067         return OpenChannel_get_channel_flags(this_ptr_conv);
3068 }
3069
3070 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1channel_1flags(JNIEnv * _env, jclass _b, jlong this_ptr, jbyte val) {
3071         LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3072         return OpenChannel_set_channel_flags(this_ptr_conv, val);
3073 }
3074
3075 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3076         LDKAcceptChannel this_ptr_conv = *(LDKAcceptChannel*)this_ptr;
3077         free((void*)this_ptr);
3078         this_ptr_conv._underlying_ref = false;
3079         return AcceptChannel_free(this_ptr_conv);
3080 }
3081
3082 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1temporary_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
3083         LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3084         jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3085         (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *AcceptChannel_get_temporary_channel_id(this_ptr_conv));
3086         return ret_arr;
3087 }
3088
3089 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1temporary_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3090         LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3091         LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3092         free((void*)val);
3093         return AcceptChannel_set_temporary_channel_id(this_ptr_conv, val_conv);
3094 }
3095
3096 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
3097         LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3098         return AcceptChannel_get_dust_limit_satoshis(this_ptr_conv);
3099 }
3100
3101 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3102         LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3103         return AcceptChannel_set_dust_limit_satoshis(this_ptr_conv, val);
3104 }
3105
3106 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1max_1htlc_1value_1in_1flight_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
3107         LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3108         return AcceptChannel_get_max_htlc_value_in_flight_msat(this_ptr_conv);
3109 }
3110
3111 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1max_1htlc_1value_1in_1flight_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3112         LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3113         return AcceptChannel_set_max_htlc_value_in_flight_msat(this_ptr_conv, val);
3114 }
3115
3116 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1channel_1reserve_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
3117         LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3118         return AcceptChannel_get_channel_reserve_satoshis(this_ptr_conv);
3119 }
3120
3121 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1channel_1reserve_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3122         LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3123         return AcceptChannel_set_channel_reserve_satoshis(this_ptr_conv, val);
3124 }
3125
3126 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
3127         LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3128         return AcceptChannel_get_htlc_minimum_msat(this_ptr_conv);
3129 }
3130
3131 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3132         LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3133         return AcceptChannel_set_htlc_minimum_msat(this_ptr_conv, val);
3134 }
3135
3136 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1minimum_1depth(JNIEnv * _env, jclass _b, jlong this_ptr) {
3137         LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3138         return AcceptChannel_get_minimum_depth(this_ptr_conv);
3139 }
3140
3141 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1minimum_1depth(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
3142         LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3143         return AcceptChannel_set_minimum_depth(this_ptr_conv, val);
3144 }
3145
3146 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr) {
3147         LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3148         uint16_t* ret = malloc(sizeof(uint16_t));
3149         *ret = AcceptChannel_get_to_self_delay(this_ptr_conv);
3150         return (long)ret;
3151 }
3152
3153 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3154         LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3155         uint16_t val_conv = *(uint16_t*)val;
3156         free((void*)val);
3157         return AcceptChannel_set_to_self_delay(this_ptr_conv, val_conv);
3158 }
3159
3160 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1max_1accepted_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr) {
3161         LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3162         uint16_t* ret = malloc(sizeof(uint16_t));
3163         *ret = AcceptChannel_get_max_accepted_htlcs(this_ptr_conv);
3164         return (long)ret;
3165 }
3166
3167 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1max_1accepted_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3168         LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3169         uint16_t val_conv = *(uint16_t*)val;
3170         free((void*)val);
3171         return AcceptChannel_set_max_accepted_htlcs(this_ptr_conv, val_conv);
3172 }
3173
3174 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1funding_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr) {
3175         LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3176         LDKPublicKey* ret = malloc(sizeof(LDKPublicKey));
3177         *ret = AcceptChannel_get_funding_pubkey(this_ptr_conv);
3178         return (long)ret;
3179 }
3180
3181 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1funding_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3182         LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3183         LDKPublicKey val_conv = *(LDKPublicKey*)val;
3184         free((void*)val);
3185         return AcceptChannel_set_funding_pubkey(this_ptr_conv, val_conv);
3186 }
3187
3188 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1revocation_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
3189         LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3190         LDKPublicKey* ret = malloc(sizeof(LDKPublicKey));
3191         *ret = AcceptChannel_get_revocation_basepoint(this_ptr_conv);
3192         return (long)ret;
3193 }
3194
3195 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1revocation_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3196         LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3197         LDKPublicKey val_conv = *(LDKPublicKey*)val;
3198         free((void*)val);
3199         return AcceptChannel_set_revocation_basepoint(this_ptr_conv, val_conv);
3200 }
3201
3202 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1payment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
3203         LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3204         LDKPublicKey* ret = malloc(sizeof(LDKPublicKey));
3205         *ret = AcceptChannel_get_payment_point(this_ptr_conv);
3206         return (long)ret;
3207 }
3208
3209 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1payment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3210         LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3211         LDKPublicKey val_conv = *(LDKPublicKey*)val;
3212         free((void*)val);
3213         return AcceptChannel_set_payment_point(this_ptr_conv, val_conv);
3214 }
3215
3216 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1delayed_1payment_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
3217         LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3218         LDKPublicKey* ret = malloc(sizeof(LDKPublicKey));
3219         *ret = AcceptChannel_get_delayed_payment_basepoint(this_ptr_conv);
3220         return (long)ret;
3221 }
3222
3223 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1delayed_1payment_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3224         LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3225         LDKPublicKey val_conv = *(LDKPublicKey*)val;
3226         free((void*)val);
3227         return AcceptChannel_set_delayed_payment_basepoint(this_ptr_conv, val_conv);
3228 }
3229
3230 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1htlc_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
3231         LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3232         LDKPublicKey* ret = malloc(sizeof(LDKPublicKey));
3233         *ret = AcceptChannel_get_htlc_basepoint(this_ptr_conv);
3234         return (long)ret;
3235 }
3236
3237 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1htlc_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3238         LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3239         LDKPublicKey val_conv = *(LDKPublicKey*)val;
3240         free((void*)val);
3241         return AcceptChannel_set_htlc_basepoint(this_ptr_conv, val_conv);
3242 }
3243
3244 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1first_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
3245         LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3246         LDKPublicKey* ret = malloc(sizeof(LDKPublicKey));
3247         *ret = AcceptChannel_get_first_per_commitment_point(this_ptr_conv);
3248         return (long)ret;
3249 }
3250
3251 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1first_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3252         LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3253         LDKPublicKey val_conv = *(LDKPublicKey*)val;
3254         free((void*)val);
3255         return AcceptChannel_set_first_per_commitment_point(this_ptr_conv, val_conv);
3256 }
3257
3258 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3259         LDKFundingCreated this_ptr_conv = *(LDKFundingCreated*)this_ptr;
3260         free((void*)this_ptr);
3261         this_ptr_conv._underlying_ref = false;
3262         return FundingCreated_free(this_ptr_conv);
3263 }
3264
3265 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1temporary_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
3266         LDKFundingCreated* this_ptr_conv = (LDKFundingCreated*)this_ptr;
3267         jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3268         (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *FundingCreated_get_temporary_channel_id(this_ptr_conv));
3269         return ret_arr;
3270 }
3271
3272 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1temporary_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3273         LDKFundingCreated* this_ptr_conv = (LDKFundingCreated*)this_ptr;
3274         LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3275         free((void*)val);
3276         return FundingCreated_set_temporary_channel_id(this_ptr_conv, val_conv);
3277 }
3278
3279 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1funding_1txid(JNIEnv * _env, jclass _b, jlong this_ptr) {
3280         LDKFundingCreated* this_ptr_conv = (LDKFundingCreated*)this_ptr;
3281         jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3282         (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *FundingCreated_get_funding_txid(this_ptr_conv));
3283         return ret_arr;
3284 }
3285
3286 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1funding_1txid(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3287         LDKFundingCreated* this_ptr_conv = (LDKFundingCreated*)this_ptr;
3288         LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3289         free((void*)val);
3290         return FundingCreated_set_funding_txid(this_ptr_conv, val_conv);
3291 }
3292
3293 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1funding_1output_1index(JNIEnv * _env, jclass _b, jlong this_ptr) {
3294         LDKFundingCreated* this_ptr_conv = (LDKFundingCreated*)this_ptr;
3295         uint16_t* ret = malloc(sizeof(uint16_t));
3296         *ret = FundingCreated_get_funding_output_index(this_ptr_conv);
3297         return (long)ret;
3298 }
3299
3300 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1funding_1output_1index(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3301         LDKFundingCreated* this_ptr_conv = (LDKFundingCreated*)this_ptr;
3302         uint16_t val_conv = *(uint16_t*)val;
3303         free((void*)val);
3304         return FundingCreated_set_funding_output_index(this_ptr_conv, val_conv);
3305 }
3306
3307 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
3308         LDKFundingCreated* this_ptr_conv = (LDKFundingCreated*)this_ptr;
3309         LDKSignature* ret = malloc(sizeof(LDKSignature));
3310         *ret = FundingCreated_get_signature(this_ptr_conv);
3311         return (long)ret;
3312 }
3313
3314 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3315         LDKFundingCreated* this_ptr_conv = (LDKFundingCreated*)this_ptr;
3316         LDKSignature val_conv = *(LDKSignature*)val;
3317         free((void*)val);
3318         return FundingCreated_set_signature(this_ptr_conv, val_conv);
3319 }
3320
3321 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingCreated_1new(JNIEnv * _env, jclass _b, jlong temporary_channel_id_arg, jlong funding_txid_arg, jlong funding_output_index_arg, jlong signature_arg) {
3322         LDKThirtyTwoBytes temporary_channel_id_arg_conv = *(LDKThirtyTwoBytes*)temporary_channel_id_arg;
3323         free((void*)temporary_channel_id_arg);
3324         LDKThirtyTwoBytes funding_txid_arg_conv = *(LDKThirtyTwoBytes*)funding_txid_arg;
3325         free((void*)funding_txid_arg);
3326         uint16_t funding_output_index_arg_conv = *(uint16_t*)funding_output_index_arg;
3327         free((void*)funding_output_index_arg);
3328         LDKSignature signature_arg_conv = *(LDKSignature*)signature_arg;
3329         free((void*)signature_arg);
3330         LDKFundingCreated* ret = malloc(sizeof(LDKFundingCreated));
3331         *ret = FundingCreated_new(temporary_channel_id_arg_conv, funding_txid_arg_conv, funding_output_index_arg_conv, signature_arg_conv);
3332         assert(!ret->_underlying_ref);
3333         ret->_underlying_ref = true;
3334         return (long)ret;
3335 }
3336
3337 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3338         LDKFundingSigned this_ptr_conv = *(LDKFundingSigned*)this_ptr;
3339         free((void*)this_ptr);
3340         this_ptr_conv._underlying_ref = false;
3341         return FundingSigned_free(this_ptr_conv);
3342 }
3343
3344 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingSigned_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
3345         LDKFundingSigned* this_ptr_conv = (LDKFundingSigned*)this_ptr;
3346         jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3347         (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *FundingSigned_get_channel_id(this_ptr_conv));
3348         return ret_arr;
3349 }
3350
3351 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3352         LDKFundingSigned* this_ptr_conv = (LDKFundingSigned*)this_ptr;
3353         LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3354         free((void*)val);
3355         return FundingSigned_set_channel_id(this_ptr_conv, val_conv);
3356 }
3357
3358 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingSigned_1get_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
3359         LDKFundingSigned* this_ptr_conv = (LDKFundingSigned*)this_ptr;
3360         LDKSignature* ret = malloc(sizeof(LDKSignature));
3361         *ret = FundingSigned_get_signature(this_ptr_conv);
3362         return (long)ret;
3363 }
3364
3365 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1set_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3366         LDKFundingSigned* this_ptr_conv = (LDKFundingSigned*)this_ptr;
3367         LDKSignature val_conv = *(LDKSignature*)val;
3368         free((void*)val);
3369         return FundingSigned_set_signature(this_ptr_conv, val_conv);
3370 }
3371
3372 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingSigned_1new(JNIEnv * _env, jclass _b, jlong channel_id_arg, jlong signature_arg) {
3373         LDKThirtyTwoBytes channel_id_arg_conv = *(LDKThirtyTwoBytes*)channel_id_arg;
3374         free((void*)channel_id_arg);
3375         LDKSignature signature_arg_conv = *(LDKSignature*)signature_arg;
3376         free((void*)signature_arg);
3377         LDKFundingSigned* ret = malloc(sizeof(LDKFundingSigned));
3378         *ret = FundingSigned_new(channel_id_arg_conv, signature_arg_conv);
3379         assert(!ret->_underlying_ref);
3380         ret->_underlying_ref = true;
3381         return (long)ret;
3382 }
3383
3384 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingLocked_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3385         LDKFundingLocked this_ptr_conv = *(LDKFundingLocked*)this_ptr;
3386         free((void*)this_ptr);
3387         this_ptr_conv._underlying_ref = false;
3388         return FundingLocked_free(this_ptr_conv);
3389 }
3390
3391 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingLocked_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
3392         LDKFundingLocked* this_ptr_conv = (LDKFundingLocked*)this_ptr;
3393         jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3394         (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *FundingLocked_get_channel_id(this_ptr_conv));
3395         return ret_arr;
3396 }
3397
3398 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingLocked_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3399         LDKFundingLocked* this_ptr_conv = (LDKFundingLocked*)this_ptr;
3400         LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3401         free((void*)val);
3402         return FundingLocked_set_channel_id(this_ptr_conv, val_conv);
3403 }
3404
3405 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingLocked_1get_1next_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
3406         LDKFundingLocked* this_ptr_conv = (LDKFundingLocked*)this_ptr;
3407         LDKPublicKey* ret = malloc(sizeof(LDKPublicKey));
3408         *ret = FundingLocked_get_next_per_commitment_point(this_ptr_conv);
3409         return (long)ret;
3410 }
3411
3412 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingLocked_1set_1next_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3413         LDKFundingLocked* this_ptr_conv = (LDKFundingLocked*)this_ptr;
3414         LDKPublicKey val_conv = *(LDKPublicKey*)val;
3415         free((void*)val);
3416         return FundingLocked_set_next_per_commitment_point(this_ptr_conv, val_conv);
3417 }
3418
3419 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingLocked_1new(JNIEnv * _env, jclass _b, jlong channel_id_arg, jlong next_per_commitment_point_arg) {
3420         LDKThirtyTwoBytes channel_id_arg_conv = *(LDKThirtyTwoBytes*)channel_id_arg;
3421         free((void*)channel_id_arg);
3422         LDKPublicKey next_per_commitment_point_arg_conv = *(LDKPublicKey*)next_per_commitment_point_arg;
3423         free((void*)next_per_commitment_point_arg);
3424         LDKFundingLocked* ret = malloc(sizeof(LDKFundingLocked));
3425         *ret = FundingLocked_new(channel_id_arg_conv, next_per_commitment_point_arg_conv);
3426         assert(!ret->_underlying_ref);
3427         ret->_underlying_ref = true;
3428         return (long)ret;
3429 }
3430
3431 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3432         LDKShutdown this_ptr_conv = *(LDKShutdown*)this_ptr;
3433         free((void*)this_ptr);
3434         this_ptr_conv._underlying_ref = false;
3435         return Shutdown_free(this_ptr_conv);
3436 }
3437
3438 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Shutdown_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
3439         LDKShutdown* this_ptr_conv = (LDKShutdown*)this_ptr;
3440         jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3441         (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *Shutdown_get_channel_id(this_ptr_conv));
3442         return ret_arr;
3443 }
3444
3445 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3446         LDKShutdown* this_ptr_conv = (LDKShutdown*)this_ptr;
3447         LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3448         free((void*)val);
3449         return Shutdown_set_channel_id(this_ptr_conv, val_conv);
3450 }
3451
3452 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Shutdown_1get_1scriptpubkey(JNIEnv * _env, jclass _b, jlong this_ptr) {
3453         LDKShutdown* this_ptr_conv = (LDKShutdown*)this_ptr;
3454         LDKu8slice* ret = malloc(sizeof(LDKu8slice));
3455         *ret = Shutdown_get_scriptpubkey(this_ptr_conv);
3456         return (long)ret;
3457 }
3458
3459 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1set_1scriptpubkey(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3460         LDKShutdown* this_ptr_conv = (LDKShutdown*)this_ptr;
3461         LDKCVec_u8Z val_conv = *(LDKCVec_u8Z*)val;
3462         free((void*)val);
3463         return Shutdown_set_scriptpubkey(this_ptr_conv, val_conv);
3464 }
3465
3466 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Shutdown_1new(JNIEnv * _env, jclass _b, jlong channel_id_arg, jlong scriptpubkey_arg) {
3467         LDKThirtyTwoBytes channel_id_arg_conv = *(LDKThirtyTwoBytes*)channel_id_arg;
3468         free((void*)channel_id_arg);
3469         LDKCVec_u8Z scriptpubkey_arg_conv = *(LDKCVec_u8Z*)scriptpubkey_arg;
3470         free((void*)scriptpubkey_arg);
3471         LDKShutdown* ret = malloc(sizeof(LDKShutdown));
3472         *ret = Shutdown_new(channel_id_arg_conv, scriptpubkey_arg_conv);
3473         assert(!ret->_underlying_ref);
3474         ret->_underlying_ref = true;
3475         return (long)ret;
3476 }
3477
3478 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3479         LDKClosingSigned this_ptr_conv = *(LDKClosingSigned*)this_ptr;
3480         free((void*)this_ptr);
3481         this_ptr_conv._underlying_ref = false;
3482         return ClosingSigned_free(this_ptr_conv);
3483 }
3484
3485 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
3486         LDKClosingSigned* this_ptr_conv = (LDKClosingSigned*)this_ptr;
3487         jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3488         (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *ClosingSigned_get_channel_id(this_ptr_conv));
3489         return ret_arr;
3490 }
3491
3492 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3493         LDKClosingSigned* this_ptr_conv = (LDKClosingSigned*)this_ptr;
3494         LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3495         free((void*)val);
3496         return ClosingSigned_set_channel_id(this_ptr_conv, val_conv);
3497 }
3498
3499 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1fee_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
3500         LDKClosingSigned* this_ptr_conv = (LDKClosingSigned*)this_ptr;
3501         return ClosingSigned_get_fee_satoshis(this_ptr_conv);
3502 }
3503
3504 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1fee_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3505         LDKClosingSigned* this_ptr_conv = (LDKClosingSigned*)this_ptr;
3506         return ClosingSigned_set_fee_satoshis(this_ptr_conv, val);
3507 }
3508
3509 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
3510         LDKClosingSigned* this_ptr_conv = (LDKClosingSigned*)this_ptr;
3511         LDKSignature* ret = malloc(sizeof(LDKSignature));
3512         *ret = ClosingSigned_get_signature(this_ptr_conv);
3513         return (long)ret;
3514 }
3515
3516 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3517         LDKClosingSigned* this_ptr_conv = (LDKClosingSigned*)this_ptr;
3518         LDKSignature val_conv = *(LDKSignature*)val;
3519         free((void*)val);
3520         return ClosingSigned_set_signature(this_ptr_conv, val_conv);
3521 }
3522
3523 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1new(JNIEnv * _env, jclass _b, jlong channel_id_arg, jlong fee_satoshis_arg, jlong signature_arg) {
3524         LDKThirtyTwoBytes channel_id_arg_conv = *(LDKThirtyTwoBytes*)channel_id_arg;
3525         free((void*)channel_id_arg);
3526         LDKSignature signature_arg_conv = *(LDKSignature*)signature_arg;
3527         free((void*)signature_arg);
3528         LDKClosingSigned* ret = malloc(sizeof(LDKClosingSigned));
3529         *ret = ClosingSigned_new(channel_id_arg_conv, fee_satoshis_arg, signature_arg_conv);
3530         assert(!ret->_underlying_ref);
3531         ret->_underlying_ref = true;
3532         return (long)ret;
3533 }
3534
3535 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3536         LDKUpdateAddHTLC this_ptr_conv = *(LDKUpdateAddHTLC*)this_ptr;
3537         free((void*)this_ptr);
3538         this_ptr_conv._underlying_ref = false;
3539         return UpdateAddHTLC_free(this_ptr_conv);
3540 }
3541
3542 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
3543         LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
3544         jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3545         (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateAddHTLC_get_channel_id(this_ptr_conv));
3546         return ret_arr;
3547 }
3548
3549 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3550         LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
3551         LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3552         free((void*)val);
3553         return UpdateAddHTLC_set_channel_id(this_ptr_conv, val_conv);
3554 }
3555
3556 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
3557         LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
3558         return UpdateAddHTLC_get_htlc_id(this_ptr_conv);
3559 }
3560
3561 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3562         LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
3563         return UpdateAddHTLC_set_htlc_id(this_ptr_conv, val);
3564 }
3565
3566 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1amount_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
3567         LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
3568         return UpdateAddHTLC_get_amount_msat(this_ptr_conv);
3569 }
3570
3571 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1amount_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3572         LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
3573         return UpdateAddHTLC_set_amount_msat(this_ptr_conv, val);
3574 }
3575
3576 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1payment_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
3577         LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
3578         jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3579         (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateAddHTLC_get_payment_hash(this_ptr_conv));
3580         return ret_arr;
3581 }
3582
3583 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1payment_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3584         LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
3585         LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3586         free((void*)val);
3587         return UpdateAddHTLC_set_payment_hash(this_ptr_conv, val_conv);
3588 }
3589
3590 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1cltv_1expiry(JNIEnv * _env, jclass _b, jlong this_ptr) {
3591         LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
3592         return UpdateAddHTLC_get_cltv_expiry(this_ptr_conv);
3593 }
3594
3595 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1cltv_1expiry(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
3596         LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
3597         return UpdateAddHTLC_set_cltv_expiry(this_ptr_conv, val);
3598 }
3599
3600 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3601         LDKUpdateFulfillHTLC this_ptr_conv = *(LDKUpdateFulfillHTLC*)this_ptr;
3602         free((void*)this_ptr);
3603         this_ptr_conv._underlying_ref = false;
3604         return UpdateFulfillHTLC_free(this_ptr_conv);
3605 }
3606
3607 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
3608         LDKUpdateFulfillHTLC* this_ptr_conv = (LDKUpdateFulfillHTLC*)this_ptr;
3609         jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3610         (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateFulfillHTLC_get_channel_id(this_ptr_conv));
3611         return ret_arr;
3612 }
3613
3614 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3615         LDKUpdateFulfillHTLC* this_ptr_conv = (LDKUpdateFulfillHTLC*)this_ptr;
3616         LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3617         free((void*)val);
3618         return UpdateFulfillHTLC_set_channel_id(this_ptr_conv, val_conv);
3619 }
3620
3621 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
3622         LDKUpdateFulfillHTLC* this_ptr_conv = (LDKUpdateFulfillHTLC*)this_ptr;
3623         return UpdateFulfillHTLC_get_htlc_id(this_ptr_conv);
3624 }
3625
3626 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1set_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3627         LDKUpdateFulfillHTLC* this_ptr_conv = (LDKUpdateFulfillHTLC*)this_ptr;
3628         return UpdateFulfillHTLC_set_htlc_id(this_ptr_conv, val);
3629 }
3630
3631 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_1payment_1preimage(JNIEnv * _env, jclass _b, jlong this_ptr) {
3632         LDKUpdateFulfillHTLC* this_ptr_conv = (LDKUpdateFulfillHTLC*)this_ptr;
3633         jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3634         (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateFulfillHTLC_get_payment_preimage(this_ptr_conv));
3635         return ret_arr;
3636 }
3637
3638 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1set_1payment_1preimage(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3639         LDKUpdateFulfillHTLC* this_ptr_conv = (LDKUpdateFulfillHTLC*)this_ptr;
3640         LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3641         free((void*)val);
3642         return UpdateFulfillHTLC_set_payment_preimage(this_ptr_conv, val_conv);
3643 }
3644
3645 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1new(JNIEnv * _env, jclass _b, jlong channel_id_arg, jlong htlc_id_arg, jlong payment_preimage_arg) {
3646         LDKThirtyTwoBytes channel_id_arg_conv = *(LDKThirtyTwoBytes*)channel_id_arg;
3647         free((void*)channel_id_arg);
3648         LDKThirtyTwoBytes payment_preimage_arg_conv = *(LDKThirtyTwoBytes*)payment_preimage_arg;
3649         free((void*)payment_preimage_arg);
3650         LDKUpdateFulfillHTLC* ret = malloc(sizeof(LDKUpdateFulfillHTLC));
3651         *ret = UpdateFulfillHTLC_new(channel_id_arg_conv, htlc_id_arg, payment_preimage_arg_conv);
3652         assert(!ret->_underlying_ref);
3653         ret->_underlying_ref = true;
3654         return (long)ret;
3655 }
3656
3657 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3658         LDKUpdateFailHTLC this_ptr_conv = *(LDKUpdateFailHTLC*)this_ptr;
3659         free((void*)this_ptr);
3660         this_ptr_conv._underlying_ref = false;
3661         return UpdateFailHTLC_free(this_ptr_conv);
3662 }
3663
3664 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
3665         LDKUpdateFailHTLC* this_ptr_conv = (LDKUpdateFailHTLC*)this_ptr;
3666         jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3667         (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateFailHTLC_get_channel_id(this_ptr_conv));
3668         return ret_arr;
3669 }
3670
3671 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3672         LDKUpdateFailHTLC* this_ptr_conv = (LDKUpdateFailHTLC*)this_ptr;
3673         LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3674         free((void*)val);
3675         return UpdateFailHTLC_set_channel_id(this_ptr_conv, val_conv);
3676 }
3677
3678 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1get_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
3679         LDKUpdateFailHTLC* this_ptr_conv = (LDKUpdateFailHTLC*)this_ptr;
3680         return UpdateFailHTLC_get_htlc_id(this_ptr_conv);
3681 }
3682
3683 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1set_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3684         LDKUpdateFailHTLC* this_ptr_conv = (LDKUpdateFailHTLC*)this_ptr;
3685         return UpdateFailHTLC_set_htlc_id(this_ptr_conv, val);
3686 }
3687
3688 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3689         LDKUpdateFailMalformedHTLC this_ptr_conv = *(LDKUpdateFailMalformedHTLC*)this_ptr;
3690         free((void*)this_ptr);
3691         this_ptr_conv._underlying_ref = false;
3692         return UpdateFailMalformedHTLC_free(this_ptr_conv);
3693 }
3694
3695 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
3696         LDKUpdateFailMalformedHTLC* this_ptr_conv = (LDKUpdateFailMalformedHTLC*)this_ptr;
3697         jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3698         (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateFailMalformedHTLC_get_channel_id(this_ptr_conv));
3699         return ret_arr;
3700 }
3701
3702 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3703         LDKUpdateFailMalformedHTLC* this_ptr_conv = (LDKUpdateFailMalformedHTLC*)this_ptr;
3704         LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3705         free((void*)val);
3706         return UpdateFailMalformedHTLC_set_channel_id(this_ptr_conv, val_conv);
3707 }
3708
3709 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1get_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
3710         LDKUpdateFailMalformedHTLC* this_ptr_conv = (LDKUpdateFailMalformedHTLC*)this_ptr;
3711         return UpdateFailMalformedHTLC_get_htlc_id(this_ptr_conv);
3712 }
3713
3714 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1set_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3715         LDKUpdateFailMalformedHTLC* this_ptr_conv = (LDKUpdateFailMalformedHTLC*)this_ptr;
3716         return UpdateFailMalformedHTLC_set_htlc_id(this_ptr_conv, val);
3717 }
3718
3719 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1get_1failure_1code(JNIEnv * _env, jclass _b, jlong this_ptr) {
3720         LDKUpdateFailMalformedHTLC* this_ptr_conv = (LDKUpdateFailMalformedHTLC*)this_ptr;
3721         uint16_t* ret = malloc(sizeof(uint16_t));
3722         *ret = UpdateFailMalformedHTLC_get_failure_code(this_ptr_conv);
3723         return (long)ret;
3724 }
3725
3726 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1set_1failure_1code(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3727         LDKUpdateFailMalformedHTLC* this_ptr_conv = (LDKUpdateFailMalformedHTLC*)this_ptr;
3728         uint16_t val_conv = *(uint16_t*)val;
3729         free((void*)val);
3730         return UpdateFailMalformedHTLC_set_failure_code(this_ptr_conv, val_conv);
3731 }
3732
3733 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3734         LDKCommitmentSigned this_ptr_conv = *(LDKCommitmentSigned*)this_ptr;
3735         free((void*)this_ptr);
3736         this_ptr_conv._underlying_ref = false;
3737         return CommitmentSigned_free(this_ptr_conv);
3738 }
3739
3740 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
3741         LDKCommitmentSigned* this_ptr_conv = (LDKCommitmentSigned*)this_ptr;
3742         jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3743         (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *CommitmentSigned_get_channel_id(this_ptr_conv));
3744         return ret_arr;
3745 }
3746
3747 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3748         LDKCommitmentSigned* this_ptr_conv = (LDKCommitmentSigned*)this_ptr;
3749         LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3750         free((void*)val);
3751         return CommitmentSigned_set_channel_id(this_ptr_conv, val_conv);
3752 }
3753
3754 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1get_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
3755         LDKCommitmentSigned* this_ptr_conv = (LDKCommitmentSigned*)this_ptr;
3756         LDKSignature* ret = malloc(sizeof(LDKSignature));
3757         *ret = CommitmentSigned_get_signature(this_ptr_conv);
3758         return (long)ret;
3759 }
3760
3761 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3762         LDKCommitmentSigned* this_ptr_conv = (LDKCommitmentSigned*)this_ptr;
3763         LDKSignature val_conv = *(LDKSignature*)val;
3764         free((void*)val);
3765         return CommitmentSigned_set_signature(this_ptr_conv, val_conv);
3766 }
3767
3768 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1htlc_1signatures(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3769         LDKCommitmentSigned* this_ptr_conv = (LDKCommitmentSigned*)this_ptr;
3770         LDKCVec_SignatureZ val_conv = *(LDKCVec_SignatureZ*)val;
3771         free((void*)val);
3772         return CommitmentSigned_set_htlc_signatures(this_ptr_conv, val_conv);
3773 }
3774
3775 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1new(JNIEnv * _env, jclass _b, jlong channel_id_arg, jlong signature_arg, jlong htlc_signatures_arg) {
3776         LDKThirtyTwoBytes channel_id_arg_conv = *(LDKThirtyTwoBytes*)channel_id_arg;
3777         free((void*)channel_id_arg);
3778         LDKSignature signature_arg_conv = *(LDKSignature*)signature_arg;
3779         free((void*)signature_arg);
3780         LDKCVec_SignatureZ htlc_signatures_arg_conv = *(LDKCVec_SignatureZ*)htlc_signatures_arg;
3781         free((void*)htlc_signatures_arg);
3782         LDKCommitmentSigned* ret = malloc(sizeof(LDKCommitmentSigned));
3783         *ret = CommitmentSigned_new(channel_id_arg_conv, signature_arg_conv, htlc_signatures_arg_conv);
3784         assert(!ret->_underlying_ref);
3785         ret->_underlying_ref = true;
3786         return (long)ret;
3787 }
3788
3789 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3790         LDKRevokeAndACK this_ptr_conv = *(LDKRevokeAndACK*)this_ptr;
3791         free((void*)this_ptr);
3792         this_ptr_conv._underlying_ref = false;
3793         return RevokeAndACK_free(this_ptr_conv);
3794 }
3795
3796 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
3797         LDKRevokeAndACK* this_ptr_conv = (LDKRevokeAndACK*)this_ptr;
3798         jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3799         (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *RevokeAndACK_get_channel_id(this_ptr_conv));
3800         return ret_arr;
3801 }
3802
3803 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3804         LDKRevokeAndACK* this_ptr_conv = (LDKRevokeAndACK*)this_ptr;
3805         LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3806         free((void*)val);
3807         return RevokeAndACK_set_channel_id(this_ptr_conv, val_conv);
3808 }
3809
3810 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1per_1commitment_1secret(JNIEnv * _env, jclass _b, jlong this_ptr) {
3811         LDKRevokeAndACK* this_ptr_conv = (LDKRevokeAndACK*)this_ptr;
3812         jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3813         (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *RevokeAndACK_get_per_commitment_secret(this_ptr_conv));
3814         return ret_arr;
3815 }
3816
3817 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1set_1per_1commitment_1secret(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3818         LDKRevokeAndACK* this_ptr_conv = (LDKRevokeAndACK*)this_ptr;
3819         LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3820         free((void*)val);
3821         return RevokeAndACK_set_per_commitment_secret(this_ptr_conv, val_conv);
3822 }
3823
3824 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1next_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
3825         LDKRevokeAndACK* this_ptr_conv = (LDKRevokeAndACK*)this_ptr;
3826         LDKPublicKey* ret = malloc(sizeof(LDKPublicKey));
3827         *ret = RevokeAndACK_get_next_per_commitment_point(this_ptr_conv);
3828         return (long)ret;
3829 }
3830
3831 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1set_1next_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3832         LDKRevokeAndACK* this_ptr_conv = (LDKRevokeAndACK*)this_ptr;
3833         LDKPublicKey val_conv = *(LDKPublicKey*)val;
3834         free((void*)val);
3835         return RevokeAndACK_set_next_per_commitment_point(this_ptr_conv, val_conv);
3836 }
3837
3838 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1new(JNIEnv * _env, jclass _b, jlong channel_id_arg, jlong per_commitment_secret_arg, jlong next_per_commitment_point_arg) {
3839         LDKThirtyTwoBytes channel_id_arg_conv = *(LDKThirtyTwoBytes*)channel_id_arg;
3840         free((void*)channel_id_arg);
3841         LDKThirtyTwoBytes per_commitment_secret_arg_conv = *(LDKThirtyTwoBytes*)per_commitment_secret_arg;
3842         free((void*)per_commitment_secret_arg);
3843         LDKPublicKey next_per_commitment_point_arg_conv = *(LDKPublicKey*)next_per_commitment_point_arg;
3844         free((void*)next_per_commitment_point_arg);
3845         LDKRevokeAndACK* ret = malloc(sizeof(LDKRevokeAndACK));
3846         *ret = RevokeAndACK_new(channel_id_arg_conv, per_commitment_secret_arg_conv, next_per_commitment_point_arg_conv);
3847         assert(!ret->_underlying_ref);
3848         ret->_underlying_ref = true;
3849         return (long)ret;
3850 }
3851
3852 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFee_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3853         LDKUpdateFee this_ptr_conv = *(LDKUpdateFee*)this_ptr;
3854         free((void*)this_ptr);
3855         this_ptr_conv._underlying_ref = false;
3856         return UpdateFee_free(this_ptr_conv);
3857 }
3858
3859 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFee_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
3860         LDKUpdateFee* this_ptr_conv = (LDKUpdateFee*)this_ptr;
3861         jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3862         (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateFee_get_channel_id(this_ptr_conv));
3863         return ret_arr;
3864 }
3865
3866 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFee_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3867         LDKUpdateFee* this_ptr_conv = (LDKUpdateFee*)this_ptr;
3868         LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3869         free((void*)val);
3870         return UpdateFee_set_channel_id(this_ptr_conv, val_conv);
3871 }
3872
3873 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UpdateFee_1get_1feerate_1per_1kw(JNIEnv * _env, jclass _b, jlong this_ptr) {
3874         LDKUpdateFee* this_ptr_conv = (LDKUpdateFee*)this_ptr;
3875         return UpdateFee_get_feerate_per_kw(this_ptr_conv);
3876 }
3877
3878 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFee_1set_1feerate_1per_1kw(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
3879         LDKUpdateFee* this_ptr_conv = (LDKUpdateFee*)this_ptr;
3880         return UpdateFee_set_feerate_per_kw(this_ptr_conv, val);
3881 }
3882
3883 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFee_1new(JNIEnv * _env, jclass _b, jlong channel_id_arg, jint feerate_per_kw_arg) {
3884         LDKThirtyTwoBytes channel_id_arg_conv = *(LDKThirtyTwoBytes*)channel_id_arg;
3885         free((void*)channel_id_arg);
3886         LDKUpdateFee* ret = malloc(sizeof(LDKUpdateFee));
3887         *ret = UpdateFee_new(channel_id_arg_conv, feerate_per_kw_arg);
3888         assert(!ret->_underlying_ref);
3889         ret->_underlying_ref = true;
3890         return (long)ret;
3891 }
3892
3893 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3894         LDKDataLossProtect this_ptr_conv = *(LDKDataLossProtect*)this_ptr;
3895         free((void*)this_ptr);
3896         this_ptr_conv._underlying_ref = false;
3897         return DataLossProtect_free(this_ptr_conv);
3898 }
3899
3900 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1get_1your_1last_1per_1commitment_1secret(JNIEnv * _env, jclass _b, jlong this_ptr) {
3901         LDKDataLossProtect* this_ptr_conv = (LDKDataLossProtect*)this_ptr;
3902         jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3903         (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *DataLossProtect_get_your_last_per_commitment_secret(this_ptr_conv));
3904         return ret_arr;
3905 }
3906
3907 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1set_1your_1last_1per_1commitment_1secret(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3908         LDKDataLossProtect* this_ptr_conv = (LDKDataLossProtect*)this_ptr;
3909         LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3910         free((void*)val);
3911         return DataLossProtect_set_your_last_per_commitment_secret(this_ptr_conv, val_conv);
3912 }
3913
3914 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1get_1my_1current_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
3915         LDKDataLossProtect* this_ptr_conv = (LDKDataLossProtect*)this_ptr;
3916         LDKPublicKey* ret = malloc(sizeof(LDKPublicKey));
3917         *ret = DataLossProtect_get_my_current_per_commitment_point(this_ptr_conv);
3918         return (long)ret;
3919 }
3920
3921 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1set_1my_1current_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3922         LDKDataLossProtect* this_ptr_conv = (LDKDataLossProtect*)this_ptr;
3923         LDKPublicKey val_conv = *(LDKPublicKey*)val;
3924         free((void*)val);
3925         return DataLossProtect_set_my_current_per_commitment_point(this_ptr_conv, val_conv);
3926 }
3927
3928 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1new(JNIEnv * _env, jclass _b, jlong your_last_per_commitment_secret_arg, jlong my_current_per_commitment_point_arg) {
3929         LDKThirtyTwoBytes your_last_per_commitment_secret_arg_conv = *(LDKThirtyTwoBytes*)your_last_per_commitment_secret_arg;
3930         free((void*)your_last_per_commitment_secret_arg);
3931         LDKPublicKey my_current_per_commitment_point_arg_conv = *(LDKPublicKey*)my_current_per_commitment_point_arg;
3932         free((void*)my_current_per_commitment_point_arg);
3933         LDKDataLossProtect* ret = malloc(sizeof(LDKDataLossProtect));
3934         *ret = DataLossProtect_new(your_last_per_commitment_secret_arg_conv, my_current_per_commitment_point_arg_conv);
3935         assert(!ret->_underlying_ref);
3936         ret->_underlying_ref = true;
3937         return (long)ret;
3938 }
3939
3940 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3941         LDKChannelReestablish this_ptr_conv = *(LDKChannelReestablish*)this_ptr;
3942         free((void*)this_ptr);
3943         this_ptr_conv._underlying_ref = false;
3944         return ChannelReestablish_free(this_ptr_conv);
3945 }
3946
3947 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
3948         LDKChannelReestablish* this_ptr_conv = (LDKChannelReestablish*)this_ptr;
3949         jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3950         (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *ChannelReestablish_get_channel_id(this_ptr_conv));
3951         return ret_arr;
3952 }
3953
3954 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3955         LDKChannelReestablish* this_ptr_conv = (LDKChannelReestablish*)this_ptr;
3956         LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3957         free((void*)val);
3958         return ChannelReestablish_set_channel_id(this_ptr_conv, val_conv);
3959 }
3960
3961 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1get_1next_1local_1commitment_1number(JNIEnv * _env, jclass _b, jlong this_ptr) {
3962         LDKChannelReestablish* this_ptr_conv = (LDKChannelReestablish*)this_ptr;
3963         return ChannelReestablish_get_next_local_commitment_number(this_ptr_conv);
3964 }
3965
3966 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1set_1next_1local_1commitment_1number(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3967         LDKChannelReestablish* this_ptr_conv = (LDKChannelReestablish*)this_ptr;
3968         return ChannelReestablish_set_next_local_commitment_number(this_ptr_conv, val);
3969 }
3970
3971 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1get_1next_1remote_1commitment_1number(JNIEnv * _env, jclass _b, jlong this_ptr) {
3972         LDKChannelReestablish* this_ptr_conv = (LDKChannelReestablish*)this_ptr;
3973         return ChannelReestablish_get_next_remote_commitment_number(this_ptr_conv);
3974 }
3975
3976 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1set_1next_1remote_1commitment_1number(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3977         LDKChannelReestablish* this_ptr_conv = (LDKChannelReestablish*)this_ptr;
3978         return ChannelReestablish_set_next_remote_commitment_number(this_ptr_conv, val);
3979 }
3980
3981 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3982         LDKAnnouncementSignatures this_ptr_conv = *(LDKAnnouncementSignatures*)this_ptr;
3983         free((void*)this_ptr);
3984         this_ptr_conv._underlying_ref = false;
3985         return AnnouncementSignatures_free(this_ptr_conv);
3986 }
3987
3988 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
3989         LDKAnnouncementSignatures* this_ptr_conv = (LDKAnnouncementSignatures*)this_ptr;
3990         jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3991         (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *AnnouncementSignatures_get_channel_id(this_ptr_conv));
3992         return ret_arr;
3993 }
3994
3995 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3996         LDKAnnouncementSignatures* this_ptr_conv = (LDKAnnouncementSignatures*)this_ptr;
3997         LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3998         free((void*)val);
3999         return AnnouncementSignatures_set_channel_id(this_ptr_conv, val_conv);
4000 }
4001
4002 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4003         LDKAnnouncementSignatures* this_ptr_conv = (LDKAnnouncementSignatures*)this_ptr;
4004         return AnnouncementSignatures_get_short_channel_id(this_ptr_conv);
4005 }
4006
4007 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4008         LDKAnnouncementSignatures* this_ptr_conv = (LDKAnnouncementSignatures*)this_ptr;
4009         return AnnouncementSignatures_set_short_channel_id(this_ptr_conv, val);
4010 }
4011
4012 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1node_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
4013         LDKAnnouncementSignatures* this_ptr_conv = (LDKAnnouncementSignatures*)this_ptr;
4014         LDKSignature* ret = malloc(sizeof(LDKSignature));
4015         *ret = AnnouncementSignatures_get_node_signature(this_ptr_conv);
4016         return (long)ret;
4017 }
4018
4019 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1node_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4020         LDKAnnouncementSignatures* this_ptr_conv = (LDKAnnouncementSignatures*)this_ptr;
4021         LDKSignature val_conv = *(LDKSignature*)val;
4022         free((void*)val);
4023         return AnnouncementSignatures_set_node_signature(this_ptr_conv, val_conv);
4024 }
4025
4026 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1bitcoin_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
4027         LDKAnnouncementSignatures* this_ptr_conv = (LDKAnnouncementSignatures*)this_ptr;
4028         LDKSignature* ret = malloc(sizeof(LDKSignature));
4029         *ret = AnnouncementSignatures_get_bitcoin_signature(this_ptr_conv);
4030         return (long)ret;
4031 }
4032
4033 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1bitcoin_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4034         LDKAnnouncementSignatures* this_ptr_conv = (LDKAnnouncementSignatures*)this_ptr;
4035         LDKSignature val_conv = *(LDKSignature*)val;
4036         free((void*)val);
4037         return AnnouncementSignatures_set_bitcoin_signature(this_ptr_conv, val_conv);
4038 }
4039
4040 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1new(JNIEnv * _env, jclass _b, jlong channel_id_arg, jlong short_channel_id_arg, jlong node_signature_arg, jlong bitcoin_signature_arg) {
4041         LDKThirtyTwoBytes channel_id_arg_conv = *(LDKThirtyTwoBytes*)channel_id_arg;
4042         free((void*)channel_id_arg);
4043         LDKSignature node_signature_arg_conv = *(LDKSignature*)node_signature_arg;
4044         free((void*)node_signature_arg);
4045         LDKSignature bitcoin_signature_arg_conv = *(LDKSignature*)bitcoin_signature_arg;
4046         free((void*)bitcoin_signature_arg);
4047         LDKAnnouncementSignatures* ret = malloc(sizeof(LDKAnnouncementSignatures));
4048         *ret = AnnouncementSignatures_new(channel_id_arg_conv, short_channel_id_arg, node_signature_arg_conv, bitcoin_signature_arg_conv);
4049         assert(!ret->_underlying_ref);
4050         ret->_underlying_ref = true;
4051         return (long)ret;
4052 }
4053
4054 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetAddress_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4055         LDKNetAddress this_ptr_conv = *(LDKNetAddress*)this_ptr;
4056         free((void*)this_ptr);
4057         return NetAddress_free(this_ptr_conv);
4058 }
4059
4060 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4061         LDKUnsignedNodeAnnouncement this_ptr_conv = *(LDKUnsignedNodeAnnouncement*)this_ptr;
4062         free((void*)this_ptr);
4063         this_ptr_conv._underlying_ref = false;
4064         return UnsignedNodeAnnouncement_free(this_ptr_conv);
4065 }
4066
4067 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1timestamp(JNIEnv * _env, jclass _b, jlong this_ptr) {
4068         LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
4069         return UnsignedNodeAnnouncement_get_timestamp(this_ptr_conv);
4070 }
4071
4072 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1timestamp(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
4073         LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
4074         return UnsignedNodeAnnouncement_set_timestamp(this_ptr_conv, val);
4075 }
4076
4077 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1node_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4078         LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
4079         LDKPublicKey* ret = malloc(sizeof(LDKPublicKey));
4080         *ret = UnsignedNodeAnnouncement_get_node_id(this_ptr_conv);
4081         return (long)ret;
4082 }
4083
4084 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1node_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4085         LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
4086         LDKPublicKey val_conv = *(LDKPublicKey*)val;
4087         free((void*)val);
4088         return UnsignedNodeAnnouncement_set_node_id(this_ptr_conv, val_conv);
4089 }
4090
4091 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1rgb(JNIEnv * _env, jclass _b, jlong this_ptr) {
4092         LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
4093         jbyteArray ret_arr = (*_env)->NewByteArray(_env, 3);
4094         (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 3, *UnsignedNodeAnnouncement_get_rgb(this_ptr_conv));
4095         return ret_arr;
4096 }
4097
4098 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1rgb(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4099         LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
4100         LDKThreeBytes val_conv = *(LDKThreeBytes*)val;
4101         free((void*)val);
4102         return UnsignedNodeAnnouncement_set_rgb(this_ptr_conv, val_conv);
4103 }
4104
4105 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1alias(JNIEnv * _env, jclass _b, jlong this_ptr) {
4106         LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
4107         jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4108         (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UnsignedNodeAnnouncement_get_alias(this_ptr_conv));
4109         return ret_arr;
4110 }
4111
4112 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1alias(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4113         LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
4114         LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4115         free((void*)val);
4116         return UnsignedNodeAnnouncement_set_alias(this_ptr_conv, val_conv);
4117 }
4118
4119 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1addresses(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4120         LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
4121         LDKCVec_NetAddressZ val_conv = *(LDKCVec_NetAddressZ*)val;
4122         free((void*)val);
4123         return UnsignedNodeAnnouncement_set_addresses(this_ptr_conv, val_conv);
4124 }
4125
4126 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4127         LDKNodeAnnouncement this_ptr_conv = *(LDKNodeAnnouncement*)this_ptr;
4128         free((void*)this_ptr);
4129         this_ptr_conv._underlying_ref = false;
4130         return NodeAnnouncement_free(this_ptr_conv);
4131 }
4132
4133 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1get_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
4134         LDKNodeAnnouncement* this_ptr_conv = (LDKNodeAnnouncement*)this_ptr;
4135         LDKSignature* ret = malloc(sizeof(LDKSignature));
4136         *ret = NodeAnnouncement_get_signature(this_ptr_conv);
4137         return (long)ret;
4138 }
4139
4140 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1set_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4141         LDKNodeAnnouncement* this_ptr_conv = (LDKNodeAnnouncement*)this_ptr;
4142         LDKSignature val_conv = *(LDKSignature*)val;
4143         free((void*)val);
4144         return NodeAnnouncement_set_signature(this_ptr_conv, val_conv);
4145 }
4146
4147 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1get_1contents(JNIEnv * _env, jclass _b, jlong this_ptr) {
4148         LDKNodeAnnouncement* this_ptr_conv = (LDKNodeAnnouncement*)this_ptr;
4149         LDKUnsignedNodeAnnouncement* ret = malloc(sizeof(LDKUnsignedNodeAnnouncement));
4150         *ret = NodeAnnouncement_get_contents(this_ptr_conv);
4151         assert(!ret->_underlying_ref);
4152         ret->_underlying_ref = true;
4153         return (long)ret;
4154 }
4155
4156 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1set_1contents(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4157         LDKNodeAnnouncement* this_ptr_conv = (LDKNodeAnnouncement*)this_ptr;
4158         LDKUnsignedNodeAnnouncement val_conv = *(LDKUnsignedNodeAnnouncement*)val;
4159         free((void*)val);
4160         val_conv._underlying_ref = false;
4161         return NodeAnnouncement_set_contents(this_ptr_conv, val_conv);
4162 }
4163
4164 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1new(JNIEnv * _env, jclass _b, jlong signature_arg, jlong contents_arg) {
4165         LDKSignature signature_arg_conv = *(LDKSignature*)signature_arg;
4166         free((void*)signature_arg);
4167         LDKUnsignedNodeAnnouncement contents_arg_conv = *(LDKUnsignedNodeAnnouncement*)contents_arg;
4168         free((void*)contents_arg);
4169         contents_arg_conv._underlying_ref = false;
4170         LDKNodeAnnouncement* ret = malloc(sizeof(LDKNodeAnnouncement));
4171         *ret = NodeAnnouncement_new(signature_arg_conv, contents_arg_conv);
4172         assert(!ret->_underlying_ref);
4173         ret->_underlying_ref = true;
4174         return (long)ret;
4175 }
4176
4177 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4178         LDKUnsignedChannelAnnouncement this_ptr_conv = *(LDKUnsignedChannelAnnouncement*)this_ptr;
4179         free((void*)this_ptr);
4180         this_ptr_conv._underlying_ref = false;
4181         return UnsignedChannelAnnouncement_free(this_ptr_conv);
4182 }
4183
4184 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
4185         LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
4186         jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4187         (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UnsignedChannelAnnouncement_get_chain_hash(this_ptr_conv));
4188         return ret_arr;
4189 }
4190
4191 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4192         LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
4193         LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4194         free((void*)val);
4195         return UnsignedChannelAnnouncement_set_chain_hash(this_ptr_conv, val_conv);
4196 }
4197
4198 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4199         LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
4200         return UnsignedChannelAnnouncement_get_short_channel_id(this_ptr_conv);
4201 }
4202
4203 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4204         LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
4205         return UnsignedChannelAnnouncement_set_short_channel_id(this_ptr_conv, val);
4206 }
4207
4208 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1node_1id_11(JNIEnv * _env, jclass _b, jlong this_ptr) {
4209         LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
4210         LDKPublicKey* ret = malloc(sizeof(LDKPublicKey));
4211         *ret = UnsignedChannelAnnouncement_get_node_id_1(this_ptr_conv);
4212         return (long)ret;
4213 }
4214
4215 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1node_1id_11(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4216         LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
4217         LDKPublicKey val_conv = *(LDKPublicKey*)val;
4218         free((void*)val);
4219         return UnsignedChannelAnnouncement_set_node_id_1(this_ptr_conv, val_conv);
4220 }
4221
4222 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1node_1id_12(JNIEnv * _env, jclass _b, jlong this_ptr) {
4223         LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
4224         LDKPublicKey* ret = malloc(sizeof(LDKPublicKey));
4225         *ret = UnsignedChannelAnnouncement_get_node_id_2(this_ptr_conv);
4226         return (long)ret;
4227 }
4228
4229 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1node_1id_12(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4230         LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
4231         LDKPublicKey val_conv = *(LDKPublicKey*)val;
4232         free((void*)val);
4233         return UnsignedChannelAnnouncement_set_node_id_2(this_ptr_conv, val_conv);
4234 }
4235
4236 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1bitcoin_1key_11(JNIEnv * _env, jclass _b, jlong this_ptr) {
4237         LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
4238         LDKPublicKey* ret = malloc(sizeof(LDKPublicKey));
4239         *ret = UnsignedChannelAnnouncement_get_bitcoin_key_1(this_ptr_conv);
4240         return (long)ret;
4241 }
4242
4243 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1bitcoin_1key_11(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4244         LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
4245         LDKPublicKey val_conv = *(LDKPublicKey*)val;
4246         free((void*)val);
4247         return UnsignedChannelAnnouncement_set_bitcoin_key_1(this_ptr_conv, val_conv);
4248 }
4249
4250 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1bitcoin_1key_12(JNIEnv * _env, jclass _b, jlong this_ptr) {
4251         LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
4252         LDKPublicKey* ret = malloc(sizeof(LDKPublicKey));
4253         *ret = UnsignedChannelAnnouncement_get_bitcoin_key_2(this_ptr_conv);
4254         return (long)ret;
4255 }
4256
4257 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1bitcoin_1key_12(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4258         LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
4259         LDKPublicKey val_conv = *(LDKPublicKey*)val;
4260         free((void*)val);
4261         return UnsignedChannelAnnouncement_set_bitcoin_key_2(this_ptr_conv, val_conv);
4262 }
4263
4264 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4265         LDKChannelAnnouncement this_ptr_conv = *(LDKChannelAnnouncement*)this_ptr;
4266         free((void*)this_ptr);
4267         this_ptr_conv._underlying_ref = false;
4268         return ChannelAnnouncement_free(this_ptr_conv);
4269 }
4270
4271 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1node_1signature_11(JNIEnv * _env, jclass _b, jlong this_ptr) {
4272         LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
4273         LDKSignature* ret = malloc(sizeof(LDKSignature));
4274         *ret = ChannelAnnouncement_get_node_signature_1(this_ptr_conv);
4275         return (long)ret;
4276 }
4277
4278 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1node_1signature_11(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4279         LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
4280         LDKSignature val_conv = *(LDKSignature*)val;
4281         free((void*)val);
4282         return ChannelAnnouncement_set_node_signature_1(this_ptr_conv, val_conv);
4283 }
4284
4285 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1node_1signature_12(JNIEnv * _env, jclass _b, jlong this_ptr) {
4286         LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
4287         LDKSignature* ret = malloc(sizeof(LDKSignature));
4288         *ret = ChannelAnnouncement_get_node_signature_2(this_ptr_conv);
4289         return (long)ret;
4290 }
4291
4292 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1node_1signature_12(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4293         LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
4294         LDKSignature val_conv = *(LDKSignature*)val;
4295         free((void*)val);
4296         return ChannelAnnouncement_set_node_signature_2(this_ptr_conv, val_conv);
4297 }
4298
4299 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1bitcoin_1signature_11(JNIEnv * _env, jclass _b, jlong this_ptr) {
4300         LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
4301         LDKSignature* ret = malloc(sizeof(LDKSignature));
4302         *ret = ChannelAnnouncement_get_bitcoin_signature_1(this_ptr_conv);
4303         return (long)ret;
4304 }
4305
4306 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1bitcoin_1signature_11(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4307         LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
4308         LDKSignature val_conv = *(LDKSignature*)val;
4309         free((void*)val);
4310         return ChannelAnnouncement_set_bitcoin_signature_1(this_ptr_conv, val_conv);
4311 }
4312
4313 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1bitcoin_1signature_12(JNIEnv * _env, jclass _b, jlong this_ptr) {
4314         LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
4315         LDKSignature* ret = malloc(sizeof(LDKSignature));
4316         *ret = ChannelAnnouncement_get_bitcoin_signature_2(this_ptr_conv);
4317         return (long)ret;
4318 }
4319
4320 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1bitcoin_1signature_12(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4321         LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
4322         LDKSignature val_conv = *(LDKSignature*)val;
4323         free((void*)val);
4324         return ChannelAnnouncement_set_bitcoin_signature_2(this_ptr_conv, val_conv);
4325 }
4326
4327 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1contents(JNIEnv * _env, jclass _b, jlong this_ptr) {
4328         LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
4329         LDKUnsignedChannelAnnouncement* ret = malloc(sizeof(LDKUnsignedChannelAnnouncement));
4330         *ret = ChannelAnnouncement_get_contents(this_ptr_conv);
4331         assert(!ret->_underlying_ref);
4332         ret->_underlying_ref = true;
4333         return (long)ret;
4334 }
4335
4336 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1contents(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4337         LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
4338         LDKUnsignedChannelAnnouncement val_conv = *(LDKUnsignedChannelAnnouncement*)val;
4339         free((void*)val);
4340         val_conv._underlying_ref = false;
4341         return ChannelAnnouncement_set_contents(this_ptr_conv, val_conv);
4342 }
4343
4344 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1new(JNIEnv * _env, jclass _b, jlong node_signature_1_arg, jlong node_signature_2_arg, jlong bitcoin_signature_1_arg, jlong bitcoin_signature_2_arg, jlong contents_arg) {
4345         LDKSignature node_signature_1_arg_conv = *(LDKSignature*)node_signature_1_arg;
4346         free((void*)node_signature_1_arg);
4347         LDKSignature node_signature_2_arg_conv = *(LDKSignature*)node_signature_2_arg;
4348         free((void*)node_signature_2_arg);
4349         LDKSignature bitcoin_signature_1_arg_conv = *(LDKSignature*)bitcoin_signature_1_arg;
4350         free((void*)bitcoin_signature_1_arg);
4351         LDKSignature bitcoin_signature_2_arg_conv = *(LDKSignature*)bitcoin_signature_2_arg;
4352         free((void*)bitcoin_signature_2_arg);
4353         LDKUnsignedChannelAnnouncement contents_arg_conv = *(LDKUnsignedChannelAnnouncement*)contents_arg;
4354         free((void*)contents_arg);
4355         contents_arg_conv._underlying_ref = false;
4356         LDKChannelAnnouncement* ret = malloc(sizeof(LDKChannelAnnouncement));
4357         *ret = ChannelAnnouncement_new(node_signature_1_arg_conv, node_signature_2_arg_conv, bitcoin_signature_1_arg_conv, bitcoin_signature_2_arg_conv, contents_arg_conv);
4358         assert(!ret->_underlying_ref);
4359         ret->_underlying_ref = true;
4360         return (long)ret;
4361 }
4362
4363 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4364         LDKUnsignedChannelUpdate this_ptr_conv = *(LDKUnsignedChannelUpdate*)this_ptr;
4365         free((void*)this_ptr);
4366         this_ptr_conv._underlying_ref = false;
4367         return UnsignedChannelUpdate_free(this_ptr_conv);
4368 }
4369
4370 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
4371         LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
4372         jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4373         (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UnsignedChannelUpdate_get_chain_hash(this_ptr_conv));
4374         return ret_arr;
4375 }
4376
4377 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4378         LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
4379         LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4380         free((void*)val);
4381         return UnsignedChannelUpdate_set_chain_hash(this_ptr_conv, val_conv);
4382 }
4383
4384 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4385         LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
4386         return UnsignedChannelUpdate_get_short_channel_id(this_ptr_conv);
4387 }
4388
4389 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4390         LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
4391         return UnsignedChannelUpdate_set_short_channel_id(this_ptr_conv, val);
4392 }
4393
4394 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1timestamp(JNIEnv * _env, jclass _b, jlong this_ptr) {
4395         LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
4396         return UnsignedChannelUpdate_get_timestamp(this_ptr_conv);
4397 }
4398
4399 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1timestamp(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
4400         LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
4401         return UnsignedChannelUpdate_set_timestamp(this_ptr_conv, val);
4402 }
4403
4404 JNIEXPORT jbyte JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1flags(JNIEnv * _env, jclass _b, jlong this_ptr) {
4405         LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
4406         return UnsignedChannelUpdate_get_flags(this_ptr_conv);
4407 }
4408
4409 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1flags(JNIEnv * _env, jclass _b, jlong this_ptr, jbyte val) {
4410         LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
4411         return UnsignedChannelUpdate_set_flags(this_ptr_conv, val);
4412 }
4413
4414 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr) {
4415         LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
4416         uint16_t* ret = malloc(sizeof(uint16_t));
4417         *ret = UnsignedChannelUpdate_get_cltv_expiry_delta(this_ptr_conv);
4418         return (long)ret;
4419 }
4420
4421 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4422         LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
4423         uint16_t val_conv = *(uint16_t*)val;
4424         free((void*)val);
4425         return UnsignedChannelUpdate_set_cltv_expiry_delta(this_ptr_conv, val_conv);
4426 }
4427
4428 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
4429         LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
4430         return UnsignedChannelUpdate_get_htlc_minimum_msat(this_ptr_conv);
4431 }
4432
4433 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4434         LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
4435         return UnsignedChannelUpdate_set_htlc_minimum_msat(this_ptr_conv, val);
4436 }
4437
4438 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1fee_1base_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
4439         LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
4440         return UnsignedChannelUpdate_get_fee_base_msat(this_ptr_conv);
4441 }
4442
4443 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1fee_1base_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
4444         LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
4445         return UnsignedChannelUpdate_set_fee_base_msat(this_ptr_conv, val);
4446 }
4447
4448 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1fee_1proportional_1millionths(JNIEnv * _env, jclass _b, jlong this_ptr) {
4449         LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
4450         return UnsignedChannelUpdate_get_fee_proportional_millionths(this_ptr_conv);
4451 }
4452
4453 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1fee_1proportional_1millionths(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
4454         LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
4455         return UnsignedChannelUpdate_set_fee_proportional_millionths(this_ptr_conv, val);
4456 }
4457
4458 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4459         LDKChannelUpdate this_ptr_conv = *(LDKChannelUpdate*)this_ptr;
4460         free((void*)this_ptr);
4461         this_ptr_conv._underlying_ref = false;
4462         return ChannelUpdate_free(this_ptr_conv);
4463 }
4464
4465 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1get_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
4466         LDKChannelUpdate* this_ptr_conv = (LDKChannelUpdate*)this_ptr;
4467         LDKSignature* ret = malloc(sizeof(LDKSignature));
4468         *ret = ChannelUpdate_get_signature(this_ptr_conv);
4469         return (long)ret;
4470 }
4471
4472 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1set_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4473         LDKChannelUpdate* this_ptr_conv = (LDKChannelUpdate*)this_ptr;
4474         LDKSignature val_conv = *(LDKSignature*)val;
4475         free((void*)val);
4476         return ChannelUpdate_set_signature(this_ptr_conv, val_conv);
4477 }
4478
4479 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1get_1contents(JNIEnv * _env, jclass _b, jlong this_ptr) {
4480         LDKChannelUpdate* this_ptr_conv = (LDKChannelUpdate*)this_ptr;
4481         LDKUnsignedChannelUpdate* ret = malloc(sizeof(LDKUnsignedChannelUpdate));
4482         *ret = ChannelUpdate_get_contents(this_ptr_conv);
4483         assert(!ret->_underlying_ref);
4484         ret->_underlying_ref = true;
4485         return (long)ret;
4486 }
4487
4488 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1set_1contents(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4489         LDKChannelUpdate* this_ptr_conv = (LDKChannelUpdate*)this_ptr;
4490         LDKUnsignedChannelUpdate val_conv = *(LDKUnsignedChannelUpdate*)val;
4491         free((void*)val);
4492         val_conv._underlying_ref = false;
4493         return ChannelUpdate_set_contents(this_ptr_conv, val_conv);
4494 }
4495
4496 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1new(JNIEnv * _env, jclass _b, jlong signature_arg, jlong contents_arg) {
4497         LDKSignature signature_arg_conv = *(LDKSignature*)signature_arg;
4498         free((void*)signature_arg);
4499         LDKUnsignedChannelUpdate contents_arg_conv = *(LDKUnsignedChannelUpdate*)contents_arg;
4500         free((void*)contents_arg);
4501         contents_arg_conv._underlying_ref = false;
4502         LDKChannelUpdate* ret = malloc(sizeof(LDKChannelUpdate));
4503         *ret = ChannelUpdate_new(signature_arg_conv, contents_arg_conv);
4504         assert(!ret->_underlying_ref);
4505         ret->_underlying_ref = true;
4506         return (long)ret;
4507 }
4508
4509 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorAction_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4510         LDKErrorAction this_ptr_conv = *(LDKErrorAction*)this_ptr;
4511         free((void*)this_ptr);
4512         return ErrorAction_free(this_ptr_conv);
4513 }
4514
4515 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4516         LDKLightningError this_ptr_conv = *(LDKLightningError*)this_ptr;
4517         free((void*)this_ptr);
4518         this_ptr_conv._underlying_ref = false;
4519         return LightningError_free(this_ptr_conv);
4520 }
4521
4522 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LightningError_1get_1err(JNIEnv * _env, jclass _b, jlong this_ptr) {
4523         LDKLightningError* this_ptr_conv = (LDKLightningError*)this_ptr;
4524         LDKStr* ret = malloc(sizeof(LDKStr));
4525         *ret = LightningError_get_err(this_ptr_conv);
4526         return (long)ret;
4527 }
4528
4529 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1set_1err(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4530         LDKLightningError* this_ptr_conv = (LDKLightningError*)this_ptr;
4531         LDKCVec_u8Z val_conv = *(LDKCVec_u8Z*)val;
4532         free((void*)val);
4533         return LightningError_set_err(this_ptr_conv, val_conv);
4534 }
4535
4536 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LightningError_1get_1action(JNIEnv * _env, jclass _b, jlong this_ptr) {
4537         LDKLightningError* this_ptr_conv = (LDKLightningError*)this_ptr;
4538         LDKErrorAction* ret = malloc(sizeof(LDKErrorAction));
4539         *ret = LightningError_get_action(this_ptr_conv);
4540         return (long)ret;
4541 }
4542
4543 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1set_1action(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4544         LDKLightningError* this_ptr_conv = (LDKLightningError*)this_ptr;
4545         LDKErrorAction val_conv = *(LDKErrorAction*)val;
4546         free((void*)val);
4547         return LightningError_set_action(this_ptr_conv, val_conv);
4548 }
4549
4550 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LightningError_1new(JNIEnv * _env, jclass _b, jlong err_arg, jlong action_arg) {
4551         LDKCVec_u8Z err_arg_conv = *(LDKCVec_u8Z*)err_arg;
4552         free((void*)err_arg);
4553         LDKErrorAction action_arg_conv = *(LDKErrorAction*)action_arg;
4554         free((void*)action_arg);
4555         LDKLightningError* ret = malloc(sizeof(LDKLightningError));
4556         *ret = LightningError_new(err_arg_conv, action_arg_conv);
4557         assert(!ret->_underlying_ref);
4558         ret->_underlying_ref = true;
4559         return (long)ret;
4560 }
4561
4562 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4563         LDKCommitmentUpdate this_ptr_conv = *(LDKCommitmentUpdate*)this_ptr;
4564         free((void*)this_ptr);
4565         this_ptr_conv._underlying_ref = false;
4566         return CommitmentUpdate_free(this_ptr_conv);
4567 }
4568
4569 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1add_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4570         LDKCommitmentUpdate* this_ptr_conv = (LDKCommitmentUpdate*)this_ptr;
4571         LDKCVec_UpdateAddHTLCZ val_conv = *(LDKCVec_UpdateAddHTLCZ*)val;
4572         free((void*)val);
4573         return CommitmentUpdate_set_update_add_htlcs(this_ptr_conv, val_conv);
4574 }
4575
4576 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fulfill_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4577         LDKCommitmentUpdate* this_ptr_conv = (LDKCommitmentUpdate*)this_ptr;
4578         LDKCVec_UpdateFulfillHTLCZ val_conv = *(LDKCVec_UpdateFulfillHTLCZ*)val;
4579         free((void*)val);
4580         return CommitmentUpdate_set_update_fulfill_htlcs(this_ptr_conv, val_conv);
4581 }
4582
4583 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fail_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4584         LDKCommitmentUpdate* this_ptr_conv = (LDKCommitmentUpdate*)this_ptr;
4585         LDKCVec_UpdateFailHTLCZ val_conv = *(LDKCVec_UpdateFailHTLCZ*)val;
4586         free((void*)val);
4587         return CommitmentUpdate_set_update_fail_htlcs(this_ptr_conv, val_conv);
4588 }
4589
4590 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fail_1malformed_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4591         LDKCommitmentUpdate* this_ptr_conv = (LDKCommitmentUpdate*)this_ptr;
4592         LDKCVec_UpdateFailMalformedHTLCZ val_conv = *(LDKCVec_UpdateFailMalformedHTLCZ*)val;
4593         free((void*)val);
4594         return CommitmentUpdate_set_update_fail_malformed_htlcs(this_ptr_conv, val_conv);
4595 }
4596
4597 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1update_1fee(JNIEnv * _env, jclass _b, jlong this_ptr) {
4598         LDKCommitmentUpdate* this_ptr_conv = (LDKCommitmentUpdate*)this_ptr;
4599         LDKUpdateFee* ret = malloc(sizeof(LDKUpdateFee));
4600         *ret = CommitmentUpdate_get_update_fee(this_ptr_conv);
4601         assert(!ret->_underlying_ref);
4602         ret->_underlying_ref = true;
4603         return (long)ret;
4604 }
4605
4606 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fee(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4607         LDKCommitmentUpdate* this_ptr_conv = (LDKCommitmentUpdate*)this_ptr;
4608         LDKUpdateFee val_conv = *(LDKUpdateFee*)val;
4609         free((void*)val);
4610         val_conv._underlying_ref = false;
4611         return CommitmentUpdate_set_update_fee(this_ptr_conv, val_conv);
4612 }
4613
4614 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1commitment_1signed(JNIEnv * _env, jclass _b, jlong this_ptr) {
4615         LDKCommitmentUpdate* this_ptr_conv = (LDKCommitmentUpdate*)this_ptr;
4616         LDKCommitmentSigned* ret = malloc(sizeof(LDKCommitmentSigned));
4617         *ret = CommitmentUpdate_get_commitment_signed(this_ptr_conv);
4618         assert(!ret->_underlying_ref);
4619         ret->_underlying_ref = true;
4620         return (long)ret;
4621 }
4622
4623 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1commitment_1signed(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4624         LDKCommitmentUpdate* this_ptr_conv = (LDKCommitmentUpdate*)this_ptr;
4625         LDKCommitmentSigned val_conv = *(LDKCommitmentSigned*)val;
4626         free((void*)val);
4627         val_conv._underlying_ref = false;
4628         return CommitmentUpdate_set_commitment_signed(this_ptr_conv, val_conv);
4629 }
4630
4631 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1new(JNIEnv * _env, jclass _b, jlong update_add_htlcs_arg, jlong update_fulfill_htlcs_arg, jlong update_fail_htlcs_arg, jlong update_fail_malformed_htlcs_arg, jlong update_fee_arg, jlong commitment_signed_arg) {
4632         LDKCVec_UpdateAddHTLCZ update_add_htlcs_arg_conv = *(LDKCVec_UpdateAddHTLCZ*)update_add_htlcs_arg;
4633         free((void*)update_add_htlcs_arg);
4634         LDKCVec_UpdateFulfillHTLCZ update_fulfill_htlcs_arg_conv = *(LDKCVec_UpdateFulfillHTLCZ*)update_fulfill_htlcs_arg;
4635         free((void*)update_fulfill_htlcs_arg);
4636         LDKCVec_UpdateFailHTLCZ update_fail_htlcs_arg_conv = *(LDKCVec_UpdateFailHTLCZ*)update_fail_htlcs_arg;
4637         free((void*)update_fail_htlcs_arg);
4638         LDKCVec_UpdateFailMalformedHTLCZ update_fail_malformed_htlcs_arg_conv = *(LDKCVec_UpdateFailMalformedHTLCZ*)update_fail_malformed_htlcs_arg;
4639         free((void*)update_fail_malformed_htlcs_arg);
4640         LDKUpdateFee update_fee_arg_conv = *(LDKUpdateFee*)update_fee_arg;
4641         free((void*)update_fee_arg);
4642         update_fee_arg_conv._underlying_ref = false;
4643         LDKCommitmentSigned commitment_signed_arg_conv = *(LDKCommitmentSigned*)commitment_signed_arg;
4644         free((void*)commitment_signed_arg);
4645         commitment_signed_arg_conv._underlying_ref = false;
4646         LDKCommitmentUpdate* ret = malloc(sizeof(LDKCommitmentUpdate));
4647         *ret = CommitmentUpdate_new(update_add_htlcs_arg_conv, update_fulfill_htlcs_arg_conv, update_fail_htlcs_arg_conv, update_fail_malformed_htlcs_arg_conv, update_fee_arg_conv, commitment_signed_arg_conv);
4648         assert(!ret->_underlying_ref);
4649         ret->_underlying_ref = true;
4650         return (long)ret;
4651 }
4652
4653 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCFailChannelUpdate_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4654         LDKHTLCFailChannelUpdate this_ptr_conv = *(LDKHTLCFailChannelUpdate*)this_ptr;
4655         free((void*)this_ptr);
4656         return HTLCFailChannelUpdate_free(this_ptr_conv);
4657 }
4658
4659 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4660         LDKChannelMessageHandler this_ptr_conv = *(LDKChannelMessageHandler*)this_ptr;
4661         free((void*)this_ptr);
4662         return ChannelMessageHandler_free(this_ptr_conv);
4663 }
4664
4665 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4666         LDKRoutingMessageHandler this_ptr_conv = *(LDKRoutingMessageHandler*)this_ptr;
4667         free((void*)this_ptr);
4668         return RoutingMessageHandler_free(this_ptr_conv);
4669 }
4670
4671 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1write(JNIEnv * _env, jclass _b, jlong obj) {
4672         LDKAcceptChannel* obj_conv = (LDKAcceptChannel*)obj;
4673         LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
4674         *ret = AcceptChannel_write(obj_conv);
4675         return (long)ret;
4676 }
4677
4678 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1read(JNIEnv * _env, jclass _b, jlong ser) {
4679         LDKu8slice ser_conv = *(LDKu8slice*)ser;
4680         free((void*)ser);
4681         LDKAcceptChannel* ret = malloc(sizeof(LDKAcceptChannel));
4682         *ret = AcceptChannel_read(ser_conv);
4683         assert(!ret->_underlying_ref);
4684         ret->_underlying_ref = true;
4685         return (long)ret;
4686 }
4687
4688 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1write(JNIEnv * _env, jclass _b, jlong obj) {
4689         LDKAnnouncementSignatures* obj_conv = (LDKAnnouncementSignatures*)obj;
4690         LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
4691         *ret = AnnouncementSignatures_write(obj_conv);
4692         return (long)ret;
4693 }
4694
4695 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1read(JNIEnv * _env, jclass _b, jlong ser) {
4696         LDKu8slice ser_conv = *(LDKu8slice*)ser;
4697         free((void*)ser);
4698         LDKAnnouncementSignatures* ret = malloc(sizeof(LDKAnnouncementSignatures));
4699         *ret = AnnouncementSignatures_read(ser_conv);
4700         assert(!ret->_underlying_ref);
4701         ret->_underlying_ref = true;
4702         return (long)ret;
4703 }
4704
4705 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1write(JNIEnv * _env, jclass _b, jlong obj) {
4706         LDKChannelReestablish* obj_conv = (LDKChannelReestablish*)obj;
4707         LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
4708         *ret = ChannelReestablish_write(obj_conv);
4709         return (long)ret;
4710 }
4711
4712 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1read(JNIEnv * _env, jclass _b, jlong ser) {
4713         LDKu8slice ser_conv = *(LDKu8slice*)ser;
4714         free((void*)ser);
4715         LDKChannelReestablish* ret = malloc(sizeof(LDKChannelReestablish));
4716         *ret = ChannelReestablish_read(ser_conv);
4717         assert(!ret->_underlying_ref);
4718         ret->_underlying_ref = true;
4719         return (long)ret;
4720 }
4721
4722 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1write(JNIEnv * _env, jclass _b, jlong obj) {
4723         LDKClosingSigned* obj_conv = (LDKClosingSigned*)obj;
4724         LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
4725         *ret = ClosingSigned_write(obj_conv);
4726         return (long)ret;
4727 }
4728
4729 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1read(JNIEnv * _env, jclass _b, jlong ser) {
4730         LDKu8slice ser_conv = *(LDKu8slice*)ser;
4731         free((void*)ser);
4732         LDKClosingSigned* ret = malloc(sizeof(LDKClosingSigned));
4733         *ret = ClosingSigned_read(ser_conv);
4734         assert(!ret->_underlying_ref);
4735         ret->_underlying_ref = true;
4736         return (long)ret;
4737 }
4738
4739 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1write(JNIEnv * _env, jclass _b, jlong obj) {
4740         LDKCommitmentSigned* obj_conv = (LDKCommitmentSigned*)obj;
4741         LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
4742         *ret = CommitmentSigned_write(obj_conv);
4743         return (long)ret;
4744 }
4745
4746 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1read(JNIEnv * _env, jclass _b, jlong ser) {
4747         LDKu8slice ser_conv = *(LDKu8slice*)ser;
4748         free((void*)ser);
4749         LDKCommitmentSigned* ret = malloc(sizeof(LDKCommitmentSigned));
4750         *ret = CommitmentSigned_read(ser_conv);
4751         assert(!ret->_underlying_ref);
4752         ret->_underlying_ref = true;
4753         return (long)ret;
4754 }
4755
4756 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingCreated_1write(JNIEnv * _env, jclass _b, jlong obj) {
4757         LDKFundingCreated* obj_conv = (LDKFundingCreated*)obj;
4758         LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
4759         *ret = FundingCreated_write(obj_conv);
4760         return (long)ret;
4761 }
4762
4763 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingCreated_1read(JNIEnv * _env, jclass _b, jlong ser) {
4764         LDKu8slice ser_conv = *(LDKu8slice*)ser;
4765         free((void*)ser);
4766         LDKFundingCreated* ret = malloc(sizeof(LDKFundingCreated));
4767         *ret = FundingCreated_read(ser_conv);
4768         assert(!ret->_underlying_ref);
4769         ret->_underlying_ref = true;
4770         return (long)ret;
4771 }
4772
4773 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingSigned_1write(JNIEnv * _env, jclass _b, jlong obj) {
4774         LDKFundingSigned* obj_conv = (LDKFundingSigned*)obj;
4775         LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
4776         *ret = FundingSigned_write(obj_conv);
4777         return (long)ret;
4778 }
4779
4780 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingSigned_1read(JNIEnv * _env, jclass _b, jlong ser) {
4781         LDKu8slice ser_conv = *(LDKu8slice*)ser;
4782         free((void*)ser);
4783         LDKFundingSigned* ret = malloc(sizeof(LDKFundingSigned));
4784         *ret = FundingSigned_read(ser_conv);
4785         assert(!ret->_underlying_ref);
4786         ret->_underlying_ref = true;
4787         return (long)ret;
4788 }
4789
4790 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingLocked_1write(JNIEnv * _env, jclass _b, jlong obj) {
4791         LDKFundingLocked* obj_conv = (LDKFundingLocked*)obj;
4792         LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
4793         *ret = FundingLocked_write(obj_conv);
4794         return (long)ret;
4795 }
4796
4797 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingLocked_1read(JNIEnv * _env, jclass _b, jlong ser) {
4798         LDKu8slice ser_conv = *(LDKu8slice*)ser;
4799         free((void*)ser);
4800         LDKFundingLocked* ret = malloc(sizeof(LDKFundingLocked));
4801         *ret = FundingLocked_read(ser_conv);
4802         assert(!ret->_underlying_ref);
4803         ret->_underlying_ref = true;
4804         return (long)ret;
4805 }
4806
4807 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Init_1write(JNIEnv * _env, jclass _b, jlong obj) {
4808         LDKInit* obj_conv = (LDKInit*)obj;
4809         LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
4810         *ret = Init_write(obj_conv);
4811         return (long)ret;
4812 }
4813
4814 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Init_1read(JNIEnv * _env, jclass _b, jlong ser) {
4815         LDKu8slice ser_conv = *(LDKu8slice*)ser;
4816         free((void*)ser);
4817         LDKInit* ret = malloc(sizeof(LDKInit));
4818         *ret = Init_read(ser_conv);
4819         assert(!ret->_underlying_ref);
4820         ret->_underlying_ref = true;
4821         return (long)ret;
4822 }
4823
4824 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1write(JNIEnv * _env, jclass _b, jlong obj) {
4825         LDKOpenChannel* obj_conv = (LDKOpenChannel*)obj;
4826         LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
4827         *ret = OpenChannel_write(obj_conv);
4828         return (long)ret;
4829 }
4830
4831 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1read(JNIEnv * _env, jclass _b, jlong ser) {
4832         LDKu8slice ser_conv = *(LDKu8slice*)ser;
4833         free((void*)ser);
4834         LDKOpenChannel* ret = malloc(sizeof(LDKOpenChannel));
4835         *ret = OpenChannel_read(ser_conv);
4836         assert(!ret->_underlying_ref);
4837         ret->_underlying_ref = true;
4838         return (long)ret;
4839 }
4840
4841 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1write(JNIEnv * _env, jclass _b, jlong obj) {
4842         LDKRevokeAndACK* obj_conv = (LDKRevokeAndACK*)obj;
4843         LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
4844         *ret = RevokeAndACK_write(obj_conv);
4845         return (long)ret;
4846 }
4847
4848 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1read(JNIEnv * _env, jclass _b, jlong ser) {
4849         LDKu8slice ser_conv = *(LDKu8slice*)ser;
4850         free((void*)ser);
4851         LDKRevokeAndACK* ret = malloc(sizeof(LDKRevokeAndACK));
4852         *ret = RevokeAndACK_read(ser_conv);
4853         assert(!ret->_underlying_ref);
4854         ret->_underlying_ref = true;
4855         return (long)ret;
4856 }
4857
4858 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Shutdown_1write(JNIEnv * _env, jclass _b, jlong obj) {
4859         LDKShutdown* obj_conv = (LDKShutdown*)obj;
4860         LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
4861         *ret = Shutdown_write(obj_conv);
4862         return (long)ret;
4863 }
4864
4865 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Shutdown_1read(JNIEnv * _env, jclass _b, jlong ser) {
4866         LDKu8slice ser_conv = *(LDKu8slice*)ser;
4867         free((void*)ser);
4868         LDKShutdown* ret = malloc(sizeof(LDKShutdown));
4869         *ret = Shutdown_read(ser_conv);
4870         assert(!ret->_underlying_ref);
4871         ret->_underlying_ref = true;
4872         return (long)ret;
4873 }
4874
4875 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1write(JNIEnv * _env, jclass _b, jlong obj) {
4876         LDKUpdateFailHTLC* obj_conv = (LDKUpdateFailHTLC*)obj;
4877         LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
4878         *ret = UpdateFailHTLC_write(obj_conv);
4879         return (long)ret;
4880 }
4881
4882 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1read(JNIEnv * _env, jclass _b, jlong ser) {
4883         LDKu8slice ser_conv = *(LDKu8slice*)ser;
4884         free((void*)ser);
4885         LDKUpdateFailHTLC* ret = malloc(sizeof(LDKUpdateFailHTLC));
4886         *ret = UpdateFailHTLC_read(ser_conv);
4887         assert(!ret->_underlying_ref);
4888         ret->_underlying_ref = true;
4889         return (long)ret;
4890 }
4891
4892 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1write(JNIEnv * _env, jclass _b, jlong obj) {
4893         LDKUpdateFailMalformedHTLC* obj_conv = (LDKUpdateFailMalformedHTLC*)obj;
4894         LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
4895         *ret = UpdateFailMalformedHTLC_write(obj_conv);
4896         return (long)ret;
4897 }
4898
4899 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1read(JNIEnv * _env, jclass _b, jlong ser) {
4900         LDKu8slice ser_conv = *(LDKu8slice*)ser;
4901         free((void*)ser);
4902         LDKUpdateFailMalformedHTLC* ret = malloc(sizeof(LDKUpdateFailMalformedHTLC));
4903         *ret = UpdateFailMalformedHTLC_read(ser_conv);
4904         assert(!ret->_underlying_ref);
4905         ret->_underlying_ref = true;
4906         return (long)ret;
4907 }
4908
4909 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFee_1write(JNIEnv * _env, jclass _b, jlong obj) {
4910         LDKUpdateFee* obj_conv = (LDKUpdateFee*)obj;
4911         LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
4912         *ret = UpdateFee_write(obj_conv);
4913         return (long)ret;
4914 }
4915
4916 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFee_1read(JNIEnv * _env, jclass _b, jlong ser) {
4917         LDKu8slice ser_conv = *(LDKu8slice*)ser;
4918         free((void*)ser);
4919         LDKUpdateFee* ret = malloc(sizeof(LDKUpdateFee));
4920         *ret = UpdateFee_read(ser_conv);
4921         assert(!ret->_underlying_ref);
4922         ret->_underlying_ref = true;
4923         return (long)ret;
4924 }
4925
4926 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1write(JNIEnv * _env, jclass _b, jlong obj) {
4927         LDKUpdateFulfillHTLC* obj_conv = (LDKUpdateFulfillHTLC*)obj;
4928         LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
4929         *ret = UpdateFulfillHTLC_write(obj_conv);
4930         return (long)ret;
4931 }
4932
4933 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1read(JNIEnv * _env, jclass _b, jlong ser) {
4934         LDKu8slice ser_conv = *(LDKu8slice*)ser;
4935         free((void*)ser);
4936         LDKUpdateFulfillHTLC* ret = malloc(sizeof(LDKUpdateFulfillHTLC));
4937         *ret = UpdateFulfillHTLC_read(ser_conv);
4938         assert(!ret->_underlying_ref);
4939         ret->_underlying_ref = true;
4940         return (long)ret;
4941 }
4942
4943 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1write(JNIEnv * _env, jclass _b, jlong obj) {
4944         LDKUpdateAddHTLC* obj_conv = (LDKUpdateAddHTLC*)obj;
4945         LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
4946         *ret = UpdateAddHTLC_write(obj_conv);
4947         return (long)ret;
4948 }
4949
4950 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1read(JNIEnv * _env, jclass _b, jlong ser) {
4951         LDKu8slice ser_conv = *(LDKu8slice*)ser;
4952         free((void*)ser);
4953         LDKUpdateAddHTLC* ret = malloc(sizeof(LDKUpdateAddHTLC));
4954         *ret = UpdateAddHTLC_read(ser_conv);
4955         assert(!ret->_underlying_ref);
4956         ret->_underlying_ref = true;
4957         return (long)ret;
4958 }
4959
4960 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Ping_1write(JNIEnv * _env, jclass _b, jlong obj) {
4961         LDKPing* obj_conv = (LDKPing*)obj;
4962         LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
4963         *ret = Ping_write(obj_conv);
4964         return (long)ret;
4965 }
4966
4967 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Ping_1read(JNIEnv * _env, jclass _b, jlong ser) {
4968         LDKu8slice ser_conv = *(LDKu8slice*)ser;
4969         free((void*)ser);
4970         LDKPing* ret = malloc(sizeof(LDKPing));
4971         *ret = Ping_read(ser_conv);
4972         assert(!ret->_underlying_ref);
4973         ret->_underlying_ref = true;
4974         return (long)ret;
4975 }
4976
4977 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Pong_1write(JNIEnv * _env, jclass _b, jlong obj) {
4978         LDKPong* obj_conv = (LDKPong*)obj;
4979         LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
4980         *ret = Pong_write(obj_conv);
4981         return (long)ret;
4982 }
4983
4984 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Pong_1read(JNIEnv * _env, jclass _b, jlong ser) {
4985         LDKu8slice ser_conv = *(LDKu8slice*)ser;
4986         free((void*)ser);
4987         LDKPong* ret = malloc(sizeof(LDKPong));
4988         *ret = Pong_read(ser_conv);
4989         assert(!ret->_underlying_ref);
4990         ret->_underlying_ref = true;
4991         return (long)ret;
4992 }
4993
4994 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1write(JNIEnv * _env, jclass _b, jlong obj) {
4995         LDKUnsignedChannelAnnouncement* obj_conv = (LDKUnsignedChannelAnnouncement*)obj;
4996         LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
4997         *ret = UnsignedChannelAnnouncement_write(obj_conv);
4998         return (long)ret;
4999 }
5000
5001 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1read(JNIEnv * _env, jclass _b, jlong ser) {
5002         LDKu8slice ser_conv = *(LDKu8slice*)ser;
5003         free((void*)ser);
5004         LDKUnsignedChannelAnnouncement* ret = malloc(sizeof(LDKUnsignedChannelAnnouncement));
5005         *ret = UnsignedChannelAnnouncement_read(ser_conv);
5006         assert(!ret->_underlying_ref);
5007         ret->_underlying_ref = true;
5008         return (long)ret;
5009 }
5010
5011 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1write(JNIEnv * _env, jclass _b, jlong obj) {
5012         LDKChannelAnnouncement* obj_conv = (LDKChannelAnnouncement*)obj;
5013         LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
5014         *ret = ChannelAnnouncement_write(obj_conv);
5015         return (long)ret;
5016 }
5017
5018 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1read(JNIEnv * _env, jclass _b, jlong ser) {
5019         LDKu8slice ser_conv = *(LDKu8slice*)ser;
5020         free((void*)ser);
5021         LDKChannelAnnouncement* ret = malloc(sizeof(LDKChannelAnnouncement));
5022         *ret = ChannelAnnouncement_read(ser_conv);
5023         assert(!ret->_underlying_ref);
5024         ret->_underlying_ref = true;
5025         return (long)ret;
5026 }
5027
5028 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1write(JNIEnv * _env, jclass _b, jlong obj) {
5029         LDKUnsignedChannelUpdate* obj_conv = (LDKUnsignedChannelUpdate*)obj;
5030         LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
5031         *ret = UnsignedChannelUpdate_write(obj_conv);
5032         return (long)ret;
5033 }
5034
5035 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1read(JNIEnv * _env, jclass _b, jlong ser) {
5036         LDKu8slice ser_conv = *(LDKu8slice*)ser;
5037         free((void*)ser);
5038         LDKUnsignedChannelUpdate* ret = malloc(sizeof(LDKUnsignedChannelUpdate));
5039         *ret = UnsignedChannelUpdate_read(ser_conv);
5040         assert(!ret->_underlying_ref);
5041         ret->_underlying_ref = true;
5042         return (long)ret;
5043 }
5044
5045 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1write(JNIEnv * _env, jclass _b, jlong obj) {
5046         LDKChannelUpdate* obj_conv = (LDKChannelUpdate*)obj;
5047         LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
5048         *ret = ChannelUpdate_write(obj_conv);
5049         return (long)ret;
5050 }
5051
5052 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1read(JNIEnv * _env, jclass _b, jlong ser) {
5053         LDKu8slice ser_conv = *(LDKu8slice*)ser;
5054         free((void*)ser);
5055         LDKChannelUpdate* ret = malloc(sizeof(LDKChannelUpdate));
5056         *ret = ChannelUpdate_read(ser_conv);
5057         assert(!ret->_underlying_ref);
5058         ret->_underlying_ref = true;
5059         return (long)ret;
5060 }
5061
5062 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1write(JNIEnv * _env, jclass _b, jlong obj) {
5063         LDKErrorMessage* obj_conv = (LDKErrorMessage*)obj;
5064         LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
5065         *ret = ErrorMessage_write(obj_conv);
5066         return (long)ret;
5067 }
5068
5069 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1read(JNIEnv * _env, jclass _b, jlong ser) {
5070         LDKu8slice ser_conv = *(LDKu8slice*)ser;
5071         free((void*)ser);
5072         LDKErrorMessage* ret = malloc(sizeof(LDKErrorMessage));
5073         *ret = ErrorMessage_read(ser_conv);
5074         assert(!ret->_underlying_ref);
5075         ret->_underlying_ref = true;
5076         return (long)ret;
5077 }
5078
5079 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1write(JNIEnv * _env, jclass _b, jlong obj) {
5080         LDKUnsignedNodeAnnouncement* obj_conv = (LDKUnsignedNodeAnnouncement*)obj;
5081         LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
5082         *ret = UnsignedNodeAnnouncement_write(obj_conv);
5083         return (long)ret;
5084 }
5085
5086 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1read(JNIEnv * _env, jclass _b, jlong ser) {
5087         LDKu8slice ser_conv = *(LDKu8slice*)ser;
5088         free((void*)ser);
5089         LDKUnsignedNodeAnnouncement* ret = malloc(sizeof(LDKUnsignedNodeAnnouncement));
5090         *ret = UnsignedNodeAnnouncement_read(ser_conv);
5091         assert(!ret->_underlying_ref);
5092         ret->_underlying_ref = true;
5093         return (long)ret;
5094 }
5095
5096 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1write(JNIEnv * _env, jclass _b, jlong obj) {
5097         LDKNodeAnnouncement* obj_conv = (LDKNodeAnnouncement*)obj;
5098         LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
5099         *ret = NodeAnnouncement_write(obj_conv);
5100         return (long)ret;
5101 }
5102
5103 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1read(JNIEnv * _env, jclass _b, jlong ser) {
5104         LDKu8slice ser_conv = *(LDKu8slice*)ser;
5105         free((void*)ser);
5106         LDKNodeAnnouncement* ret = malloc(sizeof(LDKNodeAnnouncement));
5107         *ret = NodeAnnouncement_read(ser_conv);
5108         assert(!ret->_underlying_ref);
5109         ret->_underlying_ref = true;
5110         return (long)ret;
5111 }
5112
5113 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5114         LDKMessageHandler this_ptr_conv = *(LDKMessageHandler*)this_ptr;
5115         free((void*)this_ptr);
5116         this_ptr_conv._underlying_ref = false;
5117         return MessageHandler_free(this_ptr_conv);
5118 }
5119
5120 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageHandler_1get_1chan_1handler(JNIEnv * _env, jclass _b, jlong this_ptr) {
5121         LDKMessageHandler* this_ptr_conv = (LDKMessageHandler*)this_ptr;
5122         return (long) MessageHandler_get_chan_handler(this_ptr_conv);
5123 }
5124
5125 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1set_1chan_1handler(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5126         LDKMessageHandler* this_ptr_conv = (LDKMessageHandler*)this_ptr;
5127         LDKChannelMessageHandler val_conv = *(LDKChannelMessageHandler*)val;
5128         free((void*)val);
5129         return MessageHandler_set_chan_handler(this_ptr_conv, val_conv);
5130 }
5131
5132 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageHandler_1get_1route_1handler(JNIEnv * _env, jclass _b, jlong this_ptr) {
5133         LDKMessageHandler* this_ptr_conv = (LDKMessageHandler*)this_ptr;
5134         return (long) MessageHandler_get_route_handler(this_ptr_conv);
5135 }
5136
5137 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1set_1route_1handler(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5138         LDKMessageHandler* this_ptr_conv = (LDKMessageHandler*)this_ptr;
5139         LDKRoutingMessageHandler val_conv = *(LDKRoutingMessageHandler*)val;
5140         free((void*)val);
5141         return MessageHandler_set_route_handler(this_ptr_conv, val_conv);
5142 }
5143
5144 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageHandler_1new(JNIEnv * _env, jclass _b, jlong chan_handler_arg, jlong route_handler_arg) {
5145         LDKChannelMessageHandler chan_handler_arg_conv = *(LDKChannelMessageHandler*)chan_handler_arg;
5146         free((void*)chan_handler_arg);
5147         LDKRoutingMessageHandler route_handler_arg_conv = *(LDKRoutingMessageHandler*)route_handler_arg;
5148         free((void*)route_handler_arg);
5149         LDKMessageHandler* ret = malloc(sizeof(LDKMessageHandler));
5150         *ret = MessageHandler_new(chan_handler_arg_conv, route_handler_arg_conv);
5151         assert(!ret->_underlying_ref);
5152         ret->_underlying_ref = true;
5153         return (long)ret;
5154 }
5155
5156 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5157         LDKSocketDescriptor this_ptr_conv = *(LDKSocketDescriptor*)this_ptr;
5158         free((void*)this_ptr);
5159         return SocketDescriptor_free(this_ptr_conv);
5160 }
5161
5162 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5163         LDKPeerHandleError this_ptr_conv = *(LDKPeerHandleError*)this_ptr;
5164         free((void*)this_ptr);
5165         this_ptr_conv._underlying_ref = false;
5166         return PeerHandleError_free(this_ptr_conv);
5167 }
5168
5169 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1get_1no_1connection_1possible(JNIEnv * _env, jclass _b, jlong this_ptr) {
5170         LDKPeerHandleError* this_ptr_conv = (LDKPeerHandleError*)this_ptr;
5171         return PeerHandleError_get_no_connection_possible(this_ptr_conv);
5172 }
5173
5174 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1set_1no_1connection_1possible(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
5175         LDKPeerHandleError* this_ptr_conv = (LDKPeerHandleError*)this_ptr;
5176         return PeerHandleError_set_no_connection_possible(this_ptr_conv, val);
5177 }
5178
5179 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1new(JNIEnv * _env, jclass _b, jboolean no_connection_possible_arg) {
5180         LDKPeerHandleError* ret = malloc(sizeof(LDKPeerHandleError));
5181         *ret = PeerHandleError_new(no_connection_possible_arg);
5182         assert(!ret->_underlying_ref);
5183         ret->_underlying_ref = true;
5184         return (long)ret;
5185 }
5186
5187 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5188         LDKPeerManager this_ptr_conv = *(LDKPeerManager*)this_ptr;
5189         free((void*)this_ptr);
5190         this_ptr_conv._underlying_ref = false;
5191         return PeerManager_free(this_ptr_conv);
5192 }
5193
5194 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerManager_1new(JNIEnv * _env, jclass _b, jlong message_handler, jlong our_node_secret, jbyteArray ephemeral_random_data, jlong logger) {
5195         LDKMessageHandler message_handler_conv = *(LDKMessageHandler*)message_handler;
5196         free((void*)message_handler);
5197         message_handler_conv._underlying_ref = false;
5198         LDKSecretKey our_node_secret_conv = *(LDKSecretKey*)our_node_secret;
5199         free((void*)our_node_secret);
5200         unsigned char ephemeral_random_data_arr[32];
5201         (*_env)->GetByteArrayRegion (_env, ephemeral_random_data, 0, 32, ephemeral_random_data_arr);
5202         unsigned char (*ephemeral_random_data_ref)[32] = &ephemeral_random_data_arr;
5203         LDKLogger logger_conv = *(LDKLogger*)logger;
5204         free((void*)logger);
5205         LDKPeerManager* ret = malloc(sizeof(LDKPeerManager));
5206         *ret = PeerManager_new(message_handler_conv, our_node_secret_conv, ephemeral_random_data_ref, logger_conv);
5207         assert(!ret->_underlying_ref);
5208         ret->_underlying_ref = true;
5209         return (long)ret;
5210 }
5211
5212 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerManager_1get_1peer_1node_1ids(JNIEnv * _env, jclass _b, jlong this_arg) {
5213         LDKPeerManager* this_arg_conv = (LDKPeerManager*)this_arg;
5214         LDKCVec_PublicKeyZ* ret = malloc(sizeof(LDKCVec_PublicKeyZ));
5215         *ret = PeerManager_get_peer_node_ids(this_arg_conv);
5216         return (long)ret;
5217 }
5218
5219 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerManager_1new_1outbound_1connection(JNIEnv * _env, jclass _b, jlong this_arg, jlong their_node_id, jlong descriptor) {
5220         LDKPeerManager* this_arg_conv = (LDKPeerManager*)this_arg;
5221         LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
5222         free((void*)their_node_id);
5223         LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)descriptor;
5224         free((void*)descriptor);
5225         LDKCResult_CVec_u8ZPeerHandleErrorZ* ret = malloc(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ));
5226         *ret = PeerManager_new_outbound_connection(this_arg_conv, their_node_id_conv, descriptor_conv);
5227         return (long)ret;
5228 }
5229
5230 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerManager_1new_1inbound_1connection(JNIEnv * _env, jclass _b, jlong this_arg, jlong descriptor) {
5231         LDKPeerManager* this_arg_conv = (LDKPeerManager*)this_arg;
5232         LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)descriptor;
5233         free((void*)descriptor);
5234         LDKCResult_NonePeerHandleErrorZ* ret = malloc(sizeof(LDKCResult_NonePeerHandleErrorZ));
5235         *ret = PeerManager_new_inbound_connection(this_arg_conv, descriptor_conv);
5236         return (long)ret;
5237 }
5238
5239 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerManager_1write_1buffer_1space_1avail(JNIEnv * _env, jclass _b, jlong this_arg, jlong descriptor) {
5240         LDKPeerManager* this_arg_conv = (LDKPeerManager*)this_arg;
5241         LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor;
5242         LDKCResult_NonePeerHandleErrorZ* ret = malloc(sizeof(LDKCResult_NonePeerHandleErrorZ));
5243         *ret = PeerManager_write_buffer_space_avail(this_arg_conv, descriptor_conv);
5244         return (long)ret;
5245 }
5246
5247 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerManager_1read_1event(JNIEnv * _env, jclass _b, jlong this_arg, jlong peer_descriptor, jlong data) {
5248         LDKPeerManager* this_arg_conv = (LDKPeerManager*)this_arg;
5249         LDKSocketDescriptor* peer_descriptor_conv = (LDKSocketDescriptor*)peer_descriptor;
5250         LDKu8slice data_conv = *(LDKu8slice*)data;
5251         free((void*)data);
5252         LDKCResult_boolPeerHandleErrorZ* ret = malloc(sizeof(LDKCResult_boolPeerHandleErrorZ));
5253         *ret = PeerManager_read_event(this_arg_conv, peer_descriptor_conv, data_conv);
5254         return (long)ret;
5255 }
5256
5257 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1process_1events(JNIEnv * _env, jclass _b, jlong this_arg) {
5258         LDKPeerManager* this_arg_conv = (LDKPeerManager*)this_arg;
5259         return PeerManager_process_events(this_arg_conv);
5260 }
5261
5262 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1socket_1disconnected(JNIEnv * _env, jclass _b, jlong this_arg, jlong descriptor) {
5263         LDKPeerManager* this_arg_conv = (LDKPeerManager*)this_arg;
5264         LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor;
5265         return PeerManager_socket_disconnected(this_arg_conv, descriptor_conv);
5266 }
5267
5268 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1timer_1tick_1occured(JNIEnv * _env, jclass _b, jlong this_arg) {
5269         LDKPeerManager* this_arg_conv = (LDKPeerManager*)this_arg;
5270         return PeerManager_timer_tick_occured(this_arg_conv);
5271 }
5272
5273 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_build_1commitment_1secret(JNIEnv * _env, jclass _b, jbyteArray commitment_seed, jlong idx) {
5274         unsigned char commitment_seed_arr[32];
5275         (*_env)->GetByteArrayRegion (_env, commitment_seed, 0, 32, commitment_seed_arr);
5276         unsigned char (*commitment_seed_ref)[32] = &commitment_seed_arr;
5277         LDKThirtyTwoBytes* ret = malloc(sizeof(LDKThirtyTwoBytes));
5278         *ret = build_commitment_secret(commitment_seed_ref, idx);
5279         return (long)ret;
5280 }
5281
5282 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5283         LDKTxCreationKeys this_ptr_conv = *(LDKTxCreationKeys*)this_ptr;
5284         free((void*)this_ptr);
5285         this_ptr_conv._underlying_ref = false;
5286         return TxCreationKeys_free(this_ptr_conv);
5287 }
5288
5289 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
5290         LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
5291         LDKPublicKey* ret = malloc(sizeof(LDKPublicKey));
5292         *ret = TxCreationKeys_get_per_commitment_point(this_ptr_conv);
5293         return (long)ret;
5294 }
5295
5296 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5297         LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
5298         LDKPublicKey val_conv = *(LDKPublicKey*)val;
5299         free((void*)val);
5300         return TxCreationKeys_set_per_commitment_point(this_ptr_conv, val_conv);
5301 }
5302
5303 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1revocation_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
5304         LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
5305         LDKPublicKey* ret = malloc(sizeof(LDKPublicKey));
5306         *ret = TxCreationKeys_get_revocation_key(this_ptr_conv);
5307         return (long)ret;
5308 }
5309
5310 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1revocation_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5311         LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
5312         LDKPublicKey val_conv = *(LDKPublicKey*)val;
5313         free((void*)val);
5314         return TxCreationKeys_set_revocation_key(this_ptr_conv, val_conv);
5315 }
5316
5317 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1a_1htlc_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
5318         LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
5319         LDKPublicKey* ret = malloc(sizeof(LDKPublicKey));
5320         *ret = TxCreationKeys_get_a_htlc_key(this_ptr_conv);
5321         return (long)ret;
5322 }
5323
5324 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1a_1htlc_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5325         LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
5326         LDKPublicKey val_conv = *(LDKPublicKey*)val;
5327         free((void*)val);
5328         return TxCreationKeys_set_a_htlc_key(this_ptr_conv, val_conv);
5329 }
5330
5331 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1b_1htlc_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
5332         LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
5333         LDKPublicKey* ret = malloc(sizeof(LDKPublicKey));
5334         *ret = TxCreationKeys_get_b_htlc_key(this_ptr_conv);
5335         return (long)ret;
5336 }
5337
5338 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1b_1htlc_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5339         LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
5340         LDKPublicKey val_conv = *(LDKPublicKey*)val;
5341         free((void*)val);
5342         return TxCreationKeys_set_b_htlc_key(this_ptr_conv, val_conv);
5343 }
5344
5345 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1a_1delayed_1payment_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
5346         LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
5347         LDKPublicKey* ret = malloc(sizeof(LDKPublicKey));
5348         *ret = TxCreationKeys_get_a_delayed_payment_key(this_ptr_conv);
5349         return (long)ret;
5350 }
5351
5352 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1a_1delayed_1payment_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5353         LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
5354         LDKPublicKey val_conv = *(LDKPublicKey*)val;
5355         free((void*)val);
5356         return TxCreationKeys_set_a_delayed_payment_key(this_ptr_conv, val_conv);
5357 }
5358
5359 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1new(JNIEnv * _env, jclass _b, jlong per_commitment_point_arg, jlong revocation_key_arg, jlong a_htlc_key_arg, jlong b_htlc_key_arg, jlong a_delayed_payment_key_arg) {
5360         LDKPublicKey per_commitment_point_arg_conv = *(LDKPublicKey*)per_commitment_point_arg;
5361         free((void*)per_commitment_point_arg);
5362         LDKPublicKey revocation_key_arg_conv = *(LDKPublicKey*)revocation_key_arg;
5363         free((void*)revocation_key_arg);
5364         LDKPublicKey a_htlc_key_arg_conv = *(LDKPublicKey*)a_htlc_key_arg;
5365         free((void*)a_htlc_key_arg);
5366         LDKPublicKey b_htlc_key_arg_conv = *(LDKPublicKey*)b_htlc_key_arg;
5367         free((void*)b_htlc_key_arg);
5368         LDKPublicKey a_delayed_payment_key_arg_conv = *(LDKPublicKey*)a_delayed_payment_key_arg;
5369         free((void*)a_delayed_payment_key_arg);
5370         LDKTxCreationKeys* ret = malloc(sizeof(LDKTxCreationKeys));
5371         *ret = TxCreationKeys_new(per_commitment_point_arg_conv, revocation_key_arg_conv, a_htlc_key_arg_conv, b_htlc_key_arg_conv, a_delayed_payment_key_arg_conv);
5372         assert(!ret->_underlying_ref);
5373         ret->_underlying_ref = true;
5374         return (long)ret;
5375 }
5376
5377 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1write(JNIEnv * _env, jclass _b, jlong obj) {
5378         LDKTxCreationKeys* obj_conv = (LDKTxCreationKeys*)obj;
5379         LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
5380         *ret = TxCreationKeys_write(obj_conv);
5381         return (long)ret;
5382 }
5383
5384 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1read(JNIEnv * _env, jclass _b, jlong ser) {
5385         LDKu8slice ser_conv = *(LDKu8slice*)ser;
5386         free((void*)ser);
5387         LDKTxCreationKeys* ret = malloc(sizeof(LDKTxCreationKeys));
5388         *ret = TxCreationKeys_read(ser_conv);
5389         assert(!ret->_underlying_ref);
5390         ret->_underlying_ref = true;
5391         return (long)ret;
5392 }
5393
5394 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PreCalculatedTxCreationKeys_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5395         LDKPreCalculatedTxCreationKeys this_ptr_conv = *(LDKPreCalculatedTxCreationKeys*)this_ptr;
5396         free((void*)this_ptr);
5397         this_ptr_conv._underlying_ref = false;
5398         return PreCalculatedTxCreationKeys_free(this_ptr_conv);
5399 }
5400
5401 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PreCalculatedTxCreationKeys_1new(JNIEnv * _env, jclass _b, jlong keys) {
5402         LDKTxCreationKeys keys_conv = *(LDKTxCreationKeys*)keys;
5403         free((void*)keys);
5404         keys_conv._underlying_ref = false;
5405         LDKPreCalculatedTxCreationKeys* ret = malloc(sizeof(LDKPreCalculatedTxCreationKeys));
5406         *ret = PreCalculatedTxCreationKeys_new(keys_conv);
5407         assert(!ret->_underlying_ref);
5408         ret->_underlying_ref = true;
5409         return (long)ret;
5410 }
5411
5412 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PreCalculatedTxCreationKeys_1trust_1key_1derivation(JNIEnv * _env, jclass _b, jlong this_arg) {
5413         LDKPreCalculatedTxCreationKeys* this_arg_conv = (LDKPreCalculatedTxCreationKeys*)this_arg;
5414         LDKTxCreationKeys* ret = malloc(sizeof(LDKTxCreationKeys));
5415         *ret = PreCalculatedTxCreationKeys_trust_key_derivation(this_arg_conv);
5416         assert(!ret->_underlying_ref);
5417         ret->_underlying_ref = true;
5418         return (long)ret;
5419 }
5420
5421 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PreCalculatedTxCreationKeys_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_arg) {
5422         LDKPreCalculatedTxCreationKeys* this_arg_conv = (LDKPreCalculatedTxCreationKeys*)this_arg;
5423         LDKPublicKey* ret = malloc(sizeof(LDKPublicKey));
5424         *ret = PreCalculatedTxCreationKeys_per_commitment_point(this_arg_conv);
5425         return (long)ret;
5426 }
5427
5428 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5429         LDKChannelPublicKeys this_ptr_conv = *(LDKChannelPublicKeys*)this_ptr;
5430         free((void*)this_ptr);
5431         this_ptr_conv._underlying_ref = false;
5432         return ChannelPublicKeys_free(this_ptr_conv);
5433 }
5434
5435 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1funding_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr) {
5436         LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
5437         LDKPublicKey* ret = malloc(sizeof(LDKPublicKey));
5438         *ret = ChannelPublicKeys_get_funding_pubkey(this_ptr_conv);
5439         return (long)ret;
5440 }
5441
5442 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1funding_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5443         LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
5444         LDKPublicKey val_conv = *(LDKPublicKey*)val;
5445         free((void*)val);
5446         return ChannelPublicKeys_set_funding_pubkey(this_ptr_conv, val_conv);
5447 }
5448
5449 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1revocation_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
5450         LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
5451         LDKPublicKey* ret = malloc(sizeof(LDKPublicKey));
5452         *ret = ChannelPublicKeys_get_revocation_basepoint(this_ptr_conv);
5453         return (long)ret;
5454 }
5455
5456 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1revocation_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5457         LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
5458         LDKPublicKey val_conv = *(LDKPublicKey*)val;
5459         free((void*)val);
5460         return ChannelPublicKeys_set_revocation_basepoint(this_ptr_conv, val_conv);
5461 }
5462
5463 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1payment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
5464         LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
5465         LDKPublicKey* ret = malloc(sizeof(LDKPublicKey));
5466         *ret = ChannelPublicKeys_get_payment_point(this_ptr_conv);
5467         return (long)ret;
5468 }
5469
5470 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1payment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5471         LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
5472         LDKPublicKey val_conv = *(LDKPublicKey*)val;
5473         free((void*)val);
5474         return ChannelPublicKeys_set_payment_point(this_ptr_conv, val_conv);
5475 }
5476
5477 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1delayed_1payment_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
5478         LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
5479         LDKPublicKey* ret = malloc(sizeof(LDKPublicKey));
5480         *ret = ChannelPublicKeys_get_delayed_payment_basepoint(this_ptr_conv);
5481         return (long)ret;
5482 }
5483
5484 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1delayed_1payment_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5485         LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
5486         LDKPublicKey val_conv = *(LDKPublicKey*)val;
5487         free((void*)val);
5488         return ChannelPublicKeys_set_delayed_payment_basepoint(this_ptr_conv, val_conv);
5489 }
5490
5491 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1htlc_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
5492         LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
5493         LDKPublicKey* ret = malloc(sizeof(LDKPublicKey));
5494         *ret = ChannelPublicKeys_get_htlc_basepoint(this_ptr_conv);
5495         return (long)ret;
5496 }
5497
5498 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1htlc_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5499         LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
5500         LDKPublicKey val_conv = *(LDKPublicKey*)val;
5501         free((void*)val);
5502         return ChannelPublicKeys_set_htlc_basepoint(this_ptr_conv, val_conv);
5503 }
5504
5505 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1new(JNIEnv * _env, jclass _b, jlong funding_pubkey_arg, jlong revocation_basepoint_arg, jlong payment_point_arg, jlong delayed_payment_basepoint_arg, jlong htlc_basepoint_arg) {
5506         LDKPublicKey funding_pubkey_arg_conv = *(LDKPublicKey*)funding_pubkey_arg;
5507         free((void*)funding_pubkey_arg);
5508         LDKPublicKey revocation_basepoint_arg_conv = *(LDKPublicKey*)revocation_basepoint_arg;
5509         free((void*)revocation_basepoint_arg);
5510         LDKPublicKey payment_point_arg_conv = *(LDKPublicKey*)payment_point_arg;
5511         free((void*)payment_point_arg);
5512         LDKPublicKey delayed_payment_basepoint_arg_conv = *(LDKPublicKey*)delayed_payment_basepoint_arg;
5513         free((void*)delayed_payment_basepoint_arg);
5514         LDKPublicKey htlc_basepoint_arg_conv = *(LDKPublicKey*)htlc_basepoint_arg;
5515         free((void*)htlc_basepoint_arg);
5516         LDKChannelPublicKeys* ret = malloc(sizeof(LDKChannelPublicKeys));
5517         *ret = ChannelPublicKeys_new(funding_pubkey_arg_conv, revocation_basepoint_arg_conv, payment_point_arg_conv, delayed_payment_basepoint_arg_conv, htlc_basepoint_arg_conv);
5518         assert(!ret->_underlying_ref);
5519         ret->_underlying_ref = true;
5520         return (long)ret;
5521 }
5522
5523 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1write(JNIEnv * _env, jclass _b, jlong obj) {
5524         LDKChannelPublicKeys* obj_conv = (LDKChannelPublicKeys*)obj;
5525         LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
5526         *ret = ChannelPublicKeys_write(obj_conv);
5527         return (long)ret;
5528 }
5529
5530 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1read(JNIEnv * _env, jclass _b, jlong ser) {
5531         LDKu8slice ser_conv = *(LDKu8slice*)ser;
5532         free((void*)ser);
5533         LDKChannelPublicKeys* ret = malloc(sizeof(LDKChannelPublicKeys));
5534         *ret = ChannelPublicKeys_read(ser_conv);
5535         assert(!ret->_underlying_ref);
5536         ret->_underlying_ref = true;
5537         return (long)ret;
5538 }
5539
5540 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1derive_1new(JNIEnv * _env, jclass _b, jlong per_commitment_point, jlong a_delayed_payment_base, jlong a_htlc_base, jlong b_revocation_base, jlong b_htlc_base) {
5541         LDKPublicKey per_commitment_point_conv = *(LDKPublicKey*)per_commitment_point;
5542         free((void*)per_commitment_point);
5543         LDKPublicKey a_delayed_payment_base_conv = *(LDKPublicKey*)a_delayed_payment_base;
5544         free((void*)a_delayed_payment_base);
5545         LDKPublicKey a_htlc_base_conv = *(LDKPublicKey*)a_htlc_base;
5546         free((void*)a_htlc_base);
5547         LDKPublicKey b_revocation_base_conv = *(LDKPublicKey*)b_revocation_base;
5548         free((void*)b_revocation_base);
5549         LDKPublicKey b_htlc_base_conv = *(LDKPublicKey*)b_htlc_base;
5550         free((void*)b_htlc_base);
5551         LDKCResult_TxCreationKeysSecpErrorZ* ret = malloc(sizeof(LDKCResult_TxCreationKeysSecpErrorZ));
5552         *ret = TxCreationKeys_derive_new(per_commitment_point_conv, a_delayed_payment_base_conv, a_htlc_base_conv, b_revocation_base_conv, b_htlc_base_conv);
5553         return (long)ret;
5554 }
5555
5556 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_get_1revokeable_1redeemscript(JNIEnv * _env, jclass _b, jlong revocation_key, jlong to_self_delay, jlong delayed_payment_key) {
5557         LDKPublicKey revocation_key_conv = *(LDKPublicKey*)revocation_key;
5558         free((void*)revocation_key);
5559         uint16_t to_self_delay_conv = *(uint16_t*)to_self_delay;
5560         free((void*)to_self_delay);
5561         LDKPublicKey delayed_payment_key_conv = *(LDKPublicKey*)delayed_payment_key;
5562         free((void*)delayed_payment_key);
5563         LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
5564         *ret = get_revokeable_redeemscript(revocation_key_conv, to_self_delay_conv, delayed_payment_key_conv);
5565         return (long)ret;
5566 }
5567
5568 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5569         LDKHTLCOutputInCommitment this_ptr_conv = *(LDKHTLCOutputInCommitment*)this_ptr;
5570         free((void*)this_ptr);
5571         this_ptr_conv._underlying_ref = false;
5572         return HTLCOutputInCommitment_free(this_ptr_conv);
5573 }
5574
5575 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1offered(JNIEnv * _env, jclass _b, jlong this_ptr) {
5576         LDKHTLCOutputInCommitment* this_ptr_conv = (LDKHTLCOutputInCommitment*)this_ptr;
5577         return HTLCOutputInCommitment_get_offered(this_ptr_conv);
5578 }
5579
5580 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1offered(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
5581         LDKHTLCOutputInCommitment* this_ptr_conv = (LDKHTLCOutputInCommitment*)this_ptr;
5582         return HTLCOutputInCommitment_set_offered(this_ptr_conv, val);
5583 }
5584
5585 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1amount_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
5586         LDKHTLCOutputInCommitment* this_ptr_conv = (LDKHTLCOutputInCommitment*)this_ptr;
5587         return HTLCOutputInCommitment_get_amount_msat(this_ptr_conv);
5588 }
5589
5590 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1amount_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5591         LDKHTLCOutputInCommitment* this_ptr_conv = (LDKHTLCOutputInCommitment*)this_ptr;
5592         return HTLCOutputInCommitment_set_amount_msat(this_ptr_conv, val);
5593 }
5594
5595 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1cltv_1expiry(JNIEnv * _env, jclass _b, jlong this_ptr) {
5596         LDKHTLCOutputInCommitment* this_ptr_conv = (LDKHTLCOutputInCommitment*)this_ptr;
5597         return HTLCOutputInCommitment_get_cltv_expiry(this_ptr_conv);
5598 }
5599
5600 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1cltv_1expiry(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
5601         LDKHTLCOutputInCommitment* this_ptr_conv = (LDKHTLCOutputInCommitment*)this_ptr;
5602         return HTLCOutputInCommitment_set_cltv_expiry(this_ptr_conv, val);
5603 }
5604
5605 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1payment_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
5606         LDKHTLCOutputInCommitment* this_ptr_conv = (LDKHTLCOutputInCommitment*)this_ptr;
5607         jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
5608         (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *HTLCOutputInCommitment_get_payment_hash(this_ptr_conv));
5609         return ret_arr;
5610 }
5611
5612 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1payment_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5613         LDKHTLCOutputInCommitment* this_ptr_conv = (LDKHTLCOutputInCommitment*)this_ptr;
5614         LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
5615         free((void*)val);
5616         return HTLCOutputInCommitment_set_payment_hash(this_ptr_conv, val_conv);
5617 }
5618
5619 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1write(JNIEnv * _env, jclass _b, jlong obj) {
5620         LDKHTLCOutputInCommitment* obj_conv = (LDKHTLCOutputInCommitment*)obj;
5621         LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
5622         *ret = HTLCOutputInCommitment_write(obj_conv);
5623         return (long)ret;
5624 }
5625
5626 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1read(JNIEnv * _env, jclass _b, jlong ser) {
5627         LDKu8slice ser_conv = *(LDKu8slice*)ser;
5628         free((void*)ser);
5629         LDKHTLCOutputInCommitment* ret = malloc(sizeof(LDKHTLCOutputInCommitment));
5630         *ret = HTLCOutputInCommitment_read(ser_conv);
5631         assert(!ret->_underlying_ref);
5632         ret->_underlying_ref = true;
5633         return (long)ret;
5634 }
5635
5636 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_get_1htlc_1redeemscript(JNIEnv * _env, jclass _b, jlong htlc, jlong keys) {
5637         LDKHTLCOutputInCommitment* htlc_conv = (LDKHTLCOutputInCommitment*)htlc;
5638         LDKTxCreationKeys* keys_conv = (LDKTxCreationKeys*)keys;
5639         LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
5640         *ret = get_htlc_redeemscript(htlc_conv, keys_conv);
5641         return (long)ret;
5642 }
5643
5644 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_make_1funding_1redeemscript(JNIEnv * _env, jclass _b, jlong a, jlong b) {
5645         LDKPublicKey a_conv = *(LDKPublicKey*)a;
5646         free((void*)a);
5647         LDKPublicKey b_conv = *(LDKPublicKey*)b;
5648         free((void*)b);
5649         LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
5650         *ret = make_funding_redeemscript(a_conv, b_conv);
5651         return (long)ret;
5652 }
5653
5654 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_build_1htlc_1transaction(JNIEnv * _env, jclass _b, jbyteArray prev_hash, jint feerate_per_kw, jlong to_self_delay, jlong htlc, jlong a_delayed_payment_key, jlong revocation_key) {
5655         unsigned char prev_hash_arr[32];
5656         (*_env)->GetByteArrayRegion (_env, prev_hash, 0, 32, prev_hash_arr);
5657         unsigned char (*prev_hash_ref)[32] = &prev_hash_arr;
5658         uint16_t to_self_delay_conv = *(uint16_t*)to_self_delay;
5659         free((void*)to_self_delay);
5660         LDKHTLCOutputInCommitment* htlc_conv = (LDKHTLCOutputInCommitment*)htlc;
5661         LDKPublicKey a_delayed_payment_key_conv = *(LDKPublicKey*)a_delayed_payment_key;
5662         free((void*)a_delayed_payment_key);
5663         LDKPublicKey revocation_key_conv = *(LDKPublicKey*)revocation_key;
5664         free((void*)revocation_key);
5665         LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
5666         *ret = build_htlc_transaction(prev_hash_ref, feerate_per_kw, to_self_delay_conv, htlc_conv, a_delayed_payment_key_conv, revocation_key_conv);
5667         return (long)ret;
5668 }
5669
5670 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LocalCommitmentTransaction_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5671         LDKLocalCommitmentTransaction this_ptr_conv = *(LDKLocalCommitmentTransaction*)this_ptr;
5672         free((void*)this_ptr);
5673         this_ptr_conv._underlying_ref = false;
5674         return LocalCommitmentTransaction_free(this_ptr_conv);
5675 }
5676
5677 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LocalCommitmentTransaction_1get_1unsigned_1tx(JNIEnv * _env, jclass _b, jlong this_ptr) {
5678         LDKLocalCommitmentTransaction* this_ptr_conv = (LDKLocalCommitmentTransaction*)this_ptr;
5679         LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
5680         *ret = LocalCommitmentTransaction_get_unsigned_tx(this_ptr_conv);
5681         return (long)ret;
5682 }
5683
5684 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LocalCommitmentTransaction_1set_1unsigned_1tx(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5685         LDKLocalCommitmentTransaction* this_ptr_conv = (LDKLocalCommitmentTransaction*)this_ptr;
5686         LDKCVec_u8Z val_conv = *(LDKCVec_u8Z*)val;
5687         free((void*)val);
5688         return LocalCommitmentTransaction_set_unsigned_tx(this_ptr_conv, val_conv);
5689 }
5690
5691 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LocalCommitmentTransaction_1get_1their_1sig(JNIEnv * _env, jclass _b, jlong this_ptr) {
5692         LDKLocalCommitmentTransaction* this_ptr_conv = (LDKLocalCommitmentTransaction*)this_ptr;
5693         LDKSignature* ret = malloc(sizeof(LDKSignature));
5694         *ret = LocalCommitmentTransaction_get_their_sig(this_ptr_conv);
5695         return (long)ret;
5696 }
5697
5698 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LocalCommitmentTransaction_1set_1their_1sig(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5699         LDKLocalCommitmentTransaction* this_ptr_conv = (LDKLocalCommitmentTransaction*)this_ptr;
5700         LDKSignature val_conv = *(LDKSignature*)val;
5701         free((void*)val);
5702         return LocalCommitmentTransaction_set_their_sig(this_ptr_conv, val_conv);
5703 }
5704
5705 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_LocalCommitmentTransaction_1get_1feerate_1per_1kw(JNIEnv * _env, jclass _b, jlong this_ptr) {
5706         LDKLocalCommitmentTransaction* this_ptr_conv = (LDKLocalCommitmentTransaction*)this_ptr;
5707         return LocalCommitmentTransaction_get_feerate_per_kw(this_ptr_conv);
5708 }
5709
5710 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LocalCommitmentTransaction_1set_1feerate_1per_1kw(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
5711         LDKLocalCommitmentTransaction* this_ptr_conv = (LDKLocalCommitmentTransaction*)this_ptr;
5712         return LocalCommitmentTransaction_set_feerate_per_kw(this_ptr_conv, val);
5713 }
5714
5715 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LocalCommitmentTransaction_1set_1per_1htlc(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5716         LDKLocalCommitmentTransaction* this_ptr_conv = (LDKLocalCommitmentTransaction*)this_ptr;
5717         LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ val_conv = *(LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ*)val;
5718         free((void*)val);
5719         return LocalCommitmentTransaction_set_per_htlc(this_ptr_conv, val_conv);
5720 }
5721
5722 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LocalCommitmentTransaction_1new_1missing_1local_1sig(JNIEnv * _env, jclass _b, jlong unsigned_tx, jlong their_sig, jlong our_funding_key, jlong their_funding_key, jlong local_keys, jint feerate_per_kw, jlong htlc_data) {
5723         LDKCVec_u8Z unsigned_tx_conv = *(LDKCVec_u8Z*)unsigned_tx;
5724         free((void*)unsigned_tx);
5725         LDKSignature their_sig_conv = *(LDKSignature*)their_sig;
5726         free((void*)their_sig);
5727         LDKPublicKey our_funding_key_conv = *(LDKPublicKey*)our_funding_key;
5728         free((void*)our_funding_key);
5729         LDKPublicKey their_funding_key_conv = *(LDKPublicKey*)their_funding_key;
5730         free((void*)their_funding_key);
5731         LDKTxCreationKeys local_keys_conv = *(LDKTxCreationKeys*)local_keys;
5732         free((void*)local_keys);
5733         local_keys_conv._underlying_ref = false;
5734         LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ htlc_data_conv = *(LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ*)htlc_data;
5735         free((void*)htlc_data);
5736         LDKLocalCommitmentTransaction* ret = malloc(sizeof(LDKLocalCommitmentTransaction));
5737         *ret = LocalCommitmentTransaction_new_missing_local_sig(unsigned_tx_conv, their_sig_conv, our_funding_key_conv, their_funding_key_conv, local_keys_conv, feerate_per_kw, htlc_data_conv);
5738         assert(!ret->_underlying_ref);
5739         ret->_underlying_ref = true;
5740         return (long)ret;
5741 }
5742
5743 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LocalCommitmentTransaction_1trust_1key_1derivation(JNIEnv * _env, jclass _b, jlong this_arg) {
5744         LDKLocalCommitmentTransaction* this_arg_conv = (LDKLocalCommitmentTransaction*)this_arg;
5745         LDKTxCreationKeys* ret = malloc(sizeof(LDKTxCreationKeys));
5746         *ret = LocalCommitmentTransaction_trust_key_derivation(this_arg_conv);
5747         assert(!ret->_underlying_ref);
5748         ret->_underlying_ref = true;
5749         return (long)ret;
5750 }
5751
5752 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LocalCommitmentTransaction_1txid(JNIEnv * _env, jclass _b, jlong this_arg) {
5753         LDKLocalCommitmentTransaction* this_arg_conv = (LDKLocalCommitmentTransaction*)this_arg;
5754         LDKThirtyTwoBytes* ret = malloc(sizeof(LDKThirtyTwoBytes));
5755         *ret = LocalCommitmentTransaction_txid(this_arg_conv);
5756         return (long)ret;
5757 }
5758
5759 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LocalCommitmentTransaction_1get_1local_1sig(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray funding_key, jlong funding_redeemscript, jlong channel_value_satoshis) {
5760         LDKLocalCommitmentTransaction* this_arg_conv = (LDKLocalCommitmentTransaction*)this_arg;
5761         unsigned char funding_key_arr[32];
5762         (*_env)->GetByteArrayRegion (_env, funding_key, 0, 32, funding_key_arr);
5763         unsigned char (*funding_key_ref)[32] = &funding_key_arr;
5764         LDKu8slice funding_redeemscript_conv = *(LDKu8slice*)funding_redeemscript;
5765         free((void*)funding_redeemscript);
5766         LDKSignature* ret = malloc(sizeof(LDKSignature));
5767         *ret = LocalCommitmentTransaction_get_local_sig(this_arg_conv, funding_key_ref, funding_redeemscript_conv, channel_value_satoshis);
5768         return (long)ret;
5769 }
5770
5771 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LocalCommitmentTransaction_1get_1htlc_1sigs(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray htlc_base_key, jlong local_csv) {
5772         LDKLocalCommitmentTransaction* this_arg_conv = (LDKLocalCommitmentTransaction*)this_arg;
5773         unsigned char htlc_base_key_arr[32];
5774         (*_env)->GetByteArrayRegion (_env, htlc_base_key, 0, 32, htlc_base_key_arr);
5775         unsigned char (*htlc_base_key_ref)[32] = &htlc_base_key_arr;
5776         uint16_t local_csv_conv = *(uint16_t*)local_csv;
5777         free((void*)local_csv);
5778         LDKCResult_CVec_SignatureZNoneZ* ret = malloc(sizeof(LDKCResult_CVec_SignatureZNoneZ));
5779         *ret = LocalCommitmentTransaction_get_htlc_sigs(this_arg_conv, htlc_base_key_ref, local_csv_conv);
5780         return (long)ret;
5781 }
5782
5783 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LocalCommitmentTransaction_1write(JNIEnv * _env, jclass _b, jlong obj) {
5784         LDKLocalCommitmentTransaction* obj_conv = (LDKLocalCommitmentTransaction*)obj;
5785         LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
5786         *ret = LocalCommitmentTransaction_write(obj_conv);
5787         return (long)ret;
5788 }
5789
5790 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LocalCommitmentTransaction_1read(JNIEnv * _env, jclass _b, jlong ser) {
5791         LDKu8slice ser_conv = *(LDKu8slice*)ser;
5792         free((void*)ser);
5793         LDKLocalCommitmentTransaction* ret = malloc(sizeof(LDKLocalCommitmentTransaction));
5794         *ret = LocalCommitmentTransaction_read(ser_conv);
5795         assert(!ret->_underlying_ref);
5796         ret->_underlying_ref = true;
5797         return (long)ret;
5798 }
5799
5800 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5801         LDKInitFeatures this_ptr_conv = *(LDKInitFeatures*)this_ptr;
5802         free((void*)this_ptr);
5803         this_ptr_conv._underlying_ref = false;
5804         return InitFeatures_free(this_ptr_conv);
5805 }
5806
5807 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5808         LDKNodeFeatures this_ptr_conv = *(LDKNodeFeatures*)this_ptr;
5809         free((void*)this_ptr);
5810         this_ptr_conv._underlying_ref = false;
5811         return NodeFeatures_free(this_ptr_conv);
5812 }
5813
5814 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5815         LDKChannelFeatures this_ptr_conv = *(LDKChannelFeatures*)this_ptr;
5816         free((void*)this_ptr);
5817         this_ptr_conv._underlying_ref = false;
5818         return ChannelFeatures_free(this_ptr_conv);
5819 }
5820
5821 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5822         LDKRouteHop this_ptr_conv = *(LDKRouteHop*)this_ptr;
5823         free((void*)this_ptr);
5824         this_ptr_conv._underlying_ref = false;
5825         return RouteHop_free(this_ptr_conv);
5826 }
5827
5828 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr) {
5829         LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
5830         LDKPublicKey* ret = malloc(sizeof(LDKPublicKey));
5831         *ret = RouteHop_get_pubkey(this_ptr_conv);
5832         return (long)ret;
5833 }
5834
5835 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5836         LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
5837         LDKPublicKey val_conv = *(LDKPublicKey*)val;
5838         free((void*)val);
5839         return RouteHop_set_pubkey(this_ptr_conv, val_conv);
5840 }
5841
5842 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
5843         LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
5844         return RouteHop_get_short_channel_id(this_ptr_conv);
5845 }
5846
5847 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5848         LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
5849         return RouteHop_set_short_channel_id(this_ptr_conv, val);
5850 }
5851
5852 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1fee_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
5853         LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
5854         return RouteHop_get_fee_msat(this_ptr_conv);
5855 }
5856
5857 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1fee_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5858         LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
5859         return RouteHop_set_fee_msat(this_ptr_conv, val);
5860 }
5861
5862 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr) {
5863         LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
5864         return RouteHop_get_cltv_expiry_delta(this_ptr_conv);
5865 }
5866
5867 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
5868         LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
5869         return RouteHop_set_cltv_expiry_delta(this_ptr_conv, val);
5870 }
5871
5872 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Route_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5873         LDKRoute this_ptr_conv = *(LDKRoute*)this_ptr;
5874         free((void*)this_ptr);
5875         this_ptr_conv._underlying_ref = false;
5876         return Route_free(this_ptr_conv);
5877 }
5878
5879 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Route_1set_1paths(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5880         LDKRoute* this_ptr_conv = (LDKRoute*)this_ptr;
5881         LDKCVec_CVec_RouteHopZZ val_conv = *(LDKCVec_CVec_RouteHopZZ*)val;
5882         free((void*)val);
5883         return Route_set_paths(this_ptr_conv, val_conv);
5884 }
5885
5886 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Route_1new(JNIEnv * _env, jclass _b, jlong paths_arg) {
5887         LDKCVec_CVec_RouteHopZZ paths_arg_conv = *(LDKCVec_CVec_RouteHopZZ*)paths_arg;
5888         free((void*)paths_arg);
5889         LDKRoute* ret = malloc(sizeof(LDKRoute));
5890         *ret = Route_new(paths_arg_conv);
5891         assert(!ret->_underlying_ref);
5892         ret->_underlying_ref = true;
5893         return (long)ret;
5894 }
5895
5896 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Route_1write(JNIEnv * _env, jclass _b, jlong obj) {
5897         LDKRoute* obj_conv = (LDKRoute*)obj;
5898         LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
5899         *ret = Route_write(obj_conv);
5900         return (long)ret;
5901 }
5902
5903 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Route_1read(JNIEnv * _env, jclass _b, jlong ser) {
5904         LDKu8slice ser_conv = *(LDKu8slice*)ser;
5905         free((void*)ser);
5906         LDKRoute* ret = malloc(sizeof(LDKRoute));
5907         *ret = Route_read(ser_conv);
5908         assert(!ret->_underlying_ref);
5909         ret->_underlying_ref = true;
5910         return (long)ret;
5911 }
5912
5913 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5914         LDKRouteHint this_ptr_conv = *(LDKRouteHint*)this_ptr;
5915         free((void*)this_ptr);
5916         this_ptr_conv._underlying_ref = false;
5917         return RouteHint_free(this_ptr_conv);
5918 }
5919
5920 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1src_1node_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
5921         LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
5922         LDKPublicKey* ret = malloc(sizeof(LDKPublicKey));
5923         *ret = RouteHint_get_src_node_id(this_ptr_conv);
5924         return (long)ret;
5925 }
5926
5927 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1src_1node_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5928         LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
5929         LDKPublicKey val_conv = *(LDKPublicKey*)val;
5930         free((void*)val);
5931         return RouteHint_set_src_node_id(this_ptr_conv, val_conv);
5932 }
5933
5934 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
5935         LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
5936         return RouteHint_get_short_channel_id(this_ptr_conv);
5937 }
5938
5939 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5940         LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
5941         return RouteHint_set_short_channel_id(this_ptr_conv, val);
5942 }
5943
5944 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1fees(JNIEnv * _env, jclass _b, jlong this_ptr) {
5945         LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
5946         LDKRoutingFees* ret = malloc(sizeof(LDKRoutingFees));
5947         *ret = RouteHint_get_fees(this_ptr_conv);
5948         assert(!ret->_underlying_ref);
5949         ret->_underlying_ref = true;
5950         return (long)ret;
5951 }
5952
5953 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1fees(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5954         LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
5955         LDKRoutingFees val_conv = *(LDKRoutingFees*)val;
5956         free((void*)val);
5957         val_conv._underlying_ref = false;
5958         return RouteHint_set_fees(this_ptr_conv, val_conv);
5959 }
5960
5961 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr) {
5962         LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
5963         uint16_t* ret = malloc(sizeof(uint16_t));
5964         *ret = RouteHint_get_cltv_expiry_delta(this_ptr_conv);
5965         return (long)ret;
5966 }
5967
5968 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5969         LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
5970         uint16_t val_conv = *(uint16_t*)val;
5971         free((void*)val);
5972         return RouteHint_set_cltv_expiry_delta(this_ptr_conv, val_conv);
5973 }
5974
5975 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
5976         LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
5977         return RouteHint_get_htlc_minimum_msat(this_ptr_conv);
5978 }
5979
5980 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5981         LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
5982         return RouteHint_set_htlc_minimum_msat(this_ptr_conv, val);
5983 }
5984
5985 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHint_1new(JNIEnv * _env, jclass _b, jlong src_node_id_arg, jlong short_channel_id_arg, jlong fees_arg, jlong cltv_expiry_delta_arg, jlong htlc_minimum_msat_arg) {
5986         LDKPublicKey src_node_id_arg_conv = *(LDKPublicKey*)src_node_id_arg;
5987         free((void*)src_node_id_arg);
5988         LDKRoutingFees fees_arg_conv = *(LDKRoutingFees*)fees_arg;
5989         free((void*)fees_arg);
5990         fees_arg_conv._underlying_ref = false;
5991         uint16_t cltv_expiry_delta_arg_conv = *(uint16_t*)cltv_expiry_delta_arg;
5992         free((void*)cltv_expiry_delta_arg);
5993         LDKRouteHint* ret = malloc(sizeof(LDKRouteHint));
5994         *ret = RouteHint_new(src_node_id_arg_conv, short_channel_id_arg, fees_arg_conv, cltv_expiry_delta_arg_conv, htlc_minimum_msat_arg);
5995         assert(!ret->_underlying_ref);
5996         ret->_underlying_ref = true;
5997         return (long)ret;
5998 }
5999
6000 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_get_1route(JNIEnv * _env, jclass _b, jlong our_node_id, jlong network, jlong target, jlong first_hops, jlong last_hops, jlong final_value_msat, jint final_cltv, jlong logger) {
6001         LDKPublicKey our_node_id_conv = *(LDKPublicKey*)our_node_id;
6002         free((void*)our_node_id);
6003         LDKNetworkGraph* network_conv = (LDKNetworkGraph*)network;
6004         LDKPublicKey target_conv = *(LDKPublicKey*)target;
6005         free((void*)target);
6006         LDKCVec_ChannelDetailsZ* first_hops_conv = (LDKCVec_ChannelDetailsZ*)first_hops;
6007         LDKCVec_RouteHintZ last_hops_conv = *(LDKCVec_RouteHintZ*)last_hops;
6008         free((void*)last_hops);
6009         LDKLogger logger_conv = *(LDKLogger*)logger;
6010         free((void*)logger);
6011         LDKCResult_RouteLightningErrorZ* ret = malloc(sizeof(LDKCResult_RouteLightningErrorZ));
6012         *ret = get_route(our_node_id_conv, network_conv, target_conv, first_hops_conv, last_hops_conv, final_value_msat, final_cltv, logger_conv);
6013         return (long)ret;
6014 }
6015
6016 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6017         LDKNetworkGraph this_ptr_conv = *(LDKNetworkGraph*)this_ptr;
6018         free((void*)this_ptr);
6019         this_ptr_conv._underlying_ref = false;
6020         return NetworkGraph_free(this_ptr_conv);
6021 }
6022
6023 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LockedNetworkGraph_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6024         LDKLockedNetworkGraph this_ptr_conv = *(LDKLockedNetworkGraph*)this_ptr;
6025         free((void*)this_ptr);
6026         this_ptr_conv._underlying_ref = false;
6027         return LockedNetworkGraph_free(this_ptr_conv);
6028 }
6029
6030 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6031         LDKNetGraphMsgHandler this_ptr_conv = *(LDKNetGraphMsgHandler*)this_ptr;
6032         free((void*)this_ptr);
6033         this_ptr_conv._underlying_ref = false;
6034         return NetGraphMsgHandler_free(this_ptr_conv);
6035 }
6036
6037 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1new(JNIEnv * _env, jclass _b, jlong chain_monitor, jlong logger) {
6038         LDKChainWatchInterface chain_monitor_conv = *(LDKChainWatchInterface*)chain_monitor;
6039         free((void*)chain_monitor);
6040         LDKLogger logger_conv = *(LDKLogger*)logger;
6041         free((void*)logger);
6042         LDKNetGraphMsgHandler* ret = malloc(sizeof(LDKNetGraphMsgHandler));
6043         *ret = NetGraphMsgHandler_new(chain_monitor_conv, logger_conv);
6044         assert(!ret->_underlying_ref);
6045         ret->_underlying_ref = true;
6046         return (long)ret;
6047 }
6048
6049 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1from_1net_1graph(JNIEnv * _env, jclass _b, jlong chain_monitor, jlong logger, jlong network_graph) {
6050         LDKChainWatchInterface chain_monitor_conv = *(LDKChainWatchInterface*)chain_monitor;
6051         free((void*)chain_monitor);
6052         LDKLogger logger_conv = *(LDKLogger*)logger;
6053         free((void*)logger);
6054         LDKNetworkGraph network_graph_conv = *(LDKNetworkGraph*)network_graph;
6055         free((void*)network_graph);
6056         network_graph_conv._underlying_ref = false;
6057         LDKNetGraphMsgHandler* ret = malloc(sizeof(LDKNetGraphMsgHandler));
6058         *ret = NetGraphMsgHandler_from_net_graph(chain_monitor_conv, logger_conv, network_graph_conv);
6059         assert(!ret->_underlying_ref);
6060         ret->_underlying_ref = true;
6061         return (long)ret;
6062 }
6063
6064 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1read_1locked_1graph(JNIEnv * _env, jclass _b, jlong this_arg) {
6065         LDKNetGraphMsgHandler* this_arg_conv = (LDKNetGraphMsgHandler*)this_arg;
6066         LDKLockedNetworkGraph* ret = malloc(sizeof(LDKLockedNetworkGraph));
6067         *ret = NetGraphMsgHandler_read_locked_graph(this_arg_conv);
6068         assert(!ret->_underlying_ref);
6069         ret->_underlying_ref = true;
6070         return (long)ret;
6071 }
6072
6073 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LockedNetworkGraph_1graph(JNIEnv * _env, jclass _b, jlong this_arg) {
6074         LDKLockedNetworkGraph* this_arg_conv = (LDKLockedNetworkGraph*)this_arg;
6075         LDKNetworkGraph* ret = malloc(sizeof(LDKNetworkGraph));
6076         *ret = LockedNetworkGraph_graph(this_arg_conv);
6077         assert(!ret->_underlying_ref);
6078         ret->_underlying_ref = true;
6079         return (long)ret;
6080 }
6081
6082 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1as_1RoutingMessageHandler(JNIEnv * _env, jclass _b, jlong this_arg) {
6083         LDKNetGraphMsgHandler* this_arg_conv = (LDKNetGraphMsgHandler*)this_arg;
6084         LDKRoutingMessageHandler* ret = malloc(sizeof(LDKRoutingMessageHandler));
6085         *ret = NetGraphMsgHandler_as_RoutingMessageHandler(this_arg_conv);
6086         return (long)ret;
6087 }
6088
6089 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6090         LDKDirectionalChannelInfo this_ptr_conv = *(LDKDirectionalChannelInfo*)this_ptr;
6091         free((void*)this_ptr);
6092         this_ptr_conv._underlying_ref = false;
6093         return DirectionalChannelInfo_free(this_ptr_conv);
6094 }
6095
6096 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get_1last_1update(JNIEnv * _env, jclass _b, jlong this_ptr) {
6097         LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
6098         return DirectionalChannelInfo_get_last_update(this_ptr_conv);
6099 }
6100
6101 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1last_1update(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
6102         LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
6103         return DirectionalChannelInfo_set_last_update(this_ptr_conv, val);
6104 }
6105
6106 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get_1enabled(JNIEnv * _env, jclass _b, jlong this_ptr) {
6107         LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
6108         return DirectionalChannelInfo_get_enabled(this_ptr_conv);
6109 }
6110
6111 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1enabled(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
6112         LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
6113         return DirectionalChannelInfo_set_enabled(this_ptr_conv, val);
6114 }
6115
6116 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr) {
6117         LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
6118         uint16_t* ret = malloc(sizeof(uint16_t));
6119         *ret = DirectionalChannelInfo_get_cltv_expiry_delta(this_ptr_conv);
6120         return (long)ret;
6121 }
6122
6123 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6124         LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
6125         uint16_t val_conv = *(uint16_t*)val;
6126         free((void*)val);
6127         return DirectionalChannelInfo_set_cltv_expiry_delta(this_ptr_conv, val_conv);
6128 }
6129
6130 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
6131         LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
6132         return DirectionalChannelInfo_get_htlc_minimum_msat(this_ptr_conv);
6133 }
6134
6135 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6136         LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
6137         return DirectionalChannelInfo_set_htlc_minimum_msat(this_ptr_conv, val);
6138 }
6139
6140 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1write(JNIEnv * _env, jclass _b, jlong obj) {
6141         LDKDirectionalChannelInfo* obj_conv = (LDKDirectionalChannelInfo*)obj;
6142         LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
6143         *ret = DirectionalChannelInfo_write(obj_conv);
6144         return (long)ret;
6145 }
6146
6147 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1read(JNIEnv * _env, jclass _b, jlong ser) {
6148         LDKu8slice ser_conv = *(LDKu8slice*)ser;
6149         free((void*)ser);
6150         LDKDirectionalChannelInfo* ret = malloc(sizeof(LDKDirectionalChannelInfo));
6151         *ret = DirectionalChannelInfo_read(ser_conv);
6152         assert(!ret->_underlying_ref);
6153         ret->_underlying_ref = true;
6154         return (long)ret;
6155 }
6156
6157 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6158         LDKChannelInfo this_ptr_conv = *(LDKChannelInfo*)this_ptr;
6159         free((void*)this_ptr);
6160         this_ptr_conv._underlying_ref = false;
6161         return ChannelInfo_free(this_ptr_conv);
6162 }
6163
6164 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1node_1one(JNIEnv * _env, jclass _b, jlong this_ptr) {
6165         LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
6166         LDKPublicKey* ret = malloc(sizeof(LDKPublicKey));
6167         *ret = ChannelInfo_get_node_one(this_ptr_conv);
6168         return (long)ret;
6169 }
6170
6171 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1node_1one(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6172         LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
6173         LDKPublicKey val_conv = *(LDKPublicKey*)val;
6174         free((void*)val);
6175         return ChannelInfo_set_node_one(this_ptr_conv, val_conv);
6176 }
6177
6178 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1one_1to_1two(JNIEnv * _env, jclass _b, jlong this_ptr) {
6179         LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
6180         LDKDirectionalChannelInfo* ret = malloc(sizeof(LDKDirectionalChannelInfo));
6181         *ret = ChannelInfo_get_one_to_two(this_ptr_conv);
6182         assert(!ret->_underlying_ref);
6183         ret->_underlying_ref = true;
6184         return (long)ret;
6185 }
6186
6187 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1one_1to_1two(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6188         LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
6189         LDKDirectionalChannelInfo val_conv = *(LDKDirectionalChannelInfo*)val;
6190         free((void*)val);
6191         val_conv._underlying_ref = false;
6192         return ChannelInfo_set_one_to_two(this_ptr_conv, val_conv);
6193 }
6194
6195 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1node_1two(JNIEnv * _env, jclass _b, jlong this_ptr) {
6196         LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
6197         LDKPublicKey* ret = malloc(sizeof(LDKPublicKey));
6198         *ret = ChannelInfo_get_node_two(this_ptr_conv);
6199         return (long)ret;
6200 }
6201
6202 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1node_1two(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6203         LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
6204         LDKPublicKey val_conv = *(LDKPublicKey*)val;
6205         free((void*)val);
6206         return ChannelInfo_set_node_two(this_ptr_conv, val_conv);
6207 }
6208
6209 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1two_1to_1one(JNIEnv * _env, jclass _b, jlong this_ptr) {
6210         LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
6211         LDKDirectionalChannelInfo* ret = malloc(sizeof(LDKDirectionalChannelInfo));
6212         *ret = ChannelInfo_get_two_to_one(this_ptr_conv);
6213         assert(!ret->_underlying_ref);
6214         ret->_underlying_ref = true;
6215         return (long)ret;
6216 }
6217
6218 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1two_1to_1one(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6219         LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
6220         LDKDirectionalChannelInfo val_conv = *(LDKDirectionalChannelInfo*)val;
6221         free((void*)val);
6222         val_conv._underlying_ref = false;
6223         return ChannelInfo_set_two_to_one(this_ptr_conv, val_conv);
6224 }
6225
6226 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1write(JNIEnv * _env, jclass _b, jlong obj) {
6227         LDKChannelInfo* obj_conv = (LDKChannelInfo*)obj;
6228         LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
6229         *ret = ChannelInfo_write(obj_conv);
6230         return (long)ret;
6231 }
6232
6233 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1read(JNIEnv * _env, jclass _b, jlong ser) {
6234         LDKu8slice ser_conv = *(LDKu8slice*)ser;
6235         free((void*)ser);
6236         LDKChannelInfo* ret = malloc(sizeof(LDKChannelInfo));
6237         *ret = ChannelInfo_read(ser_conv);
6238         assert(!ret->_underlying_ref);
6239         ret->_underlying_ref = true;
6240         return (long)ret;
6241 }
6242
6243 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingFees_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6244         LDKRoutingFees this_ptr_conv = *(LDKRoutingFees*)this_ptr;
6245         free((void*)this_ptr);
6246         this_ptr_conv._underlying_ref = false;
6247         return RoutingFees_free(this_ptr_conv);
6248 }
6249
6250 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_RoutingFees_1get_1base_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
6251         LDKRoutingFees* this_ptr_conv = (LDKRoutingFees*)this_ptr;
6252         return RoutingFees_get_base_msat(this_ptr_conv);
6253 }
6254
6255 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingFees_1set_1base_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
6256         LDKRoutingFees* this_ptr_conv = (LDKRoutingFees*)this_ptr;
6257         return RoutingFees_set_base_msat(this_ptr_conv, val);
6258 }
6259
6260 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_RoutingFees_1get_1proportional_1millionths(JNIEnv * _env, jclass _b, jlong this_ptr) {
6261         LDKRoutingFees* this_ptr_conv = (LDKRoutingFees*)this_ptr;
6262         return RoutingFees_get_proportional_millionths(this_ptr_conv);
6263 }
6264
6265 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingFees_1set_1proportional_1millionths(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
6266         LDKRoutingFees* this_ptr_conv = (LDKRoutingFees*)this_ptr;
6267         return RoutingFees_set_proportional_millionths(this_ptr_conv, val);
6268 }
6269
6270 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RoutingFees_1new(JNIEnv * _env, jclass _b, jint base_msat_arg, jint proportional_millionths_arg) {
6271         LDKRoutingFees* ret = malloc(sizeof(LDKRoutingFees));
6272         *ret = RoutingFees_new(base_msat_arg, proportional_millionths_arg);
6273         assert(!ret->_underlying_ref);
6274         ret->_underlying_ref = true;
6275         return (long)ret;
6276 }
6277
6278 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RoutingFees_1read(JNIEnv * _env, jclass _b, jlong ser) {
6279         LDKu8slice ser_conv = *(LDKu8slice*)ser;
6280         free((void*)ser);
6281         LDKRoutingFees* ret = malloc(sizeof(LDKRoutingFees));
6282         *ret = RoutingFees_read(ser_conv);
6283         assert(!ret->_underlying_ref);
6284         ret->_underlying_ref = true;
6285         return (long)ret;
6286 }
6287
6288 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RoutingFees_1write(JNIEnv * _env, jclass _b, jlong obj) {
6289         LDKRoutingFees* obj_conv = (LDKRoutingFees*)obj;
6290         LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
6291         *ret = RoutingFees_write(obj_conv);
6292         return (long)ret;
6293 }
6294
6295 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6296         LDKNodeAnnouncementInfo this_ptr_conv = *(LDKNodeAnnouncementInfo*)this_ptr;
6297         free((void*)this_ptr);
6298         this_ptr_conv._underlying_ref = false;
6299         return NodeAnnouncementInfo_free(this_ptr_conv);
6300 }
6301
6302 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1last_1update(JNIEnv * _env, jclass _b, jlong this_ptr) {
6303         LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
6304         return NodeAnnouncementInfo_get_last_update(this_ptr_conv);
6305 }
6306
6307 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1last_1update(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
6308         LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
6309         return NodeAnnouncementInfo_set_last_update(this_ptr_conv, val);
6310 }
6311
6312 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1rgb(JNIEnv * _env, jclass _b, jlong this_ptr) {
6313         LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
6314         jbyteArray ret_arr = (*_env)->NewByteArray(_env, 3);
6315         (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 3, *NodeAnnouncementInfo_get_rgb(this_ptr_conv));
6316         return ret_arr;
6317 }
6318
6319 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1rgb(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6320         LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
6321         LDKThreeBytes val_conv = *(LDKThreeBytes*)val;
6322         free((void*)val);
6323         return NodeAnnouncementInfo_set_rgb(this_ptr_conv, val_conv);
6324 }
6325
6326 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1alias(JNIEnv * _env, jclass _b, jlong this_ptr) {
6327         LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
6328         jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
6329         (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *NodeAnnouncementInfo_get_alias(this_ptr_conv));
6330         return ret_arr;
6331 }
6332
6333 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1alias(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6334         LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
6335         LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
6336         free((void*)val);
6337         return NodeAnnouncementInfo_set_alias(this_ptr_conv, val_conv);
6338 }
6339
6340 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1addresses(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6341         LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
6342         LDKCVec_NetAddressZ val_conv = *(LDKCVec_NetAddressZ*)val;
6343         free((void*)val);
6344         return NodeAnnouncementInfo_set_addresses(this_ptr_conv, val_conv);
6345 }
6346
6347 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1write(JNIEnv * _env, jclass _b, jlong obj) {
6348         LDKNodeAnnouncementInfo* obj_conv = (LDKNodeAnnouncementInfo*)obj;
6349         LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
6350         *ret = NodeAnnouncementInfo_write(obj_conv);
6351         return (long)ret;
6352 }
6353
6354 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1read(JNIEnv * _env, jclass _b, jlong ser) {
6355         LDKu8slice ser_conv = *(LDKu8slice*)ser;
6356         free((void*)ser);
6357         LDKNodeAnnouncementInfo* ret = malloc(sizeof(LDKNodeAnnouncementInfo));
6358         *ret = NodeAnnouncementInfo_read(ser_conv);
6359         assert(!ret->_underlying_ref);
6360         ret->_underlying_ref = true;
6361         return (long)ret;
6362 }
6363
6364 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6365         LDKNodeInfo this_ptr_conv = *(LDKNodeInfo*)this_ptr;
6366         free((void*)this_ptr);
6367         this_ptr_conv._underlying_ref = false;
6368         return NodeInfo_free(this_ptr_conv);
6369 }
6370
6371 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1set_1channels(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6372         LDKNodeInfo* this_ptr_conv = (LDKNodeInfo*)this_ptr;
6373         LDKCVec_u64Z val_conv = *(LDKCVec_u64Z*)val;
6374         free((void*)val);
6375         return NodeInfo_set_channels(this_ptr_conv, val_conv);
6376 }
6377
6378 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeInfo_1get_1lowest_1inbound_1channel_1fees(JNIEnv * _env, jclass _b, jlong this_ptr) {
6379         LDKNodeInfo* this_ptr_conv = (LDKNodeInfo*)this_ptr;
6380         LDKRoutingFees* ret = malloc(sizeof(LDKRoutingFees));
6381         *ret = NodeInfo_get_lowest_inbound_channel_fees(this_ptr_conv);
6382         assert(!ret->_underlying_ref);
6383         ret->_underlying_ref = true;
6384         return (long)ret;
6385 }
6386
6387 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1set_1lowest_1inbound_1channel_1fees(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6388         LDKNodeInfo* this_ptr_conv = (LDKNodeInfo*)this_ptr;
6389         LDKRoutingFees val_conv = *(LDKRoutingFees*)val;
6390         free((void*)val);
6391         val_conv._underlying_ref = false;
6392         return NodeInfo_set_lowest_inbound_channel_fees(this_ptr_conv, val_conv);
6393 }
6394
6395 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeInfo_1get_1announcement_1info(JNIEnv * _env, jclass _b, jlong this_ptr) {
6396         LDKNodeInfo* this_ptr_conv = (LDKNodeInfo*)this_ptr;
6397         LDKNodeAnnouncementInfo* ret = malloc(sizeof(LDKNodeAnnouncementInfo));
6398         *ret = NodeInfo_get_announcement_info(this_ptr_conv);
6399         assert(!ret->_underlying_ref);
6400         ret->_underlying_ref = true;
6401         return (long)ret;
6402 }
6403
6404 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1set_1announcement_1info(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6405         LDKNodeInfo* this_ptr_conv = (LDKNodeInfo*)this_ptr;
6406         LDKNodeAnnouncementInfo val_conv = *(LDKNodeAnnouncementInfo*)val;
6407         free((void*)val);
6408         val_conv._underlying_ref = false;
6409         return NodeInfo_set_announcement_info(this_ptr_conv, val_conv);
6410 }
6411
6412 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeInfo_1new(JNIEnv * _env, jclass _b, jlong channels_arg, jlong lowest_inbound_channel_fees_arg, jlong announcement_info_arg) {
6413         LDKCVec_u64Z channels_arg_conv = *(LDKCVec_u64Z*)channels_arg;
6414         free((void*)channels_arg);
6415         LDKRoutingFees lowest_inbound_channel_fees_arg_conv = *(LDKRoutingFees*)lowest_inbound_channel_fees_arg;
6416         free((void*)lowest_inbound_channel_fees_arg);
6417         lowest_inbound_channel_fees_arg_conv._underlying_ref = false;
6418         LDKNodeAnnouncementInfo announcement_info_arg_conv = *(LDKNodeAnnouncementInfo*)announcement_info_arg;
6419         free((void*)announcement_info_arg);
6420         announcement_info_arg_conv._underlying_ref = false;
6421         LDKNodeInfo* ret = malloc(sizeof(LDKNodeInfo));
6422         *ret = NodeInfo_new(channels_arg_conv, lowest_inbound_channel_fees_arg_conv, announcement_info_arg_conv);
6423         assert(!ret->_underlying_ref);
6424         ret->_underlying_ref = true;
6425         return (long)ret;
6426 }
6427
6428 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeInfo_1write(JNIEnv * _env, jclass _b, jlong obj) {
6429         LDKNodeInfo* obj_conv = (LDKNodeInfo*)obj;
6430         LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
6431         *ret = NodeInfo_write(obj_conv);
6432         return (long)ret;
6433 }
6434
6435 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeInfo_1read(JNIEnv * _env, jclass _b, jlong ser) {
6436         LDKu8slice ser_conv = *(LDKu8slice*)ser;
6437         free((void*)ser);
6438         LDKNodeInfo* ret = malloc(sizeof(LDKNodeInfo));
6439         *ret = NodeInfo_read(ser_conv);
6440         assert(!ret->_underlying_ref);
6441         ret->_underlying_ref = true;
6442         return (long)ret;
6443 }
6444
6445 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1write(JNIEnv * _env, jclass _b, jlong obj) {
6446         LDKNetworkGraph* obj_conv = (LDKNetworkGraph*)obj;
6447         LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
6448         *ret = NetworkGraph_write(obj_conv);
6449         return (long)ret;
6450 }
6451
6452 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1read(JNIEnv * _env, jclass _b, jlong ser) {
6453         LDKu8slice ser_conv = *(LDKu8slice*)ser;
6454         free((void*)ser);
6455         LDKNetworkGraph* ret = malloc(sizeof(LDKNetworkGraph));
6456         *ret = NetworkGraph_read(ser_conv);
6457         assert(!ret->_underlying_ref);
6458         ret->_underlying_ref = true;
6459         return (long)ret;
6460 }
6461
6462 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1new(JNIEnv * _env, jclass _b) {
6463         LDKNetworkGraph* ret = malloc(sizeof(LDKNetworkGraph));
6464         *ret = NetworkGraph_new();
6465         assert(!ret->_underlying_ref);
6466         ret->_underlying_ref = true;
6467         return (long)ret;
6468 }
6469
6470 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1close_1channel_1from_1update(JNIEnv * _env, jclass _b, jlong this_arg, jlong short_channel_id, jboolean is_permanent) {
6471         LDKNetworkGraph* this_arg_conv = (LDKNetworkGraph*)this_arg;
6472         return NetworkGraph_close_channel_from_update(this_arg_conv, short_channel_id, is_permanent);
6473 }
6474