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