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