1 #include "org_ldk_impl_bindings.h"
2 #include <rust_types.h>
7 #define DO_ASSERT(a) do { bool _assert_val = (a); assert(_assert_val); } while(0)
10 static mtx_t allocation_mtx;
12 void __attribute__((constructor)) init_mtx() {
13 DO_ASSERT(mtx_init(&allocation_mtx, mtx_plain) == thrd_success);
16 typedef struct allocation {
17 struct allocation* next;
19 const char* struct_name;
21 static allocation* allocation_ll = NULL;
23 void* MALLOC(size_t len, const char* struct_name) {
24 void* res = malloc(len);
25 allocation* new_alloc = malloc(sizeof(allocation));
27 new_alloc->struct_name = struct_name;
28 DO_ASSERT(mtx_lock(&allocation_mtx) == thrd_success);
29 new_alloc->next = allocation_ll;
30 allocation_ll = new_alloc;
31 DO_ASSERT(mtx_unlock(&allocation_mtx) == thrd_success);
35 void FREE(void* ptr) {
37 DO_ASSERT(mtx_lock(&allocation_mtx) == thrd_success);
38 allocation* it = allocation_ll;
39 while (it->ptr != ptr) { p = it; it = it->next; }
40 if (p) { p->next = it->next; } else { allocation_ll = it->next; }
41 DO_ASSERT(mtx_unlock(&allocation_mtx) == thrd_success);
42 DO_ASSERT(it->ptr == ptr);
47 void __attribute__((destructor)) check_leaks() {
48 for (allocation* a = allocation_ll; a != NULL; a = a->next) { fprintf(stderr, "%s %p remains\n", a->struct_name, a->ptr); }
49 DO_ASSERT(allocation_ll == NULL);
52 jmethodID ordinal_meth = NULL;
53 jmethodID slicedef_meth = NULL;
54 jclass slicedef_cls = NULL;
55 JNIEXPORT void Java_org_ldk_impl_bindings_init(JNIEnv * env, jclass _b, jclass enum_class, jclass slicedef_class) {
56 ordinal_meth = (*env)->GetMethodID(env, enum_class, "ordinal", "()I");
57 DO_ASSERT(ordinal_meth != NULL);
58 slicedef_meth = (*env)->GetMethodID(env, slicedef_class, "<init>", "(JJJ)V");
59 DO_ASSERT(slicedef_meth != NULL);
60 slicedef_cls = (*env)->NewGlobalRef(env, slicedef_class);
61 DO_ASSERT(slicedef_cls != NULL);
64 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_deref_1bool (JNIEnv * env, jclass _a, jlong ptr) {
67 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_deref_1long (JNIEnv * env, jclass _a, jlong ptr) {
70 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_free_1heap_1ptr (JNIEnv * env, jclass _a, jlong ptr) {
73 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_get_1u8_1slice_1bytes (JNIEnv * _env, jclass _b, jlong slice_ptr) {
74 LDKu8slice *slice = (LDKu8slice*)slice_ptr;
75 jbyteArray ret_arr = (*_env)->NewByteArray(_env, slice->datalen);
76 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, slice->datalen, slice->data);
79 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_bytes_1to_1u8_1vec (JNIEnv * _env, jclass _b, jbyteArray bytes) {
80 LDKCVec_u8Z *vec = (LDKCVec_u8Z*)MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8");
81 vec->datalen = (*_env)->GetArrayLength(_env, bytes);
82 vec->data = (uint8_t*)malloc(vec->datalen); // May be freed by rust, so don't track allocation
83 (*_env)->GetByteArrayRegion (_env, bytes, 0, vec->datalen, vec->data);
86 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_vec_1slice_1len (JNIEnv * env, jclass _a, jlong ptr) {
87 // Check offsets of a few Vec types are all consistent as we're meant to be generic across types
88 _Static_assert(offsetof(LDKCVec_u8Z, datalen) == offsetof(LDKCVec_SignatureZ, datalen), "Vec<*> needs to be mapped identically");
89 _Static_assert(offsetof(LDKCVec_u8Z, datalen) == offsetof(LDKCVec_MessageSendEventZ, datalen), "Vec<*> needs to be mapped identically");
90 _Static_assert(offsetof(LDKCVec_u8Z, datalen) == offsetof(LDKCVec_EventZ, datalen), "Vec<*> needs to be mapped identically");
91 _Static_assert(offsetof(LDKCVec_u8Z, datalen) == offsetof(LDKCVec_C2Tuple_usizeTransactionZZ, datalen), "Vec<*> needs to be mapped identically");
92 LDKCVec_u8Z *vec = (LDKCVec_u8Z*)ptr;
93 return (long)vec->datalen;
95 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_new_1empty_1slice_1vec (JNIEnv * _env, jclass _b) {
96 // Check sizes of a few Vec types are all consistent as we're meant to be generic across types
97 _Static_assert(sizeof(LDKCVec_u8Z) == sizeof(LDKCVec_SignatureZ), "Vec<*> needs to be mapped identically");
98 _Static_assert(sizeof(LDKCVec_u8Z) == sizeof(LDKCVec_MessageSendEventZ), "Vec<*> needs to be mapped identically");
99 _Static_assert(sizeof(LDKCVec_u8Z) == sizeof(LDKCVec_EventZ), "Vec<*> needs to be mapped identically");
100 _Static_assert(sizeof(LDKCVec_u8Z) == sizeof(LDKCVec_C2Tuple_usizeTransactionZZ), "Vec<*> needs to be mapped identically");
101 LDKCVec_u8Z *vec = (LDKCVec_u8Z*)MALLOC(sizeof(LDKCVec_u8Z), "Empty LDKCVec");
107 // We assume that CVec_u8Z and u8slice are the same size and layout (and thus pointers to the two can be mixed)
108 _Static_assert(sizeof(LDKCVec_u8Z) == sizeof(LDKu8slice), "Vec<u8> and [u8] need to have been mapped identically");
109 _Static_assert(offsetof(LDKCVec_u8Z, data) == offsetof(LDKu8slice, data), "Vec<u8> and [u8] need to have been mapped identically");
110 _Static_assert(offsetof(LDKCVec_u8Z, datalen) == offsetof(LDKu8slice, datalen), "Vec<u8> and [u8] need to have been mapped identically");
112 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKSecretKey_1new(JNIEnv * _env, jclass _b) {
113 LDKSecretKey* key = (LDKSecretKey*)MALLOC(sizeof(LDKSecretKey), "LDKSecretKey");
116 static inline LDKAccessError LDKAccessError_from_java(JNIEnv *env, jclass val) {
117 switch ((*env)->CallIntMethod(env, val, ordinal_meth)) {
118 case 0: return LDKAccessError_UnknownChain;
119 case 1: return LDKAccessError_UnknownTx;
123 static jclass LDKAccessError_class = NULL;
124 static jfieldID LDKAccessError_LDKAccessError_UnknownChain = NULL;
125 static jfieldID LDKAccessError_LDKAccessError_UnknownTx = NULL;
126 JNIEXPORT void JNICALL Java_org_ldk_enums_LDKAccessError_init (JNIEnv * env, jclass clz) {
127 LDKAccessError_class = (*env)->NewGlobalRef(env, clz);
128 DO_ASSERT(LDKAccessError_class != NULL);
129 LDKAccessError_LDKAccessError_UnknownChain = (*env)->GetStaticFieldID(env, LDKAccessError_class, "LDKAccessError_UnknownChain", "Lorg/ldk/enums/LDKAccessError;");
130 DO_ASSERT(LDKAccessError_LDKAccessError_UnknownChain != NULL);
131 LDKAccessError_LDKAccessError_UnknownTx = (*env)->GetStaticFieldID(env, LDKAccessError_class, "LDKAccessError_UnknownTx", "Lorg/ldk/enums/LDKAccessError;");
132 DO_ASSERT(LDKAccessError_LDKAccessError_UnknownTx != NULL);
134 static inline jclass LDKAccessError_to_java(JNIEnv *env, LDKAccessError val) {
136 case LDKAccessError_UnknownChain:
137 return (*env)->GetStaticObjectField(env, LDKAccessError_class, LDKAccessError_LDKAccessError_UnknownChain);
138 case LDKAccessError_UnknownTx:
139 return (*env)->GetStaticObjectField(env, LDKAccessError_class, LDKAccessError_LDKAccessError_UnknownTx);
144 static inline LDKChannelMonitorUpdateErr LDKChannelMonitorUpdateErr_from_java(JNIEnv *env, jclass val) {
145 switch ((*env)->CallIntMethod(env, val, ordinal_meth)) {
146 case 0: return LDKChannelMonitorUpdateErr_TemporaryFailure;
147 case 1: return LDKChannelMonitorUpdateErr_PermanentFailure;
151 static jclass LDKChannelMonitorUpdateErr_class = NULL;
152 static jfieldID LDKChannelMonitorUpdateErr_LDKChannelMonitorUpdateErr_TemporaryFailure = NULL;
153 static jfieldID LDKChannelMonitorUpdateErr_LDKChannelMonitorUpdateErr_PermanentFailure = NULL;
154 JNIEXPORT void JNICALL Java_org_ldk_enums_LDKChannelMonitorUpdateErr_init (JNIEnv * env, jclass clz) {
155 LDKChannelMonitorUpdateErr_class = (*env)->NewGlobalRef(env, clz);
156 DO_ASSERT(LDKChannelMonitorUpdateErr_class != NULL);
157 LDKChannelMonitorUpdateErr_LDKChannelMonitorUpdateErr_TemporaryFailure = (*env)->GetStaticFieldID(env, LDKChannelMonitorUpdateErr_class, "LDKChannelMonitorUpdateErr_TemporaryFailure", "Lorg/ldk/enums/LDKChannelMonitorUpdateErr;");
158 DO_ASSERT(LDKChannelMonitorUpdateErr_LDKChannelMonitorUpdateErr_TemporaryFailure != NULL);
159 LDKChannelMonitorUpdateErr_LDKChannelMonitorUpdateErr_PermanentFailure = (*env)->GetStaticFieldID(env, LDKChannelMonitorUpdateErr_class, "LDKChannelMonitorUpdateErr_PermanentFailure", "Lorg/ldk/enums/LDKChannelMonitorUpdateErr;");
160 DO_ASSERT(LDKChannelMonitorUpdateErr_LDKChannelMonitorUpdateErr_PermanentFailure != NULL);
162 static inline jclass LDKChannelMonitorUpdateErr_to_java(JNIEnv *env, LDKChannelMonitorUpdateErr val) {
164 case LDKChannelMonitorUpdateErr_TemporaryFailure:
165 return (*env)->GetStaticObjectField(env, LDKChannelMonitorUpdateErr_class, LDKChannelMonitorUpdateErr_LDKChannelMonitorUpdateErr_TemporaryFailure);
166 case LDKChannelMonitorUpdateErr_PermanentFailure:
167 return (*env)->GetStaticObjectField(env, LDKChannelMonitorUpdateErr_class, LDKChannelMonitorUpdateErr_LDKChannelMonitorUpdateErr_PermanentFailure);
172 static inline LDKConfirmationTarget LDKConfirmationTarget_from_java(JNIEnv *env, jclass val) {
173 switch ((*env)->CallIntMethod(env, val, ordinal_meth)) {
174 case 0: return LDKConfirmationTarget_Background;
175 case 1: return LDKConfirmationTarget_Normal;
176 case 2: return LDKConfirmationTarget_HighPriority;
180 static jclass LDKConfirmationTarget_class = NULL;
181 static jfieldID LDKConfirmationTarget_LDKConfirmationTarget_Background = NULL;
182 static jfieldID LDKConfirmationTarget_LDKConfirmationTarget_Normal = NULL;
183 static jfieldID LDKConfirmationTarget_LDKConfirmationTarget_HighPriority = NULL;
184 JNIEXPORT void JNICALL Java_org_ldk_enums_LDKConfirmationTarget_init (JNIEnv * env, jclass clz) {
185 LDKConfirmationTarget_class = (*env)->NewGlobalRef(env, clz);
186 DO_ASSERT(LDKConfirmationTarget_class != NULL);
187 LDKConfirmationTarget_LDKConfirmationTarget_Background = (*env)->GetStaticFieldID(env, LDKConfirmationTarget_class, "LDKConfirmationTarget_Background", "Lorg/ldk/enums/LDKConfirmationTarget;");
188 DO_ASSERT(LDKConfirmationTarget_LDKConfirmationTarget_Background != NULL);
189 LDKConfirmationTarget_LDKConfirmationTarget_Normal = (*env)->GetStaticFieldID(env, LDKConfirmationTarget_class, "LDKConfirmationTarget_Normal", "Lorg/ldk/enums/LDKConfirmationTarget;");
190 DO_ASSERT(LDKConfirmationTarget_LDKConfirmationTarget_Normal != NULL);
191 LDKConfirmationTarget_LDKConfirmationTarget_HighPriority = (*env)->GetStaticFieldID(env, LDKConfirmationTarget_class, "LDKConfirmationTarget_HighPriority", "Lorg/ldk/enums/LDKConfirmationTarget;");
192 DO_ASSERT(LDKConfirmationTarget_LDKConfirmationTarget_HighPriority != NULL);
194 static inline jclass LDKConfirmationTarget_to_java(JNIEnv *env, LDKConfirmationTarget val) {
196 case LDKConfirmationTarget_Background:
197 return (*env)->GetStaticObjectField(env, LDKConfirmationTarget_class, LDKConfirmationTarget_LDKConfirmationTarget_Background);
198 case LDKConfirmationTarget_Normal:
199 return (*env)->GetStaticObjectField(env, LDKConfirmationTarget_class, LDKConfirmationTarget_LDKConfirmationTarget_Normal);
200 case LDKConfirmationTarget_HighPriority:
201 return (*env)->GetStaticObjectField(env, LDKConfirmationTarget_class, LDKConfirmationTarget_LDKConfirmationTarget_HighPriority);
206 static inline LDKLevel LDKLevel_from_java(JNIEnv *env, jclass val) {
207 switch ((*env)->CallIntMethod(env, val, ordinal_meth)) {
208 case 0: return LDKLevel_Off;
209 case 1: return LDKLevel_Error;
210 case 2: return LDKLevel_Warn;
211 case 3: return LDKLevel_Info;
212 case 4: return LDKLevel_Debug;
213 case 5: return LDKLevel_Trace;
217 static jclass LDKLevel_class = NULL;
218 static jfieldID LDKLevel_LDKLevel_Off = NULL;
219 static jfieldID LDKLevel_LDKLevel_Error = NULL;
220 static jfieldID LDKLevel_LDKLevel_Warn = NULL;
221 static jfieldID LDKLevel_LDKLevel_Info = NULL;
222 static jfieldID LDKLevel_LDKLevel_Debug = NULL;
223 static jfieldID LDKLevel_LDKLevel_Trace = NULL;
224 JNIEXPORT void JNICALL Java_org_ldk_enums_LDKLevel_init (JNIEnv * env, jclass clz) {
225 LDKLevel_class = (*env)->NewGlobalRef(env, clz);
226 DO_ASSERT(LDKLevel_class != NULL);
227 LDKLevel_LDKLevel_Off = (*env)->GetStaticFieldID(env, LDKLevel_class, "LDKLevel_Off", "Lorg/ldk/enums/LDKLevel;");
228 DO_ASSERT(LDKLevel_LDKLevel_Off != NULL);
229 LDKLevel_LDKLevel_Error = (*env)->GetStaticFieldID(env, LDKLevel_class, "LDKLevel_Error", "Lorg/ldk/enums/LDKLevel;");
230 DO_ASSERT(LDKLevel_LDKLevel_Error != NULL);
231 LDKLevel_LDKLevel_Warn = (*env)->GetStaticFieldID(env, LDKLevel_class, "LDKLevel_Warn", "Lorg/ldk/enums/LDKLevel;");
232 DO_ASSERT(LDKLevel_LDKLevel_Warn != NULL);
233 LDKLevel_LDKLevel_Info = (*env)->GetStaticFieldID(env, LDKLevel_class, "LDKLevel_Info", "Lorg/ldk/enums/LDKLevel;");
234 DO_ASSERT(LDKLevel_LDKLevel_Info != NULL);
235 LDKLevel_LDKLevel_Debug = (*env)->GetStaticFieldID(env, LDKLevel_class, "LDKLevel_Debug", "Lorg/ldk/enums/LDKLevel;");
236 DO_ASSERT(LDKLevel_LDKLevel_Debug != NULL);
237 LDKLevel_LDKLevel_Trace = (*env)->GetStaticFieldID(env, LDKLevel_class, "LDKLevel_Trace", "Lorg/ldk/enums/LDKLevel;");
238 DO_ASSERT(LDKLevel_LDKLevel_Trace != NULL);
240 static inline jclass LDKLevel_to_java(JNIEnv *env, LDKLevel val) {
243 return (*env)->GetStaticObjectField(env, LDKLevel_class, LDKLevel_LDKLevel_Off);
245 return (*env)->GetStaticObjectField(env, LDKLevel_class, LDKLevel_LDKLevel_Error);
247 return (*env)->GetStaticObjectField(env, LDKLevel_class, LDKLevel_LDKLevel_Warn);
249 return (*env)->GetStaticObjectField(env, LDKLevel_class, LDKLevel_LDKLevel_Info);
251 return (*env)->GetStaticObjectField(env, LDKLevel_class, LDKLevel_LDKLevel_Debug);
253 return (*env)->GetStaticObjectField(env, LDKLevel_class, LDKLevel_LDKLevel_Trace);
258 static inline LDKNetwork LDKNetwork_from_java(JNIEnv *env, jclass val) {
259 switch ((*env)->CallIntMethod(env, val, ordinal_meth)) {
260 case 0: return LDKNetwork_Bitcoin;
261 case 1: return LDKNetwork_Testnet;
262 case 2: return LDKNetwork_Regtest;
266 static jclass LDKNetwork_class = NULL;
267 static jfieldID LDKNetwork_LDKNetwork_Bitcoin = NULL;
268 static jfieldID LDKNetwork_LDKNetwork_Testnet = NULL;
269 static jfieldID LDKNetwork_LDKNetwork_Regtest = NULL;
270 JNIEXPORT void JNICALL Java_org_ldk_enums_LDKNetwork_init (JNIEnv * env, jclass clz) {
271 LDKNetwork_class = (*env)->NewGlobalRef(env, clz);
272 DO_ASSERT(LDKNetwork_class != NULL);
273 LDKNetwork_LDKNetwork_Bitcoin = (*env)->GetStaticFieldID(env, LDKNetwork_class, "LDKNetwork_Bitcoin", "Lorg/ldk/enums/LDKNetwork;");
274 DO_ASSERT(LDKNetwork_LDKNetwork_Bitcoin != NULL);
275 LDKNetwork_LDKNetwork_Testnet = (*env)->GetStaticFieldID(env, LDKNetwork_class, "LDKNetwork_Testnet", "Lorg/ldk/enums/LDKNetwork;");
276 DO_ASSERT(LDKNetwork_LDKNetwork_Testnet != NULL);
277 LDKNetwork_LDKNetwork_Regtest = (*env)->GetStaticFieldID(env, LDKNetwork_class, "LDKNetwork_Regtest", "Lorg/ldk/enums/LDKNetwork;");
278 DO_ASSERT(LDKNetwork_LDKNetwork_Regtest != NULL);
280 static inline jclass LDKNetwork_to_java(JNIEnv *env, LDKNetwork val) {
282 case LDKNetwork_Bitcoin:
283 return (*env)->GetStaticObjectField(env, LDKNetwork_class, LDKNetwork_LDKNetwork_Bitcoin);
284 case LDKNetwork_Testnet:
285 return (*env)->GetStaticObjectField(env, LDKNetwork_class, LDKNetwork_LDKNetwork_Testnet);
286 case LDKNetwork_Regtest:
287 return (*env)->GetStaticObjectField(env, LDKNetwork_class, LDKNetwork_LDKNetwork_Regtest);
292 static inline LDKSecp256k1Error LDKSecp256k1Error_from_java(JNIEnv *env, jclass val) {
293 switch ((*env)->CallIntMethod(env, val, ordinal_meth)) {
294 case 0: return LDKSecp256k1Error_IncorrectSignature;
295 case 1: return LDKSecp256k1Error_InvalidMessage;
296 case 2: return LDKSecp256k1Error_InvalidPublicKey;
297 case 3: return LDKSecp256k1Error_InvalidSignature;
298 case 4: return LDKSecp256k1Error_InvalidSecretKey;
299 case 5: return LDKSecp256k1Error_InvalidRecoveryId;
300 case 6: return LDKSecp256k1Error_InvalidTweak;
301 case 7: return LDKSecp256k1Error_NotEnoughMemory;
302 case 8: return LDKSecp256k1Error_CallbackPanicked;
306 static jclass LDKSecp256k1Error_class = NULL;
307 static jfieldID LDKSecp256k1Error_LDKSecp256k1Error_IncorrectSignature = NULL;
308 static jfieldID LDKSecp256k1Error_LDKSecp256k1Error_InvalidMessage = NULL;
309 static jfieldID LDKSecp256k1Error_LDKSecp256k1Error_InvalidPublicKey = NULL;
310 static jfieldID LDKSecp256k1Error_LDKSecp256k1Error_InvalidSignature = NULL;
311 static jfieldID LDKSecp256k1Error_LDKSecp256k1Error_InvalidSecretKey = NULL;
312 static jfieldID LDKSecp256k1Error_LDKSecp256k1Error_InvalidRecoveryId = NULL;
313 static jfieldID LDKSecp256k1Error_LDKSecp256k1Error_InvalidTweak = NULL;
314 static jfieldID LDKSecp256k1Error_LDKSecp256k1Error_NotEnoughMemory = NULL;
315 static jfieldID LDKSecp256k1Error_LDKSecp256k1Error_CallbackPanicked = NULL;
316 JNIEXPORT void JNICALL Java_org_ldk_enums_LDKSecp256k1Error_init (JNIEnv * env, jclass clz) {
317 LDKSecp256k1Error_class = (*env)->NewGlobalRef(env, clz);
318 DO_ASSERT(LDKSecp256k1Error_class != NULL);
319 LDKSecp256k1Error_LDKSecp256k1Error_IncorrectSignature = (*env)->GetStaticFieldID(env, LDKSecp256k1Error_class, "LDKSecp256k1Error_IncorrectSignature", "Lorg/ldk/enums/LDKSecp256k1Error;");
320 DO_ASSERT(LDKSecp256k1Error_LDKSecp256k1Error_IncorrectSignature != NULL);
321 LDKSecp256k1Error_LDKSecp256k1Error_InvalidMessage = (*env)->GetStaticFieldID(env, LDKSecp256k1Error_class, "LDKSecp256k1Error_InvalidMessage", "Lorg/ldk/enums/LDKSecp256k1Error;");
322 DO_ASSERT(LDKSecp256k1Error_LDKSecp256k1Error_InvalidMessage != NULL);
323 LDKSecp256k1Error_LDKSecp256k1Error_InvalidPublicKey = (*env)->GetStaticFieldID(env, LDKSecp256k1Error_class, "LDKSecp256k1Error_InvalidPublicKey", "Lorg/ldk/enums/LDKSecp256k1Error;");
324 DO_ASSERT(LDKSecp256k1Error_LDKSecp256k1Error_InvalidPublicKey != NULL);
325 LDKSecp256k1Error_LDKSecp256k1Error_InvalidSignature = (*env)->GetStaticFieldID(env, LDKSecp256k1Error_class, "LDKSecp256k1Error_InvalidSignature", "Lorg/ldk/enums/LDKSecp256k1Error;");
326 DO_ASSERT(LDKSecp256k1Error_LDKSecp256k1Error_InvalidSignature != NULL);
327 LDKSecp256k1Error_LDKSecp256k1Error_InvalidSecretKey = (*env)->GetStaticFieldID(env, LDKSecp256k1Error_class, "LDKSecp256k1Error_InvalidSecretKey", "Lorg/ldk/enums/LDKSecp256k1Error;");
328 DO_ASSERT(LDKSecp256k1Error_LDKSecp256k1Error_InvalidSecretKey != NULL);
329 LDKSecp256k1Error_LDKSecp256k1Error_InvalidRecoveryId = (*env)->GetStaticFieldID(env, LDKSecp256k1Error_class, "LDKSecp256k1Error_InvalidRecoveryId", "Lorg/ldk/enums/LDKSecp256k1Error;");
330 DO_ASSERT(LDKSecp256k1Error_LDKSecp256k1Error_InvalidRecoveryId != NULL);
331 LDKSecp256k1Error_LDKSecp256k1Error_InvalidTweak = (*env)->GetStaticFieldID(env, LDKSecp256k1Error_class, "LDKSecp256k1Error_InvalidTweak", "Lorg/ldk/enums/LDKSecp256k1Error;");
332 DO_ASSERT(LDKSecp256k1Error_LDKSecp256k1Error_InvalidTweak != NULL);
333 LDKSecp256k1Error_LDKSecp256k1Error_NotEnoughMemory = (*env)->GetStaticFieldID(env, LDKSecp256k1Error_class, "LDKSecp256k1Error_NotEnoughMemory", "Lorg/ldk/enums/LDKSecp256k1Error;");
334 DO_ASSERT(LDKSecp256k1Error_LDKSecp256k1Error_NotEnoughMemory != NULL);
335 LDKSecp256k1Error_LDKSecp256k1Error_CallbackPanicked = (*env)->GetStaticFieldID(env, LDKSecp256k1Error_class, "LDKSecp256k1Error_CallbackPanicked", "Lorg/ldk/enums/LDKSecp256k1Error;");
336 DO_ASSERT(LDKSecp256k1Error_LDKSecp256k1Error_CallbackPanicked != NULL);
338 static inline jclass LDKSecp256k1Error_to_java(JNIEnv *env, LDKSecp256k1Error val) {
340 case LDKSecp256k1Error_IncorrectSignature:
341 return (*env)->GetStaticObjectField(env, LDKSecp256k1Error_class, LDKSecp256k1Error_LDKSecp256k1Error_IncorrectSignature);
342 case LDKSecp256k1Error_InvalidMessage:
343 return (*env)->GetStaticObjectField(env, LDKSecp256k1Error_class, LDKSecp256k1Error_LDKSecp256k1Error_InvalidMessage);
344 case LDKSecp256k1Error_InvalidPublicKey:
345 return (*env)->GetStaticObjectField(env, LDKSecp256k1Error_class, LDKSecp256k1Error_LDKSecp256k1Error_InvalidPublicKey);
346 case LDKSecp256k1Error_InvalidSignature:
347 return (*env)->GetStaticObjectField(env, LDKSecp256k1Error_class, LDKSecp256k1Error_LDKSecp256k1Error_InvalidSignature);
348 case LDKSecp256k1Error_InvalidSecretKey:
349 return (*env)->GetStaticObjectField(env, LDKSecp256k1Error_class, LDKSecp256k1Error_LDKSecp256k1Error_InvalidSecretKey);
350 case LDKSecp256k1Error_InvalidRecoveryId:
351 return (*env)->GetStaticObjectField(env, LDKSecp256k1Error_class, LDKSecp256k1Error_LDKSecp256k1Error_InvalidRecoveryId);
352 case LDKSecp256k1Error_InvalidTweak:
353 return (*env)->GetStaticObjectField(env, LDKSecp256k1Error_class, LDKSecp256k1Error_LDKSecp256k1Error_InvalidTweak);
354 case LDKSecp256k1Error_NotEnoughMemory:
355 return (*env)->GetStaticObjectField(env, LDKSecp256k1Error_class, LDKSecp256k1Error_LDKSecp256k1Error_NotEnoughMemory);
356 case LDKSecp256k1Error_CallbackPanicked:
357 return (*env)->GetStaticObjectField(env, LDKSecp256k1Error_class, LDKSecp256k1Error_LDKSecp256k1Error_CallbackPanicked);
362 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1u8_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
363 LDKCVecTempl_u8 *vec = (LDKCVecTempl_u8*)ptr;
364 return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(uint8_t));
366 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneChannelMonitorUpdateErrZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
367 return ((LDKCResult_NoneChannelMonitorUpdateErrZ*)arg)->result_ok;
369 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneChannelMonitorUpdateErrZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
370 if (((LDKCResult_NoneChannelMonitorUpdateErrZ*)arg)->result_ok) {
371 return (long)((LDKCResult_NoneChannelMonitorUpdateErrZ*)arg)->contents.result;
373 return (long)((LDKCResult_NoneChannelMonitorUpdateErrZ*)arg)->contents.err;
376 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKMonitorUpdateError_1optional_1none (JNIEnv * env, jclass _a) {
377 LDKMonitorUpdateError *ret = MALLOC(sizeof(LDKMonitorUpdateError), "LDKMonitorUpdateError");
381 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneMonitorUpdateErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
382 return ((LDKCResult_NoneMonitorUpdateErrorZ*)arg)->result_ok;
384 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneMonitorUpdateErrorZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
385 if (((LDKCResult_NoneMonitorUpdateErrorZ*)arg)->result_ok) {
386 return (long)((LDKCResult_NoneMonitorUpdateErrorZ*)arg)->contents.result;
388 return (long)((LDKCResult_NoneMonitorUpdateErrorZ*)arg)->contents.err;
391 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKOutPoint_1optional_1none (JNIEnv * env, jclass _a) {
392 LDKOutPoint *ret = MALLOC(sizeof(LDKOutPoint), "LDKOutPoint");
396 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1TxOut_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
397 LDKCVecTempl_TxOut *vec = (LDKCVecTempl_TxOut*)ptr;
398 return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKTxOut));
400 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1Signature_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
401 LDKCVecTempl_Signature *vec = (LDKCVecTempl_Signature*)ptr;
402 return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKSignature));
404 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
405 return ((LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)arg)->result_ok;
407 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
408 if (((LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)arg)->result_ok) {
409 return (long)((LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)arg)->contents.result;
411 return (long)((LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)arg)->contents.err;
414 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SignatureNoneZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
415 return ((LDKCResult_SignatureNoneZ*)arg)->result_ok;
417 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SignatureNoneZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
418 if (((LDKCResult_SignatureNoneZ*)arg)->result_ok) {
419 return (long)((LDKCResult_SignatureNoneZ*)arg)->contents.result;
421 return (long)((LDKCResult_SignatureNoneZ*)arg)->contents.err;
424 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1SignatureZNoneZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
425 return ((LDKCResult_CVec_SignatureZNoneZ*)arg)->result_ok;
427 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1SignatureZNoneZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
428 if (((LDKCResult_CVec_SignatureZNoneZ*)arg)->result_ok) {
429 return (long)((LDKCResult_CVec_SignatureZNoneZ*)arg)->contents.result;
431 return (long)((LDKCResult_CVec_SignatureZNoneZ*)arg)->contents.err;
434 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneAPIErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
435 return ((LDKCResult_NoneAPIErrorZ*)arg)->result_ok;
437 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneAPIErrorZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
438 if (((LDKCResult_NoneAPIErrorZ*)arg)->result_ok) {
439 return (long)((LDKCResult_NoneAPIErrorZ*)arg)->contents.result;
441 return (long)((LDKCResult_NoneAPIErrorZ*)arg)->contents.err;
444 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKPaymentSendFailure_1optional_1none (JNIEnv * env, jclass _a) {
445 LDKPaymentSendFailure *ret = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
449 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePaymentSendFailureZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
450 return ((LDKCResult_NonePaymentSendFailureZ*)arg)->result_ok;
452 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePaymentSendFailureZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
453 if (((LDKCResult_NonePaymentSendFailureZ*)arg)->result_ok) {
454 return (long)((LDKCResult_NonePaymentSendFailureZ*)arg)->contents.result;
456 return (long)((LDKCResult_NonePaymentSendFailureZ*)arg)->contents.err;
459 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelAnnouncement_1optional_1none (JNIEnv * env, jclass _a) {
460 LDKChannelAnnouncement *ret = MALLOC(sizeof(LDKChannelAnnouncement), "LDKChannelAnnouncement");
464 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelUpdate_1optional_1none (JNIEnv * env, jclass _a) {
465 LDKChannelUpdate *ret = MALLOC(sizeof(LDKChannelUpdate), "LDKChannelUpdate");
469 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKPeerHandleError_1optional_1none (JNIEnv * env, jclass _a) {
470 LDKPeerHandleError *ret = MALLOC(sizeof(LDKPeerHandleError), "LDKPeerHandleError");
474 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePeerHandleErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
475 return ((LDKCResult_NonePeerHandleErrorZ*)arg)->result_ok;
477 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePeerHandleErrorZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
478 if (((LDKCResult_NonePeerHandleErrorZ*)arg)->result_ok) {
479 return (long)((LDKCResult_NonePeerHandleErrorZ*)arg)->contents.result;
481 return (long)((LDKCResult_NonePeerHandleErrorZ*)arg)->contents.err;
484 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKHTLCOutputInCommitment_1optional_1none (JNIEnv * env, jclass _a) {
485 LDKHTLCOutputInCommitment *ret = MALLOC(sizeof(LDKHTLCOutputInCommitment), "LDKHTLCOutputInCommitment");
489 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1SpendableOutputDescriptor_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
490 LDKCVecTempl_SpendableOutputDescriptor *vec = (LDKCVecTempl_SpendableOutputDescriptor*)ptr;
491 return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKSpendableOutputDescriptor));
493 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKAcceptChannel_1optional_1none (JNIEnv * env, jclass _a) {
494 LDKAcceptChannel *ret = MALLOC(sizeof(LDKAcceptChannel), "LDKAcceptChannel");
498 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKOpenChannel_1optional_1none (JNIEnv * env, jclass _a) {
499 LDKOpenChannel *ret = MALLOC(sizeof(LDKOpenChannel), "LDKOpenChannel");
503 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKFundingCreated_1optional_1none (JNIEnv * env, jclass _a) {
504 LDKFundingCreated *ret = MALLOC(sizeof(LDKFundingCreated), "LDKFundingCreated");
508 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKFundingSigned_1optional_1none (JNIEnv * env, jclass _a) {
509 LDKFundingSigned *ret = MALLOC(sizeof(LDKFundingSigned), "LDKFundingSigned");
513 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKFundingLocked_1optional_1none (JNIEnv * env, jclass _a) {
514 LDKFundingLocked *ret = MALLOC(sizeof(LDKFundingLocked), "LDKFundingLocked");
518 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKAnnouncementSignatures_1optional_1none (JNIEnv * env, jclass _a) {
519 LDKAnnouncementSignatures *ret = MALLOC(sizeof(LDKAnnouncementSignatures), "LDKAnnouncementSignatures");
523 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCommitmentUpdate_1optional_1none (JNIEnv * env, jclass _a) {
524 LDKCommitmentUpdate *ret = MALLOC(sizeof(LDKCommitmentUpdate), "LDKCommitmentUpdate");
528 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKRevokeAndACK_1optional_1none (JNIEnv * env, jclass _a) {
529 LDKRevokeAndACK *ret = MALLOC(sizeof(LDKRevokeAndACK), "LDKRevokeAndACK");
533 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKClosingSigned_1optional_1none (JNIEnv * env, jclass _a) {
534 LDKClosingSigned *ret = MALLOC(sizeof(LDKClosingSigned), "LDKClosingSigned");
538 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKShutdown_1optional_1none (JNIEnv * env, jclass _a) {
539 LDKShutdown *ret = MALLOC(sizeof(LDKShutdown), "LDKShutdown");
543 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelReestablish_1optional_1none (JNIEnv * env, jclass _a) {
544 LDKChannelReestablish *ret = MALLOC(sizeof(LDKChannelReestablish), "LDKChannelReestablish");
548 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKNodeAnnouncement_1optional_1none (JNIEnv * env, jclass _a) {
549 LDKNodeAnnouncement *ret = MALLOC(sizeof(LDKNodeAnnouncement), "LDKNodeAnnouncement");
553 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKErrorMessage_1optional_1none (JNIEnv * env, jclass _a) {
554 LDKErrorMessage *ret = MALLOC(sizeof(LDKErrorMessage), "LDKErrorMessage");
558 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1MessageSendEvent_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
559 LDKCVecTempl_MessageSendEvent *vec = (LDKCVecTempl_MessageSendEvent*)ptr;
560 return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKMessageSendEvent));
562 typedef struct LDKMessageSendEventsProvider_JCalls {
563 atomic_size_t refcnt;
566 jmethodID get_and_clear_pending_msg_events_meth;
567 } LDKMessageSendEventsProvider_JCalls;
568 LDKCVec_MessageSendEventZ get_and_clear_pending_msg_events_jcall(const void* this_arg) {
569 LDKMessageSendEventsProvider_JCalls *j_calls = (LDKMessageSendEventsProvider_JCalls*) this_arg;
571 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
572 LDKCVec_MessageSendEventZ* ret = (LDKCVec_MessageSendEventZ*)(*env)->CallLongMethod(env, j_calls->o, j_calls->get_and_clear_pending_msg_events_meth);
573 LDKCVec_MessageSendEventZ res = *ret;
577 static void LDKMessageSendEventsProvider_JCalls_free(void* this_arg) {
578 LDKMessageSendEventsProvider_JCalls *j_calls = (LDKMessageSendEventsProvider_JCalls*) this_arg;
579 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
581 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
582 (*env)->DeleteGlobalRef(env, j_calls->o);
586 static void* LDKMessageSendEventsProvider_JCalls_clone(const void* this_arg) {
587 LDKMessageSendEventsProvider_JCalls *j_calls = (LDKMessageSendEventsProvider_JCalls*) this_arg;
588 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
589 return (void*) this_arg;
591 static inline LDKMessageSendEventsProvider LDKMessageSendEventsProvider_init (JNIEnv * env, jclass _a, jobject o) {
592 jclass c = (*env)->GetObjectClass(env, o);
593 DO_ASSERT(c != NULL);
594 LDKMessageSendEventsProvider_JCalls *calls = MALLOC(sizeof(LDKMessageSendEventsProvider_JCalls), "LDKMessageSendEventsProvider_JCalls");
595 atomic_init(&calls->refcnt, 1);
596 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
597 calls->o = (*env)->NewGlobalRef(env, o);
598 calls->get_and_clear_pending_msg_events_meth = (*env)->GetMethodID(env, c, "get_and_clear_pending_msg_events", "()J");
599 DO_ASSERT(calls->get_and_clear_pending_msg_events_meth != NULL);
601 LDKMessageSendEventsProvider ret = {
602 .this_arg = (void*) calls,
603 .get_and_clear_pending_msg_events = get_and_clear_pending_msg_events_jcall,
604 .free = LDKMessageSendEventsProvider_JCalls_free,
608 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEventsProvider_1new (JNIEnv * env, jclass _a, jobject o) {
609 LDKMessageSendEventsProvider *res_ptr = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
610 *res_ptr = LDKMessageSendEventsProvider_init(env, _a, o);
611 return (long)res_ptr;
613 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEventsProvider_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
614 return ((LDKMessageSendEventsProvider_JCalls*)val)->o;
616 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEventsProvider_1call_1get_1and_1clear_1pending_1msg_1events(JNIEnv * _env, jclass _b, jlong arg) {
617 LDKMessageSendEventsProvider* arg_conv = (LDKMessageSendEventsProvider*)arg;
618 LDKCVec_MessageSendEventZ* ret = MALLOC(sizeof(LDKCVec_MessageSendEventZ), "LDKCVec_MessageSendEventZ");
619 *ret = (arg_conv->get_and_clear_pending_msg_events)(arg_conv->this_arg);
623 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1Event_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
624 LDKCVecTempl_Event *vec = (LDKCVecTempl_Event*)ptr;
625 return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKEvent));
627 typedef struct LDKEventsProvider_JCalls {
628 atomic_size_t refcnt;
631 jmethodID get_and_clear_pending_events_meth;
632 } LDKEventsProvider_JCalls;
633 LDKCVec_EventZ get_and_clear_pending_events_jcall(const void* this_arg) {
634 LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) this_arg;
636 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
637 LDKCVec_EventZ* ret = (LDKCVec_EventZ*)(*env)->CallLongMethod(env, j_calls->o, j_calls->get_and_clear_pending_events_meth);
638 LDKCVec_EventZ res = *ret;
642 static void LDKEventsProvider_JCalls_free(void* this_arg) {
643 LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) this_arg;
644 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
646 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
647 (*env)->DeleteGlobalRef(env, j_calls->o);
651 static void* LDKEventsProvider_JCalls_clone(const void* this_arg) {
652 LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) this_arg;
653 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
654 return (void*) this_arg;
656 static inline LDKEventsProvider LDKEventsProvider_init (JNIEnv * env, jclass _a, jobject o) {
657 jclass c = (*env)->GetObjectClass(env, o);
658 DO_ASSERT(c != NULL);
659 LDKEventsProvider_JCalls *calls = MALLOC(sizeof(LDKEventsProvider_JCalls), "LDKEventsProvider_JCalls");
660 atomic_init(&calls->refcnt, 1);
661 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
662 calls->o = (*env)->NewGlobalRef(env, o);
663 calls->get_and_clear_pending_events_meth = (*env)->GetMethodID(env, c, "get_and_clear_pending_events", "()J");
664 DO_ASSERT(calls->get_and_clear_pending_events_meth != NULL);
666 LDKEventsProvider ret = {
667 .this_arg = (void*) calls,
668 .get_and_clear_pending_events = get_and_clear_pending_events_jcall,
669 .free = LDKEventsProvider_JCalls_free,
673 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKEventsProvider_1new (JNIEnv * env, jclass _a, jobject o) {
674 LDKEventsProvider *res_ptr = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider");
675 *res_ptr = LDKEventsProvider_init(env, _a, o);
676 return (long)res_ptr;
678 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEventsProvider_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
679 return ((LDKEventsProvider_JCalls*)val)->o;
681 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKEventsProvider_1call_1get_1and_1clear_1pending_1events(JNIEnv * _env, jclass _b, jlong arg) {
682 LDKEventsProvider* arg_conv = (LDKEventsProvider*)arg;
683 LDKCVec_EventZ* ret = MALLOC(sizeof(LDKCVec_EventZ), "LDKCVec_EventZ");
684 *ret = (arg_conv->get_and_clear_pending_events)(arg_conv->this_arg);
688 typedef struct LDKLogger_JCalls {
689 atomic_size_t refcnt;
694 void log_jcall(const void* this_arg, const char *record) {
695 LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) this_arg;
697 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
698 jstring record_conv = (*env)->NewStringUTF(env, record);
699 return (*env)->CallVoidMethod(env, j_calls->o, j_calls->log_meth, record_conv);
701 static void LDKLogger_JCalls_free(void* this_arg) {
702 LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) this_arg;
703 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
705 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
706 (*env)->DeleteGlobalRef(env, j_calls->o);
710 static void* LDKLogger_JCalls_clone(const void* this_arg) {
711 LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) this_arg;
712 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
713 return (void*) this_arg;
715 static inline LDKLogger LDKLogger_init (JNIEnv * env, jclass _a, jobject o) {
716 jclass c = (*env)->GetObjectClass(env, o);
717 DO_ASSERT(c != NULL);
718 LDKLogger_JCalls *calls = MALLOC(sizeof(LDKLogger_JCalls), "LDKLogger_JCalls");
719 atomic_init(&calls->refcnt, 1);
720 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
721 calls->o = (*env)->NewGlobalRef(env, o);
722 calls->log_meth = (*env)->GetMethodID(env, c, "log", "(Ljava/lang/String;)V");
723 DO_ASSERT(calls->log_meth != NULL);
726 .this_arg = (void*) calls,
728 .free = LDKLogger_JCalls_free,
732 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKLogger_1new (JNIEnv * env, jclass _a, jobject o) {
733 LDKLogger *res_ptr = MALLOC(sizeof(LDKLogger), "LDKLogger");
734 *res_ptr = LDKLogger_init(env, _a, o);
735 return (long)res_ptr;
737 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKLogger_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
738 return ((LDKLogger_JCalls*)val)->o;
740 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelHandshakeConfig_1optional_1none (JNIEnv * env, jclass _a) {
741 LDKChannelHandshakeConfig *ret = MALLOC(sizeof(LDKChannelHandshakeConfig), "LDKChannelHandshakeConfig");
745 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelHandshakeLimits_1optional_1none (JNIEnv * env, jclass _a) {
746 LDKChannelHandshakeLimits *ret = MALLOC(sizeof(LDKChannelHandshakeLimits), "LDKChannelHandshakeLimits");
750 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelConfig_1optional_1none (JNIEnv * env, jclass _a) {
751 LDKChannelConfig *ret = MALLOC(sizeof(LDKChannelConfig), "LDKChannelConfig");
755 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKUserConfig_1optional_1none (JNIEnv * env, jclass _a) {
756 LDKUserConfig *ret = MALLOC(sizeof(LDKUserConfig), "LDKUserConfig");
760 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxOutAccessErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
761 return ((LDKCResult_TxOutAccessErrorZ*)arg)->result_ok;
763 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxOutAccessErrorZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
764 if (((LDKCResult_TxOutAccessErrorZ*)arg)->result_ok) {
765 return (long)((LDKCResult_TxOutAccessErrorZ*)arg)->contents.result;
767 return (long)((LDKCResult_TxOutAccessErrorZ*)arg)->contents.err;
770 typedef struct LDKAccess_JCalls {
771 atomic_size_t refcnt;
774 jmethodID get_utxo_meth;
776 LDKCResult_TxOutAccessErrorZ get_utxo_jcall(const void* this_arg, const uint8_t (*genesis_hash)[32], uint64_t short_channel_id) {
777 LDKAccess_JCalls *j_calls = (LDKAccess_JCalls*) this_arg;
779 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
780 jbyteArray genesis_hash_arr = (*env)->NewByteArray(env, 32);
781 (*env)->SetByteArrayRegion(env, genesis_hash_arr, 0, 32, *genesis_hash);
782 LDKCResult_TxOutAccessErrorZ* ret = (LDKCResult_TxOutAccessErrorZ*)(*env)->CallLongMethod(env, j_calls->o, j_calls->get_utxo_meth, genesis_hash_arr, short_channel_id);
783 LDKCResult_TxOutAccessErrorZ res = *ret;
787 static void LDKAccess_JCalls_free(void* this_arg) {
788 LDKAccess_JCalls *j_calls = (LDKAccess_JCalls*) this_arg;
789 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
791 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
792 (*env)->DeleteGlobalRef(env, j_calls->o);
796 static void* LDKAccess_JCalls_clone(const void* this_arg) {
797 LDKAccess_JCalls *j_calls = (LDKAccess_JCalls*) this_arg;
798 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
799 return (void*) this_arg;
801 static inline LDKAccess LDKAccess_init (JNIEnv * env, jclass _a, jobject o) {
802 jclass c = (*env)->GetObjectClass(env, o);
803 DO_ASSERT(c != NULL);
804 LDKAccess_JCalls *calls = MALLOC(sizeof(LDKAccess_JCalls), "LDKAccess_JCalls");
805 atomic_init(&calls->refcnt, 1);
806 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
807 calls->o = (*env)->NewGlobalRef(env, o);
808 calls->get_utxo_meth = (*env)->GetMethodID(env, c, "get_utxo", "([BJ)J");
809 DO_ASSERT(calls->get_utxo_meth != NULL);
812 .this_arg = (void*) calls,
813 .get_utxo = get_utxo_jcall,
814 .free = LDKAccess_JCalls_free,
818 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKAccess_1new (JNIEnv * env, jclass _a, jobject o) {
819 LDKAccess *res_ptr = MALLOC(sizeof(LDKAccess), "LDKAccess");
820 *res_ptr = LDKAccess_init(env, _a, o);
821 return (long)res_ptr;
823 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKAccess_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
824 return ((LDKAccess_JCalls*)val)->o;
826 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKAccess_1call_1get_1utxo(JNIEnv * _env, jclass _b, jlong arg, jbyteArray genesis_hash, jlong short_channel_id) {
827 LDKAccess* arg_conv = (LDKAccess*)arg;
828 unsigned char genesis_hash_arr[32];
829 (*_env)->GetByteArrayRegion (_env, genesis_hash, 0, 32, genesis_hash_arr);
830 unsigned char (*genesis_hash_ref)[32] = &genesis_hash_arr;
831 LDKCResult_TxOutAccessErrorZ* ret = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ");
832 *ret = (arg_conv->get_utxo)(arg_conv->this_arg, genesis_hash_ref, short_channel_id);
836 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelPublicKeys_1optional_1none (JNIEnv * env, jclass _a) {
837 LDKChannelPublicKeys *ret = MALLOC(sizeof(LDKChannelPublicKeys), "LDKChannelPublicKeys");
841 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKPreCalculatedTxCreationKeys_1optional_1none (JNIEnv * env, jclass _a) {
842 LDKPreCalculatedTxCreationKeys *ret = MALLOC(sizeof(LDKPreCalculatedTxCreationKeys), "LDKPreCalculatedTxCreationKeys");
846 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1HTLCOutputInCommitment_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
847 LDKCVecTempl_HTLCOutputInCommitment *vec = (LDKCVecTempl_HTLCOutputInCommitment*)ptr;
848 return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKHTLCOutputInCommitment));
850 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKHolderCommitmentTransaction_1optional_1none (JNIEnv * env, jclass _a) {
851 LDKHolderCommitmentTransaction *ret = MALLOC(sizeof(LDKHolderCommitmentTransaction), "LDKHolderCommitmentTransaction");
855 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKUnsignedChannelAnnouncement_1optional_1none (JNIEnv * env, jclass _a) {
856 LDKUnsignedChannelAnnouncement *ret = MALLOC(sizeof(LDKUnsignedChannelAnnouncement), "LDKUnsignedChannelAnnouncement");
860 typedef struct LDKChannelKeys_JCalls {
861 atomic_size_t refcnt;
864 jmethodID get_per_commitment_point_meth;
865 jmethodID release_commitment_secret_meth;
866 jmethodID key_derivation_params_meth;
867 jmethodID sign_counterparty_commitment_meth;
868 jmethodID sign_holder_commitment_meth;
869 jmethodID sign_holder_commitment_htlc_transactions_meth;
870 jmethodID sign_justice_transaction_meth;
871 jmethodID sign_counterparty_htlc_transaction_meth;
872 jmethodID sign_closing_transaction_meth;
873 jmethodID sign_channel_announcement_meth;
874 jmethodID on_accept_meth;
875 } LDKChannelKeys_JCalls;
876 LDKPublicKey get_per_commitment_point_jcall(const void* this_arg, uint64_t idx) {
877 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
879 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
880 LDKPublicKey* ret = (LDKPublicKey*)(*env)->CallLongMethod(env, j_calls->o, j_calls->get_per_commitment_point_meth, idx);
881 LDKPublicKey res = *ret;
885 LDKThirtyTwoBytes release_commitment_secret_jcall(const void* this_arg, uint64_t idx) {
886 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
888 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
889 LDKThirtyTwoBytes* ret = (LDKThirtyTwoBytes*)(*env)->CallLongMethod(env, j_calls->o, j_calls->release_commitment_secret_meth, idx);
890 LDKThirtyTwoBytes res = *ret;
894 LDKC2Tuple_u64u64Z key_derivation_params_jcall(const void* this_arg) {
895 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
897 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
898 LDKC2Tuple_u64u64Z* ret = (LDKC2Tuple_u64u64Z*)(*env)->CallLongMethod(env, j_calls->o, j_calls->key_derivation_params_meth);
899 LDKC2Tuple_u64u64Z res = *ret;
903 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_counterparty_commitment_jcall(const void* this_arg, uint32_t feerate_per_kw, LDKTransaction commitment_tx, const LDKPreCalculatedTxCreationKeys *keys, LDKCVec_HTLCOutputInCommitmentZ htlcs) {
904 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
906 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
907 long commitment_tx_ref = (long)&commitment_tx;
908 long htlcs_ref = (long)&htlcs;
909 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(*env)->CallLongMethod(env, j_calls->o, j_calls->sign_counterparty_commitment_meth, feerate_per_kw, commitment_tx_ref, keys, htlcs_ref);
910 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ res = *ret;
914 LDKCResult_SignatureNoneZ sign_holder_commitment_jcall(const void* this_arg, const LDKHolderCommitmentTransaction *holder_commitment_tx) {
915 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
917 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
918 LDKCResult_SignatureNoneZ* ret = (LDKCResult_SignatureNoneZ*)(*env)->CallLongMethod(env, j_calls->o, j_calls->sign_holder_commitment_meth, holder_commitment_tx);
919 LDKCResult_SignatureNoneZ res = *ret;
923 LDKCResult_CVec_SignatureZNoneZ sign_holder_commitment_htlc_transactions_jcall(const void* this_arg, const LDKHolderCommitmentTransaction *holder_commitment_tx) {
924 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
926 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
927 LDKCResult_CVec_SignatureZNoneZ* ret = (LDKCResult_CVec_SignatureZNoneZ*)(*env)->CallLongMethod(env, j_calls->o, j_calls->sign_holder_commitment_htlc_transactions_meth, holder_commitment_tx);
928 LDKCResult_CVec_SignatureZNoneZ res = *ret;
932 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) {
933 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
935 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
936 long justice_tx_ref = (long)&justice_tx;
937 jbyteArray per_commitment_key_arr = (*env)->NewByteArray(env, 32);
938 (*env)->SetByteArrayRegion(env, per_commitment_key_arr, 0, 32, *per_commitment_key);
939 LDKCResult_SignatureNoneZ* ret = (LDKCResult_SignatureNoneZ*)(*env)->CallLongMethod(env, j_calls->o, j_calls->sign_justice_transaction_meth, justice_tx_ref, input, amount, per_commitment_key_arr, htlc);
940 LDKCResult_SignatureNoneZ res = *ret;
944 LDKCResult_SignatureNoneZ sign_counterparty_htlc_transaction_jcall(const void* this_arg, LDKTransaction htlc_tx, uintptr_t input, uint64_t amount, LDKPublicKey per_commitment_point, const LDKHTLCOutputInCommitment *htlc) {
945 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
947 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
948 long htlc_tx_ref = (long)&htlc_tx;
949 long per_commitment_point_ref = (long)&per_commitment_point;
950 LDKCResult_SignatureNoneZ* ret = (LDKCResult_SignatureNoneZ*)(*env)->CallLongMethod(env, j_calls->o, j_calls->sign_counterparty_htlc_transaction_meth, htlc_tx_ref, input, amount, per_commitment_point_ref, htlc);
951 LDKCResult_SignatureNoneZ res = *ret;
955 LDKCResult_SignatureNoneZ sign_closing_transaction_jcall(const void* this_arg, LDKTransaction closing_tx) {
956 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
958 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
959 long closing_tx_ref = (long)&closing_tx;
960 LDKCResult_SignatureNoneZ* ret = (LDKCResult_SignatureNoneZ*)(*env)->CallLongMethod(env, j_calls->o, j_calls->sign_closing_transaction_meth, closing_tx_ref);
961 LDKCResult_SignatureNoneZ res = *ret;
965 LDKCResult_SignatureNoneZ sign_channel_announcement_jcall(const void* this_arg, const LDKUnsignedChannelAnnouncement *msg) {
966 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
968 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
969 LDKCResult_SignatureNoneZ* ret = (LDKCResult_SignatureNoneZ*)(*env)->CallLongMethod(env, j_calls->o, j_calls->sign_channel_announcement_meth, msg);
970 LDKCResult_SignatureNoneZ res = *ret;
974 void on_accept_jcall(void* this_arg, const LDKChannelPublicKeys *channel_points, uint16_t counterparty_selected_contest_delay, uint16_t holder_selected_contest_delay) {
975 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
977 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
978 return (*env)->CallVoidMethod(env, j_calls->o, j_calls->on_accept_meth, channel_points, counterparty_selected_contest_delay, holder_selected_contest_delay);
980 static void LDKChannelKeys_JCalls_free(void* this_arg) {
981 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
982 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
984 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
985 (*env)->DeleteGlobalRef(env, j_calls->o);
989 static void* LDKChannelKeys_JCalls_clone(const void* this_arg) {
990 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
991 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
992 return (void*) this_arg;
994 static inline LDKChannelKeys LDKChannelKeys_init (JNIEnv * env, jclass _a, jobject o) {
995 jclass c = (*env)->GetObjectClass(env, o);
996 DO_ASSERT(c != NULL);
997 LDKChannelKeys_JCalls *calls = MALLOC(sizeof(LDKChannelKeys_JCalls), "LDKChannelKeys_JCalls");
998 atomic_init(&calls->refcnt, 1);
999 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
1000 calls->o = (*env)->NewGlobalRef(env, o);
1001 calls->get_per_commitment_point_meth = (*env)->GetMethodID(env, c, "get_per_commitment_point", "(J)J");
1002 DO_ASSERT(calls->get_per_commitment_point_meth != NULL);
1003 calls->release_commitment_secret_meth = (*env)->GetMethodID(env, c, "release_commitment_secret", "(J)J");
1004 DO_ASSERT(calls->release_commitment_secret_meth != NULL);
1005 calls->key_derivation_params_meth = (*env)->GetMethodID(env, c, "key_derivation_params", "()J");
1006 DO_ASSERT(calls->key_derivation_params_meth != NULL);
1007 calls->sign_counterparty_commitment_meth = (*env)->GetMethodID(env, c, "sign_counterparty_commitment", "(IJJJ)J");
1008 DO_ASSERT(calls->sign_counterparty_commitment_meth != NULL);
1009 calls->sign_holder_commitment_meth = (*env)->GetMethodID(env, c, "sign_holder_commitment", "(J)J");
1010 DO_ASSERT(calls->sign_holder_commitment_meth != NULL);
1011 calls->sign_holder_commitment_htlc_transactions_meth = (*env)->GetMethodID(env, c, "sign_holder_commitment_htlc_transactions", "(J)J");
1012 DO_ASSERT(calls->sign_holder_commitment_htlc_transactions_meth != NULL);
1013 calls->sign_justice_transaction_meth = (*env)->GetMethodID(env, c, "sign_justice_transaction", "(JJJ[BJ)J");
1014 DO_ASSERT(calls->sign_justice_transaction_meth != NULL);
1015 calls->sign_counterparty_htlc_transaction_meth = (*env)->GetMethodID(env, c, "sign_counterparty_htlc_transaction", "(JJJJJ)J");
1016 DO_ASSERT(calls->sign_counterparty_htlc_transaction_meth != NULL);
1017 calls->sign_closing_transaction_meth = (*env)->GetMethodID(env, c, "sign_closing_transaction", "(J)J");
1018 DO_ASSERT(calls->sign_closing_transaction_meth != NULL);
1019 calls->sign_channel_announcement_meth = (*env)->GetMethodID(env, c, "sign_channel_announcement", "(J)J");
1020 DO_ASSERT(calls->sign_channel_announcement_meth != NULL);
1021 calls->on_accept_meth = (*env)->GetMethodID(env, c, "on_accept", "(JSS)V");
1022 DO_ASSERT(calls->on_accept_meth != NULL);
1024 LDKChannelKeys ret = {
1025 .this_arg = (void*) calls,
1026 .get_per_commitment_point = get_per_commitment_point_jcall,
1027 .release_commitment_secret = release_commitment_secret_jcall,
1028 .key_derivation_params = key_derivation_params_jcall,
1029 .sign_counterparty_commitment = sign_counterparty_commitment_jcall,
1030 .sign_holder_commitment = sign_holder_commitment_jcall,
1031 .sign_holder_commitment_htlc_transactions = sign_holder_commitment_htlc_transactions_jcall,
1032 .sign_justice_transaction = sign_justice_transaction_jcall,
1033 .sign_counterparty_htlc_transaction = sign_counterparty_htlc_transaction_jcall,
1034 .sign_closing_transaction = sign_closing_transaction_jcall,
1035 .sign_channel_announcement = sign_channel_announcement_jcall,
1036 .on_accept = on_accept_jcall,
1037 .clone = LDKChannelKeys_JCalls_clone,
1038 .free = LDKChannelKeys_JCalls_free,
1042 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKChannelKeys_1new (JNIEnv * env, jclass _a, jobject o) {
1043 LDKChannelKeys *res_ptr = MALLOC(sizeof(LDKChannelKeys), "LDKChannelKeys");
1044 *res_ptr = LDKChannelKeys_init(env, _a, o);
1045 return (long)res_ptr;
1047 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKChannelKeys_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
1048 return ((LDKChannelKeys_JCalls*)val)->o;
1050 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelKeys_1call_1get_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong arg, jlong idx) {
1051 LDKChannelKeys* arg_conv = (LDKChannelKeys*)arg;
1052 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
1053 *ret = (arg_conv->get_per_commitment_point)(arg_conv->this_arg, idx);
1057 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelKeys_1call_1release_1commitment_1secret(JNIEnv * _env, jclass _b, jlong arg, jlong idx) {
1058 LDKChannelKeys* arg_conv = (LDKChannelKeys*)arg;
1059 LDKThirtyTwoBytes* ret = MALLOC(sizeof(LDKThirtyTwoBytes), "LDKThirtyTwoBytes");
1060 *ret = (arg_conv->release_commitment_secret)(arg_conv->this_arg, idx);
1064 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelKeys_1call_1key_1derivation_1params(JNIEnv * _env, jclass _b, jlong arg) {
1065 LDKChannelKeys* arg_conv = (LDKChannelKeys*)arg;
1066 LDKC2Tuple_u64u64Z* ret = MALLOC(sizeof(LDKC2Tuple_u64u64Z), "LDKC2Tuple_u64u64Z");
1067 *ret = (arg_conv->key_derivation_params)(arg_conv->this_arg);
1071 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelKeys_1call_1sign_1counterparty_1commitment(JNIEnv * _env, jclass _b, jlong arg, jint feerate_per_kw, jlong commitment_tx, jlong keys, jlong htlcs) {
1072 LDKChannelKeys* arg_conv = (LDKChannelKeys*)arg;
1073 LDKTransaction commitment_tx_conv = *(LDKTransaction*)commitment_tx;
1074 FREE((void*)commitment_tx);
1075 LDKPreCalculatedTxCreationKeys* keys_conv = (LDKPreCalculatedTxCreationKeys*)keys;
1076 LDKCVec_HTLCOutputInCommitmentZ htlcs_conv = *(LDKCVec_HTLCOutputInCommitmentZ*)htlcs;
1078 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
1079 *ret = (arg_conv->sign_counterparty_commitment)(arg_conv->this_arg, feerate_per_kw, commitment_tx_conv, keys_conv, htlcs_conv);
1083 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelKeys_1call_1sign_1holder_1commitment(JNIEnv * _env, jclass _b, jlong arg, jlong holder_commitment_tx) {
1084 LDKChannelKeys* arg_conv = (LDKChannelKeys*)arg;
1085 LDKHolderCommitmentTransaction* holder_commitment_tx_conv = (LDKHolderCommitmentTransaction*)holder_commitment_tx;
1086 LDKCResult_SignatureNoneZ* ret = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
1087 *ret = (arg_conv->sign_holder_commitment)(arg_conv->this_arg, holder_commitment_tx_conv);
1091 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelKeys_1call_1sign_1holder_1commitment_1htlc_1transactions(JNIEnv * _env, jclass _b, jlong arg, jlong holder_commitment_tx) {
1092 LDKChannelKeys* arg_conv = (LDKChannelKeys*)arg;
1093 LDKHolderCommitmentTransaction* holder_commitment_tx_conv = (LDKHolderCommitmentTransaction*)holder_commitment_tx;
1094 LDKCResult_CVec_SignatureZNoneZ* ret = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
1095 *ret = (arg_conv->sign_holder_commitment_htlc_transactions)(arg_conv->this_arg, holder_commitment_tx_conv);
1099 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelKeys_1call_1sign_1justice_1transaction(JNIEnv * _env, jclass _b, jlong arg, jlong justice_tx, jlong input, jlong amount, jbyteArray per_commitment_key, jlong htlc) {
1100 LDKChannelKeys* arg_conv = (LDKChannelKeys*)arg;
1101 LDKTransaction justice_tx_conv = *(LDKTransaction*)justice_tx;
1102 FREE((void*)justice_tx);
1103 unsigned char per_commitment_key_arr[32];
1104 (*_env)->GetByteArrayRegion (_env, per_commitment_key, 0, 32, per_commitment_key_arr);
1105 unsigned char (*per_commitment_key_ref)[32] = &per_commitment_key_arr;
1106 LDKHTLCOutputInCommitment* htlc_conv = (LDKHTLCOutputInCommitment*)htlc;
1107 LDKCResult_SignatureNoneZ* ret = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
1108 *ret = (arg_conv->sign_justice_transaction)(arg_conv->this_arg, justice_tx_conv, input, amount, per_commitment_key_ref, htlc_conv);
1112 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelKeys_1call_1sign_1counterparty_1htlc_1transaction(JNIEnv * _env, jclass _b, jlong arg, jlong htlc_tx, jlong input, jlong amount, jlong per_commitment_point, jlong htlc) {
1113 LDKChannelKeys* arg_conv = (LDKChannelKeys*)arg;
1114 LDKTransaction htlc_tx_conv = *(LDKTransaction*)htlc_tx;
1115 FREE((void*)htlc_tx);
1116 LDKPublicKey per_commitment_point_conv = *(LDKPublicKey*)per_commitment_point;
1117 FREE((void*)per_commitment_point);
1118 LDKHTLCOutputInCommitment* htlc_conv = (LDKHTLCOutputInCommitment*)htlc;
1119 LDKCResult_SignatureNoneZ* ret = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
1120 *ret = (arg_conv->sign_counterparty_htlc_transaction)(arg_conv->this_arg, htlc_tx_conv, input, amount, per_commitment_point_conv, htlc_conv);
1124 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelKeys_1call_1sign_1closing_1transaction(JNIEnv * _env, jclass _b, jlong arg, jlong closing_tx) {
1125 LDKChannelKeys* arg_conv = (LDKChannelKeys*)arg;
1126 LDKTransaction closing_tx_conv = *(LDKTransaction*)closing_tx;
1127 FREE((void*)closing_tx);
1128 LDKCResult_SignatureNoneZ* ret = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
1129 *ret = (arg_conv->sign_closing_transaction)(arg_conv->this_arg, closing_tx_conv);
1133 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelKeys_1call_1sign_1channel_1announcement(JNIEnv * _env, jclass _b, jlong arg, jlong msg) {
1134 LDKChannelKeys* arg_conv = (LDKChannelKeys*)arg;
1135 LDKUnsignedChannelAnnouncement* msg_conv = (LDKUnsignedChannelAnnouncement*)msg;
1136 LDKCResult_SignatureNoneZ* ret = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
1137 *ret = (arg_conv->sign_channel_announcement)(arg_conv->this_arg, msg_conv);
1141 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKChannelKeys_1call_1on_1accept(JNIEnv * _env, jclass _b, jlong arg, jlong channel_points, jshort counterparty_selected_contest_delay, jshort holder_selected_contest_delay) {
1142 LDKChannelKeys* arg_conv = (LDKChannelKeys*)arg;
1143 LDKChannelPublicKeys* channel_points_conv = (LDKChannelPublicKeys*)channel_points;
1144 return (arg_conv->on_accept)(arg_conv->this_arg, channel_points_conv, counterparty_selected_contest_delay, holder_selected_contest_delay);
1147 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelMonitor_1optional_1none (JNIEnv * env, jclass _a) {
1148 LDKChannelMonitor *ret = MALLOC(sizeof(LDKChannelMonitor), "LDKChannelMonitor");
1152 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelMonitorUpdate_1optional_1none (JNIEnv * env, jclass _a) {
1153 LDKChannelMonitorUpdate *ret = MALLOC(sizeof(LDKChannelMonitorUpdate), "LDKChannelMonitorUpdate");
1157 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKMonitorEvent_1optional_1none (JNIEnv * env, jclass _a) {
1158 LDKMonitorEvent *ret = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
1162 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1MonitorEvent_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
1163 LDKCVecTempl_MonitorEvent *vec = (LDKCVecTempl_MonitorEvent*)ptr;
1164 return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKMonitorEvent));
1166 typedef struct LDKWatch_JCalls {
1167 atomic_size_t refcnt;
1170 jmethodID watch_channel_meth;
1171 jmethodID update_channel_meth;
1172 jmethodID release_pending_monitor_events_meth;
1174 LDKCResult_NoneChannelMonitorUpdateErrZ watch_channel_jcall(const void* this_arg, LDKOutPoint funding_txo, LDKChannelMonitor monitor) {
1175 LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
1177 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1178 long funding_txo_ref = (long)&funding_txo;
1179 long monitor_ref = (long)&monitor;
1180 LDKCResult_NoneChannelMonitorUpdateErrZ* ret = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(*env)->CallLongMethod(env, j_calls->o, j_calls->watch_channel_meth, funding_txo_ref, monitor_ref);
1181 LDKCResult_NoneChannelMonitorUpdateErrZ res = *ret;
1185 LDKCResult_NoneChannelMonitorUpdateErrZ update_channel_jcall(const void* this_arg, LDKOutPoint funding_txo, LDKChannelMonitorUpdate update) {
1186 LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
1188 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1189 long funding_txo_ref = (long)&funding_txo;
1190 long update_ref = (long)&update;
1191 LDKCResult_NoneChannelMonitorUpdateErrZ* ret = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(*env)->CallLongMethod(env, j_calls->o, j_calls->update_channel_meth, funding_txo_ref, update_ref);
1192 LDKCResult_NoneChannelMonitorUpdateErrZ res = *ret;
1196 LDKCVec_MonitorEventZ release_pending_monitor_events_jcall(const void* this_arg) {
1197 LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
1199 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1200 LDKCVec_MonitorEventZ* ret = (LDKCVec_MonitorEventZ*)(*env)->CallLongMethod(env, j_calls->o, j_calls->release_pending_monitor_events_meth);
1201 LDKCVec_MonitorEventZ res = *ret;
1205 static void LDKWatch_JCalls_free(void* this_arg) {
1206 LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
1207 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
1209 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1210 (*env)->DeleteGlobalRef(env, j_calls->o);
1214 static void* LDKWatch_JCalls_clone(const void* this_arg) {
1215 LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
1216 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
1217 return (void*) this_arg;
1219 static inline LDKWatch LDKWatch_init (JNIEnv * env, jclass _a, jobject o) {
1220 jclass c = (*env)->GetObjectClass(env, o);
1221 DO_ASSERT(c != NULL);
1222 LDKWatch_JCalls *calls = MALLOC(sizeof(LDKWatch_JCalls), "LDKWatch_JCalls");
1223 atomic_init(&calls->refcnt, 1);
1224 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
1225 calls->o = (*env)->NewGlobalRef(env, o);
1226 calls->watch_channel_meth = (*env)->GetMethodID(env, c, "watch_channel", "(JJ)J");
1227 DO_ASSERT(calls->watch_channel_meth != NULL);
1228 calls->update_channel_meth = (*env)->GetMethodID(env, c, "update_channel", "(JJ)J");
1229 DO_ASSERT(calls->update_channel_meth != NULL);
1230 calls->release_pending_monitor_events_meth = (*env)->GetMethodID(env, c, "release_pending_monitor_events", "()J");
1231 DO_ASSERT(calls->release_pending_monitor_events_meth != NULL);
1234 .this_arg = (void*) calls,
1235 .watch_channel = watch_channel_jcall,
1236 .update_channel = update_channel_jcall,
1237 .release_pending_monitor_events = release_pending_monitor_events_jcall,
1238 .free = LDKWatch_JCalls_free,
1242 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKWatch_1new (JNIEnv * env, jclass _a, jobject o) {
1243 LDKWatch *res_ptr = MALLOC(sizeof(LDKWatch), "LDKWatch");
1244 *res_ptr = LDKWatch_init(env, _a, o);
1245 return (long)res_ptr;
1247 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKWatch_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
1248 return ((LDKWatch_JCalls*)val)->o;
1250 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKWatch_1call_1watch_1channel(JNIEnv * _env, jclass _b, jlong arg, jlong funding_txo, jlong monitor) {
1251 LDKWatch* arg_conv = (LDKWatch*)arg;
1252 LDKOutPoint funding_txo_conv = *(LDKOutPoint*)funding_txo;
1253 FREE((void*)funding_txo);
1254 funding_txo_conv.is_owned = true;
1255 LDKChannelMonitor monitor_conv = *(LDKChannelMonitor*)monitor;
1256 FREE((void*)monitor);
1257 monitor_conv.is_owned = true;
1258 LDKCResult_NoneChannelMonitorUpdateErrZ* ret = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
1259 *ret = (arg_conv->watch_channel)(arg_conv->this_arg, funding_txo_conv, monitor_conv);
1263 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKWatch_1call_1update_1channel(JNIEnv * _env, jclass _b, jlong arg, jlong funding_txo, jlong update) {
1264 LDKWatch* arg_conv = (LDKWatch*)arg;
1265 LDKOutPoint funding_txo_conv = *(LDKOutPoint*)funding_txo;
1266 FREE((void*)funding_txo);
1267 funding_txo_conv.is_owned = true;
1268 LDKChannelMonitorUpdate update_conv = *(LDKChannelMonitorUpdate*)update;
1269 FREE((void*)update);
1270 update_conv.is_owned = true;
1271 LDKCResult_NoneChannelMonitorUpdateErrZ* ret = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
1272 *ret = (arg_conv->update_channel)(arg_conv->this_arg, funding_txo_conv, update_conv);
1276 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKWatch_1call_1release_1pending_1monitor_1events(JNIEnv * _env, jclass _b, jlong arg) {
1277 LDKWatch* arg_conv = (LDKWatch*)arg;
1278 LDKCVec_MonitorEventZ* ret = MALLOC(sizeof(LDKCVec_MonitorEventZ), "LDKCVec_MonitorEventZ");
1279 *ret = (arg_conv->release_pending_monitor_events)(arg_conv->this_arg);
1283 typedef struct LDKFilter_JCalls {
1284 atomic_size_t refcnt;
1287 jmethodID register_tx_meth;
1288 jmethodID register_output_meth;
1290 void register_tx_jcall(const void* this_arg, const uint8_t (*txid)[32], LDKu8slice script_pubkey) {
1291 LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg;
1293 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1294 jbyteArray txid_arr = (*env)->NewByteArray(env, 32);
1295 (*env)->SetByteArrayRegion(env, txid_arr, 0, 32, *txid);
1296 long script_pubkey_ref = (long)&script_pubkey;
1297 return (*env)->CallVoidMethod(env, j_calls->o, j_calls->register_tx_meth, txid_arr, script_pubkey_ref);
1299 void register_output_jcall(const void* this_arg, const LDKOutPoint *outpoint, LDKu8slice script_pubkey) {
1300 LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg;
1302 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1303 long script_pubkey_ref = (long)&script_pubkey;
1304 return (*env)->CallVoidMethod(env, j_calls->o, j_calls->register_output_meth, outpoint, script_pubkey_ref);
1306 static void LDKFilter_JCalls_free(void* this_arg) {
1307 LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg;
1308 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
1310 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1311 (*env)->DeleteGlobalRef(env, j_calls->o);
1315 static void* LDKFilter_JCalls_clone(const void* this_arg) {
1316 LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg;
1317 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
1318 return (void*) this_arg;
1320 static inline LDKFilter LDKFilter_init (JNIEnv * env, jclass _a, jobject o) {
1321 jclass c = (*env)->GetObjectClass(env, o);
1322 DO_ASSERT(c != NULL);
1323 LDKFilter_JCalls *calls = MALLOC(sizeof(LDKFilter_JCalls), "LDKFilter_JCalls");
1324 atomic_init(&calls->refcnt, 1);
1325 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
1326 calls->o = (*env)->NewGlobalRef(env, o);
1327 calls->register_tx_meth = (*env)->GetMethodID(env, c, "register_tx", "([BJ)V");
1328 DO_ASSERT(calls->register_tx_meth != NULL);
1329 calls->register_output_meth = (*env)->GetMethodID(env, c, "register_output", "(JJ)V");
1330 DO_ASSERT(calls->register_output_meth != NULL);
1333 .this_arg = (void*) calls,
1334 .register_tx = register_tx_jcall,
1335 .register_output = register_output_jcall,
1336 .free = LDKFilter_JCalls_free,
1340 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKFilter_1new (JNIEnv * env, jclass _a, jobject o) {
1341 LDKFilter *res_ptr = MALLOC(sizeof(LDKFilter), "LDKFilter");
1342 *res_ptr = LDKFilter_init(env, _a, o);
1343 return (long)res_ptr;
1345 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKFilter_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
1346 return ((LDKFilter_JCalls*)val)->o;
1348 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKFilter_1call_1register_1tx(JNIEnv * _env, jclass _b, jlong arg, jbyteArray txid, jlong script_pubkey) {
1349 LDKFilter* arg_conv = (LDKFilter*)arg;
1350 unsigned char txid_arr[32];
1351 (*_env)->GetByteArrayRegion (_env, txid, 0, 32, txid_arr);
1352 unsigned char (*txid_ref)[32] = &txid_arr;
1353 LDKu8slice script_pubkey_conv = *(LDKu8slice*)script_pubkey;
1354 return (arg_conv->register_tx)(arg_conv->this_arg, txid_ref, script_pubkey_conv);
1357 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKFilter_1call_1register_1output(JNIEnv * _env, jclass _b, jlong arg, jlong outpoint, jlong script_pubkey) {
1358 LDKFilter* arg_conv = (LDKFilter*)arg;
1359 LDKOutPoint* outpoint_conv = (LDKOutPoint*)outpoint;
1360 LDKu8slice script_pubkey_conv = *(LDKu8slice*)script_pubkey;
1361 return (arg_conv->register_output)(arg_conv->this_arg, outpoint_conv, script_pubkey_conv);
1364 typedef struct LDKBroadcasterInterface_JCalls {
1365 atomic_size_t refcnt;
1368 jmethodID broadcast_transaction_meth;
1369 } LDKBroadcasterInterface_JCalls;
1370 void broadcast_transaction_jcall(const void* this_arg, LDKTransaction tx) {
1371 LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_JCalls*) this_arg;
1373 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1374 long tx_ref = (long)&tx;
1375 return (*env)->CallVoidMethod(env, j_calls->o, j_calls->broadcast_transaction_meth, tx_ref);
1377 static void LDKBroadcasterInterface_JCalls_free(void* this_arg) {
1378 LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_JCalls*) this_arg;
1379 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
1381 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1382 (*env)->DeleteGlobalRef(env, j_calls->o);
1386 static void* LDKBroadcasterInterface_JCalls_clone(const void* this_arg) {
1387 LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_JCalls*) this_arg;
1388 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
1389 return (void*) this_arg;
1391 static inline LDKBroadcasterInterface LDKBroadcasterInterface_init (JNIEnv * env, jclass _a, jobject o) {
1392 jclass c = (*env)->GetObjectClass(env, o);
1393 DO_ASSERT(c != NULL);
1394 LDKBroadcasterInterface_JCalls *calls = MALLOC(sizeof(LDKBroadcasterInterface_JCalls), "LDKBroadcasterInterface_JCalls");
1395 atomic_init(&calls->refcnt, 1);
1396 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
1397 calls->o = (*env)->NewGlobalRef(env, o);
1398 calls->broadcast_transaction_meth = (*env)->GetMethodID(env, c, "broadcast_transaction", "(J)V");
1399 DO_ASSERT(calls->broadcast_transaction_meth != NULL);
1401 LDKBroadcasterInterface ret = {
1402 .this_arg = (void*) calls,
1403 .broadcast_transaction = broadcast_transaction_jcall,
1404 .free = LDKBroadcasterInterface_JCalls_free,
1408 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKBroadcasterInterface_1new (JNIEnv * env, jclass _a, jobject o) {
1409 LDKBroadcasterInterface *res_ptr = MALLOC(sizeof(LDKBroadcasterInterface), "LDKBroadcasterInterface");
1410 *res_ptr = LDKBroadcasterInterface_init(env, _a, o);
1411 return (long)res_ptr;
1413 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKBroadcasterInterface_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
1414 return ((LDKBroadcasterInterface_JCalls*)val)->o;
1416 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKBroadcasterInterface_1call_1broadcast_1transaction(JNIEnv * _env, jclass _b, jlong arg, jlong tx) {
1417 LDKBroadcasterInterface* arg_conv = (LDKBroadcasterInterface*)arg;
1418 LDKTransaction tx_conv = *(LDKTransaction*)tx;
1420 return (arg_conv->broadcast_transaction)(arg_conv->this_arg, tx_conv);
1423 typedef struct LDKFeeEstimator_JCalls {
1424 atomic_size_t refcnt;
1427 jmethodID get_est_sat_per_1000_weight_meth;
1428 } LDKFeeEstimator_JCalls;
1429 uint32_t get_est_sat_per_1000_weight_jcall(const void* this_arg, LDKConfirmationTarget confirmation_target) {
1430 LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) this_arg;
1432 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1433 jclass confirmation_target_conv = LDKConfirmationTarget_to_java(env, confirmation_target);
1434 return (*env)->CallIntMethod(env, j_calls->o, j_calls->get_est_sat_per_1000_weight_meth, confirmation_target_conv);
1436 static void LDKFeeEstimator_JCalls_free(void* this_arg) {
1437 LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) this_arg;
1438 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
1440 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1441 (*env)->DeleteGlobalRef(env, j_calls->o);
1445 static void* LDKFeeEstimator_JCalls_clone(const void* this_arg) {
1446 LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) this_arg;
1447 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
1448 return (void*) this_arg;
1450 static inline LDKFeeEstimator LDKFeeEstimator_init (JNIEnv * env, jclass _a, jobject o) {
1451 jclass c = (*env)->GetObjectClass(env, o);
1452 DO_ASSERT(c != NULL);
1453 LDKFeeEstimator_JCalls *calls = MALLOC(sizeof(LDKFeeEstimator_JCalls), "LDKFeeEstimator_JCalls");
1454 atomic_init(&calls->refcnt, 1);
1455 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
1456 calls->o = (*env)->NewGlobalRef(env, o);
1457 calls->get_est_sat_per_1000_weight_meth = (*env)->GetMethodID(env, c, "get_est_sat_per_1000_weight", "(Lorg/ldk/enums/LDKConfirmationTarget;)I");
1458 DO_ASSERT(calls->get_est_sat_per_1000_weight_meth != NULL);
1460 LDKFeeEstimator ret = {
1461 .this_arg = (void*) calls,
1462 .get_est_sat_per_1000_weight = get_est_sat_per_1000_weight_jcall,
1463 .free = LDKFeeEstimator_JCalls_free,
1467 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKFeeEstimator_1new (JNIEnv * env, jclass _a, jobject o) {
1468 LDKFeeEstimator *res_ptr = MALLOC(sizeof(LDKFeeEstimator), "LDKFeeEstimator");
1469 *res_ptr = LDKFeeEstimator_init(env, _a, o);
1470 return (long)res_ptr;
1472 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKFeeEstimator_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
1473 return ((LDKFeeEstimator_JCalls*)val)->o;
1475 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_LDKFeeEstimator_1call_1get_1est_1sat_1per_11000_1weight(JNIEnv * _env, jclass _b, jlong arg, jclass confirmation_target) {
1476 LDKFeeEstimator* arg_conv = (LDKFeeEstimator*)arg;
1477 LDKConfirmationTarget confirmation_target_conv = LDKConfirmationTarget_from_java(_env, confirmation_target);
1478 return (arg_conv->get_est_sat_per_1000_weight)(arg_conv->this_arg, confirmation_target_conv);
1481 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChainMonitor_1optional_1none (JNIEnv * env, jclass _a) {
1482 LDKChainMonitor *ret = MALLOC(sizeof(LDKChainMonitor), "LDKChainMonitor");
1486 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1C2TupleTempl_1usize_1_1Transaction_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
1487 LDKCVecTempl_C2TupleTempl_usize__Transaction *vec = (LDKCVecTempl_C2TupleTempl_usize__Transaction*)ptr;
1488 return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKC2TupleTempl_usize__Transaction));
1490 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKHTLCUpdate_1optional_1none (JNIEnv * env, jclass _a) {
1491 LDKHTLCUpdate *ret = MALLOC(sizeof(LDKHTLCUpdate), "LDKHTLCUpdate");
1495 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1Transaction_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
1496 LDKCVecTempl_Transaction *vec = (LDKCVecTempl_Transaction*)ptr;
1497 return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKTransaction));
1499 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1C2TupleTempl_1ThirtyTwoBytes_1_1CVecTempl_1TxOut_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
1500 LDKCVecTempl_C2TupleTempl_ThirtyTwoBytes__CVecTempl_TxOut *vec = (LDKCVecTempl_C2TupleTempl_ThirtyTwoBytes__CVecTempl_TxOut*)ptr;
1501 return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKC2TupleTempl_ThirtyTwoBytes__CVecTempl_TxOut));
1503 typedef struct LDKKeysInterface_JCalls {
1504 atomic_size_t refcnt;
1507 jmethodID get_node_secret_meth;
1508 jmethodID get_destination_script_meth;
1509 jmethodID get_shutdown_pubkey_meth;
1510 jmethodID get_channel_keys_meth;
1511 jmethodID get_secure_random_bytes_meth;
1512 } LDKKeysInterface_JCalls;
1513 LDKSecretKey get_node_secret_jcall(const void* this_arg) {
1514 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
1516 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1517 LDKSecretKey* ret = (LDKSecretKey*)(*env)->CallLongMethod(env, j_calls->o, j_calls->get_node_secret_meth);
1518 LDKSecretKey res = *ret;
1522 LDKCVec_u8Z get_destination_script_jcall(const void* this_arg) {
1523 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
1525 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1526 LDKCVec_u8Z* ret = (LDKCVec_u8Z*)(*env)->CallLongMethod(env, j_calls->o, j_calls->get_destination_script_meth);
1527 LDKCVec_u8Z res = *ret;
1531 LDKPublicKey get_shutdown_pubkey_jcall(const void* this_arg) {
1532 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
1534 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1535 LDKPublicKey* ret = (LDKPublicKey*)(*env)->CallLongMethod(env, j_calls->o, j_calls->get_shutdown_pubkey_meth);
1536 LDKPublicKey res = *ret;
1540 LDKChannelKeys get_channel_keys_jcall(const void* this_arg, bool inbound, uint64_t channel_value_satoshis) {
1541 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
1543 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1544 LDKChannelKeys* ret = (LDKChannelKeys*)(*env)->CallLongMethod(env, j_calls->o, j_calls->get_channel_keys_meth, inbound, channel_value_satoshis);
1545 LDKChannelKeys res = *ret;
1549 LDKThirtyTwoBytes get_secure_random_bytes_jcall(const void* this_arg) {
1550 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
1552 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1553 LDKThirtyTwoBytes* ret = (LDKThirtyTwoBytes*)(*env)->CallLongMethod(env, j_calls->o, j_calls->get_secure_random_bytes_meth);
1554 LDKThirtyTwoBytes res = *ret;
1558 static void LDKKeysInterface_JCalls_free(void* this_arg) {
1559 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
1560 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
1562 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1563 (*env)->DeleteGlobalRef(env, j_calls->o);
1567 static void* LDKKeysInterface_JCalls_clone(const void* this_arg) {
1568 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
1569 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
1570 return (void*) this_arg;
1572 static inline LDKKeysInterface LDKKeysInterface_init (JNIEnv * env, jclass _a, jobject o) {
1573 jclass c = (*env)->GetObjectClass(env, o);
1574 DO_ASSERT(c != NULL);
1575 LDKKeysInterface_JCalls *calls = MALLOC(sizeof(LDKKeysInterface_JCalls), "LDKKeysInterface_JCalls");
1576 atomic_init(&calls->refcnt, 1);
1577 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
1578 calls->o = (*env)->NewGlobalRef(env, o);
1579 calls->get_node_secret_meth = (*env)->GetMethodID(env, c, "get_node_secret", "()J");
1580 DO_ASSERT(calls->get_node_secret_meth != NULL);
1581 calls->get_destination_script_meth = (*env)->GetMethodID(env, c, "get_destination_script", "()J");
1582 DO_ASSERT(calls->get_destination_script_meth != NULL);
1583 calls->get_shutdown_pubkey_meth = (*env)->GetMethodID(env, c, "get_shutdown_pubkey", "()J");
1584 DO_ASSERT(calls->get_shutdown_pubkey_meth != NULL);
1585 calls->get_channel_keys_meth = (*env)->GetMethodID(env, c, "get_channel_keys", "(ZJ)J");
1586 DO_ASSERT(calls->get_channel_keys_meth != NULL);
1587 calls->get_secure_random_bytes_meth = (*env)->GetMethodID(env, c, "get_secure_random_bytes", "()J");
1588 DO_ASSERT(calls->get_secure_random_bytes_meth != NULL);
1590 LDKKeysInterface ret = {
1591 .this_arg = (void*) calls,
1592 .get_node_secret = get_node_secret_jcall,
1593 .get_destination_script = get_destination_script_jcall,
1594 .get_shutdown_pubkey = get_shutdown_pubkey_jcall,
1595 .get_channel_keys = get_channel_keys_jcall,
1596 .get_secure_random_bytes = get_secure_random_bytes_jcall,
1597 .free = LDKKeysInterface_JCalls_free,
1601 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKKeysInterface_1new (JNIEnv * env, jclass _a, jobject o) {
1602 LDKKeysInterface *res_ptr = MALLOC(sizeof(LDKKeysInterface), "LDKKeysInterface");
1603 *res_ptr = LDKKeysInterface_init(env, _a, o);
1604 return (long)res_ptr;
1606 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKKeysInterface_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
1607 return ((LDKKeysInterface_JCalls*)val)->o;
1609 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKKeysInterface_1call_1get_1node_1secret(JNIEnv * _env, jclass _b, jlong arg) {
1610 LDKKeysInterface* arg_conv = (LDKKeysInterface*)arg;
1611 LDKSecretKey* ret = MALLOC(sizeof(LDKSecretKey), "LDKSecretKey");
1612 *ret = (arg_conv->get_node_secret)(arg_conv->this_arg);
1616 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKKeysInterface_1call_1get_1destination_1script(JNIEnv * _env, jclass _b, jlong arg) {
1617 LDKKeysInterface* arg_conv = (LDKKeysInterface*)arg;
1618 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
1619 *ret = (arg_conv->get_destination_script)(arg_conv->this_arg);
1623 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKKeysInterface_1call_1get_1shutdown_1pubkey(JNIEnv * _env, jclass _b, jlong arg) {
1624 LDKKeysInterface* arg_conv = (LDKKeysInterface*)arg;
1625 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
1626 *ret = (arg_conv->get_shutdown_pubkey)(arg_conv->this_arg);
1630 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKKeysInterface_1call_1get_1channel_1keys(JNIEnv * _env, jclass _b, jlong arg, jboolean inbound, jlong channel_value_satoshis) {
1631 LDKKeysInterface* arg_conv = (LDKKeysInterface*)arg;
1632 LDKChannelKeys* ret = MALLOC(sizeof(LDKChannelKeys), "LDKChannelKeys");
1633 *ret = (arg_conv->get_channel_keys)(arg_conv->this_arg, inbound, channel_value_satoshis);
1637 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKKeysInterface_1call_1get_1secure_1random_1bytes(JNIEnv * _env, jclass _b, jlong arg) {
1638 LDKKeysInterface* arg_conv = (LDKKeysInterface*)arg;
1639 LDKThirtyTwoBytes* ret = MALLOC(sizeof(LDKThirtyTwoBytes), "LDKThirtyTwoBytes");
1640 *ret = (arg_conv->get_secure_random_bytes)(arg_conv->this_arg);
1644 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKInMemoryChannelKeys_1optional_1none (JNIEnv * env, jclass _a) {
1645 LDKInMemoryChannelKeys *ret = MALLOC(sizeof(LDKInMemoryChannelKeys), "LDKInMemoryChannelKeys");
1649 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKKeysManager_1optional_1none (JNIEnv * env, jclass _a) {
1650 LDKKeysManager *ret = MALLOC(sizeof(LDKKeysManager), "LDKKeysManager");
1654 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelManager_1optional_1none (JNIEnv * env, jclass _a) {
1655 LDKChannelManager *ret = MALLOC(sizeof(LDKChannelManager), "LDKChannelManager");
1659 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelDetails_1optional_1none (JNIEnv * env, jclass _a) {
1660 LDKChannelDetails *ret = MALLOC(sizeof(LDKChannelDetails), "LDKChannelDetails");
1664 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKInitFeatures_1optional_1none (JNIEnv * env, jclass _a) {
1665 LDKInitFeatures *ret = MALLOC(sizeof(LDKInitFeatures), "LDKInitFeatures");
1669 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1ChannelDetails_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
1670 LDKCVecTempl_ChannelDetails *vec = (LDKCVecTempl_ChannelDetails*)ptr;
1671 return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKChannelDetails));
1673 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKRoute_1optional_1none (JNIEnv * env, jclass _a) {
1674 LDKRoute *ret = MALLOC(sizeof(LDKRoute), "LDKRoute");
1678 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1NetAddress_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
1679 LDKCVecTempl_NetAddress *vec = (LDKCVecTempl_NetAddress*)ptr;
1680 return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKNetAddress));
1682 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKUpdateAddHTLC_1optional_1none (JNIEnv * env, jclass _a) {
1683 LDKUpdateAddHTLC *ret = MALLOC(sizeof(LDKUpdateAddHTLC), "LDKUpdateAddHTLC");
1687 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKUpdateFulfillHTLC_1optional_1none (JNIEnv * env, jclass _a) {
1688 LDKUpdateFulfillHTLC *ret = MALLOC(sizeof(LDKUpdateFulfillHTLC), "LDKUpdateFulfillHTLC");
1692 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKUpdateFailHTLC_1optional_1none (JNIEnv * env, jclass _a) {
1693 LDKUpdateFailHTLC *ret = MALLOC(sizeof(LDKUpdateFailHTLC), "LDKUpdateFailHTLC");
1697 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKUpdateFailMalformedHTLC_1optional_1none (JNIEnv * env, jclass _a) {
1698 LDKUpdateFailMalformedHTLC *ret = MALLOC(sizeof(LDKUpdateFailMalformedHTLC), "LDKUpdateFailMalformedHTLC");
1702 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCommitmentSigned_1optional_1none (JNIEnv * env, jclass _a) {
1703 LDKCommitmentSigned *ret = MALLOC(sizeof(LDKCommitmentSigned), "LDKCommitmentSigned");
1707 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKUpdateFee_1optional_1none (JNIEnv * env, jclass _a) {
1708 LDKUpdateFee *ret = MALLOC(sizeof(LDKUpdateFee), "LDKUpdateFee");
1712 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKInit_1optional_1none (JNIEnv * env, jclass _a) {
1713 LDKInit *ret = MALLOC(sizeof(LDKInit), "LDKInit");
1717 typedef struct LDKChannelMessageHandler_JCalls {
1718 atomic_size_t refcnt;
1721 LDKMessageSendEventsProvider_JCalls* MessageSendEventsProvider;
1722 jmethodID handle_open_channel_meth;
1723 jmethodID handle_accept_channel_meth;
1724 jmethodID handle_funding_created_meth;
1725 jmethodID handle_funding_signed_meth;
1726 jmethodID handle_funding_locked_meth;
1727 jmethodID handle_shutdown_meth;
1728 jmethodID handle_closing_signed_meth;
1729 jmethodID handle_update_add_htlc_meth;
1730 jmethodID handle_update_fulfill_htlc_meth;
1731 jmethodID handle_update_fail_htlc_meth;
1732 jmethodID handle_update_fail_malformed_htlc_meth;
1733 jmethodID handle_commitment_signed_meth;
1734 jmethodID handle_revoke_and_ack_meth;
1735 jmethodID handle_update_fee_meth;
1736 jmethodID handle_announcement_signatures_meth;
1737 jmethodID peer_disconnected_meth;
1738 jmethodID peer_connected_meth;
1739 jmethodID handle_channel_reestablish_meth;
1740 jmethodID handle_error_meth;
1741 } LDKChannelMessageHandler_JCalls;
1742 void handle_open_channel_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKInitFeatures their_features, const LDKOpenChannel *msg) {
1743 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
1745 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1746 long their_node_id_ref = (long)&their_node_id;
1747 long their_features_ref = (long)&their_features;
1748 return (*env)->CallVoidMethod(env, j_calls->o, j_calls->handle_open_channel_meth, their_node_id_ref, their_features_ref, msg);
1750 void handle_accept_channel_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKInitFeatures their_features, const LDKAcceptChannel *msg) {
1751 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
1753 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1754 long their_node_id_ref = (long)&their_node_id;
1755 long their_features_ref = (long)&their_features;
1756 return (*env)->CallVoidMethod(env, j_calls->o, j_calls->handle_accept_channel_meth, their_node_id_ref, their_features_ref, msg);
1758 void handle_funding_created_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingCreated *msg) {
1759 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
1761 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1762 long their_node_id_ref = (long)&their_node_id;
1763 return (*env)->CallVoidMethod(env, j_calls->o, j_calls->handle_funding_created_meth, their_node_id_ref, msg);
1765 void handle_funding_signed_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingSigned *msg) {
1766 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
1768 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1769 long their_node_id_ref = (long)&their_node_id;
1770 return (*env)->CallVoidMethod(env, j_calls->o, j_calls->handle_funding_signed_meth, their_node_id_ref, msg);
1772 void handle_funding_locked_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingLocked *msg) {
1773 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
1775 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1776 long their_node_id_ref = (long)&their_node_id;
1777 return (*env)->CallVoidMethod(env, j_calls->o, j_calls->handle_funding_locked_meth, their_node_id_ref, msg);
1779 void handle_shutdown_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKShutdown *msg) {
1780 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
1782 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1783 long their_node_id_ref = (long)&their_node_id;
1784 return (*env)->CallVoidMethod(env, j_calls->o, j_calls->handle_shutdown_meth, their_node_id_ref, msg);
1786 void handle_closing_signed_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKClosingSigned *msg) {
1787 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
1789 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1790 long their_node_id_ref = (long)&their_node_id;
1791 return (*env)->CallVoidMethod(env, j_calls->o, j_calls->handle_closing_signed_meth, their_node_id_ref, msg);
1793 void handle_update_add_htlc_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateAddHTLC *msg) {
1794 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
1796 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1797 long their_node_id_ref = (long)&their_node_id;
1798 return (*env)->CallVoidMethod(env, j_calls->o, j_calls->handle_update_add_htlc_meth, their_node_id_ref, msg);
1800 void handle_update_fulfill_htlc_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFulfillHTLC *msg) {
1801 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
1803 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1804 long their_node_id_ref = (long)&their_node_id;
1805 return (*env)->CallVoidMethod(env, j_calls->o, j_calls->handle_update_fulfill_htlc_meth, their_node_id_ref, msg);
1807 void handle_update_fail_htlc_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFailHTLC *msg) {
1808 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
1810 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1811 long their_node_id_ref = (long)&their_node_id;
1812 return (*env)->CallVoidMethod(env, j_calls->o, j_calls->handle_update_fail_htlc_meth, their_node_id_ref, msg);
1814 void handle_update_fail_malformed_htlc_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFailMalformedHTLC *msg) {
1815 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
1817 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1818 long their_node_id_ref = (long)&their_node_id;
1819 return (*env)->CallVoidMethod(env, j_calls->o, j_calls->handle_update_fail_malformed_htlc_meth, their_node_id_ref, msg);
1821 void handle_commitment_signed_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKCommitmentSigned *msg) {
1822 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
1824 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1825 long their_node_id_ref = (long)&their_node_id;
1826 return (*env)->CallVoidMethod(env, j_calls->o, j_calls->handle_commitment_signed_meth, their_node_id_ref, msg);
1828 void handle_revoke_and_ack_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKRevokeAndACK *msg) {
1829 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
1831 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1832 long their_node_id_ref = (long)&their_node_id;
1833 return (*env)->CallVoidMethod(env, j_calls->o, j_calls->handle_revoke_and_ack_meth, their_node_id_ref, msg);
1835 void handle_update_fee_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFee *msg) {
1836 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
1838 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1839 long their_node_id_ref = (long)&their_node_id;
1840 return (*env)->CallVoidMethod(env, j_calls->o, j_calls->handle_update_fee_meth, their_node_id_ref, msg);
1842 void handle_announcement_signatures_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKAnnouncementSignatures *msg) {
1843 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
1845 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1846 long their_node_id_ref = (long)&their_node_id;
1847 return (*env)->CallVoidMethod(env, j_calls->o, j_calls->handle_announcement_signatures_meth, their_node_id_ref, msg);
1849 void peer_disconnected_jcall(const void* this_arg, LDKPublicKey their_node_id, bool no_connection_possible) {
1850 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
1852 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1853 long their_node_id_ref = (long)&their_node_id;
1854 return (*env)->CallVoidMethod(env, j_calls->o, j_calls->peer_disconnected_meth, their_node_id_ref, no_connection_possible);
1856 void peer_connected_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit *msg) {
1857 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
1859 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1860 long their_node_id_ref = (long)&their_node_id;
1861 return (*env)->CallVoidMethod(env, j_calls->o, j_calls->peer_connected_meth, their_node_id_ref, msg);
1863 void handle_channel_reestablish_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKChannelReestablish *msg) {
1864 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
1866 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1867 long their_node_id_ref = (long)&their_node_id;
1868 return (*env)->CallVoidMethod(env, j_calls->o, j_calls->handle_channel_reestablish_meth, their_node_id_ref, msg);
1870 void handle_error_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKErrorMessage *msg) {
1871 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
1873 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1874 long their_node_id_ref = (long)&their_node_id;
1875 return (*env)->CallVoidMethod(env, j_calls->o, j_calls->handle_error_meth, their_node_id_ref, msg);
1877 static void LDKChannelMessageHandler_JCalls_free(void* this_arg) {
1878 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
1879 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
1881 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1882 (*env)->DeleteGlobalRef(env, j_calls->o);
1886 static void* LDKChannelMessageHandler_JCalls_clone(const void* this_arg) {
1887 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
1888 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
1889 atomic_fetch_add_explicit(&j_calls->MessageSendEventsProvider->refcnt, 1, memory_order_release);
1890 return (void*) this_arg;
1892 static inline LDKChannelMessageHandler LDKChannelMessageHandler_init (JNIEnv * env, jclass _a, jobject o, jobject MessageSendEventsProvider) {
1893 jclass c = (*env)->GetObjectClass(env, o);
1894 DO_ASSERT(c != NULL);
1895 LDKChannelMessageHandler_JCalls *calls = MALLOC(sizeof(LDKChannelMessageHandler_JCalls), "LDKChannelMessageHandler_JCalls");
1896 atomic_init(&calls->refcnt, 1);
1897 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
1898 calls->o = (*env)->NewGlobalRef(env, o);
1899 calls->handle_open_channel_meth = (*env)->GetMethodID(env, c, "handle_open_channel", "(JJJ)V");
1900 DO_ASSERT(calls->handle_open_channel_meth != NULL);
1901 calls->handle_accept_channel_meth = (*env)->GetMethodID(env, c, "handle_accept_channel", "(JJJ)V");
1902 DO_ASSERT(calls->handle_accept_channel_meth != NULL);
1903 calls->handle_funding_created_meth = (*env)->GetMethodID(env, c, "handle_funding_created", "(JJ)V");
1904 DO_ASSERT(calls->handle_funding_created_meth != NULL);
1905 calls->handle_funding_signed_meth = (*env)->GetMethodID(env, c, "handle_funding_signed", "(JJ)V");
1906 DO_ASSERT(calls->handle_funding_signed_meth != NULL);
1907 calls->handle_funding_locked_meth = (*env)->GetMethodID(env, c, "handle_funding_locked", "(JJ)V");
1908 DO_ASSERT(calls->handle_funding_locked_meth != NULL);
1909 calls->handle_shutdown_meth = (*env)->GetMethodID(env, c, "handle_shutdown", "(JJ)V");
1910 DO_ASSERT(calls->handle_shutdown_meth != NULL);
1911 calls->handle_closing_signed_meth = (*env)->GetMethodID(env, c, "handle_closing_signed", "(JJ)V");
1912 DO_ASSERT(calls->handle_closing_signed_meth != NULL);
1913 calls->handle_update_add_htlc_meth = (*env)->GetMethodID(env, c, "handle_update_add_htlc", "(JJ)V");
1914 DO_ASSERT(calls->handle_update_add_htlc_meth != NULL);
1915 calls->handle_update_fulfill_htlc_meth = (*env)->GetMethodID(env, c, "handle_update_fulfill_htlc", "(JJ)V");
1916 DO_ASSERT(calls->handle_update_fulfill_htlc_meth != NULL);
1917 calls->handle_update_fail_htlc_meth = (*env)->GetMethodID(env, c, "handle_update_fail_htlc", "(JJ)V");
1918 DO_ASSERT(calls->handle_update_fail_htlc_meth != NULL);
1919 calls->handle_update_fail_malformed_htlc_meth = (*env)->GetMethodID(env, c, "handle_update_fail_malformed_htlc", "(JJ)V");
1920 DO_ASSERT(calls->handle_update_fail_malformed_htlc_meth != NULL);
1921 calls->handle_commitment_signed_meth = (*env)->GetMethodID(env, c, "handle_commitment_signed", "(JJ)V");
1922 DO_ASSERT(calls->handle_commitment_signed_meth != NULL);
1923 calls->handle_revoke_and_ack_meth = (*env)->GetMethodID(env, c, "handle_revoke_and_ack", "(JJ)V");
1924 DO_ASSERT(calls->handle_revoke_and_ack_meth != NULL);
1925 calls->handle_update_fee_meth = (*env)->GetMethodID(env, c, "handle_update_fee", "(JJ)V");
1926 DO_ASSERT(calls->handle_update_fee_meth != NULL);
1927 calls->handle_announcement_signatures_meth = (*env)->GetMethodID(env, c, "handle_announcement_signatures", "(JJ)V");
1928 DO_ASSERT(calls->handle_announcement_signatures_meth != NULL);
1929 calls->peer_disconnected_meth = (*env)->GetMethodID(env, c, "peer_disconnected", "(JZ)V");
1930 DO_ASSERT(calls->peer_disconnected_meth != NULL);
1931 calls->peer_connected_meth = (*env)->GetMethodID(env, c, "peer_connected", "(JJ)V");
1932 DO_ASSERT(calls->peer_connected_meth != NULL);
1933 calls->handle_channel_reestablish_meth = (*env)->GetMethodID(env, c, "handle_channel_reestablish", "(JJ)V");
1934 DO_ASSERT(calls->handle_channel_reestablish_meth != NULL);
1935 calls->handle_error_meth = (*env)->GetMethodID(env, c, "handle_error", "(JJ)V");
1936 DO_ASSERT(calls->handle_error_meth != NULL);
1938 LDKChannelMessageHandler ret = {
1939 .this_arg = (void*) calls,
1940 .handle_open_channel = handle_open_channel_jcall,
1941 .handle_accept_channel = handle_accept_channel_jcall,
1942 .handle_funding_created = handle_funding_created_jcall,
1943 .handle_funding_signed = handle_funding_signed_jcall,
1944 .handle_funding_locked = handle_funding_locked_jcall,
1945 .handle_shutdown = handle_shutdown_jcall,
1946 .handle_closing_signed = handle_closing_signed_jcall,
1947 .handle_update_add_htlc = handle_update_add_htlc_jcall,
1948 .handle_update_fulfill_htlc = handle_update_fulfill_htlc_jcall,
1949 .handle_update_fail_htlc = handle_update_fail_htlc_jcall,
1950 .handle_update_fail_malformed_htlc = handle_update_fail_malformed_htlc_jcall,
1951 .handle_commitment_signed = handle_commitment_signed_jcall,
1952 .handle_revoke_and_ack = handle_revoke_and_ack_jcall,
1953 .handle_update_fee = handle_update_fee_jcall,
1954 .handle_announcement_signatures = handle_announcement_signatures_jcall,
1955 .peer_disconnected = peer_disconnected_jcall,
1956 .peer_connected = peer_connected_jcall,
1957 .handle_channel_reestablish = handle_channel_reestablish_jcall,
1958 .handle_error = handle_error_jcall,
1959 .free = LDKChannelMessageHandler_JCalls_free,
1960 .MessageSendEventsProvider = LDKMessageSendEventsProvider_init(env, _a, MessageSendEventsProvider),
1962 calls->MessageSendEventsProvider = ret.MessageSendEventsProvider.this_arg;
1965 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1new (JNIEnv * env, jclass _a, jobject o, jobject MessageSendEventsProvider) {
1966 LDKChannelMessageHandler *res_ptr = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler");
1967 *res_ptr = LDKChannelMessageHandler_init(env, _a, o, MessageSendEventsProvider);
1968 return (long)res_ptr;
1970 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
1971 return ((LDKChannelMessageHandler_JCalls*)val)->o;
1973 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1call_1handle_1open_1channel(JNIEnv * _env, jclass _b, jlong arg, jlong their_node_id, jlong their_features, jlong msg) {
1974 LDKChannelMessageHandler* arg_conv = (LDKChannelMessageHandler*)arg;
1975 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
1976 FREE((void*)their_node_id);
1977 LDKInitFeatures their_features_conv = *(LDKInitFeatures*)their_features;
1978 FREE((void*)their_features);
1979 their_features_conv.is_owned = true;
1980 LDKOpenChannel* msg_conv = (LDKOpenChannel*)msg;
1981 return (arg_conv->handle_open_channel)(arg_conv->this_arg, their_node_id_conv, their_features_conv, msg_conv);
1984 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1call_1handle_1accept_1channel(JNIEnv * _env, jclass _b, jlong arg, jlong their_node_id, jlong their_features, jlong msg) {
1985 LDKChannelMessageHandler* arg_conv = (LDKChannelMessageHandler*)arg;
1986 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
1987 FREE((void*)their_node_id);
1988 LDKInitFeatures their_features_conv = *(LDKInitFeatures*)their_features;
1989 FREE((void*)their_features);
1990 their_features_conv.is_owned = true;
1991 LDKAcceptChannel* msg_conv = (LDKAcceptChannel*)msg;
1992 return (arg_conv->handle_accept_channel)(arg_conv->this_arg, their_node_id_conv, their_features_conv, msg_conv);
1995 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1call_1handle_1funding_1created(JNIEnv * _env, jclass _b, jlong arg, jlong their_node_id, jlong msg) {
1996 LDKChannelMessageHandler* arg_conv = (LDKChannelMessageHandler*)arg;
1997 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
1998 FREE((void*)their_node_id);
1999 LDKFundingCreated* msg_conv = (LDKFundingCreated*)msg;
2000 return (arg_conv->handle_funding_created)(arg_conv->this_arg, their_node_id_conv, msg_conv);
2003 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1call_1handle_1funding_1signed(JNIEnv * _env, jclass _b, jlong arg, jlong their_node_id, jlong msg) {
2004 LDKChannelMessageHandler* arg_conv = (LDKChannelMessageHandler*)arg;
2005 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
2006 FREE((void*)their_node_id);
2007 LDKFundingSigned* msg_conv = (LDKFundingSigned*)msg;
2008 return (arg_conv->handle_funding_signed)(arg_conv->this_arg, their_node_id_conv, msg_conv);
2011 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1call_1handle_1funding_1locked(JNIEnv * _env, jclass _b, jlong arg, jlong their_node_id, jlong msg) {
2012 LDKChannelMessageHandler* arg_conv = (LDKChannelMessageHandler*)arg;
2013 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
2014 FREE((void*)their_node_id);
2015 LDKFundingLocked* msg_conv = (LDKFundingLocked*)msg;
2016 return (arg_conv->handle_funding_locked)(arg_conv->this_arg, their_node_id_conv, msg_conv);
2019 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1call_1handle_1shutdown(JNIEnv * _env, jclass _b, jlong arg, jlong their_node_id, jlong msg) {
2020 LDKChannelMessageHandler* arg_conv = (LDKChannelMessageHandler*)arg;
2021 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
2022 FREE((void*)their_node_id);
2023 LDKShutdown* msg_conv = (LDKShutdown*)msg;
2024 return (arg_conv->handle_shutdown)(arg_conv->this_arg, their_node_id_conv, msg_conv);
2027 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1call_1handle_1closing_1signed(JNIEnv * _env, jclass _b, jlong arg, jlong their_node_id, jlong msg) {
2028 LDKChannelMessageHandler* arg_conv = (LDKChannelMessageHandler*)arg;
2029 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
2030 FREE((void*)their_node_id);
2031 LDKClosingSigned* msg_conv = (LDKClosingSigned*)msg;
2032 return (arg_conv->handle_closing_signed)(arg_conv->this_arg, their_node_id_conv, msg_conv);
2035 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1call_1handle_1update_1add_1htlc(JNIEnv * _env, jclass _b, jlong arg, jlong their_node_id, jlong msg) {
2036 LDKChannelMessageHandler* arg_conv = (LDKChannelMessageHandler*)arg;
2037 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
2038 FREE((void*)their_node_id);
2039 LDKUpdateAddHTLC* msg_conv = (LDKUpdateAddHTLC*)msg;
2040 return (arg_conv->handle_update_add_htlc)(arg_conv->this_arg, their_node_id_conv, msg_conv);
2043 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1call_1handle_1update_1fulfill_1htlc(JNIEnv * _env, jclass _b, jlong arg, jlong their_node_id, jlong msg) {
2044 LDKChannelMessageHandler* arg_conv = (LDKChannelMessageHandler*)arg;
2045 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
2046 FREE((void*)their_node_id);
2047 LDKUpdateFulfillHTLC* msg_conv = (LDKUpdateFulfillHTLC*)msg;
2048 return (arg_conv->handle_update_fulfill_htlc)(arg_conv->this_arg, their_node_id_conv, msg_conv);
2051 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1call_1handle_1update_1fail_1htlc(JNIEnv * _env, jclass _b, jlong arg, jlong their_node_id, jlong msg) {
2052 LDKChannelMessageHandler* arg_conv = (LDKChannelMessageHandler*)arg;
2053 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
2054 FREE((void*)their_node_id);
2055 LDKUpdateFailHTLC* msg_conv = (LDKUpdateFailHTLC*)msg;
2056 return (arg_conv->handle_update_fail_htlc)(arg_conv->this_arg, their_node_id_conv, msg_conv);
2059 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1call_1handle_1update_1fail_1malformed_1htlc(JNIEnv * _env, jclass _b, jlong arg, jlong their_node_id, jlong msg) {
2060 LDKChannelMessageHandler* arg_conv = (LDKChannelMessageHandler*)arg;
2061 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
2062 FREE((void*)their_node_id);
2063 LDKUpdateFailMalformedHTLC* msg_conv = (LDKUpdateFailMalformedHTLC*)msg;
2064 return (arg_conv->handle_update_fail_malformed_htlc)(arg_conv->this_arg, their_node_id_conv, msg_conv);
2067 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1call_1handle_1commitment_1signed(JNIEnv * _env, jclass _b, jlong arg, jlong their_node_id, jlong msg) {
2068 LDKChannelMessageHandler* arg_conv = (LDKChannelMessageHandler*)arg;
2069 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
2070 FREE((void*)their_node_id);
2071 LDKCommitmentSigned* msg_conv = (LDKCommitmentSigned*)msg;
2072 return (arg_conv->handle_commitment_signed)(arg_conv->this_arg, their_node_id_conv, msg_conv);
2075 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1call_1handle_1revoke_1and_1ack(JNIEnv * _env, jclass _b, jlong arg, jlong their_node_id, jlong msg) {
2076 LDKChannelMessageHandler* arg_conv = (LDKChannelMessageHandler*)arg;
2077 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
2078 FREE((void*)their_node_id);
2079 LDKRevokeAndACK* msg_conv = (LDKRevokeAndACK*)msg;
2080 return (arg_conv->handle_revoke_and_ack)(arg_conv->this_arg, their_node_id_conv, msg_conv);
2083 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1call_1handle_1update_1fee(JNIEnv * _env, jclass _b, jlong arg, jlong their_node_id, jlong msg) {
2084 LDKChannelMessageHandler* arg_conv = (LDKChannelMessageHandler*)arg;
2085 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
2086 FREE((void*)their_node_id);
2087 LDKUpdateFee* msg_conv = (LDKUpdateFee*)msg;
2088 return (arg_conv->handle_update_fee)(arg_conv->this_arg, their_node_id_conv, msg_conv);
2091 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1call_1handle_1announcement_1signatures(JNIEnv * _env, jclass _b, jlong arg, jlong their_node_id, jlong msg) {
2092 LDKChannelMessageHandler* arg_conv = (LDKChannelMessageHandler*)arg;
2093 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
2094 FREE((void*)their_node_id);
2095 LDKAnnouncementSignatures* msg_conv = (LDKAnnouncementSignatures*)msg;
2096 return (arg_conv->handle_announcement_signatures)(arg_conv->this_arg, their_node_id_conv, msg_conv);
2099 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1call_1peer_1disconnected(JNIEnv * _env, jclass _b, jlong arg, jlong their_node_id, jboolean no_connection_possible) {
2100 LDKChannelMessageHandler* arg_conv = (LDKChannelMessageHandler*)arg;
2101 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
2102 FREE((void*)their_node_id);
2103 return (arg_conv->peer_disconnected)(arg_conv->this_arg, their_node_id_conv, no_connection_possible);
2106 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1call_1peer_1connected(JNIEnv * _env, jclass _b, jlong arg, jlong their_node_id, jlong msg) {
2107 LDKChannelMessageHandler* arg_conv = (LDKChannelMessageHandler*)arg;
2108 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
2109 FREE((void*)their_node_id);
2110 LDKInit* msg_conv = (LDKInit*)msg;
2111 return (arg_conv->peer_connected)(arg_conv->this_arg, their_node_id_conv, msg_conv);
2114 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1call_1handle_1channel_1reestablish(JNIEnv * _env, jclass _b, jlong arg, jlong their_node_id, jlong msg) {
2115 LDKChannelMessageHandler* arg_conv = (LDKChannelMessageHandler*)arg;
2116 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
2117 FREE((void*)their_node_id);
2118 LDKChannelReestablish* msg_conv = (LDKChannelReestablish*)msg;
2119 return (arg_conv->handle_channel_reestablish)(arg_conv->this_arg, their_node_id_conv, msg_conv);
2122 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1call_1handle_1error(JNIEnv * _env, jclass _b, jlong arg, jlong their_node_id, jlong msg) {
2123 LDKChannelMessageHandler* arg_conv = (LDKChannelMessageHandler*)arg;
2124 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
2125 FREE((void*)their_node_id);
2126 LDKErrorMessage* msg_conv = (LDKErrorMessage*)msg;
2127 return (arg_conv->handle_error)(arg_conv->this_arg, their_node_id_conv, msg_conv);
2130 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelManagerReadArgs_1optional_1none (JNIEnv * env, jclass _a) {
2131 LDKChannelManagerReadArgs *ret = MALLOC(sizeof(LDKChannelManagerReadArgs), "LDKChannelManagerReadArgs");
2135 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1ChannelMonitor_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
2136 LDKCVecTempl_ChannelMonitor *vec = (LDKCVecTempl_ChannelMonitor*)ptr;
2137 return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKChannelMonitor));
2139 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKDecodeError_1optional_1none (JNIEnv * env, jclass _a) {
2140 LDKDecodeError *ret = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
2144 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKPing_1optional_1none (JNIEnv * env, jclass _a) {
2145 LDKPing *ret = MALLOC(sizeof(LDKPing), "LDKPing");
2149 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKPong_1optional_1none (JNIEnv * env, jclass _a) {
2150 LDKPong *ret = MALLOC(sizeof(LDKPong), "LDKPong");
2154 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKDataLossProtect_1optional_1none (JNIEnv * env, jclass _a) {
2155 LDKDataLossProtect *ret = MALLOC(sizeof(LDKDataLossProtect), "LDKDataLossProtect");
2159 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKUnsignedNodeAnnouncement_1optional_1none (JNIEnv * env, jclass _a) {
2160 LDKUnsignedNodeAnnouncement *ret = MALLOC(sizeof(LDKUnsignedNodeAnnouncement), "LDKUnsignedNodeAnnouncement");
2164 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKNodeFeatures_1optional_1none (JNIEnv * env, jclass _a) {
2165 LDKNodeFeatures *ret = MALLOC(sizeof(LDKNodeFeatures), "LDKNodeFeatures");
2169 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelFeatures_1optional_1none (JNIEnv * env, jclass _a) {
2170 LDKChannelFeatures *ret = MALLOC(sizeof(LDKChannelFeatures), "LDKChannelFeatures");
2174 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKUnsignedChannelUpdate_1optional_1none (JNIEnv * env, jclass _a) {
2175 LDKUnsignedChannelUpdate *ret = MALLOC(sizeof(LDKUnsignedChannelUpdate), "LDKUnsignedChannelUpdate");
2179 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKQueryChannelRange_1optional_1none (JNIEnv * env, jclass _a) {
2180 LDKQueryChannelRange *ret = MALLOC(sizeof(LDKQueryChannelRange), "LDKQueryChannelRange");
2184 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKReplyChannelRange_1optional_1none (JNIEnv * env, jclass _a) {
2185 LDKReplyChannelRange *ret = MALLOC(sizeof(LDKReplyChannelRange), "LDKReplyChannelRange");
2189 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1u64_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
2190 LDKCVecTempl_u64 *vec = (LDKCVecTempl_u64*)ptr;
2191 return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(uint64_t));
2193 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKQueryShortChannelIds_1optional_1none (JNIEnv * env, jclass _a) {
2194 LDKQueryShortChannelIds *ret = MALLOC(sizeof(LDKQueryShortChannelIds), "LDKQueryShortChannelIds");
2198 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKReplyShortChannelIdsEnd_1optional_1none (JNIEnv * env, jclass _a) {
2199 LDKReplyShortChannelIdsEnd *ret = MALLOC(sizeof(LDKReplyShortChannelIdsEnd), "LDKReplyShortChannelIdsEnd");
2203 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKGossipTimestampFilter_1optional_1none (JNIEnv * env, jclass _a) {
2204 LDKGossipTimestampFilter *ret = MALLOC(sizeof(LDKGossipTimestampFilter), "LDKGossipTimestampFilter");
2208 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKLightningError_1optional_1none (JNIEnv * env, jclass _a) {
2209 LDKLightningError *ret = MALLOC(sizeof(LDKLightningError), "LDKLightningError");
2213 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1UpdateAddHTLC_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
2214 LDKCVecTempl_UpdateAddHTLC *vec = (LDKCVecTempl_UpdateAddHTLC*)ptr;
2215 return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKUpdateAddHTLC));
2217 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1UpdateFulfillHTLC_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
2218 LDKCVecTempl_UpdateFulfillHTLC *vec = (LDKCVecTempl_UpdateFulfillHTLC*)ptr;
2219 return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKUpdateFulfillHTLC));
2221 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1UpdateFailHTLC_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
2222 LDKCVecTempl_UpdateFailHTLC *vec = (LDKCVecTempl_UpdateFailHTLC*)ptr;
2223 return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKUpdateFailHTLC));
2225 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1UpdateFailMalformedHTLC_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
2226 LDKCVecTempl_UpdateFailMalformedHTLC *vec = (LDKCVecTempl_UpdateFailMalformedHTLC*)ptr;
2227 return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKUpdateFailMalformedHTLC));
2229 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolLightningErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
2230 return ((LDKCResult_boolLightningErrorZ*)arg)->result_ok;
2232 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolLightningErrorZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
2233 if (((LDKCResult_boolLightningErrorZ*)arg)->result_ok) {
2234 return (long)((LDKCResult_boolLightningErrorZ*)arg)->contents.result;
2236 return (long)((LDKCResult_boolLightningErrorZ*)arg)->contents.err;
2239 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1C3TupleTempl_1ChannelAnnouncement_1_1ChannelUpdate_1_1ChannelUpdate_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
2240 LDKCVecTempl_C3TupleTempl_ChannelAnnouncement__ChannelUpdate__ChannelUpdate *vec = (LDKCVecTempl_C3TupleTempl_ChannelAnnouncement__ChannelUpdate__ChannelUpdate*)ptr;
2241 return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKC3TupleTempl_ChannelAnnouncement__ChannelUpdate__ChannelUpdate));
2243 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1NodeAnnouncement_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
2244 LDKCVecTempl_NodeAnnouncement *vec = (LDKCVecTempl_NodeAnnouncement*)ptr;
2245 return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKNodeAnnouncement));
2247 typedef struct LDKRoutingMessageHandler_JCalls {
2248 atomic_size_t refcnt;
2251 jmethodID handle_node_announcement_meth;
2252 jmethodID handle_channel_announcement_meth;
2253 jmethodID handle_channel_update_meth;
2254 jmethodID handle_htlc_fail_channel_update_meth;
2255 jmethodID get_next_channel_announcements_meth;
2256 jmethodID get_next_node_announcements_meth;
2257 jmethodID should_request_full_sync_meth;
2258 } LDKRoutingMessageHandler_JCalls;
2259 LDKCResult_boolLightningErrorZ handle_node_announcement_jcall(const void* this_arg, const LDKNodeAnnouncement *msg) {
2260 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
2262 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2263 LDKCResult_boolLightningErrorZ* ret = (LDKCResult_boolLightningErrorZ*)(*env)->CallLongMethod(env, j_calls->o, j_calls->handle_node_announcement_meth, msg);
2264 LDKCResult_boolLightningErrorZ res = *ret;
2268 LDKCResult_boolLightningErrorZ handle_channel_announcement_jcall(const void* this_arg, const LDKChannelAnnouncement *msg) {
2269 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
2271 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2272 LDKCResult_boolLightningErrorZ* ret = (LDKCResult_boolLightningErrorZ*)(*env)->CallLongMethod(env, j_calls->o, j_calls->handle_channel_announcement_meth, msg);
2273 LDKCResult_boolLightningErrorZ res = *ret;
2277 LDKCResult_boolLightningErrorZ handle_channel_update_jcall(const void* this_arg, const LDKChannelUpdate *msg) {
2278 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
2280 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2281 LDKCResult_boolLightningErrorZ* ret = (LDKCResult_boolLightningErrorZ*)(*env)->CallLongMethod(env, j_calls->o, j_calls->handle_channel_update_meth, msg);
2282 LDKCResult_boolLightningErrorZ res = *ret;
2286 void handle_htlc_fail_channel_update_jcall(const void* this_arg, const LDKHTLCFailChannelUpdate *update) {
2287 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
2289 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2290 return (*env)->CallVoidMethod(env, j_calls->o, j_calls->handle_htlc_fail_channel_update_meth, update);
2292 LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ get_next_channel_announcements_jcall(const void* this_arg, uint64_t starting_point, uint8_t batch_amount) {
2293 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
2295 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2296 LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ* ret = (LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ*)(*env)->CallLongMethod(env, j_calls->o, j_calls->get_next_channel_announcements_meth, starting_point, batch_amount);
2297 LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ res = *ret;
2301 LDKCVec_NodeAnnouncementZ get_next_node_announcements_jcall(const void* this_arg, LDKPublicKey starting_point, uint8_t batch_amount) {
2302 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
2304 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2305 long starting_point_ref = (long)&starting_point;
2306 LDKCVec_NodeAnnouncementZ* ret = (LDKCVec_NodeAnnouncementZ*)(*env)->CallLongMethod(env, j_calls->o, j_calls->get_next_node_announcements_meth, starting_point_ref, batch_amount);
2307 LDKCVec_NodeAnnouncementZ res = *ret;
2311 bool should_request_full_sync_jcall(const void* this_arg, LDKPublicKey node_id) {
2312 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
2314 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2315 long node_id_ref = (long)&node_id;
2316 return (*env)->CallBooleanMethod(env, j_calls->o, j_calls->should_request_full_sync_meth, node_id_ref);
2318 static void LDKRoutingMessageHandler_JCalls_free(void* this_arg) {
2319 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
2320 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
2322 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2323 (*env)->DeleteGlobalRef(env, j_calls->o);
2327 static void* LDKRoutingMessageHandler_JCalls_clone(const void* this_arg) {
2328 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
2329 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
2330 return (void*) this_arg;
2332 static inline LDKRoutingMessageHandler LDKRoutingMessageHandler_init (JNIEnv * env, jclass _a, jobject o) {
2333 jclass c = (*env)->GetObjectClass(env, o);
2334 DO_ASSERT(c != NULL);
2335 LDKRoutingMessageHandler_JCalls *calls = MALLOC(sizeof(LDKRoutingMessageHandler_JCalls), "LDKRoutingMessageHandler_JCalls");
2336 atomic_init(&calls->refcnt, 1);
2337 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
2338 calls->o = (*env)->NewGlobalRef(env, o);
2339 calls->handle_node_announcement_meth = (*env)->GetMethodID(env, c, "handle_node_announcement", "(J)J");
2340 DO_ASSERT(calls->handle_node_announcement_meth != NULL);
2341 calls->handle_channel_announcement_meth = (*env)->GetMethodID(env, c, "handle_channel_announcement", "(J)J");
2342 DO_ASSERT(calls->handle_channel_announcement_meth != NULL);
2343 calls->handle_channel_update_meth = (*env)->GetMethodID(env, c, "handle_channel_update", "(J)J");
2344 DO_ASSERT(calls->handle_channel_update_meth != NULL);
2345 calls->handle_htlc_fail_channel_update_meth = (*env)->GetMethodID(env, c, "handle_htlc_fail_channel_update", "(J)V");
2346 DO_ASSERT(calls->handle_htlc_fail_channel_update_meth != NULL);
2347 calls->get_next_channel_announcements_meth = (*env)->GetMethodID(env, c, "get_next_channel_announcements", "(JB)J");
2348 DO_ASSERT(calls->get_next_channel_announcements_meth != NULL);
2349 calls->get_next_node_announcements_meth = (*env)->GetMethodID(env, c, "get_next_node_announcements", "(JB)J");
2350 DO_ASSERT(calls->get_next_node_announcements_meth != NULL);
2351 calls->should_request_full_sync_meth = (*env)->GetMethodID(env, c, "should_request_full_sync", "(J)Z");
2352 DO_ASSERT(calls->should_request_full_sync_meth != NULL);
2354 LDKRoutingMessageHandler ret = {
2355 .this_arg = (void*) calls,
2356 .handle_node_announcement = handle_node_announcement_jcall,
2357 .handle_channel_announcement = handle_channel_announcement_jcall,
2358 .handle_channel_update = handle_channel_update_jcall,
2359 .handle_htlc_fail_channel_update = handle_htlc_fail_channel_update_jcall,
2360 .get_next_channel_announcements = get_next_channel_announcements_jcall,
2361 .get_next_node_announcements = get_next_node_announcements_jcall,
2362 .should_request_full_sync = should_request_full_sync_jcall,
2363 .free = LDKRoutingMessageHandler_JCalls_free,
2367 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKRoutingMessageHandler_1new (JNIEnv * env, jclass _a, jobject o) {
2368 LDKRoutingMessageHandler *res_ptr = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler");
2369 *res_ptr = LDKRoutingMessageHandler_init(env, _a, o);
2370 return (long)res_ptr;
2372 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKRoutingMessageHandler_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
2373 return ((LDKRoutingMessageHandler_JCalls*)val)->o;
2375 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKRoutingMessageHandler_1call_1handle_1node_1announcement(JNIEnv * _env, jclass _b, jlong arg, jlong msg) {
2376 LDKRoutingMessageHandler* arg_conv = (LDKRoutingMessageHandler*)arg;
2377 LDKNodeAnnouncement* msg_conv = (LDKNodeAnnouncement*)msg;
2378 LDKCResult_boolLightningErrorZ* ret = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
2379 *ret = (arg_conv->handle_node_announcement)(arg_conv->this_arg, msg_conv);
2383 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKRoutingMessageHandler_1call_1handle_1channel_1announcement(JNIEnv * _env, jclass _b, jlong arg, jlong msg) {
2384 LDKRoutingMessageHandler* arg_conv = (LDKRoutingMessageHandler*)arg;
2385 LDKChannelAnnouncement* msg_conv = (LDKChannelAnnouncement*)msg;
2386 LDKCResult_boolLightningErrorZ* ret = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
2387 *ret = (arg_conv->handle_channel_announcement)(arg_conv->this_arg, msg_conv);
2391 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKRoutingMessageHandler_1call_1handle_1channel_1update(JNIEnv * _env, jclass _b, jlong arg, jlong msg) {
2392 LDKRoutingMessageHandler* arg_conv = (LDKRoutingMessageHandler*)arg;
2393 LDKChannelUpdate* msg_conv = (LDKChannelUpdate*)msg;
2394 LDKCResult_boolLightningErrorZ* ret = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
2395 *ret = (arg_conv->handle_channel_update)(arg_conv->this_arg, msg_conv);
2399 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKRoutingMessageHandler_1call_1handle_1htlc_1fail_1channel_1update(JNIEnv * _env, jclass _b, jlong arg, jlong update) {
2400 LDKRoutingMessageHandler* arg_conv = (LDKRoutingMessageHandler*)arg;
2401 LDKHTLCFailChannelUpdate* update_conv = (LDKHTLCFailChannelUpdate*)update;
2402 return (arg_conv->handle_htlc_fail_channel_update)(arg_conv->this_arg, update_conv);
2405 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKRoutingMessageHandler_1call_1get_1next_1channel_1announcements(JNIEnv * _env, jclass _b, jlong arg, jlong starting_point, jbyte batch_amount) {
2406 LDKRoutingMessageHandler* arg_conv = (LDKRoutingMessageHandler*)arg;
2407 LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ* ret = MALLOC(sizeof(LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ), "LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ");
2408 *ret = (arg_conv->get_next_channel_announcements)(arg_conv->this_arg, starting_point, batch_amount);
2412 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKRoutingMessageHandler_1call_1get_1next_1node_1announcements(JNIEnv * _env, jclass _b, jlong arg, jlong starting_point, jbyte batch_amount) {
2413 LDKRoutingMessageHandler* arg_conv = (LDKRoutingMessageHandler*)arg;
2414 LDKPublicKey starting_point_conv = *(LDKPublicKey*)starting_point;
2415 FREE((void*)starting_point);
2416 LDKCVec_NodeAnnouncementZ* ret = MALLOC(sizeof(LDKCVec_NodeAnnouncementZ), "LDKCVec_NodeAnnouncementZ");
2417 *ret = (arg_conv->get_next_node_announcements)(arg_conv->this_arg, starting_point_conv, batch_amount);
2421 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKRoutingMessageHandler_1call_1should_1request_1full_1sync(JNIEnv * _env, jclass _b, jlong arg, jlong node_id) {
2422 LDKRoutingMessageHandler* arg_conv = (LDKRoutingMessageHandler*)arg;
2423 LDKPublicKey node_id_conv = *(LDKPublicKey*)node_id;
2424 FREE((void*)node_id);
2425 return (arg_conv->should_request_full_sync)(arg_conv->this_arg, node_id_conv);
2428 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKMessageHandler_1optional_1none (JNIEnv * env, jclass _a) {
2429 LDKMessageHandler *ret = MALLOC(sizeof(LDKMessageHandler), "LDKMessageHandler");
2433 typedef struct LDKSocketDescriptor_JCalls {
2434 atomic_size_t refcnt;
2437 jmethodID send_data_meth;
2438 jmethodID disconnect_socket_meth;
2440 jmethodID hash_meth;
2441 } LDKSocketDescriptor_JCalls;
2442 uintptr_t send_data_jcall(void* this_arg, LDKu8slice data, bool resume_read) {
2443 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
2445 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2446 long data_ref = (long)&data;
2447 return (*env)->CallLongMethod(env, j_calls->o, j_calls->send_data_meth, data_ref, resume_read);
2449 void disconnect_socket_jcall(void* this_arg) {
2450 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
2452 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2453 return (*env)->CallVoidMethod(env, j_calls->o, j_calls->disconnect_socket_meth);
2455 bool eq_jcall(const void* this_arg, const void *other_arg) {
2456 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
2458 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2459 return (*env)->CallBooleanMethod(env, j_calls->o, j_calls->eq_meth, other_arg);
2461 uint64_t hash_jcall(const void* this_arg) {
2462 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
2464 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2465 return (*env)->CallLongMethod(env, j_calls->o, j_calls->hash_meth);
2467 static void LDKSocketDescriptor_JCalls_free(void* this_arg) {
2468 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
2469 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
2471 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2472 (*env)->DeleteGlobalRef(env, j_calls->o);
2476 static void* LDKSocketDescriptor_JCalls_clone(const void* this_arg) {
2477 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
2478 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
2479 return (void*) this_arg;
2481 static inline LDKSocketDescriptor LDKSocketDescriptor_init (JNIEnv * env, jclass _a, jobject o) {
2482 jclass c = (*env)->GetObjectClass(env, o);
2483 DO_ASSERT(c != NULL);
2484 LDKSocketDescriptor_JCalls *calls = MALLOC(sizeof(LDKSocketDescriptor_JCalls), "LDKSocketDescriptor_JCalls");
2485 atomic_init(&calls->refcnt, 1);
2486 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
2487 calls->o = (*env)->NewGlobalRef(env, o);
2488 calls->send_data_meth = (*env)->GetMethodID(env, c, "send_data", "(JZ)J");
2489 DO_ASSERT(calls->send_data_meth != NULL);
2490 calls->disconnect_socket_meth = (*env)->GetMethodID(env, c, "disconnect_socket", "()V");
2491 DO_ASSERT(calls->disconnect_socket_meth != NULL);
2492 calls->eq_meth = (*env)->GetMethodID(env, c, "eq", "(J)Z");
2493 DO_ASSERT(calls->eq_meth != NULL);
2494 calls->hash_meth = (*env)->GetMethodID(env, c, "hash", "()J");
2495 DO_ASSERT(calls->hash_meth != NULL);
2497 LDKSocketDescriptor ret = {
2498 .this_arg = (void*) calls,
2499 .send_data = send_data_jcall,
2500 .disconnect_socket = disconnect_socket_jcall,
2503 .clone = LDKSocketDescriptor_JCalls_clone,
2504 .free = LDKSocketDescriptor_JCalls_free,
2508 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKSocketDescriptor_1new (JNIEnv * env, jclass _a, jobject o) {
2509 LDKSocketDescriptor *res_ptr = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor");
2510 *res_ptr = LDKSocketDescriptor_init(env, _a, o);
2511 return (long)res_ptr;
2513 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKSocketDescriptor_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
2514 return ((LDKSocketDescriptor_JCalls*)val)->o;
2516 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKSocketDescriptor_1call_1send_1data(JNIEnv * _env, jclass _b, jlong arg, jlong data, jboolean resume_read) {
2517 LDKSocketDescriptor* arg_conv = (LDKSocketDescriptor*)arg;
2518 LDKu8slice data_conv = *(LDKu8slice*)data;
2519 return (arg_conv->send_data)(arg_conv->this_arg, data_conv, resume_read);
2522 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKSocketDescriptor_1call_1disconnect_1socket(JNIEnv * _env, jclass _b, jlong arg) {
2523 LDKSocketDescriptor* arg_conv = (LDKSocketDescriptor*)arg;
2524 return (arg_conv->disconnect_socket)(arg_conv->this_arg);
2527 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKSocketDescriptor_1call_1hash(JNIEnv * _env, jclass _b, jlong arg) {
2528 LDKSocketDescriptor* arg_conv = (LDKSocketDescriptor*)arg;
2529 return (arg_conv->hash)(arg_conv->this_arg);
2532 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKPeerManager_1optional_1none (JNIEnv * env, jclass _a) {
2533 LDKPeerManager *ret = MALLOC(sizeof(LDKPeerManager), "LDKPeerManager");
2537 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1PublicKey_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
2538 LDKCVecTempl_PublicKey *vec = (LDKCVecTempl_PublicKey*)ptr;
2539 return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKPublicKey));
2541 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1u8ZPeerHandleErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
2542 return ((LDKCResult_CVec_u8ZPeerHandleErrorZ*)arg)->result_ok;
2544 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1u8ZPeerHandleErrorZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
2545 if (((LDKCResult_CVec_u8ZPeerHandleErrorZ*)arg)->result_ok) {
2546 return (long)((LDKCResult_CVec_u8ZPeerHandleErrorZ*)arg)->contents.result;
2548 return (long)((LDKCResult_CVec_u8ZPeerHandleErrorZ*)arg)->contents.err;
2551 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolPeerHandleErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
2552 return ((LDKCResult_boolPeerHandleErrorZ*)arg)->result_ok;
2554 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolPeerHandleErrorZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
2555 if (((LDKCResult_boolPeerHandleErrorZ*)arg)->result_ok) {
2556 return (long)((LDKCResult_boolPeerHandleErrorZ*)arg)->contents.result;
2558 return (long)((LDKCResult_boolPeerHandleErrorZ*)arg)->contents.err;
2561 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SecretKeySecpErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
2562 return ((LDKCResult_SecretKeySecpErrorZ*)arg)->result_ok;
2564 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SecretKeySecpErrorZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
2565 if (((LDKCResult_SecretKeySecpErrorZ*)arg)->result_ok) {
2566 return (long)((LDKCResult_SecretKeySecpErrorZ*)arg)->contents.result;
2568 return (long)((LDKCResult_SecretKeySecpErrorZ*)arg)->contents.err;
2571 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PublicKeySecpErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
2572 return ((LDKCResult_PublicKeySecpErrorZ*)arg)->result_ok;
2574 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PublicKeySecpErrorZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
2575 if (((LDKCResult_PublicKeySecpErrorZ*)arg)->result_ok) {
2576 return (long)((LDKCResult_PublicKeySecpErrorZ*)arg)->contents.result;
2578 return (long)((LDKCResult_PublicKeySecpErrorZ*)arg)->contents.err;
2581 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKTxCreationKeys_1optional_1none (JNIEnv * env, jclass _a) {
2582 LDKTxCreationKeys *ret = MALLOC(sizeof(LDKTxCreationKeys), "LDKTxCreationKeys");
2586 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxCreationKeysSecpErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
2587 return ((LDKCResult_TxCreationKeysSecpErrorZ*)arg)->result_ok;
2589 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxCreationKeysSecpErrorZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
2590 if (((LDKCResult_TxCreationKeysSecpErrorZ*)arg)->result_ok) {
2591 return (long)((LDKCResult_TxCreationKeysSecpErrorZ*)arg)->contents.result;
2593 return (long)((LDKCResult_TxCreationKeysSecpErrorZ*)arg)->contents.err;
2596 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1C2TupleTempl_1HTLCOutputInCommitment_1_1Signature_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
2597 LDKCVecTempl_C2TupleTempl_HTLCOutputInCommitment__Signature *vec = (LDKCVecTempl_C2TupleTempl_HTLCOutputInCommitment__Signature*)ptr;
2598 return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKC2TupleTempl_HTLCOutputInCommitment__Signature));
2600 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKRouteHop_1optional_1none (JNIEnv * env, jclass _a) {
2601 LDKRouteHop *ret = MALLOC(sizeof(LDKRouteHop), "LDKRouteHop");
2605 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1RouteHop_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
2606 LDKCVecTempl_RouteHop *vec = (LDKCVecTempl_RouteHop*)ptr;
2607 return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKRouteHop));
2609 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1CVecTempl_1RouteHop_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
2610 LDKCVecTempl_CVecTempl_RouteHop *vec = (LDKCVecTempl_CVecTempl_RouteHop*)ptr;
2611 return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKCVecTempl_RouteHop));
2613 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKRouteHint_1optional_1none (JNIEnv * env, jclass _a) {
2614 LDKRouteHint *ret = MALLOC(sizeof(LDKRouteHint), "LDKRouteHint");
2618 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKRoutingFees_1optional_1none (JNIEnv * env, jclass _a) {
2619 LDKRoutingFees *ret = MALLOC(sizeof(LDKRoutingFees), "LDKRoutingFees");
2623 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteLightningErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
2624 return ((LDKCResult_RouteLightningErrorZ*)arg)->result_ok;
2626 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteLightningErrorZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
2627 if (((LDKCResult_RouteLightningErrorZ*)arg)->result_ok) {
2628 return (long)((LDKCResult_RouteLightningErrorZ*)arg)->contents.result;
2630 return (long)((LDKCResult_RouteLightningErrorZ*)arg)->contents.err;
2633 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKNetworkGraph_1optional_1none (JNIEnv * env, jclass _a) {
2634 LDKNetworkGraph *ret = MALLOC(sizeof(LDKNetworkGraph), "LDKNetworkGraph");
2638 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1RouteHint_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
2639 LDKCVecTempl_RouteHint *vec = (LDKCVecTempl_RouteHint*)ptr;
2640 return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKRouteHint));
2642 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKLockedNetworkGraph_1optional_1none (JNIEnv * env, jclass _a) {
2643 LDKLockedNetworkGraph *ret = MALLOC(sizeof(LDKLockedNetworkGraph), "LDKLockedNetworkGraph");
2647 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKNetGraphMsgHandler_1optional_1none (JNIEnv * env, jclass _a) {
2648 LDKNetGraphMsgHandler *ret = MALLOC(sizeof(LDKNetGraphMsgHandler), "LDKNetGraphMsgHandler");
2652 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKDirectionalChannelInfo_1optional_1none (JNIEnv * env, jclass _a) {
2653 LDKDirectionalChannelInfo *ret = MALLOC(sizeof(LDKDirectionalChannelInfo), "LDKDirectionalChannelInfo");
2657 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelInfo_1optional_1none (JNIEnv * env, jclass _a) {
2658 LDKChannelInfo *ret = MALLOC(sizeof(LDKChannelInfo), "LDKChannelInfo");
2662 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKNodeAnnouncementInfo_1optional_1none (JNIEnv * env, jclass _a) {
2663 LDKNodeAnnouncementInfo *ret = MALLOC(sizeof(LDKNodeAnnouncementInfo), "LDKNodeAnnouncementInfo");
2667 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKNodeInfo_1optional_1none (JNIEnv * env, jclass _a) {
2668 LDKNodeInfo *ret = MALLOC(sizeof(LDKNodeInfo), "LDKNodeInfo");
2672 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1HTLCOutputInCommitmentSignatureZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
2673 LDKC2Tuple_HTLCOutputInCommitmentSignatureZ arg_conv = *(LDKC2Tuple_HTLCOutputInCommitmentSignatureZ*)arg;
2675 return C2Tuple_HTLCOutputInCommitmentSignatureZ_free(arg_conv);
2678 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
2679 LDKC2Tuple_OutPointScriptZ arg_conv = *(LDKC2Tuple_OutPointScriptZ*)arg;
2681 return C2Tuple_OutPointScriptZ_free(arg_conv);
2684 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
2685 LDKC2Tuple_SignatureCVec_SignatureZZ arg_conv = *(LDKC2Tuple_SignatureCVec_SignatureZZ*)arg;
2687 return C2Tuple_SignatureCVec_SignatureZZ_free(arg_conv);
2690 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1TxOutZZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
2691 LDKC2Tuple_TxidCVec_TxOutZZ arg_conv = *(LDKC2Tuple_TxidCVec_TxOutZZ*)arg;
2693 return C2Tuple_TxidCVec_TxOutZZ_free(arg_conv);
2696 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u64u64Z_1free(JNIEnv * _env, jclass _b, jlong arg) {
2697 LDKC2Tuple_u64u64Z arg_conv = *(LDKC2Tuple_u64u64Z*)arg;
2699 return C2Tuple_u64u64Z_free(arg_conv);
2702 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
2703 LDKC2Tuple_usizeTransactionZ arg_conv = *(LDKC2Tuple_usizeTransactionZ*)arg;
2705 return C2Tuple_usizeTransactionZ_free(arg_conv);
2708 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
2709 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ arg_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)arg;
2711 return C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(arg_conv);
2714 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
2715 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ arg_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)arg;
2717 return CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(arg_conv);
2720 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
2721 LDKC2Tuple_SignatureCVec_SignatureZZ arg_conv = *(LDKC2Tuple_SignatureCVec_SignatureZZ*)arg;
2723 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
2724 *ret = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(arg_conv);
2728 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
2729 LDKCResult_CVec_SignatureZNoneZ arg_conv = *(LDKCResult_CVec_SignatureZNoneZ*)arg;
2731 return CResult_CVec_SignatureZNoneZ_free(arg_conv);
2734 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
2735 LDKCVec_SignatureZ arg_conv = *(LDKCVec_SignatureZ*)arg;
2737 LDKCResult_CVec_SignatureZNoneZ* ret = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
2738 *ret = CResult_CVec_SignatureZNoneZ_ok(arg_conv);
2742 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
2743 LDKPeerHandleError arg_conv = *(LDKPeerHandleError*)arg;
2745 LDKCResult_CVec_u8ZPeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
2746 *ret = CResult_CVec_u8ZPeerHandleErrorZ_err(arg_conv);
2750 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
2751 LDKCResult_CVec_u8ZPeerHandleErrorZ arg_conv = *(LDKCResult_CVec_u8ZPeerHandleErrorZ*)arg;
2753 return CResult_CVec_u8ZPeerHandleErrorZ_free(arg_conv);
2756 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
2757 LDKCVec_u8Z arg_conv = *(LDKCVec_u8Z*)arg;
2759 LDKCResult_CVec_u8ZPeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
2760 *ret = CResult_CVec_u8ZPeerHandleErrorZ_ok(arg_conv);
2764 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
2765 LDKAPIError arg_conv = *(LDKAPIError*)arg;
2767 LDKCResult_NoneAPIErrorZ* ret = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
2768 *ret = CResult_NoneAPIErrorZ_err(arg_conv);
2772 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
2773 LDKCResult_NoneAPIErrorZ arg_conv = *(LDKCResult_NoneAPIErrorZ*)arg;
2775 return CResult_NoneAPIErrorZ_free(arg_conv);
2778 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1err(JNIEnv * _env, jclass _b, jclass arg) {
2779 LDKChannelMonitorUpdateErr arg_conv = *(LDKChannelMonitorUpdateErr*)arg;
2781 LDKCResult_NoneChannelMonitorUpdateErrZ* ret = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
2782 *ret = CResult_NoneChannelMonitorUpdateErrZ_err(arg_conv);
2786 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
2787 LDKCResult_NoneChannelMonitorUpdateErrZ arg_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)arg;
2789 return CResult_NoneChannelMonitorUpdateErrZ_free(arg_conv);
2792 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
2793 LDKMonitorUpdateError arg_conv = *(LDKMonitorUpdateError*)arg;
2795 LDKCResult_NoneMonitorUpdateErrorZ* ret = MALLOC(sizeof(LDKCResult_NoneMonitorUpdateErrorZ), "LDKCResult_NoneMonitorUpdateErrorZ");
2796 *ret = CResult_NoneMonitorUpdateErrorZ_err(arg_conv);
2800 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
2801 LDKCResult_NoneMonitorUpdateErrorZ arg_conv = *(LDKCResult_NoneMonitorUpdateErrorZ*)arg;
2803 return CResult_NoneMonitorUpdateErrorZ_free(arg_conv);
2806 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
2807 LDKPaymentSendFailure arg_conv = *(LDKPaymentSendFailure*)arg;
2809 LDKCResult_NonePaymentSendFailureZ* ret = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
2810 *ret = CResult_NonePaymentSendFailureZ_err(arg_conv);
2814 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
2815 LDKCResult_NonePaymentSendFailureZ arg_conv = *(LDKCResult_NonePaymentSendFailureZ*)arg;
2817 return CResult_NonePaymentSendFailureZ_free(arg_conv);
2820 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
2821 LDKPeerHandleError arg_conv = *(LDKPeerHandleError*)arg;
2823 LDKCResult_NonePeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
2824 *ret = CResult_NonePeerHandleErrorZ_err(arg_conv);
2828 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
2829 LDKCResult_NonePeerHandleErrorZ arg_conv = *(LDKCResult_NonePeerHandleErrorZ*)arg;
2831 return CResult_NonePeerHandleErrorZ_free(arg_conv);
2834 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeySecpErrorZ_1err(JNIEnv * _env, jclass _b, jclass arg) {
2835 LDKSecp256k1Error arg_conv = *(LDKSecp256k1Error*)arg;
2837 LDKCResult_PublicKeySecpErrorZ* ret = MALLOC(sizeof(LDKCResult_PublicKeySecpErrorZ), "LDKCResult_PublicKeySecpErrorZ");
2838 *ret = CResult_PublicKeySecpErrorZ_err(arg_conv);
2842 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeySecpErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
2843 LDKCResult_PublicKeySecpErrorZ arg_conv = *(LDKCResult_PublicKeySecpErrorZ*)arg;
2845 return CResult_PublicKeySecpErrorZ_free(arg_conv);
2848 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeySecpErrorZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
2849 LDKPublicKey arg_conv = *(LDKPublicKey*)arg;
2851 LDKCResult_PublicKeySecpErrorZ* ret = MALLOC(sizeof(LDKCResult_PublicKeySecpErrorZ), "LDKCResult_PublicKeySecpErrorZ");
2852 *ret = CResult_PublicKeySecpErrorZ_ok(arg_conv);
2856 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
2857 LDKLightningError arg_conv = *(LDKLightningError*)arg;
2859 LDKCResult_RouteLightningErrorZ* ret = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
2860 *ret = CResult_RouteLightningErrorZ_err(arg_conv);
2864 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
2865 LDKCResult_RouteLightningErrorZ arg_conv = *(LDKCResult_RouteLightningErrorZ*)arg;
2867 return CResult_RouteLightningErrorZ_free(arg_conv);
2870 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
2871 LDKRoute arg_conv = *(LDKRoute*)arg;
2873 LDKCResult_RouteLightningErrorZ* ret = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
2874 *ret = CResult_RouteLightningErrorZ_ok(arg_conv);
2878 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeySecpErrorZ_1err(JNIEnv * _env, jclass _b, jclass arg) {
2879 LDKSecp256k1Error arg_conv = *(LDKSecp256k1Error*)arg;
2881 LDKCResult_SecretKeySecpErrorZ* ret = MALLOC(sizeof(LDKCResult_SecretKeySecpErrorZ), "LDKCResult_SecretKeySecpErrorZ");
2882 *ret = CResult_SecretKeySecpErrorZ_err(arg_conv);
2886 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeySecpErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
2887 LDKCResult_SecretKeySecpErrorZ arg_conv = *(LDKCResult_SecretKeySecpErrorZ*)arg;
2889 return CResult_SecretKeySecpErrorZ_free(arg_conv);
2892 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeySecpErrorZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
2893 LDKSecretKey arg_conv = *(LDKSecretKey*)arg;
2895 LDKCResult_SecretKeySecpErrorZ* ret = MALLOC(sizeof(LDKCResult_SecretKeySecpErrorZ), "LDKCResult_SecretKeySecpErrorZ");
2896 *ret = CResult_SecretKeySecpErrorZ_ok(arg_conv);
2900 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
2901 LDKCResult_SignatureNoneZ arg_conv = *(LDKCResult_SignatureNoneZ*)arg;
2903 return CResult_SignatureNoneZ_free(arg_conv);
2906 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
2907 LDKSignature arg_conv = *(LDKSignature*)arg;
2909 LDKCResult_SignatureNoneZ* ret = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
2910 *ret = CResult_SignatureNoneZ_ok(arg_conv);
2914 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysSecpErrorZ_1err(JNIEnv * _env, jclass _b, jclass arg) {
2915 LDKSecp256k1Error arg_conv = *(LDKSecp256k1Error*)arg;
2917 LDKCResult_TxCreationKeysSecpErrorZ* ret = MALLOC(sizeof(LDKCResult_TxCreationKeysSecpErrorZ), "LDKCResult_TxCreationKeysSecpErrorZ");
2918 *ret = CResult_TxCreationKeysSecpErrorZ_err(arg_conv);
2922 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysSecpErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
2923 LDKCResult_TxCreationKeysSecpErrorZ arg_conv = *(LDKCResult_TxCreationKeysSecpErrorZ*)arg;
2925 return CResult_TxCreationKeysSecpErrorZ_free(arg_conv);
2928 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysSecpErrorZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
2929 LDKTxCreationKeys arg_conv = *(LDKTxCreationKeys*)arg;
2931 LDKCResult_TxCreationKeysSecpErrorZ* ret = MALLOC(sizeof(LDKCResult_TxCreationKeysSecpErrorZ), "LDKCResult_TxCreationKeysSecpErrorZ");
2932 *ret = CResult_TxCreationKeysSecpErrorZ_ok(arg_conv);
2936 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1err(JNIEnv * _env, jclass _b, jclass arg) {
2937 LDKAccessError arg_conv = *(LDKAccessError*)arg;
2939 LDKCResult_TxOutAccessErrorZ* ret = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ");
2940 *ret = CResult_TxOutAccessErrorZ_err(arg_conv);
2944 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
2945 LDKCResult_TxOutAccessErrorZ arg_conv = *(LDKCResult_TxOutAccessErrorZ*)arg;
2947 return CResult_TxOutAccessErrorZ_free(arg_conv);
2950 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
2951 LDKTxOut arg_conv = *(LDKTxOut*)arg;
2953 LDKCResult_TxOutAccessErrorZ* ret = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ");
2954 *ret = CResult_TxOutAccessErrorZ_ok(arg_conv);
2958 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
2959 LDKLightningError arg_conv = *(LDKLightningError*)arg;
2961 LDKCResult_boolLightningErrorZ* ret = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
2962 *ret = CResult_boolLightningErrorZ_err(arg_conv);
2966 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
2967 LDKCResult_boolLightningErrorZ arg_conv = *(LDKCResult_boolLightningErrorZ*)arg;
2969 return CResult_boolLightningErrorZ_free(arg_conv);
2972 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1ok(JNIEnv * _env, jclass _b, jboolean arg) {
2973 LDKCResult_boolLightningErrorZ* ret = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
2974 *ret = CResult_boolLightningErrorZ_ok(arg);
2978 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
2979 LDKPeerHandleError arg_conv = *(LDKPeerHandleError*)arg;
2981 LDKCResult_boolPeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
2982 *ret = CResult_boolPeerHandleErrorZ_err(arg_conv);
2986 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
2987 LDKCResult_boolPeerHandleErrorZ arg_conv = *(LDKCResult_boolPeerHandleErrorZ*)arg;
2989 return CResult_boolPeerHandleErrorZ_free(arg_conv);
2992 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1ok(JNIEnv * _env, jclass _b, jboolean arg) {
2993 LDKCResult_boolPeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
2994 *ret = CResult_boolPeerHandleErrorZ_ok(arg);
2998 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1HTLCOutputInCommitmentSignatureZZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
2999 LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ arg_conv = *(LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ*)arg;
3001 return CVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ_free(arg_conv);
3004 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1TxidCVec_1TxOutZZZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3005 LDKCVec_C2Tuple_TxidCVec_TxOutZZZ arg_conv = *(LDKCVec_C2Tuple_TxidCVec_TxOutZZZ*)arg;
3007 return CVec_C2Tuple_TxidCVec_TxOutZZZ_free(arg_conv);
3010 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1usizeTransactionZZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3011 LDKCVec_C2Tuple_usizeTransactionZZ arg_conv = *(LDKCVec_C2Tuple_usizeTransactionZZ*)arg;
3013 return CVec_C2Tuple_usizeTransactionZZ_free(arg_conv);
3016 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3017 LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ arg_conv = *(LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ*)arg;
3019 return CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(arg_conv);
3022 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1CVec_1RouteHopZZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3023 LDKCVec_CVec_RouteHopZZ arg_conv = *(LDKCVec_CVec_RouteHopZZ*)arg;
3025 return CVec_CVec_RouteHopZZ_free(arg_conv);
3028 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ChannelDetailsZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3029 LDKCVec_ChannelDetailsZ arg_conv = *(LDKCVec_ChannelDetailsZ*)arg;
3031 return CVec_ChannelDetailsZ_free(arg_conv);
3034 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ChannelMonitorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3035 LDKCVec_ChannelMonitorZ arg_conv = *(LDKCVec_ChannelMonitorZ*)arg;
3037 return CVec_ChannelMonitorZ_free(arg_conv);
3040 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1EventZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3041 LDKCVec_EventZ arg_conv = *(LDKCVec_EventZ*)arg;
3043 return CVec_EventZ_free(arg_conv);
3046 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1HTLCOutputInCommitmentZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3047 LDKCVec_HTLCOutputInCommitmentZ arg_conv = *(LDKCVec_HTLCOutputInCommitmentZ*)arg;
3049 return CVec_HTLCOutputInCommitmentZ_free(arg_conv);
3052 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1MessageSendEventZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3053 LDKCVec_MessageSendEventZ arg_conv = *(LDKCVec_MessageSendEventZ*)arg;
3055 return CVec_MessageSendEventZ_free(arg_conv);
3058 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1MonitorEventZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3059 LDKCVec_MonitorEventZ arg_conv = *(LDKCVec_MonitorEventZ*)arg;
3061 return CVec_MonitorEventZ_free(arg_conv);
3064 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1NetAddressZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3065 LDKCVec_NetAddressZ arg_conv = *(LDKCVec_NetAddressZ*)arg;
3067 return CVec_NetAddressZ_free(arg_conv);
3070 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1NodeAnnouncementZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3071 LDKCVec_NodeAnnouncementZ arg_conv = *(LDKCVec_NodeAnnouncementZ*)arg;
3073 return CVec_NodeAnnouncementZ_free(arg_conv);
3076 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1PublicKeyZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3077 LDKCVec_PublicKeyZ arg_conv = *(LDKCVec_PublicKeyZ*)arg;
3079 return CVec_PublicKeyZ_free(arg_conv);
3082 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHintZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3083 LDKCVec_RouteHintZ arg_conv = *(LDKCVec_RouteHintZ*)arg;
3085 return CVec_RouteHintZ_free(arg_conv);
3088 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHopZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3089 LDKCVec_RouteHopZ arg_conv = *(LDKCVec_RouteHopZ*)arg;
3091 return CVec_RouteHopZ_free(arg_conv);
3094 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1SignatureZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3095 LDKCVec_SignatureZ arg_conv = *(LDKCVec_SignatureZ*)arg;
3097 return CVec_SignatureZ_free(arg_conv);
3100 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1SpendableOutputDescriptorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3101 LDKCVec_SpendableOutputDescriptorZ arg_conv = *(LDKCVec_SpendableOutputDescriptorZ*)arg;
3103 return CVec_SpendableOutputDescriptorZ_free(arg_conv);
3106 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1TransactionZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3107 LDKCVec_TransactionZ arg_conv = *(LDKCVec_TransactionZ*)arg;
3109 return CVec_TransactionZ_free(arg_conv);
3112 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1TxOutZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3113 LDKCVec_TxOutZ arg_conv = *(LDKCVec_TxOutZ*)arg;
3115 return CVec_TxOutZ_free(arg_conv);
3118 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateAddHTLCZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3119 LDKCVec_UpdateAddHTLCZ arg_conv = *(LDKCVec_UpdateAddHTLCZ*)arg;
3121 return CVec_UpdateAddHTLCZ_free(arg_conv);
3124 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateFailHTLCZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3125 LDKCVec_UpdateFailHTLCZ arg_conv = *(LDKCVec_UpdateFailHTLCZ*)arg;
3127 return CVec_UpdateFailHTLCZ_free(arg_conv);
3130 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateFailMalformedHTLCZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3131 LDKCVec_UpdateFailMalformedHTLCZ arg_conv = *(LDKCVec_UpdateFailMalformedHTLCZ*)arg;
3133 return CVec_UpdateFailMalformedHTLCZ_free(arg_conv);
3136 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateFulfillHTLCZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3137 LDKCVec_UpdateFulfillHTLCZ arg_conv = *(LDKCVec_UpdateFulfillHTLCZ*)arg;
3139 return CVec_UpdateFulfillHTLCZ_free(arg_conv);
3142 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1u64Z_1free(JNIEnv * _env, jclass _b, jlong arg) {
3143 LDKCVec_u64Z arg_conv = *(LDKCVec_u64Z*)arg;
3145 return CVec_u64Z_free(arg_conv);
3148 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1u8Z_1free(JNIEnv * _env, jclass _b, jlong arg) {
3149 LDKCVec_u8Z arg_conv = *(LDKCVec_u8Z*)arg;
3151 return CVec_u8Z_free(arg_conv);
3154 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Transaction_1free(JNIEnv * _env, jclass _b, jlong _res) {
3155 LDKTransaction _res_conv = *(LDKTransaction*)_res;
3157 return Transaction_free(_res_conv);
3160 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxOut_1free(JNIEnv * _env, jclass _b, jlong _res) {
3161 LDKTxOut _res_conv = *(LDKTxOut*)_res;
3163 return TxOut_free(_res_conv);
3166 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1new(JNIEnv * _env, jclass _b, jlong a, jlong b) {
3167 LDKTransaction b_conv = *(LDKTransaction*)b;
3169 LDKC2Tuple_usizeTransactionZ* ret = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ");
3170 *ret = C2Tuple_usizeTransactionZ_new(a, b_conv);
3174 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1ok(JNIEnv * _env, jclass _b) {
3175 LDKCResult_NoneChannelMonitorUpdateErrZ* ret = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
3176 *ret = CResult_NoneChannelMonitorUpdateErrZ_ok();
3180 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1ok(JNIEnv * _env, jclass _b) {
3181 LDKCResult_NoneMonitorUpdateErrorZ* ret = MALLOC(sizeof(LDKCResult_NoneMonitorUpdateErrorZ), "LDKCResult_NoneMonitorUpdateErrorZ");
3182 *ret = CResult_NoneMonitorUpdateErrorZ_ok();
3186 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1new(JNIEnv * _env, jclass _b, jlong a, jlong b) {
3187 LDKOutPoint a_conv = *(LDKOutPoint*)a;
3189 a_conv.is_owned = true;
3190 LDKCVec_u8Z b_conv = *(LDKCVec_u8Z*)b;
3192 LDKC2Tuple_OutPointScriptZ* ret = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ");
3193 *ret = C2Tuple_OutPointScriptZ_new(a_conv, b_conv);
3197 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1TxOutZZ_1new(JNIEnv * _env, jclass _b, jlong a, jlong b) {
3198 LDKThirtyTwoBytes a_conv = *(LDKThirtyTwoBytes*)a;
3200 LDKCVec_TxOutZ b_conv = *(LDKCVec_TxOutZ*)b;
3202 LDKC2Tuple_TxidCVec_TxOutZZ* ret = MALLOC(sizeof(LDKC2Tuple_TxidCVec_TxOutZZ), "LDKC2Tuple_TxidCVec_TxOutZZ");
3203 *ret = C2Tuple_TxidCVec_TxOutZZ_new(a_conv, b_conv);
3207 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u64u64Z_1new(JNIEnv * _env, jclass _b, jlong a, jlong b) {
3208 LDKC2Tuple_u64u64Z* ret = MALLOC(sizeof(LDKC2Tuple_u64u64Z), "LDKC2Tuple_u64u64Z");
3209 *ret = C2Tuple_u64u64Z_new(a, b);
3213 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1new(JNIEnv * _env, jclass _b, jlong a, jlong b) {
3214 LDKSignature a_conv = *(LDKSignature*)a;
3216 LDKCVec_SignatureZ b_conv = *(LDKCVec_SignatureZ*)b;
3218 LDKC2Tuple_SignatureCVec_SignatureZZ* ret = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ");
3219 *ret = C2Tuple_SignatureCVec_SignatureZZ_new(a_conv, b_conv);
3223 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1err(JNIEnv * _env, jclass _b) {
3224 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
3225 *ret = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err();
3229 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1err(JNIEnv * _env, jclass _b) {
3230 LDKCResult_SignatureNoneZ* ret = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
3231 *ret = CResult_SignatureNoneZ_err();
3235 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1err(JNIEnv * _env, jclass _b) {
3236 LDKCResult_CVec_SignatureZNoneZ* ret = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
3237 *ret = CResult_CVec_SignatureZNoneZ_err();
3241 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1ok(JNIEnv * _env, jclass _b) {
3242 LDKCResult_NoneAPIErrorZ* ret = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
3243 *ret = CResult_NoneAPIErrorZ_ok();
3247 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1ok(JNIEnv * _env, jclass _b) {
3248 LDKCResult_NonePaymentSendFailureZ* ret = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
3249 *ret = CResult_NonePaymentSendFailureZ_ok();
3253 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1new(JNIEnv * _env, jclass _b, jlong a, jlong b, jlong c) {
3254 LDKChannelAnnouncement a_conv = *(LDKChannelAnnouncement*)a;
3256 a_conv.is_owned = true;
3257 LDKChannelUpdate b_conv = *(LDKChannelUpdate*)b;
3259 b_conv.is_owned = true;
3260 LDKChannelUpdate c_conv = *(LDKChannelUpdate*)c;
3262 c_conv.is_owned = true;
3263 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ");
3264 *ret = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(a_conv, b_conv, c_conv);
3268 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1ok(JNIEnv * _env, jclass _b) {
3269 LDKCResult_NonePeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
3270 *ret = CResult_NonePeerHandleErrorZ_ok();
3274 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1HTLCOutputInCommitmentSignatureZ_1new(JNIEnv * _env, jclass _b, jlong a, jlong b) {
3275 LDKHTLCOutputInCommitment a_conv = *(LDKHTLCOutputInCommitment*)a;
3277 a_conv.is_owned = true;
3278 LDKSignature b_conv = *(LDKSignature*)b;
3280 LDKC2Tuple_HTLCOutputInCommitmentSignatureZ* ret = MALLOC(sizeof(LDKC2Tuple_HTLCOutputInCommitmentSignatureZ), "LDKC2Tuple_HTLCOutputInCommitmentSignatureZ");
3281 *ret = C2Tuple_HTLCOutputInCommitmentSignatureZ_new(a_conv, b_conv);
3285 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Event_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3286 LDKEvent this_ptr_conv = *(LDKEvent*)this_ptr;
3287 FREE((void*)this_ptr);
3288 return Event_free(this_ptr_conv);
3291 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3292 LDKMessageSendEvent this_ptr_conv = *(LDKMessageSendEvent*)this_ptr;
3293 FREE((void*)this_ptr);
3294 return MessageSendEvent_free(this_ptr_conv);
3297 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageSendEventsProvider_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3298 LDKMessageSendEventsProvider this_ptr_conv = *(LDKMessageSendEventsProvider*)this_ptr;
3299 FREE((void*)this_ptr);
3300 return MessageSendEventsProvider_free(this_ptr_conv);
3303 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EventsProvider_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3304 LDKEventsProvider this_ptr_conv = *(LDKEventsProvider*)this_ptr;
3305 FREE((void*)this_ptr);
3306 return EventsProvider_free(this_ptr_conv);
3309 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_APIError_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3310 LDKAPIError this_ptr_conv = *(LDKAPIError*)this_ptr;
3311 FREE((void*)this_ptr);
3312 return APIError_free(this_ptr_conv);
3315 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1max(JNIEnv * _env, jclass _b) {
3316 jclass ret = LDKLevel_to_java(_env, Level_max());
3320 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Logger_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3321 LDKLogger this_ptr_conv = *(LDKLogger*)this_ptr;
3322 FREE((void*)this_ptr);
3323 return Logger_free(this_ptr_conv);
3326 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3327 LDKChannelHandshakeConfig this_ptr_conv = *(LDKChannelHandshakeConfig*)this_ptr;
3328 FREE((void*)this_ptr);
3329 this_ptr_conv.is_owned = true;
3330 return ChannelHandshakeConfig_free(this_ptr_conv);
3333 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1minimum_1depth(JNIEnv * _env, jclass _b, jlong this_ptr) {
3334 LDKChannelHandshakeConfig* this_ptr_conv = (LDKChannelHandshakeConfig*)this_ptr;
3335 return ChannelHandshakeConfig_get_minimum_depth(this_ptr_conv);
3338 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1minimum_1depth(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
3339 LDKChannelHandshakeConfig* this_ptr_conv = (LDKChannelHandshakeConfig*)this_ptr;
3340 return ChannelHandshakeConfig_set_minimum_depth(this_ptr_conv, val);
3343 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1our_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr) {
3344 LDKChannelHandshakeConfig* this_ptr_conv = (LDKChannelHandshakeConfig*)this_ptr;
3345 return ChannelHandshakeConfig_get_our_to_self_delay(this_ptr_conv);
3348 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1our_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
3349 LDKChannelHandshakeConfig* this_ptr_conv = (LDKChannelHandshakeConfig*)this_ptr;
3350 return ChannelHandshakeConfig_set_our_to_self_delay(this_ptr_conv, val);
3353 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1our_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
3354 LDKChannelHandshakeConfig* this_ptr_conv = (LDKChannelHandshakeConfig*)this_ptr;
3355 return ChannelHandshakeConfig_get_our_htlc_minimum_msat(this_ptr_conv);
3358 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1our_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3359 LDKChannelHandshakeConfig* this_ptr_conv = (LDKChannelHandshakeConfig*)this_ptr;
3360 return ChannelHandshakeConfig_set_our_htlc_minimum_msat(this_ptr_conv, val);
3363 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) {
3364 LDKChannelHandshakeConfig* ret = MALLOC(sizeof(LDKChannelHandshakeConfig), "LDKChannelHandshakeConfig");
3365 *ret = ChannelHandshakeConfig_new(minimum_depth_arg, our_to_self_delay_arg, our_htlc_minimum_msat_arg);
3366 DO_ASSERT(ret->is_owned);
3367 ret->is_owned = false;
3371 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1default(JNIEnv * _env, jclass _b) {
3372 LDKChannelHandshakeConfig* ret = MALLOC(sizeof(LDKChannelHandshakeConfig), "LDKChannelHandshakeConfig");
3373 *ret = ChannelHandshakeConfig_default();
3374 DO_ASSERT(ret->is_owned);
3375 ret->is_owned = false;
3379 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3380 LDKChannelHandshakeLimits this_ptr_conv = *(LDKChannelHandshakeLimits*)this_ptr;
3381 FREE((void*)this_ptr);
3382 this_ptr_conv.is_owned = true;
3383 return ChannelHandshakeLimits_free(this_ptr_conv);
3386 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1min_1funding_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
3387 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
3388 return ChannelHandshakeLimits_get_min_funding_satoshis(this_ptr_conv);
3391 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1min_1funding_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3392 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
3393 return ChannelHandshakeLimits_set_min_funding_satoshis(this_ptr_conv, val);
3396 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1max_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
3397 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
3398 return ChannelHandshakeLimits_get_max_htlc_minimum_msat(this_ptr_conv);
3401 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1max_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3402 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
3403 return ChannelHandshakeLimits_set_max_htlc_minimum_msat(this_ptr_conv, val);
3406 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1min_1max_1htlc_1value_1in_1flight_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
3407 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
3408 return ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(this_ptr_conv);
3411 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) {
3412 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
3413 return ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(this_ptr_conv, val);
3416 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1max_1channel_1reserve_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
3417 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
3418 return ChannelHandshakeLimits_get_max_channel_reserve_satoshis(this_ptr_conv);
3421 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1max_1channel_1reserve_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3422 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
3423 return ChannelHandshakeLimits_set_max_channel_reserve_satoshis(this_ptr_conv, val);
3426 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1min_1max_1accepted_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr) {
3427 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
3428 return ChannelHandshakeLimits_get_min_max_accepted_htlcs(this_ptr_conv);
3431 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1min_1max_1accepted_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
3432 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
3433 return ChannelHandshakeLimits_set_min_max_accepted_htlcs(this_ptr_conv, val);
3436 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1min_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
3437 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
3438 return ChannelHandshakeLimits_get_min_dust_limit_satoshis(this_ptr_conv);
3441 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1min_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3442 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
3443 return ChannelHandshakeLimits_set_min_dust_limit_satoshis(this_ptr_conv, val);
3446 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1max_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
3447 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
3448 return ChannelHandshakeLimits_get_max_dust_limit_satoshis(this_ptr_conv);
3451 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1max_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3452 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
3453 return ChannelHandshakeLimits_set_max_dust_limit_satoshis(this_ptr_conv, val);
3456 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1max_1minimum_1depth(JNIEnv * _env, jclass _b, jlong this_ptr) {
3457 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
3458 return ChannelHandshakeLimits_get_max_minimum_depth(this_ptr_conv);
3461 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1max_1minimum_1depth(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
3462 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
3463 return ChannelHandshakeLimits_set_max_minimum_depth(this_ptr_conv, val);
3466 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1force_1announced_1channel_1preference(JNIEnv * _env, jclass _b, jlong this_ptr) {
3467 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
3468 return ChannelHandshakeLimits_get_force_announced_channel_preference(this_ptr_conv);
3471 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1force_1announced_1channel_1preference(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
3472 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
3473 return ChannelHandshakeLimits_set_force_announced_channel_preference(this_ptr_conv, val);
3476 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1their_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr) {
3477 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
3478 return ChannelHandshakeLimits_get_their_to_self_delay(this_ptr_conv);
3481 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1their_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
3482 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
3483 return ChannelHandshakeLimits_set_their_to_self_delay(this_ptr_conv, val);
3486 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) {
3487 LDKChannelHandshakeLimits* ret = MALLOC(sizeof(LDKChannelHandshakeLimits), "LDKChannelHandshakeLimits");
3488 *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);
3489 DO_ASSERT(ret->is_owned);
3490 ret->is_owned = false;
3494 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1default(JNIEnv * _env, jclass _b) {
3495 LDKChannelHandshakeLimits* ret = MALLOC(sizeof(LDKChannelHandshakeLimits), "LDKChannelHandshakeLimits");
3496 *ret = ChannelHandshakeLimits_default();
3497 DO_ASSERT(ret->is_owned);
3498 ret->is_owned = false;
3502 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3503 LDKChannelConfig this_ptr_conv = *(LDKChannelConfig*)this_ptr;
3504 FREE((void*)this_ptr);
3505 this_ptr_conv.is_owned = true;
3506 return ChannelConfig_free(this_ptr_conv);
3509 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1fee_1proportional_1millionths(JNIEnv * _env, jclass _b, jlong this_ptr) {
3510 LDKChannelConfig* this_ptr_conv = (LDKChannelConfig*)this_ptr;
3511 return ChannelConfig_get_fee_proportional_millionths(this_ptr_conv);
3514 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1fee_1proportional_1millionths(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
3515 LDKChannelConfig* this_ptr_conv = (LDKChannelConfig*)this_ptr;
3516 return ChannelConfig_set_fee_proportional_millionths(this_ptr_conv, val);
3519 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1announced_1channel(JNIEnv * _env, jclass _b, jlong this_ptr) {
3520 LDKChannelConfig* this_ptr_conv = (LDKChannelConfig*)this_ptr;
3521 return ChannelConfig_get_announced_channel(this_ptr_conv);
3524 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1announced_1channel(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
3525 LDKChannelConfig* this_ptr_conv = (LDKChannelConfig*)this_ptr;
3526 return ChannelConfig_set_announced_channel(this_ptr_conv, val);
3529 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1commit_1upfront_1shutdown_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr) {
3530 LDKChannelConfig* this_ptr_conv = (LDKChannelConfig*)this_ptr;
3531 return ChannelConfig_get_commit_upfront_shutdown_pubkey(this_ptr_conv);
3534 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1commit_1upfront_1shutdown_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
3535 LDKChannelConfig* this_ptr_conv = (LDKChannelConfig*)this_ptr;
3536 return ChannelConfig_set_commit_upfront_shutdown_pubkey(this_ptr_conv, val);
3539 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) {
3540 LDKChannelConfig* ret = MALLOC(sizeof(LDKChannelConfig), "LDKChannelConfig");
3541 *ret = ChannelConfig_new(fee_proportional_millionths_arg, announced_channel_arg, commit_upfront_shutdown_pubkey_arg);
3542 DO_ASSERT(ret->is_owned);
3543 ret->is_owned = false;
3547 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1default(JNIEnv * _env, jclass _b) {
3548 LDKChannelConfig* ret = MALLOC(sizeof(LDKChannelConfig), "LDKChannelConfig");
3549 *ret = ChannelConfig_default();
3550 DO_ASSERT(ret->is_owned);
3551 ret->is_owned = false;
3555 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1write(JNIEnv * _env, jclass _b, jlong obj) {
3556 LDKChannelConfig* obj_conv = (LDKChannelConfig*)obj;
3557 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
3558 *ret = ChannelConfig_write(obj_conv);
3562 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1read(JNIEnv * _env, jclass _b, jlong ser) {
3563 LDKu8slice ser_conv = *(LDKu8slice*)ser;
3564 LDKChannelConfig* ret = MALLOC(sizeof(LDKChannelConfig), "LDKChannelConfig");
3565 *ret = ChannelConfig_read(ser_conv);
3566 DO_ASSERT(ret->is_owned);
3567 ret->is_owned = false;
3571 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3572 LDKUserConfig this_ptr_conv = *(LDKUserConfig*)this_ptr;
3573 FREE((void*)this_ptr);
3574 this_ptr_conv.is_owned = true;
3575 return UserConfig_free(this_ptr_conv);
3578 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1own_1channel_1config(JNIEnv * _env, jclass _b, jlong this_ptr) {
3579 LDKUserConfig* this_ptr_conv = (LDKUserConfig*)this_ptr;
3580 LDKChannelHandshakeConfig* ret = MALLOC(sizeof(LDKChannelHandshakeConfig), "LDKChannelHandshakeConfig");
3581 *ret = UserConfig_get_own_channel_config(this_ptr_conv);
3582 DO_ASSERT(ret->is_owned);
3583 ret->is_owned = false;
3587 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1own_1channel_1config(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3588 LDKUserConfig* this_ptr_conv = (LDKUserConfig*)this_ptr;
3589 LDKChannelHandshakeConfig val_conv = *(LDKChannelHandshakeConfig*)val;
3591 val_conv.is_owned = true;
3592 return UserConfig_set_own_channel_config(this_ptr_conv, val_conv);
3595 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1peer_1channel_1config_1limits(JNIEnv * _env, jclass _b, jlong this_ptr) {
3596 LDKUserConfig* this_ptr_conv = (LDKUserConfig*)this_ptr;
3597 LDKChannelHandshakeLimits* ret = MALLOC(sizeof(LDKChannelHandshakeLimits), "LDKChannelHandshakeLimits");
3598 *ret = UserConfig_get_peer_channel_config_limits(this_ptr_conv);
3599 DO_ASSERT(ret->is_owned);
3600 ret->is_owned = false;
3604 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1peer_1channel_1config_1limits(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3605 LDKUserConfig* this_ptr_conv = (LDKUserConfig*)this_ptr;
3606 LDKChannelHandshakeLimits val_conv = *(LDKChannelHandshakeLimits*)val;
3608 val_conv.is_owned = true;
3609 return UserConfig_set_peer_channel_config_limits(this_ptr_conv, val_conv);
3612 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1channel_1options(JNIEnv * _env, jclass _b, jlong this_ptr) {
3613 LDKUserConfig* this_ptr_conv = (LDKUserConfig*)this_ptr;
3614 LDKChannelConfig* ret = MALLOC(sizeof(LDKChannelConfig), "LDKChannelConfig");
3615 *ret = UserConfig_get_channel_options(this_ptr_conv);
3616 DO_ASSERT(ret->is_owned);
3617 ret->is_owned = false;
3621 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1channel_1options(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3622 LDKUserConfig* this_ptr_conv = (LDKUserConfig*)this_ptr;
3623 LDKChannelConfig val_conv = *(LDKChannelConfig*)val;
3625 val_conv.is_owned = true;
3626 return UserConfig_set_channel_options(this_ptr_conv, val_conv);
3629 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) {
3630 LDKChannelHandshakeConfig own_channel_config_arg_conv = *(LDKChannelHandshakeConfig*)own_channel_config_arg;
3631 FREE((void*)own_channel_config_arg);
3632 own_channel_config_arg_conv.is_owned = true;
3633 LDKChannelHandshakeLimits peer_channel_config_limits_arg_conv = *(LDKChannelHandshakeLimits*)peer_channel_config_limits_arg;
3634 FREE((void*)peer_channel_config_limits_arg);
3635 peer_channel_config_limits_arg_conv.is_owned = true;
3636 LDKChannelConfig channel_options_arg_conv = *(LDKChannelConfig*)channel_options_arg;
3637 FREE((void*)channel_options_arg);
3638 channel_options_arg_conv.is_owned = true;
3639 LDKUserConfig* ret = MALLOC(sizeof(LDKUserConfig), "LDKUserConfig");
3640 *ret = UserConfig_new(own_channel_config_arg_conv, peer_channel_config_limits_arg_conv, channel_options_arg_conv);
3641 DO_ASSERT(ret->is_owned);
3642 ret->is_owned = false;
3646 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UserConfig_1default(JNIEnv * _env, jclass _b) {
3647 LDKUserConfig* ret = MALLOC(sizeof(LDKUserConfig), "LDKUserConfig");
3648 *ret = UserConfig_default();
3649 DO_ASSERT(ret->is_owned);
3650 ret->is_owned = false;
3654 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Access_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3655 LDKAccess this_ptr_conv = *(LDKAccess*)this_ptr;
3656 FREE((void*)this_ptr);
3657 return Access_free(this_ptr_conv);
3660 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Watch_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3661 LDKWatch this_ptr_conv = *(LDKWatch*)this_ptr;
3662 FREE((void*)this_ptr);
3663 return Watch_free(this_ptr_conv);
3666 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Filter_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3667 LDKFilter this_ptr_conv = *(LDKFilter*)this_ptr;
3668 FREE((void*)this_ptr);
3669 return Filter_free(this_ptr_conv);
3672 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BroadcasterInterface_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3673 LDKBroadcasterInterface this_ptr_conv = *(LDKBroadcasterInterface*)this_ptr;
3674 FREE((void*)this_ptr);
3675 return BroadcasterInterface_free(this_ptr_conv);
3678 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FeeEstimator_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3679 LDKFeeEstimator this_ptr_conv = *(LDKFeeEstimator*)this_ptr;
3680 FREE((void*)this_ptr);
3681 return FeeEstimator_free(this_ptr_conv);
3684 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3685 LDKChainMonitor this_ptr_conv = *(LDKChainMonitor*)this_ptr;
3686 FREE((void*)this_ptr);
3687 this_ptr_conv.is_owned = true;
3688 return ChainMonitor_free(this_ptr_conv);
3691 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1block_1connected(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray header, jlong txdata, jint height) {
3692 LDKChainMonitor* this_arg_conv = (LDKChainMonitor*)this_arg;
3693 unsigned char header_arr[80];
3694 (*_env)->GetByteArrayRegion (_env, header, 0, 80, header_arr);
3695 unsigned char (*header_ref)[80] = &header_arr;
3696 LDKCVec_C2Tuple_usizeTransactionZZ txdata_conv = *(LDKCVec_C2Tuple_usizeTransactionZZ*)txdata;
3697 FREE((void*)txdata);
3698 return ChainMonitor_block_connected(this_arg_conv, header_ref, txdata_conv, height);
3701 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1block_1disconnected(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray header, jint disconnected_height) {
3702 LDKChainMonitor* this_arg_conv = (LDKChainMonitor*)this_arg;
3703 unsigned char header_arr[80];
3704 (*_env)->GetByteArrayRegion (_env, header, 0, 80, header_arr);
3705 unsigned char (*header_ref)[80] = &header_arr;
3706 return ChainMonitor_block_disconnected(this_arg_conv, header_ref, disconnected_height);
3709 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1new(JNIEnv * _env, jclass _b, jlong chain_source, jlong broadcaster, jlong logger, jlong feeest) {
3710 LDKFilter* chain_source_conv = (LDKFilter*)chain_source;
3711 LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)broadcaster;
3712 if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
3713 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
3714 LDKBroadcasterInterface_JCalls_clone(broadcaster_conv.this_arg);
3716 LDKLogger logger_conv = *(LDKLogger*)logger;
3717 if (logger_conv.free == LDKLogger_JCalls_free) {
3718 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
3719 LDKLogger_JCalls_clone(logger_conv.this_arg);
3721 LDKFeeEstimator feeest_conv = *(LDKFeeEstimator*)feeest;
3722 if (feeest_conv.free == LDKFeeEstimator_JCalls_free) {
3723 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
3724 LDKFeeEstimator_JCalls_clone(feeest_conv.this_arg);
3726 LDKChainMonitor* ret = MALLOC(sizeof(LDKChainMonitor), "LDKChainMonitor");
3727 *ret = ChainMonitor_new(chain_source_conv, broadcaster_conv, logger_conv, feeest_conv);
3728 DO_ASSERT(ret->is_owned);
3729 ret->is_owned = false;
3733 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1as_1Watch(JNIEnv * _env, jclass _b, jlong this_arg) {
3734 LDKChainMonitor* this_arg_conv = (LDKChainMonitor*)this_arg;
3735 LDKWatch* ret = MALLOC(sizeof(LDKWatch), "LDKWatch");
3736 *ret = ChainMonitor_as_Watch(this_arg_conv);
3740 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1as_1EventsProvider(JNIEnv * _env, jclass _b, jlong this_arg) {
3741 LDKChainMonitor* this_arg_conv = (LDKChainMonitor*)this_arg;
3742 LDKEventsProvider* ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider");
3743 *ret = ChainMonitor_as_EventsProvider(this_arg_conv);
3747 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3748 LDKChannelMonitorUpdate this_ptr_conv = *(LDKChannelMonitorUpdate*)this_ptr;
3749 FREE((void*)this_ptr);
3750 this_ptr_conv.is_owned = true;
3751 return ChannelMonitorUpdate_free(this_ptr_conv);
3754 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1get_1update_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
3755 LDKChannelMonitorUpdate* this_ptr_conv = (LDKChannelMonitorUpdate*)this_ptr;
3756 return ChannelMonitorUpdate_get_update_id(this_ptr_conv);
3759 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1set_1update_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3760 LDKChannelMonitorUpdate* this_ptr_conv = (LDKChannelMonitorUpdate*)this_ptr;
3761 return ChannelMonitorUpdate_set_update_id(this_ptr_conv, val);
3764 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1write(JNIEnv * _env, jclass _b, jlong obj) {
3765 LDKChannelMonitorUpdate* obj_conv = (LDKChannelMonitorUpdate*)obj;
3766 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
3767 *ret = ChannelMonitorUpdate_write(obj_conv);
3771 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1read(JNIEnv * _env, jclass _b, jlong ser) {
3772 LDKu8slice ser_conv = *(LDKu8slice*)ser;
3773 LDKChannelMonitorUpdate* ret = MALLOC(sizeof(LDKChannelMonitorUpdate), "LDKChannelMonitorUpdate");
3774 *ret = ChannelMonitorUpdate_read(ser_conv);
3775 DO_ASSERT(ret->is_owned);
3776 ret->is_owned = false;
3780 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorUpdateError_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3781 LDKMonitorUpdateError this_ptr_conv = *(LDKMonitorUpdateError*)this_ptr;
3782 FREE((void*)this_ptr);
3783 this_ptr_conv.is_owned = true;
3784 return MonitorUpdateError_free(this_ptr_conv);
3787 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3788 LDKMonitorEvent this_ptr_conv = *(LDKMonitorEvent*)this_ptr;
3789 FREE((void*)this_ptr);
3790 this_ptr_conv.is_owned = true;
3791 return MonitorEvent_free(this_ptr_conv);
3794 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3795 LDKHTLCUpdate this_ptr_conv = *(LDKHTLCUpdate*)this_ptr;
3796 FREE((void*)this_ptr);
3797 this_ptr_conv.is_owned = true;
3798 return HTLCUpdate_free(this_ptr_conv);
3801 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1write(JNIEnv * _env, jclass _b, jlong obj) {
3802 LDKHTLCUpdate* obj_conv = (LDKHTLCUpdate*)obj;
3803 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
3804 *ret = HTLCUpdate_write(obj_conv);
3808 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1read(JNIEnv * _env, jclass _b, jlong ser) {
3809 LDKu8slice ser_conv = *(LDKu8slice*)ser;
3810 LDKHTLCUpdate* ret = MALLOC(sizeof(LDKHTLCUpdate), "LDKHTLCUpdate");
3811 *ret = HTLCUpdate_read(ser_conv);
3812 DO_ASSERT(ret->is_owned);
3813 ret->is_owned = false;
3817 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3818 LDKChannelMonitor this_ptr_conv = *(LDKChannelMonitor*)this_ptr;
3819 FREE((void*)this_ptr);
3820 this_ptr_conv.is_owned = true;
3821 return ChannelMonitor_free(this_ptr_conv);
3824 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1update_1monitor(JNIEnv * _env, jclass _b, jlong this_arg, jlong updates, jlong broadcaster, jlong logger) {
3825 LDKChannelMonitor* this_arg_conv = (LDKChannelMonitor*)this_arg;
3826 LDKChannelMonitorUpdate updates_conv = *(LDKChannelMonitorUpdate*)updates;
3827 FREE((void*)updates);
3828 updates_conv.is_owned = true;
3829 LDKBroadcasterInterface* broadcaster_conv = (LDKBroadcasterInterface*)broadcaster;
3830 LDKLogger* logger_conv = (LDKLogger*)logger;
3831 LDKCResult_NoneMonitorUpdateErrorZ* ret = MALLOC(sizeof(LDKCResult_NoneMonitorUpdateErrorZ), "LDKCResult_NoneMonitorUpdateErrorZ");
3832 *ret = ChannelMonitor_update_monitor(this_arg_conv, updates_conv, broadcaster_conv, logger_conv);
3836 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1latest_1update_1id(JNIEnv * _env, jclass _b, jlong this_arg) {
3837 LDKChannelMonitor* this_arg_conv = (LDKChannelMonitor*)this_arg;
3838 return ChannelMonitor_get_latest_update_id(this_arg_conv);
3841 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1funding_1txo(JNIEnv * _env, jclass _b, jlong this_arg) {
3842 LDKChannelMonitor* this_arg_conv = (LDKChannelMonitor*)this_arg;
3843 LDKC2Tuple_OutPointScriptZ* ret = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ");
3844 *ret = ChannelMonitor_get_funding_txo(this_arg_conv);
3848 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1and_1clear_1pending_1monitor_1events(JNIEnv * _env, jclass _b, jlong this_arg) {
3849 LDKChannelMonitor* this_arg_conv = (LDKChannelMonitor*)this_arg;
3850 LDKCVec_MonitorEventZ* ret = MALLOC(sizeof(LDKCVec_MonitorEventZ), "LDKCVec_MonitorEventZ");
3851 *ret = ChannelMonitor_get_and_clear_pending_monitor_events(this_arg_conv);
3855 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1and_1clear_1pending_1events(JNIEnv * _env, jclass _b, jlong this_arg) {
3856 LDKChannelMonitor* this_arg_conv = (LDKChannelMonitor*)this_arg;
3857 LDKCVec_EventZ* ret = MALLOC(sizeof(LDKCVec_EventZ), "LDKCVec_EventZ");
3858 *ret = ChannelMonitor_get_and_clear_pending_events(this_arg_conv);
3862 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1latest_1holder_1commitment_1txn(JNIEnv * _env, jclass _b, jlong this_arg, jlong logger) {
3863 LDKChannelMonitor* this_arg_conv = (LDKChannelMonitor*)this_arg;
3864 LDKLogger* logger_conv = (LDKLogger*)logger;
3865 LDKCVec_TransactionZ* ret = MALLOC(sizeof(LDKCVec_TransactionZ), "LDKCVec_TransactionZ");
3866 *ret = ChannelMonitor_get_latest_holder_commitment_txn(this_arg_conv, logger_conv);
3870 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1block_1connected(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray header, jlong txdata, jint height, jlong broadcaster, jlong fee_estimator, jlong logger) {
3871 LDKChannelMonitor* this_arg_conv = (LDKChannelMonitor*)this_arg;
3872 unsigned char header_arr[80];
3873 (*_env)->GetByteArrayRegion (_env, header, 0, 80, header_arr);
3874 unsigned char (*header_ref)[80] = &header_arr;
3875 LDKCVec_C2Tuple_usizeTransactionZZ txdata_conv = *(LDKCVec_C2Tuple_usizeTransactionZZ*)txdata;
3876 FREE((void*)txdata);
3877 LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)broadcaster;
3878 if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
3879 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
3880 LDKBroadcasterInterface_JCalls_clone(broadcaster_conv.this_arg);
3882 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)fee_estimator;
3883 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
3884 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
3885 LDKFeeEstimator_JCalls_clone(fee_estimator_conv.this_arg);
3887 LDKLogger logger_conv = *(LDKLogger*)logger;
3888 if (logger_conv.free == LDKLogger_JCalls_free) {
3889 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
3890 LDKLogger_JCalls_clone(logger_conv.this_arg);
3892 LDKCVec_C2Tuple_TxidCVec_TxOutZZZ* ret = MALLOC(sizeof(LDKCVec_C2Tuple_TxidCVec_TxOutZZZ), "LDKCVec_C2Tuple_TxidCVec_TxOutZZZ");
3893 *ret = ChannelMonitor_block_connected(this_arg_conv, header_ref, txdata_conv, height, broadcaster_conv, fee_estimator_conv, logger_conv);
3897 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1block_1disconnected(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray header, jint height, jlong broadcaster, jlong fee_estimator, jlong logger) {
3898 LDKChannelMonitor* this_arg_conv = (LDKChannelMonitor*)this_arg;
3899 unsigned char header_arr[80];
3900 (*_env)->GetByteArrayRegion (_env, header, 0, 80, header_arr);
3901 unsigned char (*header_ref)[80] = &header_arr;
3902 LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)broadcaster;
3903 if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
3904 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
3905 LDKBroadcasterInterface_JCalls_clone(broadcaster_conv.this_arg);
3907 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)fee_estimator;
3908 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
3909 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
3910 LDKFeeEstimator_JCalls_clone(fee_estimator_conv.this_arg);
3912 LDKLogger logger_conv = *(LDKLogger*)logger;
3913 if (logger_conv.free == LDKLogger_JCalls_free) {
3914 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
3915 LDKLogger_JCalls_clone(logger_conv.this_arg);
3917 return ChannelMonitor_block_disconnected(this_arg_conv, header_ref, height, broadcaster_conv, fee_estimator_conv, logger_conv);
3920 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3921 LDKOutPoint this_ptr_conv = *(LDKOutPoint*)this_ptr;
3922 FREE((void*)this_ptr);
3923 this_ptr_conv.is_owned = true;
3924 return OutPoint_free(this_ptr_conv);
3927 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OutPoint_1get_1txid(JNIEnv * _env, jclass _b, jlong this_ptr) {
3928 LDKOutPoint* this_ptr_conv = (LDKOutPoint*)this_ptr;
3929 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3930 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *OutPoint_get_txid(this_ptr_conv));
3934 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1set_1txid(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3935 LDKOutPoint* this_ptr_conv = (LDKOutPoint*)this_ptr;
3936 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3938 return OutPoint_set_txid(this_ptr_conv, val_conv);
3941 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_OutPoint_1get_1index(JNIEnv * _env, jclass _b, jlong this_ptr) {
3942 LDKOutPoint* this_ptr_conv = (LDKOutPoint*)this_ptr;
3943 return OutPoint_get_index(this_ptr_conv);
3946 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1set_1index(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
3947 LDKOutPoint* this_ptr_conv = (LDKOutPoint*)this_ptr;
3948 return OutPoint_set_index(this_ptr_conv, val);
3951 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OutPoint_1new(JNIEnv * _env, jclass _b, jlong txid_arg, jshort index_arg) {
3952 LDKThirtyTwoBytes txid_arg_conv = *(LDKThirtyTwoBytes*)txid_arg;
3953 FREE((void*)txid_arg);
3954 LDKOutPoint* ret = MALLOC(sizeof(LDKOutPoint), "LDKOutPoint");
3955 *ret = OutPoint_new(txid_arg_conv, index_arg);
3956 DO_ASSERT(ret->is_owned);
3957 ret->is_owned = false;
3961 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OutPoint_1to_1channel_1id(JNIEnv * _env, jclass _b, jlong this_arg) {
3962 LDKOutPoint* this_arg_conv = (LDKOutPoint*)this_arg;
3963 LDKThirtyTwoBytes* ret = MALLOC(sizeof(LDKThirtyTwoBytes), "LDKThirtyTwoBytes");
3964 *ret = OutPoint_to_channel_id(this_arg_conv);
3968 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OutPoint_1write(JNIEnv * _env, jclass _b, jlong obj) {
3969 LDKOutPoint* obj_conv = (LDKOutPoint*)obj;
3970 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
3971 *ret = OutPoint_write(obj_conv);
3975 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OutPoint_1read(JNIEnv * _env, jclass _b, jlong ser) {
3976 LDKu8slice ser_conv = *(LDKu8slice*)ser;
3977 LDKOutPoint* ret = MALLOC(sizeof(LDKOutPoint), "LDKOutPoint");
3978 *ret = OutPoint_read(ser_conv);
3979 DO_ASSERT(ret->is_owned);
3980 ret->is_owned = false;
3984 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3985 LDKSpendableOutputDescriptor this_ptr_conv = *(LDKSpendableOutputDescriptor*)this_ptr;
3986 FREE((void*)this_ptr);
3987 return SpendableOutputDescriptor_free(this_ptr_conv);
3990 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3991 LDKChannelKeys this_ptr_conv = *(LDKChannelKeys*)this_ptr;
3992 FREE((void*)this_ptr);
3993 return ChannelKeys_free(this_ptr_conv);
3996 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_KeysInterface_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3997 LDKKeysInterface this_ptr_conv = *(LDKKeysInterface*)this_ptr;
3998 FREE((void*)this_ptr);
3999 return KeysInterface_free(this_ptr_conv);
4002 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4003 LDKInMemoryChannelKeys this_ptr_conv = *(LDKInMemoryChannelKeys*)this_ptr;
4004 FREE((void*)this_ptr);
4005 this_ptr_conv.is_owned = true;
4006 return InMemoryChannelKeys_free(this_ptr_conv);
4009 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1funding_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
4010 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
4011 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4012 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *InMemoryChannelKeys_get_funding_key(this_ptr_conv));
4016 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1funding_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4017 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
4018 LDKSecretKey val_conv = *(LDKSecretKey*)val;
4020 return InMemoryChannelKeys_set_funding_key(this_ptr_conv, val_conv);
4023 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1revocation_1base_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
4024 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
4025 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4026 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *InMemoryChannelKeys_get_revocation_base_key(this_ptr_conv));
4030 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1revocation_1base_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4031 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
4032 LDKSecretKey val_conv = *(LDKSecretKey*)val;
4034 return InMemoryChannelKeys_set_revocation_base_key(this_ptr_conv, val_conv);
4037 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1payment_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
4038 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
4039 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4040 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *InMemoryChannelKeys_get_payment_key(this_ptr_conv));
4044 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1payment_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4045 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
4046 LDKSecretKey val_conv = *(LDKSecretKey*)val;
4048 return InMemoryChannelKeys_set_payment_key(this_ptr_conv, val_conv);
4051 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1delayed_1payment_1base_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
4052 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
4053 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4054 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *InMemoryChannelKeys_get_delayed_payment_base_key(this_ptr_conv));
4058 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1delayed_1payment_1base_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4059 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
4060 LDKSecretKey val_conv = *(LDKSecretKey*)val;
4062 return InMemoryChannelKeys_set_delayed_payment_base_key(this_ptr_conv, val_conv);
4065 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1htlc_1base_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
4066 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
4067 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4068 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *InMemoryChannelKeys_get_htlc_base_key(this_ptr_conv));
4072 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1htlc_1base_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4073 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
4074 LDKSecretKey val_conv = *(LDKSecretKey*)val;
4076 return InMemoryChannelKeys_set_htlc_base_key(this_ptr_conv, val_conv);
4079 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1commitment_1seed(JNIEnv * _env, jclass _b, jlong this_ptr) {
4080 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
4081 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4082 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *InMemoryChannelKeys_get_commitment_seed(this_ptr_conv));
4086 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1commitment_1seed(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4087 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
4088 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4090 return InMemoryChannelKeys_set_commitment_seed(this_ptr_conv, val_conv);
4093 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) {
4094 LDKSecretKey funding_key_conv = *(LDKSecretKey*)funding_key;
4095 FREE((void*)funding_key);
4096 LDKSecretKey revocation_base_key_conv = *(LDKSecretKey*)revocation_base_key;
4097 FREE((void*)revocation_base_key);
4098 LDKSecretKey payment_key_conv = *(LDKSecretKey*)payment_key;
4099 FREE((void*)payment_key);
4100 LDKSecretKey delayed_payment_base_key_conv = *(LDKSecretKey*)delayed_payment_base_key;
4101 FREE((void*)delayed_payment_base_key);
4102 LDKSecretKey htlc_base_key_conv = *(LDKSecretKey*)htlc_base_key;
4103 FREE((void*)htlc_base_key);
4104 LDKThirtyTwoBytes commitment_seed_conv = *(LDKThirtyTwoBytes*)commitment_seed;
4105 FREE((void*)commitment_seed);
4106 LDKC2Tuple_u64u64Z key_derivation_params_conv = *(LDKC2Tuple_u64u64Z*)key_derivation_params;
4107 FREE((void*)key_derivation_params);
4108 LDKInMemoryChannelKeys* ret = MALLOC(sizeof(LDKInMemoryChannelKeys), "LDKInMemoryChannelKeys");
4109 *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);
4110 DO_ASSERT(ret->is_owned);
4111 ret->is_owned = false;
4115 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1counterparty_1pubkeys(JNIEnv * _env, jclass _b, jlong this_arg) {
4116 LDKInMemoryChannelKeys* this_arg_conv = (LDKInMemoryChannelKeys*)this_arg;
4117 LDKChannelPublicKeys* ret = MALLOC(sizeof(LDKChannelPublicKeys), "LDKChannelPublicKeys");
4118 *ret = InMemoryChannelKeys_counterparty_pubkeys(this_arg_conv);
4119 DO_ASSERT(ret->is_owned);
4120 ret->is_owned = false;
4124 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1counterparty_1selected_1contest_1delay(JNIEnv * _env, jclass _b, jlong this_arg) {
4125 LDKInMemoryChannelKeys* this_arg_conv = (LDKInMemoryChannelKeys*)this_arg;
4126 return InMemoryChannelKeys_counterparty_selected_contest_delay(this_arg_conv);
4129 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1holder_1selected_1contest_1delay(JNIEnv * _env, jclass _b, jlong this_arg) {
4130 LDKInMemoryChannelKeys* this_arg_conv = (LDKInMemoryChannelKeys*)this_arg;
4131 return InMemoryChannelKeys_holder_selected_contest_delay(this_arg_conv);
4134 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1as_1ChannelKeys(JNIEnv * _env, jclass _b, jlong this_arg) {
4135 LDKInMemoryChannelKeys* this_arg_conv = (LDKInMemoryChannelKeys*)this_arg;
4136 LDKChannelKeys* ret = MALLOC(sizeof(LDKChannelKeys), "LDKChannelKeys");
4137 *ret = InMemoryChannelKeys_as_ChannelKeys(this_arg_conv);
4141 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1write(JNIEnv * _env, jclass _b, jlong obj) {
4142 LDKInMemoryChannelKeys* obj_conv = (LDKInMemoryChannelKeys*)obj;
4143 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
4144 *ret = InMemoryChannelKeys_write(obj_conv);
4148 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1read(JNIEnv * _env, jclass _b, jlong ser) {
4149 LDKu8slice ser_conv = *(LDKu8slice*)ser;
4150 LDKInMemoryChannelKeys* ret = MALLOC(sizeof(LDKInMemoryChannelKeys), "LDKInMemoryChannelKeys");
4151 *ret = InMemoryChannelKeys_read(ser_conv);
4152 DO_ASSERT(ret->is_owned);
4153 ret->is_owned = false;
4157 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_KeysManager_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4158 LDKKeysManager this_ptr_conv = *(LDKKeysManager*)this_ptr;
4159 FREE((void*)this_ptr);
4160 this_ptr_conv.is_owned = true;
4161 return KeysManager_free(this_ptr_conv);
4164 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_KeysManager_1new(JNIEnv * _env, jclass _b, jbyteArray seed, jclass network, jlong starting_time_secs, jint starting_time_nanos) {
4165 unsigned char seed_arr[32];
4166 (*_env)->GetByteArrayRegion (_env, seed, 0, 32, seed_arr);
4167 unsigned char (*seed_ref)[32] = &seed_arr;
4168 LDKNetwork network_conv = LDKNetwork_from_java(_env, network);
4169 LDKKeysManager* ret = MALLOC(sizeof(LDKKeysManager), "LDKKeysManager");
4170 *ret = KeysManager_new(seed_ref, network_conv, starting_time_secs, starting_time_nanos);
4171 DO_ASSERT(ret->is_owned);
4172 ret->is_owned = false;
4176 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) {
4177 LDKKeysManager* this_arg_conv = (LDKKeysManager*)this_arg;
4178 LDKInMemoryChannelKeys* ret = MALLOC(sizeof(LDKInMemoryChannelKeys), "LDKInMemoryChannelKeys");
4179 *ret = KeysManager_derive_channel_keys(this_arg_conv, channel_value_satoshis, params_1, params_2);
4180 DO_ASSERT(ret->is_owned);
4181 ret->is_owned = false;
4185 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_KeysManager_1as_1KeysInterface(JNIEnv * _env, jclass _b, jlong this_arg) {
4186 LDKKeysManager* this_arg_conv = (LDKKeysManager*)this_arg;
4187 LDKKeysInterface* ret = MALLOC(sizeof(LDKKeysInterface), "LDKKeysInterface");
4188 *ret = KeysManager_as_KeysInterface(this_arg_conv);
4192 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4193 LDKChannelManager this_ptr_conv = *(LDKChannelManager*)this_ptr;
4194 FREE((void*)this_ptr);
4195 this_ptr_conv.is_owned = true;
4196 return ChannelManager_free(this_ptr_conv);
4199 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4200 LDKChannelDetails this_ptr_conv = *(LDKChannelDetails*)this_ptr;
4201 FREE((void*)this_ptr);
4202 this_ptr_conv.is_owned = true;
4203 return ChannelDetails_free(this_ptr_conv);
4206 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4207 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
4208 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4209 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *ChannelDetails_get_channel_id(this_ptr_conv));
4213 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4214 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
4215 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4217 return ChannelDetails_set_channel_id(this_ptr_conv, val_conv);
4220 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1remote_1network_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4221 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
4222 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
4223 *ret = ChannelDetails_get_remote_network_id(this_ptr_conv);
4227 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1remote_1network_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4228 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
4229 LDKPublicKey val_conv = *(LDKPublicKey*)val;
4231 return ChannelDetails_set_remote_network_id(this_ptr_conv, val_conv);
4234 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1counterparty_1features(JNIEnv * _env, jclass _b, jlong this_ptr) {
4235 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
4236 LDKInitFeatures* ret = MALLOC(sizeof(LDKInitFeatures), "LDKInitFeatures");
4237 *ret = ChannelDetails_get_counterparty_features(this_ptr_conv);
4238 DO_ASSERT(ret->is_owned);
4239 ret->is_owned = false;
4243 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1counterparty_1features(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4244 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
4245 LDKInitFeatures val_conv = *(LDKInitFeatures*)val;
4247 val_conv.is_owned = true;
4248 return ChannelDetails_set_counterparty_features(this_ptr_conv, val_conv);
4251 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1channel_1value_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
4252 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
4253 return ChannelDetails_get_channel_value_satoshis(this_ptr_conv);
4256 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1channel_1value_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4257 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
4258 return ChannelDetails_set_channel_value_satoshis(this_ptr_conv, val);
4261 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1user_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4262 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
4263 return ChannelDetails_get_user_id(this_ptr_conv);
4266 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1user_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4267 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
4268 return ChannelDetails_set_user_id(this_ptr_conv, val);
4271 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1outbound_1capacity_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
4272 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
4273 return ChannelDetails_get_outbound_capacity_msat(this_ptr_conv);
4276 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1outbound_1capacity_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4277 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
4278 return ChannelDetails_set_outbound_capacity_msat(this_ptr_conv, val);
4281 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1inbound_1capacity_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
4282 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
4283 return ChannelDetails_get_inbound_capacity_msat(this_ptr_conv);
4286 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1inbound_1capacity_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4287 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
4288 return ChannelDetails_set_inbound_capacity_msat(this_ptr_conv, val);
4291 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1is_1live(JNIEnv * _env, jclass _b, jlong this_ptr) {
4292 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
4293 return ChannelDetails_get_is_live(this_ptr_conv);
4296 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1is_1live(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
4297 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
4298 return ChannelDetails_set_is_live(this_ptr_conv, val);
4301 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4302 LDKPaymentSendFailure this_ptr_conv = *(LDKPaymentSendFailure*)this_ptr;
4303 FREE((void*)this_ptr);
4304 this_ptr_conv.is_owned = true;
4305 return PaymentSendFailure_free(this_ptr_conv);
4308 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1new(JNIEnv * _env, jclass _b, jclass network, jlong fee_est, jlong chain_monitor, jlong tx_broadcaster, jlong logger, jlong keys_manager, jlong config, jlong current_blockchain_height) {
4309 LDKNetwork network_conv = LDKNetwork_from_java(_env, network);
4310 LDKFeeEstimator fee_est_conv = *(LDKFeeEstimator*)fee_est;
4311 if (fee_est_conv.free == LDKFeeEstimator_JCalls_free) {
4312 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
4313 LDKFeeEstimator_JCalls_clone(fee_est_conv.this_arg);
4315 LDKWatch chain_monitor_conv = *(LDKWatch*)chain_monitor;
4316 if (chain_monitor_conv.free == LDKWatch_JCalls_free) {
4317 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
4318 LDKWatch_JCalls_clone(chain_monitor_conv.this_arg);
4320 LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)tx_broadcaster;
4321 if (tx_broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
4322 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
4323 LDKBroadcasterInterface_JCalls_clone(tx_broadcaster_conv.this_arg);
4325 LDKLogger logger_conv = *(LDKLogger*)logger;
4326 if (logger_conv.free == LDKLogger_JCalls_free) {
4327 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
4328 LDKLogger_JCalls_clone(logger_conv.this_arg);
4330 LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)keys_manager;
4331 if (keys_manager_conv.free == LDKKeysInterface_JCalls_free) {
4332 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
4333 LDKKeysInterface_JCalls_clone(keys_manager_conv.this_arg);
4335 LDKUserConfig config_conv = *(LDKUserConfig*)config;
4336 FREE((void*)config);
4337 config_conv.is_owned = true;
4338 LDKChannelManager* ret = MALLOC(sizeof(LDKChannelManager), "LDKChannelManager");
4339 *ret = ChannelManager_new(network_conv, fee_est_conv, chain_monitor_conv, tx_broadcaster_conv, logger_conv, keys_manager_conv, config_conv, current_blockchain_height);
4340 DO_ASSERT(ret->is_owned);
4341 ret->is_owned = false;
4345 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) {
4346 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
4347 LDKPublicKey their_network_key_conv = *(LDKPublicKey*)their_network_key;
4348 FREE((void*)their_network_key);
4349 LDKUserConfig override_config_conv = *(LDKUserConfig*)override_config;
4350 FREE((void*)override_config);
4351 override_config_conv.is_owned = true;
4352 LDKCResult_NoneAPIErrorZ* ret = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
4353 *ret = ChannelManager_create_channel(this_arg_conv, their_network_key_conv, channel_value_satoshis, push_msat, user_id, override_config_conv);
4357 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1list_1channels(JNIEnv * _env, jclass _b, jlong this_arg) {
4358 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
4359 LDKCVec_ChannelDetailsZ* ret = MALLOC(sizeof(LDKCVec_ChannelDetailsZ), "LDKCVec_ChannelDetailsZ");
4360 *ret = ChannelManager_list_channels(this_arg_conv);
4364 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1list_1usable_1channels(JNIEnv * _env, jclass _b, jlong this_arg) {
4365 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
4366 LDKCVec_ChannelDetailsZ* ret = MALLOC(sizeof(LDKCVec_ChannelDetailsZ), "LDKCVec_ChannelDetailsZ");
4367 *ret = ChannelManager_list_usable_channels(this_arg_conv);
4371 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1close_1channel(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray channel_id) {
4372 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
4373 unsigned char channel_id_arr[32];
4374 (*_env)->GetByteArrayRegion (_env, channel_id, 0, 32, channel_id_arr);
4375 unsigned char (*channel_id_ref)[32] = &channel_id_arr;
4376 LDKCResult_NoneAPIErrorZ* ret = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
4377 *ret = ChannelManager_close_channel(this_arg_conv, channel_id_ref);
4381 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1close_1channel(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray channel_id) {
4382 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
4383 unsigned char channel_id_arr[32];
4384 (*_env)->GetByteArrayRegion (_env, channel_id, 0, 32, channel_id_arr);
4385 unsigned char (*channel_id_ref)[32] = &channel_id_arr;
4386 return ChannelManager_force_close_channel(this_arg_conv, channel_id_ref);
4389 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1close_1all_1channels(JNIEnv * _env, jclass _b, jlong this_arg) {
4390 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
4391 return ChannelManager_force_close_all_channels(this_arg_conv);
4394 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) {
4395 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
4396 LDKRoute* route_conv = (LDKRoute*)route;
4397 LDKThirtyTwoBytes payment_hash_conv = *(LDKThirtyTwoBytes*)payment_hash;
4398 FREE((void*)payment_hash);
4399 LDKThirtyTwoBytes payment_secret_conv = *(LDKThirtyTwoBytes*)payment_secret;
4400 FREE((void*)payment_secret);
4401 LDKCResult_NonePaymentSendFailureZ* ret = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
4402 *ret = ChannelManager_send_payment(this_arg_conv, route_conv, payment_hash_conv, payment_secret_conv);
4406 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) {
4407 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
4408 unsigned char temporary_channel_id_arr[32];
4409 (*_env)->GetByteArrayRegion (_env, temporary_channel_id, 0, 32, temporary_channel_id_arr);
4410 unsigned char (*temporary_channel_id_ref)[32] = &temporary_channel_id_arr;
4411 LDKOutPoint funding_txo_conv = *(LDKOutPoint*)funding_txo;
4412 FREE((void*)funding_txo);
4413 funding_txo_conv.is_owned = true;
4414 return ChannelManager_funding_transaction_generated(this_arg_conv, temporary_channel_id_ref, funding_txo_conv);
4417 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) {
4418 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
4419 LDKThreeBytes rgb_conv = *(LDKThreeBytes*)rgb;
4421 LDKThirtyTwoBytes alias_conv = *(LDKThirtyTwoBytes*)alias;
4423 LDKCVec_NetAddressZ addresses_conv = *(LDKCVec_NetAddressZ*)addresses;
4424 FREE((void*)addresses);
4425 return ChannelManager_broadcast_node_announcement(this_arg_conv, rgb_conv, alias_conv, addresses_conv);
4428 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1process_1pending_1htlc_1forwards(JNIEnv * _env, jclass _b, jlong this_arg) {
4429 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
4430 return ChannelManager_process_pending_htlc_forwards(this_arg_conv);
4433 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1timer_1chan_1freshness_1every_1min(JNIEnv * _env, jclass _b, jlong this_arg) {
4434 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
4435 return ChannelManager_timer_chan_freshness_every_min(this_arg_conv);
4438 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) {
4439 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
4440 unsigned char payment_hash_arr[32];
4441 (*_env)->GetByteArrayRegion (_env, payment_hash, 0, 32, payment_hash_arr);
4442 unsigned char (*payment_hash_ref)[32] = &payment_hash_arr;
4443 LDKThirtyTwoBytes payment_secret_conv = *(LDKThirtyTwoBytes*)payment_secret;
4444 FREE((void*)payment_secret);
4445 return ChannelManager_fail_htlc_backwards(this_arg_conv, payment_hash_ref, payment_secret_conv);
4448 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) {
4449 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
4450 LDKThirtyTwoBytes payment_preimage_conv = *(LDKThirtyTwoBytes*)payment_preimage;
4451 FREE((void*)payment_preimage);
4452 LDKThirtyTwoBytes payment_secret_conv = *(LDKThirtyTwoBytes*)payment_secret;
4453 FREE((void*)payment_secret);
4454 return ChannelManager_claim_funds(this_arg_conv, payment_preimage_conv, payment_secret_conv, expected_amount);
4457 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1our_1node_1id(JNIEnv * _env, jclass _b, jlong this_arg) {
4458 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
4459 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
4460 *ret = ChannelManager_get_our_node_id(this_arg_conv);
4464 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) {
4465 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
4466 LDKOutPoint* funding_txo_conv = (LDKOutPoint*)funding_txo;
4467 return ChannelManager_channel_monitor_updated(this_arg_conv, funding_txo_conv, highest_applied_update_id);
4470 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1MessageSendEventsProvider(JNIEnv * _env, jclass _b, jlong this_arg) {
4471 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
4472 LDKMessageSendEventsProvider* ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
4473 *ret = ChannelManager_as_MessageSendEventsProvider(this_arg_conv);
4477 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1EventsProvider(JNIEnv * _env, jclass _b, jlong this_arg) {
4478 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
4479 LDKEventsProvider* ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider");
4480 *ret = ChannelManager_as_EventsProvider(this_arg_conv);
4484 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1block_1connected(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray header, jlong txdata, jint height) {
4485 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
4486 unsigned char header_arr[80];
4487 (*_env)->GetByteArrayRegion (_env, header, 0, 80, header_arr);
4488 unsigned char (*header_ref)[80] = &header_arr;
4489 LDKCVec_C2Tuple_usizeTransactionZZ txdata_conv = *(LDKCVec_C2Tuple_usizeTransactionZZ*)txdata;
4490 FREE((void*)txdata);
4491 return ChannelManager_block_connected(this_arg_conv, header_ref, txdata_conv, height);
4494 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1block_1disconnected(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray header) {
4495 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
4496 unsigned char header_arr[80];
4497 (*_env)->GetByteArrayRegion (_env, header, 0, 80, header_arr);
4498 unsigned char (*header_ref)[80] = &header_arr;
4499 return ChannelManager_block_disconnected(this_arg_conv, header_ref);
4502 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1ChannelMessageHandler(JNIEnv * _env, jclass _b, jlong this_arg) {
4503 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
4504 LDKChannelMessageHandler* ret = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler");
4505 *ret = ChannelManager_as_ChannelMessageHandler(this_arg_conv);
4509 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4510 LDKChannelManagerReadArgs this_ptr_conv = *(LDKChannelManagerReadArgs*)this_ptr;
4511 FREE((void*)this_ptr);
4512 this_ptr_conv.is_owned = true;
4513 return ChannelManagerReadArgs_free(this_ptr_conv);
4516 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1keys_1manager(JNIEnv * _env, jclass _b, jlong this_ptr) {
4517 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
4518 long ret = (long)ChannelManagerReadArgs_get_keys_manager(this_ptr_conv);
4522 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1keys_1manager(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4523 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
4524 LDKKeysInterface val_conv = *(LDKKeysInterface*)val;
4525 if (val_conv.free == LDKKeysInterface_JCalls_free) {
4526 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
4527 LDKKeysInterface_JCalls_clone(val_conv.this_arg);
4529 return ChannelManagerReadArgs_set_keys_manager(this_ptr_conv, val_conv);
4532 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1fee_1estimator(JNIEnv * _env, jclass _b, jlong this_ptr) {
4533 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
4534 long ret = (long)ChannelManagerReadArgs_get_fee_estimator(this_ptr_conv);
4538 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1fee_1estimator(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4539 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
4540 LDKFeeEstimator val_conv = *(LDKFeeEstimator*)val;
4541 if (val_conv.free == LDKFeeEstimator_JCalls_free) {
4542 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
4543 LDKFeeEstimator_JCalls_clone(val_conv.this_arg);
4545 return ChannelManagerReadArgs_set_fee_estimator(this_ptr_conv, val_conv);
4548 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1chain_1monitor(JNIEnv * _env, jclass _b, jlong this_ptr) {
4549 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
4550 long ret = (long)ChannelManagerReadArgs_get_chain_monitor(this_ptr_conv);
4554 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1chain_1monitor(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4555 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
4556 LDKWatch val_conv = *(LDKWatch*)val;
4557 if (val_conv.free == LDKWatch_JCalls_free) {
4558 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
4559 LDKWatch_JCalls_clone(val_conv.this_arg);
4561 return ChannelManagerReadArgs_set_chain_monitor(this_ptr_conv, val_conv);
4564 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1tx_1broadcaster(JNIEnv * _env, jclass _b, jlong this_ptr) {
4565 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
4566 long ret = (long)ChannelManagerReadArgs_get_tx_broadcaster(this_ptr_conv);
4570 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1tx_1broadcaster(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4571 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
4572 LDKBroadcasterInterface val_conv = *(LDKBroadcasterInterface*)val;
4573 if (val_conv.free == LDKBroadcasterInterface_JCalls_free) {
4574 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
4575 LDKBroadcasterInterface_JCalls_clone(val_conv.this_arg);
4577 return ChannelManagerReadArgs_set_tx_broadcaster(this_ptr_conv, val_conv);
4580 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1logger(JNIEnv * _env, jclass _b, jlong this_ptr) {
4581 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
4582 long ret = (long)ChannelManagerReadArgs_get_logger(this_ptr_conv);
4586 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1logger(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4587 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
4588 LDKLogger val_conv = *(LDKLogger*)val;
4589 if (val_conv.free == LDKLogger_JCalls_free) {
4590 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
4591 LDKLogger_JCalls_clone(val_conv.this_arg);
4593 return ChannelManagerReadArgs_set_logger(this_ptr_conv, val_conv);
4596 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1default_1config(JNIEnv * _env, jclass _b, jlong this_ptr) {
4597 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
4598 LDKUserConfig* ret = MALLOC(sizeof(LDKUserConfig), "LDKUserConfig");
4599 *ret = ChannelManagerReadArgs_get_default_config(this_ptr_conv);
4600 DO_ASSERT(ret->is_owned);
4601 ret->is_owned = false;
4605 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1default_1config(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4606 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
4607 LDKUserConfig val_conv = *(LDKUserConfig*)val;
4609 val_conv.is_owned = true;
4610 return ChannelManagerReadArgs_set_default_config(this_ptr_conv, val_conv);
4613 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1new(JNIEnv * _env, jclass _b, jlong keys_manager, jlong fee_estimator, jlong chain_monitor, jlong tx_broadcaster, jlong logger, jlong default_config, jlong channel_monitors) {
4614 LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)keys_manager;
4615 if (keys_manager_conv.free == LDKKeysInterface_JCalls_free) {
4616 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
4617 LDKKeysInterface_JCalls_clone(keys_manager_conv.this_arg);
4619 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)fee_estimator;
4620 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
4621 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
4622 LDKFeeEstimator_JCalls_clone(fee_estimator_conv.this_arg);
4624 LDKWatch chain_monitor_conv = *(LDKWatch*)chain_monitor;
4625 if (chain_monitor_conv.free == LDKWatch_JCalls_free) {
4626 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
4627 LDKWatch_JCalls_clone(chain_monitor_conv.this_arg);
4629 LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)tx_broadcaster;
4630 if (tx_broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
4631 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
4632 LDKBroadcasterInterface_JCalls_clone(tx_broadcaster_conv.this_arg);
4634 LDKLogger logger_conv = *(LDKLogger*)logger;
4635 if (logger_conv.free == LDKLogger_JCalls_free) {
4636 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
4637 LDKLogger_JCalls_clone(logger_conv.this_arg);
4639 LDKUserConfig default_config_conv = *(LDKUserConfig*)default_config;
4640 FREE((void*)default_config);
4641 default_config_conv.is_owned = true;
4642 LDKCVec_ChannelMonitorZ channel_monitors_conv = *(LDKCVec_ChannelMonitorZ*)channel_monitors;
4643 FREE((void*)channel_monitors);
4644 LDKChannelManagerReadArgs* ret = MALLOC(sizeof(LDKChannelManagerReadArgs), "LDKChannelManagerReadArgs");
4645 *ret = ChannelManagerReadArgs_new(keys_manager_conv, fee_estimator_conv, chain_monitor_conv, tx_broadcaster_conv, logger_conv, default_config_conv, channel_monitors_conv);
4646 DO_ASSERT(ret->is_owned);
4647 ret->is_owned = false;
4651 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DecodeError_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4652 LDKDecodeError this_ptr_conv = *(LDKDecodeError*)this_ptr;
4653 FREE((void*)this_ptr);
4654 this_ptr_conv.is_owned = true;
4655 return DecodeError_free(this_ptr_conv);
4658 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Init_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4659 LDKInit this_ptr_conv = *(LDKInit*)this_ptr;
4660 FREE((void*)this_ptr);
4661 this_ptr_conv.is_owned = true;
4662 return Init_free(this_ptr_conv);
4665 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4666 LDKErrorMessage this_ptr_conv = *(LDKErrorMessage*)this_ptr;
4667 FREE((void*)this_ptr);
4668 this_ptr_conv.is_owned = true;
4669 return ErrorMessage_free(this_ptr_conv);
4672 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4673 LDKErrorMessage* this_ptr_conv = (LDKErrorMessage*)this_ptr;
4674 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4675 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *ErrorMessage_get_channel_id(this_ptr_conv));
4679 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4680 LDKErrorMessage* this_ptr_conv = (LDKErrorMessage*)this_ptr;
4681 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4683 return ErrorMessage_set_channel_id(this_ptr_conv, val_conv);
4686 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1get_1data(JNIEnv * _env, jclass _b, jlong this_ptr) {
4687 LDKErrorMessage* this_ptr_conv = (LDKErrorMessage*)this_ptr;
4688 LDKStr* ret = MALLOC(sizeof(LDKStr), "LDKStr");
4689 *ret = ErrorMessage_get_data(this_ptr_conv);
4693 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1set_1data(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4694 LDKErrorMessage* this_ptr_conv = (LDKErrorMessage*)this_ptr;
4695 LDKCVec_u8Z val_conv = *(LDKCVec_u8Z*)val;
4697 return ErrorMessage_set_data(this_ptr_conv, val_conv);
4700 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1new(JNIEnv * _env, jclass _b, jlong channel_id_arg, jlong data_arg) {
4701 LDKThirtyTwoBytes channel_id_arg_conv = *(LDKThirtyTwoBytes*)channel_id_arg;
4702 FREE((void*)channel_id_arg);
4703 LDKCVec_u8Z data_arg_conv = *(LDKCVec_u8Z*)data_arg;
4704 FREE((void*)data_arg);
4705 LDKErrorMessage* ret = MALLOC(sizeof(LDKErrorMessage), "LDKErrorMessage");
4706 *ret = ErrorMessage_new(channel_id_arg_conv, data_arg_conv);
4707 DO_ASSERT(ret->is_owned);
4708 ret->is_owned = false;
4712 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Ping_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4713 LDKPing this_ptr_conv = *(LDKPing*)this_ptr;
4714 FREE((void*)this_ptr);
4715 this_ptr_conv.is_owned = true;
4716 return Ping_free(this_ptr_conv);
4719 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_Ping_1get_1ponglen(JNIEnv * _env, jclass _b, jlong this_ptr) {
4720 LDKPing* this_ptr_conv = (LDKPing*)this_ptr;
4721 return Ping_get_ponglen(this_ptr_conv);
4724 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Ping_1set_1ponglen(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
4725 LDKPing* this_ptr_conv = (LDKPing*)this_ptr;
4726 return Ping_set_ponglen(this_ptr_conv, val);
4729 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_Ping_1get_1byteslen(JNIEnv * _env, jclass _b, jlong this_ptr) {
4730 LDKPing* this_ptr_conv = (LDKPing*)this_ptr;
4731 return Ping_get_byteslen(this_ptr_conv);
4734 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Ping_1set_1byteslen(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
4735 LDKPing* this_ptr_conv = (LDKPing*)this_ptr;
4736 return Ping_set_byteslen(this_ptr_conv, val);
4739 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Ping_1new(JNIEnv * _env, jclass _b, jshort ponglen_arg, jshort byteslen_arg) {
4740 LDKPing* ret = MALLOC(sizeof(LDKPing), "LDKPing");
4741 *ret = Ping_new(ponglen_arg, byteslen_arg);
4742 DO_ASSERT(ret->is_owned);
4743 ret->is_owned = false;
4747 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Pong_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4748 LDKPong this_ptr_conv = *(LDKPong*)this_ptr;
4749 FREE((void*)this_ptr);
4750 this_ptr_conv.is_owned = true;
4751 return Pong_free(this_ptr_conv);
4754 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_Pong_1get_1byteslen(JNIEnv * _env, jclass _b, jlong this_ptr) {
4755 LDKPong* this_ptr_conv = (LDKPong*)this_ptr;
4756 return Pong_get_byteslen(this_ptr_conv);
4759 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Pong_1set_1byteslen(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
4760 LDKPong* this_ptr_conv = (LDKPong*)this_ptr;
4761 return Pong_set_byteslen(this_ptr_conv, val);
4764 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Pong_1new(JNIEnv * _env, jclass _b, jshort byteslen_arg) {
4765 LDKPong* ret = MALLOC(sizeof(LDKPong), "LDKPong");
4766 *ret = Pong_new(byteslen_arg);
4767 DO_ASSERT(ret->is_owned);
4768 ret->is_owned = false;
4772 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4773 LDKOpenChannel this_ptr_conv = *(LDKOpenChannel*)this_ptr;
4774 FREE((void*)this_ptr);
4775 this_ptr_conv.is_owned = true;
4776 return OpenChannel_free(this_ptr_conv);
4779 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
4780 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
4781 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4782 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *OpenChannel_get_chain_hash(this_ptr_conv));
4786 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4787 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
4788 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4790 return OpenChannel_set_chain_hash(this_ptr_conv, val_conv);
4793 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1temporary_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4794 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
4795 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4796 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *OpenChannel_get_temporary_channel_id(this_ptr_conv));
4800 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1temporary_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4801 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
4802 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4804 return OpenChannel_set_temporary_channel_id(this_ptr_conv, val_conv);
4807 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1funding_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
4808 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
4809 return OpenChannel_get_funding_satoshis(this_ptr_conv);
4812 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1funding_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4813 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
4814 return OpenChannel_set_funding_satoshis(this_ptr_conv, val);
4817 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1push_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
4818 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
4819 return OpenChannel_get_push_msat(this_ptr_conv);
4822 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1push_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4823 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
4824 return OpenChannel_set_push_msat(this_ptr_conv, val);
4827 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
4828 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
4829 return OpenChannel_get_dust_limit_satoshis(this_ptr_conv);
4832 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4833 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
4834 return OpenChannel_set_dust_limit_satoshis(this_ptr_conv, val);
4837 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1max_1htlc_1value_1in_1flight_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
4838 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
4839 return OpenChannel_get_max_htlc_value_in_flight_msat(this_ptr_conv);
4842 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) {
4843 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
4844 return OpenChannel_set_max_htlc_value_in_flight_msat(this_ptr_conv, val);
4847 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1channel_1reserve_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
4848 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
4849 return OpenChannel_get_channel_reserve_satoshis(this_ptr_conv);
4852 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1channel_1reserve_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4853 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
4854 return OpenChannel_set_channel_reserve_satoshis(this_ptr_conv, val);
4857 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
4858 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
4859 return OpenChannel_get_htlc_minimum_msat(this_ptr_conv);
4862 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4863 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
4864 return OpenChannel_set_htlc_minimum_msat(this_ptr_conv, val);
4867 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1feerate_1per_1kw(JNIEnv * _env, jclass _b, jlong this_ptr) {
4868 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
4869 return OpenChannel_get_feerate_per_kw(this_ptr_conv);
4872 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1feerate_1per_1kw(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
4873 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
4874 return OpenChannel_set_feerate_per_kw(this_ptr_conv, val);
4877 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr) {
4878 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
4879 return OpenChannel_get_to_self_delay(this_ptr_conv);
4882 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
4883 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
4884 return OpenChannel_set_to_self_delay(this_ptr_conv, val);
4887 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1max_1accepted_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr) {
4888 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
4889 return OpenChannel_get_max_accepted_htlcs(this_ptr_conv);
4892 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1max_1accepted_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
4893 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
4894 return OpenChannel_set_max_accepted_htlcs(this_ptr_conv, val);
4897 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1funding_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr) {
4898 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
4899 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
4900 *ret = OpenChannel_get_funding_pubkey(this_ptr_conv);
4904 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1funding_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4905 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
4906 LDKPublicKey val_conv = *(LDKPublicKey*)val;
4908 return OpenChannel_set_funding_pubkey(this_ptr_conv, val_conv);
4911 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1revocation_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
4912 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
4913 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
4914 *ret = OpenChannel_get_revocation_basepoint(this_ptr_conv);
4918 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1revocation_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4919 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
4920 LDKPublicKey val_conv = *(LDKPublicKey*)val;
4922 return OpenChannel_set_revocation_basepoint(this_ptr_conv, val_conv);
4925 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1payment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
4926 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
4927 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
4928 *ret = OpenChannel_get_payment_point(this_ptr_conv);
4932 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1payment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4933 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
4934 LDKPublicKey val_conv = *(LDKPublicKey*)val;
4936 return OpenChannel_set_payment_point(this_ptr_conv, val_conv);
4939 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1delayed_1payment_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
4940 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
4941 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
4942 *ret = OpenChannel_get_delayed_payment_basepoint(this_ptr_conv);
4946 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1delayed_1payment_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4947 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
4948 LDKPublicKey val_conv = *(LDKPublicKey*)val;
4950 return OpenChannel_set_delayed_payment_basepoint(this_ptr_conv, val_conv);
4953 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1htlc_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
4954 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
4955 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
4956 *ret = OpenChannel_get_htlc_basepoint(this_ptr_conv);
4960 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1htlc_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4961 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
4962 LDKPublicKey val_conv = *(LDKPublicKey*)val;
4964 return OpenChannel_set_htlc_basepoint(this_ptr_conv, val_conv);
4967 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1first_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
4968 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
4969 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
4970 *ret = OpenChannel_get_first_per_commitment_point(this_ptr_conv);
4974 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1first_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4975 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
4976 LDKPublicKey val_conv = *(LDKPublicKey*)val;
4978 return OpenChannel_set_first_per_commitment_point(this_ptr_conv, val_conv);
4981 JNIEXPORT jbyte JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1channel_1flags(JNIEnv * _env, jclass _b, jlong this_ptr) {
4982 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
4983 return OpenChannel_get_channel_flags(this_ptr_conv);
4986 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1channel_1flags(JNIEnv * _env, jclass _b, jlong this_ptr, jbyte val) {
4987 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
4988 return OpenChannel_set_channel_flags(this_ptr_conv, val);
4991 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4992 LDKAcceptChannel this_ptr_conv = *(LDKAcceptChannel*)this_ptr;
4993 FREE((void*)this_ptr);
4994 this_ptr_conv.is_owned = true;
4995 return AcceptChannel_free(this_ptr_conv);
4998 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1temporary_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4999 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
5000 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
5001 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *AcceptChannel_get_temporary_channel_id(this_ptr_conv));
5005 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1temporary_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5006 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
5007 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
5009 return AcceptChannel_set_temporary_channel_id(this_ptr_conv, val_conv);
5012 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
5013 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
5014 return AcceptChannel_get_dust_limit_satoshis(this_ptr_conv);
5017 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5018 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
5019 return AcceptChannel_set_dust_limit_satoshis(this_ptr_conv, val);
5022 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1max_1htlc_1value_1in_1flight_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
5023 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
5024 return AcceptChannel_get_max_htlc_value_in_flight_msat(this_ptr_conv);
5027 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) {
5028 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
5029 return AcceptChannel_set_max_htlc_value_in_flight_msat(this_ptr_conv, val);
5032 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1channel_1reserve_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
5033 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
5034 return AcceptChannel_get_channel_reserve_satoshis(this_ptr_conv);
5037 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1channel_1reserve_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5038 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
5039 return AcceptChannel_set_channel_reserve_satoshis(this_ptr_conv, val);
5042 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
5043 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
5044 return AcceptChannel_get_htlc_minimum_msat(this_ptr_conv);
5047 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5048 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
5049 return AcceptChannel_set_htlc_minimum_msat(this_ptr_conv, val);
5052 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1minimum_1depth(JNIEnv * _env, jclass _b, jlong this_ptr) {
5053 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
5054 return AcceptChannel_get_minimum_depth(this_ptr_conv);
5057 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1minimum_1depth(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
5058 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
5059 return AcceptChannel_set_minimum_depth(this_ptr_conv, val);
5062 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr) {
5063 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
5064 return AcceptChannel_get_to_self_delay(this_ptr_conv);
5067 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
5068 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
5069 return AcceptChannel_set_to_self_delay(this_ptr_conv, val);
5072 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1max_1accepted_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr) {
5073 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
5074 return AcceptChannel_get_max_accepted_htlcs(this_ptr_conv);
5077 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1max_1accepted_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
5078 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
5079 return AcceptChannel_set_max_accepted_htlcs(this_ptr_conv, val);
5082 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1funding_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr) {
5083 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
5084 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
5085 *ret = AcceptChannel_get_funding_pubkey(this_ptr_conv);
5089 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1funding_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5090 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
5091 LDKPublicKey val_conv = *(LDKPublicKey*)val;
5093 return AcceptChannel_set_funding_pubkey(this_ptr_conv, val_conv);
5096 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1revocation_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
5097 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
5098 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
5099 *ret = AcceptChannel_get_revocation_basepoint(this_ptr_conv);
5103 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1revocation_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5104 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
5105 LDKPublicKey val_conv = *(LDKPublicKey*)val;
5107 return AcceptChannel_set_revocation_basepoint(this_ptr_conv, val_conv);
5110 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1payment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
5111 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
5112 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
5113 *ret = AcceptChannel_get_payment_point(this_ptr_conv);
5117 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1payment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5118 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
5119 LDKPublicKey val_conv = *(LDKPublicKey*)val;
5121 return AcceptChannel_set_payment_point(this_ptr_conv, val_conv);
5124 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1delayed_1payment_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
5125 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
5126 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
5127 *ret = AcceptChannel_get_delayed_payment_basepoint(this_ptr_conv);
5131 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1delayed_1payment_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5132 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
5133 LDKPublicKey val_conv = *(LDKPublicKey*)val;
5135 return AcceptChannel_set_delayed_payment_basepoint(this_ptr_conv, val_conv);
5138 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1htlc_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
5139 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
5140 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
5141 *ret = AcceptChannel_get_htlc_basepoint(this_ptr_conv);
5145 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1htlc_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5146 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
5147 LDKPublicKey val_conv = *(LDKPublicKey*)val;
5149 return AcceptChannel_set_htlc_basepoint(this_ptr_conv, val_conv);
5152 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1first_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
5153 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
5154 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
5155 *ret = AcceptChannel_get_first_per_commitment_point(this_ptr_conv);
5159 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1first_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5160 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
5161 LDKPublicKey val_conv = *(LDKPublicKey*)val;
5163 return AcceptChannel_set_first_per_commitment_point(this_ptr_conv, val_conv);
5166 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5167 LDKFundingCreated this_ptr_conv = *(LDKFundingCreated*)this_ptr;
5168 FREE((void*)this_ptr);
5169 this_ptr_conv.is_owned = true;
5170 return FundingCreated_free(this_ptr_conv);
5173 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1temporary_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
5174 LDKFundingCreated* this_ptr_conv = (LDKFundingCreated*)this_ptr;
5175 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
5176 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *FundingCreated_get_temporary_channel_id(this_ptr_conv));
5180 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1temporary_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5181 LDKFundingCreated* this_ptr_conv = (LDKFundingCreated*)this_ptr;
5182 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
5184 return FundingCreated_set_temporary_channel_id(this_ptr_conv, val_conv);
5187 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1funding_1txid(JNIEnv * _env, jclass _b, jlong this_ptr) {
5188 LDKFundingCreated* this_ptr_conv = (LDKFundingCreated*)this_ptr;
5189 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
5190 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *FundingCreated_get_funding_txid(this_ptr_conv));
5194 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1funding_1txid(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5195 LDKFundingCreated* this_ptr_conv = (LDKFundingCreated*)this_ptr;
5196 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
5198 return FundingCreated_set_funding_txid(this_ptr_conv, val_conv);
5201 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1funding_1output_1index(JNIEnv * _env, jclass _b, jlong this_ptr) {
5202 LDKFundingCreated* this_ptr_conv = (LDKFundingCreated*)this_ptr;
5203 return FundingCreated_get_funding_output_index(this_ptr_conv);
5206 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1funding_1output_1index(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
5207 LDKFundingCreated* this_ptr_conv = (LDKFundingCreated*)this_ptr;
5208 return FundingCreated_set_funding_output_index(this_ptr_conv, val);
5211 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
5212 LDKFundingCreated* this_ptr_conv = (LDKFundingCreated*)this_ptr;
5213 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
5214 *ret = FundingCreated_get_signature(this_ptr_conv);
5218 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5219 LDKFundingCreated* this_ptr_conv = (LDKFundingCreated*)this_ptr;
5220 LDKSignature val_conv = *(LDKSignature*)val;
5222 return FundingCreated_set_signature(this_ptr_conv, val_conv);
5225 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) {
5226 LDKThirtyTwoBytes temporary_channel_id_arg_conv = *(LDKThirtyTwoBytes*)temporary_channel_id_arg;
5227 FREE((void*)temporary_channel_id_arg);
5228 LDKThirtyTwoBytes funding_txid_arg_conv = *(LDKThirtyTwoBytes*)funding_txid_arg;
5229 FREE((void*)funding_txid_arg);
5230 LDKSignature signature_arg_conv = *(LDKSignature*)signature_arg;
5231 FREE((void*)signature_arg);
5232 LDKFundingCreated* ret = MALLOC(sizeof(LDKFundingCreated), "LDKFundingCreated");
5233 *ret = FundingCreated_new(temporary_channel_id_arg_conv, funding_txid_arg_conv, funding_output_index_arg, signature_arg_conv);
5234 DO_ASSERT(ret->is_owned);
5235 ret->is_owned = false;
5239 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5240 LDKFundingSigned this_ptr_conv = *(LDKFundingSigned*)this_ptr;
5241 FREE((void*)this_ptr);
5242 this_ptr_conv.is_owned = true;
5243 return FundingSigned_free(this_ptr_conv);
5246 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingSigned_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
5247 LDKFundingSigned* this_ptr_conv = (LDKFundingSigned*)this_ptr;
5248 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
5249 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *FundingSigned_get_channel_id(this_ptr_conv));
5253 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5254 LDKFundingSigned* this_ptr_conv = (LDKFundingSigned*)this_ptr;
5255 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
5257 return FundingSigned_set_channel_id(this_ptr_conv, val_conv);
5260 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingSigned_1get_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
5261 LDKFundingSigned* this_ptr_conv = (LDKFundingSigned*)this_ptr;
5262 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
5263 *ret = FundingSigned_get_signature(this_ptr_conv);
5267 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1set_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5268 LDKFundingSigned* this_ptr_conv = (LDKFundingSigned*)this_ptr;
5269 LDKSignature val_conv = *(LDKSignature*)val;
5271 return FundingSigned_set_signature(this_ptr_conv, val_conv);
5274 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingSigned_1new(JNIEnv * _env, jclass _b, jlong channel_id_arg, jlong signature_arg) {
5275 LDKThirtyTwoBytes channel_id_arg_conv = *(LDKThirtyTwoBytes*)channel_id_arg;
5276 FREE((void*)channel_id_arg);
5277 LDKSignature signature_arg_conv = *(LDKSignature*)signature_arg;
5278 FREE((void*)signature_arg);
5279 LDKFundingSigned* ret = MALLOC(sizeof(LDKFundingSigned), "LDKFundingSigned");
5280 *ret = FundingSigned_new(channel_id_arg_conv, signature_arg_conv);
5281 DO_ASSERT(ret->is_owned);
5282 ret->is_owned = false;
5286 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingLocked_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5287 LDKFundingLocked this_ptr_conv = *(LDKFundingLocked*)this_ptr;
5288 FREE((void*)this_ptr);
5289 this_ptr_conv.is_owned = true;
5290 return FundingLocked_free(this_ptr_conv);
5293 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingLocked_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
5294 LDKFundingLocked* this_ptr_conv = (LDKFundingLocked*)this_ptr;
5295 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
5296 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *FundingLocked_get_channel_id(this_ptr_conv));
5300 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingLocked_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5301 LDKFundingLocked* this_ptr_conv = (LDKFundingLocked*)this_ptr;
5302 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
5304 return FundingLocked_set_channel_id(this_ptr_conv, val_conv);
5307 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingLocked_1get_1next_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
5308 LDKFundingLocked* this_ptr_conv = (LDKFundingLocked*)this_ptr;
5309 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
5310 *ret = FundingLocked_get_next_per_commitment_point(this_ptr_conv);
5314 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingLocked_1set_1next_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5315 LDKFundingLocked* this_ptr_conv = (LDKFundingLocked*)this_ptr;
5316 LDKPublicKey val_conv = *(LDKPublicKey*)val;
5318 return FundingLocked_set_next_per_commitment_point(this_ptr_conv, val_conv);
5321 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingLocked_1new(JNIEnv * _env, jclass _b, jlong channel_id_arg, jlong next_per_commitment_point_arg) {
5322 LDKThirtyTwoBytes channel_id_arg_conv = *(LDKThirtyTwoBytes*)channel_id_arg;
5323 FREE((void*)channel_id_arg);
5324 LDKPublicKey next_per_commitment_point_arg_conv = *(LDKPublicKey*)next_per_commitment_point_arg;
5325 FREE((void*)next_per_commitment_point_arg);
5326 LDKFundingLocked* ret = MALLOC(sizeof(LDKFundingLocked), "LDKFundingLocked");
5327 *ret = FundingLocked_new(channel_id_arg_conv, next_per_commitment_point_arg_conv);
5328 DO_ASSERT(ret->is_owned);
5329 ret->is_owned = false;
5333 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5334 LDKShutdown this_ptr_conv = *(LDKShutdown*)this_ptr;
5335 FREE((void*)this_ptr);
5336 this_ptr_conv.is_owned = true;
5337 return Shutdown_free(this_ptr_conv);
5340 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Shutdown_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
5341 LDKShutdown* this_ptr_conv = (LDKShutdown*)this_ptr;
5342 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
5343 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *Shutdown_get_channel_id(this_ptr_conv));
5347 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5348 LDKShutdown* this_ptr_conv = (LDKShutdown*)this_ptr;
5349 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
5351 return Shutdown_set_channel_id(this_ptr_conv, val_conv);
5354 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Shutdown_1get_1scriptpubkey(JNIEnv * _env, jclass _b, jlong this_ptr) {
5355 LDKShutdown* this_ptr_conv = (LDKShutdown*)this_ptr;
5356 LDKu8slice* ret = MALLOC(sizeof(LDKu8slice), "LDKu8slice");
5357 *ret = Shutdown_get_scriptpubkey(this_ptr_conv);
5361 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1set_1scriptpubkey(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5362 LDKShutdown* this_ptr_conv = (LDKShutdown*)this_ptr;
5363 LDKCVec_u8Z val_conv = *(LDKCVec_u8Z*)val;
5365 return Shutdown_set_scriptpubkey(this_ptr_conv, val_conv);
5368 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Shutdown_1new(JNIEnv * _env, jclass _b, jlong channel_id_arg, jlong scriptpubkey_arg) {
5369 LDKThirtyTwoBytes channel_id_arg_conv = *(LDKThirtyTwoBytes*)channel_id_arg;
5370 FREE((void*)channel_id_arg);
5371 LDKCVec_u8Z scriptpubkey_arg_conv = *(LDKCVec_u8Z*)scriptpubkey_arg;
5372 FREE((void*)scriptpubkey_arg);
5373 LDKShutdown* ret = MALLOC(sizeof(LDKShutdown), "LDKShutdown");
5374 *ret = Shutdown_new(channel_id_arg_conv, scriptpubkey_arg_conv);
5375 DO_ASSERT(ret->is_owned);
5376 ret->is_owned = false;
5380 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5381 LDKClosingSigned this_ptr_conv = *(LDKClosingSigned*)this_ptr;
5382 FREE((void*)this_ptr);
5383 this_ptr_conv.is_owned = true;
5384 return ClosingSigned_free(this_ptr_conv);
5387 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
5388 LDKClosingSigned* this_ptr_conv = (LDKClosingSigned*)this_ptr;
5389 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
5390 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *ClosingSigned_get_channel_id(this_ptr_conv));
5394 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5395 LDKClosingSigned* this_ptr_conv = (LDKClosingSigned*)this_ptr;
5396 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
5398 return ClosingSigned_set_channel_id(this_ptr_conv, val_conv);
5401 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1fee_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
5402 LDKClosingSigned* this_ptr_conv = (LDKClosingSigned*)this_ptr;
5403 return ClosingSigned_get_fee_satoshis(this_ptr_conv);
5406 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1fee_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5407 LDKClosingSigned* this_ptr_conv = (LDKClosingSigned*)this_ptr;
5408 return ClosingSigned_set_fee_satoshis(this_ptr_conv, val);
5411 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
5412 LDKClosingSigned* this_ptr_conv = (LDKClosingSigned*)this_ptr;
5413 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
5414 *ret = ClosingSigned_get_signature(this_ptr_conv);
5418 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5419 LDKClosingSigned* this_ptr_conv = (LDKClosingSigned*)this_ptr;
5420 LDKSignature val_conv = *(LDKSignature*)val;
5422 return ClosingSigned_set_signature(this_ptr_conv, val_conv);
5425 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) {
5426 LDKThirtyTwoBytes channel_id_arg_conv = *(LDKThirtyTwoBytes*)channel_id_arg;
5427 FREE((void*)channel_id_arg);
5428 LDKSignature signature_arg_conv = *(LDKSignature*)signature_arg;
5429 FREE((void*)signature_arg);
5430 LDKClosingSigned* ret = MALLOC(sizeof(LDKClosingSigned), "LDKClosingSigned");
5431 *ret = ClosingSigned_new(channel_id_arg_conv, fee_satoshis_arg, signature_arg_conv);
5432 DO_ASSERT(ret->is_owned);
5433 ret->is_owned = false;
5437 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5438 LDKUpdateAddHTLC this_ptr_conv = *(LDKUpdateAddHTLC*)this_ptr;
5439 FREE((void*)this_ptr);
5440 this_ptr_conv.is_owned = true;
5441 return UpdateAddHTLC_free(this_ptr_conv);
5444 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
5445 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
5446 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
5447 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateAddHTLC_get_channel_id(this_ptr_conv));
5451 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5452 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
5453 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
5455 return UpdateAddHTLC_set_channel_id(this_ptr_conv, val_conv);
5458 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
5459 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
5460 return UpdateAddHTLC_get_htlc_id(this_ptr_conv);
5463 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5464 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
5465 return UpdateAddHTLC_set_htlc_id(this_ptr_conv, val);
5468 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1amount_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
5469 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
5470 return UpdateAddHTLC_get_amount_msat(this_ptr_conv);
5473 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1amount_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5474 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
5475 return UpdateAddHTLC_set_amount_msat(this_ptr_conv, val);
5478 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1payment_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
5479 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
5480 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
5481 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateAddHTLC_get_payment_hash(this_ptr_conv));
5485 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1payment_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5486 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
5487 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
5489 return UpdateAddHTLC_set_payment_hash(this_ptr_conv, val_conv);
5492 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1cltv_1expiry(JNIEnv * _env, jclass _b, jlong this_ptr) {
5493 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
5494 return UpdateAddHTLC_get_cltv_expiry(this_ptr_conv);
5497 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1cltv_1expiry(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
5498 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
5499 return UpdateAddHTLC_set_cltv_expiry(this_ptr_conv, val);
5502 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5503 LDKUpdateFulfillHTLC this_ptr_conv = *(LDKUpdateFulfillHTLC*)this_ptr;
5504 FREE((void*)this_ptr);
5505 this_ptr_conv.is_owned = true;
5506 return UpdateFulfillHTLC_free(this_ptr_conv);
5509 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
5510 LDKUpdateFulfillHTLC* this_ptr_conv = (LDKUpdateFulfillHTLC*)this_ptr;
5511 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
5512 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateFulfillHTLC_get_channel_id(this_ptr_conv));
5516 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5517 LDKUpdateFulfillHTLC* this_ptr_conv = (LDKUpdateFulfillHTLC*)this_ptr;
5518 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
5520 return UpdateFulfillHTLC_set_channel_id(this_ptr_conv, val_conv);
5523 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
5524 LDKUpdateFulfillHTLC* this_ptr_conv = (LDKUpdateFulfillHTLC*)this_ptr;
5525 return UpdateFulfillHTLC_get_htlc_id(this_ptr_conv);
5528 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1set_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5529 LDKUpdateFulfillHTLC* this_ptr_conv = (LDKUpdateFulfillHTLC*)this_ptr;
5530 return UpdateFulfillHTLC_set_htlc_id(this_ptr_conv, val);
5533 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_1payment_1preimage(JNIEnv * _env, jclass _b, jlong this_ptr) {
5534 LDKUpdateFulfillHTLC* this_ptr_conv = (LDKUpdateFulfillHTLC*)this_ptr;
5535 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
5536 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateFulfillHTLC_get_payment_preimage(this_ptr_conv));
5540 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1set_1payment_1preimage(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5541 LDKUpdateFulfillHTLC* this_ptr_conv = (LDKUpdateFulfillHTLC*)this_ptr;
5542 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
5544 return UpdateFulfillHTLC_set_payment_preimage(this_ptr_conv, val_conv);
5547 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) {
5548 LDKThirtyTwoBytes channel_id_arg_conv = *(LDKThirtyTwoBytes*)channel_id_arg;
5549 FREE((void*)channel_id_arg);
5550 LDKThirtyTwoBytes payment_preimage_arg_conv = *(LDKThirtyTwoBytes*)payment_preimage_arg;
5551 FREE((void*)payment_preimage_arg);
5552 LDKUpdateFulfillHTLC* ret = MALLOC(sizeof(LDKUpdateFulfillHTLC), "LDKUpdateFulfillHTLC");
5553 *ret = UpdateFulfillHTLC_new(channel_id_arg_conv, htlc_id_arg, payment_preimage_arg_conv);
5554 DO_ASSERT(ret->is_owned);
5555 ret->is_owned = false;
5559 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5560 LDKUpdateFailHTLC this_ptr_conv = *(LDKUpdateFailHTLC*)this_ptr;
5561 FREE((void*)this_ptr);
5562 this_ptr_conv.is_owned = true;
5563 return UpdateFailHTLC_free(this_ptr_conv);
5566 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
5567 LDKUpdateFailHTLC* this_ptr_conv = (LDKUpdateFailHTLC*)this_ptr;
5568 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
5569 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateFailHTLC_get_channel_id(this_ptr_conv));
5573 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5574 LDKUpdateFailHTLC* this_ptr_conv = (LDKUpdateFailHTLC*)this_ptr;
5575 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
5577 return UpdateFailHTLC_set_channel_id(this_ptr_conv, val_conv);
5580 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1get_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
5581 LDKUpdateFailHTLC* this_ptr_conv = (LDKUpdateFailHTLC*)this_ptr;
5582 return UpdateFailHTLC_get_htlc_id(this_ptr_conv);
5585 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1set_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5586 LDKUpdateFailHTLC* this_ptr_conv = (LDKUpdateFailHTLC*)this_ptr;
5587 return UpdateFailHTLC_set_htlc_id(this_ptr_conv, val);
5590 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5591 LDKUpdateFailMalformedHTLC this_ptr_conv = *(LDKUpdateFailMalformedHTLC*)this_ptr;
5592 FREE((void*)this_ptr);
5593 this_ptr_conv.is_owned = true;
5594 return UpdateFailMalformedHTLC_free(this_ptr_conv);
5597 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
5598 LDKUpdateFailMalformedHTLC* this_ptr_conv = (LDKUpdateFailMalformedHTLC*)this_ptr;
5599 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
5600 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateFailMalformedHTLC_get_channel_id(this_ptr_conv));
5604 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5605 LDKUpdateFailMalformedHTLC* this_ptr_conv = (LDKUpdateFailMalformedHTLC*)this_ptr;
5606 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
5608 return UpdateFailMalformedHTLC_set_channel_id(this_ptr_conv, val_conv);
5611 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1get_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
5612 LDKUpdateFailMalformedHTLC* this_ptr_conv = (LDKUpdateFailMalformedHTLC*)this_ptr;
5613 return UpdateFailMalformedHTLC_get_htlc_id(this_ptr_conv);
5616 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1set_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5617 LDKUpdateFailMalformedHTLC* this_ptr_conv = (LDKUpdateFailMalformedHTLC*)this_ptr;
5618 return UpdateFailMalformedHTLC_set_htlc_id(this_ptr_conv, val);
5621 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1get_1failure_1code(JNIEnv * _env, jclass _b, jlong this_ptr) {
5622 LDKUpdateFailMalformedHTLC* this_ptr_conv = (LDKUpdateFailMalformedHTLC*)this_ptr;
5623 return UpdateFailMalformedHTLC_get_failure_code(this_ptr_conv);
5626 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1set_1failure_1code(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
5627 LDKUpdateFailMalformedHTLC* this_ptr_conv = (LDKUpdateFailMalformedHTLC*)this_ptr;
5628 return UpdateFailMalformedHTLC_set_failure_code(this_ptr_conv, val);
5631 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5632 LDKCommitmentSigned this_ptr_conv = *(LDKCommitmentSigned*)this_ptr;
5633 FREE((void*)this_ptr);
5634 this_ptr_conv.is_owned = true;
5635 return CommitmentSigned_free(this_ptr_conv);
5638 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
5639 LDKCommitmentSigned* this_ptr_conv = (LDKCommitmentSigned*)this_ptr;
5640 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
5641 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *CommitmentSigned_get_channel_id(this_ptr_conv));
5645 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5646 LDKCommitmentSigned* this_ptr_conv = (LDKCommitmentSigned*)this_ptr;
5647 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
5649 return CommitmentSigned_set_channel_id(this_ptr_conv, val_conv);
5652 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1get_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
5653 LDKCommitmentSigned* this_ptr_conv = (LDKCommitmentSigned*)this_ptr;
5654 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
5655 *ret = CommitmentSigned_get_signature(this_ptr_conv);
5659 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5660 LDKCommitmentSigned* this_ptr_conv = (LDKCommitmentSigned*)this_ptr;
5661 LDKSignature val_conv = *(LDKSignature*)val;
5663 return CommitmentSigned_set_signature(this_ptr_conv, val_conv);
5666 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1htlc_1signatures(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5667 LDKCommitmentSigned* this_ptr_conv = (LDKCommitmentSigned*)this_ptr;
5668 LDKCVec_SignatureZ val_conv = *(LDKCVec_SignatureZ*)val;
5670 return CommitmentSigned_set_htlc_signatures(this_ptr_conv, val_conv);
5673 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) {
5674 LDKThirtyTwoBytes channel_id_arg_conv = *(LDKThirtyTwoBytes*)channel_id_arg;
5675 FREE((void*)channel_id_arg);
5676 LDKSignature signature_arg_conv = *(LDKSignature*)signature_arg;
5677 FREE((void*)signature_arg);
5678 LDKCVec_SignatureZ htlc_signatures_arg_conv = *(LDKCVec_SignatureZ*)htlc_signatures_arg;
5679 FREE((void*)htlc_signatures_arg);
5680 LDKCommitmentSigned* ret = MALLOC(sizeof(LDKCommitmentSigned), "LDKCommitmentSigned");
5681 *ret = CommitmentSigned_new(channel_id_arg_conv, signature_arg_conv, htlc_signatures_arg_conv);
5682 DO_ASSERT(ret->is_owned);
5683 ret->is_owned = false;
5687 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5688 LDKRevokeAndACK this_ptr_conv = *(LDKRevokeAndACK*)this_ptr;
5689 FREE((void*)this_ptr);
5690 this_ptr_conv.is_owned = true;
5691 return RevokeAndACK_free(this_ptr_conv);
5694 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
5695 LDKRevokeAndACK* this_ptr_conv = (LDKRevokeAndACK*)this_ptr;
5696 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
5697 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *RevokeAndACK_get_channel_id(this_ptr_conv));
5701 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5702 LDKRevokeAndACK* this_ptr_conv = (LDKRevokeAndACK*)this_ptr;
5703 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
5705 return RevokeAndACK_set_channel_id(this_ptr_conv, val_conv);
5708 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1per_1commitment_1secret(JNIEnv * _env, jclass _b, jlong this_ptr) {
5709 LDKRevokeAndACK* this_ptr_conv = (LDKRevokeAndACK*)this_ptr;
5710 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
5711 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *RevokeAndACK_get_per_commitment_secret(this_ptr_conv));
5715 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1set_1per_1commitment_1secret(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5716 LDKRevokeAndACK* this_ptr_conv = (LDKRevokeAndACK*)this_ptr;
5717 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
5719 return RevokeAndACK_set_per_commitment_secret(this_ptr_conv, val_conv);
5722 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1next_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
5723 LDKRevokeAndACK* this_ptr_conv = (LDKRevokeAndACK*)this_ptr;
5724 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
5725 *ret = RevokeAndACK_get_next_per_commitment_point(this_ptr_conv);
5729 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1set_1next_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5730 LDKRevokeAndACK* this_ptr_conv = (LDKRevokeAndACK*)this_ptr;
5731 LDKPublicKey val_conv = *(LDKPublicKey*)val;
5733 return RevokeAndACK_set_next_per_commitment_point(this_ptr_conv, val_conv);
5736 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) {
5737 LDKThirtyTwoBytes channel_id_arg_conv = *(LDKThirtyTwoBytes*)channel_id_arg;
5738 FREE((void*)channel_id_arg);
5739 LDKThirtyTwoBytes per_commitment_secret_arg_conv = *(LDKThirtyTwoBytes*)per_commitment_secret_arg;
5740 FREE((void*)per_commitment_secret_arg);
5741 LDKPublicKey next_per_commitment_point_arg_conv = *(LDKPublicKey*)next_per_commitment_point_arg;
5742 FREE((void*)next_per_commitment_point_arg);
5743 LDKRevokeAndACK* ret = MALLOC(sizeof(LDKRevokeAndACK), "LDKRevokeAndACK");
5744 *ret = RevokeAndACK_new(channel_id_arg_conv, per_commitment_secret_arg_conv, next_per_commitment_point_arg_conv);
5745 DO_ASSERT(ret->is_owned);
5746 ret->is_owned = false;
5750 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFee_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5751 LDKUpdateFee this_ptr_conv = *(LDKUpdateFee*)this_ptr;
5752 FREE((void*)this_ptr);
5753 this_ptr_conv.is_owned = true;
5754 return UpdateFee_free(this_ptr_conv);
5757 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFee_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
5758 LDKUpdateFee* this_ptr_conv = (LDKUpdateFee*)this_ptr;
5759 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
5760 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateFee_get_channel_id(this_ptr_conv));
5764 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFee_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5765 LDKUpdateFee* this_ptr_conv = (LDKUpdateFee*)this_ptr;
5766 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
5768 return UpdateFee_set_channel_id(this_ptr_conv, val_conv);
5771 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UpdateFee_1get_1feerate_1per_1kw(JNIEnv * _env, jclass _b, jlong this_ptr) {
5772 LDKUpdateFee* this_ptr_conv = (LDKUpdateFee*)this_ptr;
5773 return UpdateFee_get_feerate_per_kw(this_ptr_conv);
5776 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFee_1set_1feerate_1per_1kw(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
5777 LDKUpdateFee* this_ptr_conv = (LDKUpdateFee*)this_ptr;
5778 return UpdateFee_set_feerate_per_kw(this_ptr_conv, val);
5781 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFee_1new(JNIEnv * _env, jclass _b, jlong channel_id_arg, jint feerate_per_kw_arg) {
5782 LDKThirtyTwoBytes channel_id_arg_conv = *(LDKThirtyTwoBytes*)channel_id_arg;
5783 FREE((void*)channel_id_arg);
5784 LDKUpdateFee* ret = MALLOC(sizeof(LDKUpdateFee), "LDKUpdateFee");
5785 *ret = UpdateFee_new(channel_id_arg_conv, feerate_per_kw_arg);
5786 DO_ASSERT(ret->is_owned);
5787 ret->is_owned = false;
5791 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5792 LDKDataLossProtect this_ptr_conv = *(LDKDataLossProtect*)this_ptr;
5793 FREE((void*)this_ptr);
5794 this_ptr_conv.is_owned = true;
5795 return DataLossProtect_free(this_ptr_conv);
5798 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1get_1your_1last_1per_1commitment_1secret(JNIEnv * _env, jclass _b, jlong this_ptr) {
5799 LDKDataLossProtect* this_ptr_conv = (LDKDataLossProtect*)this_ptr;
5800 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
5801 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *DataLossProtect_get_your_last_per_commitment_secret(this_ptr_conv));
5805 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1set_1your_1last_1per_1commitment_1secret(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5806 LDKDataLossProtect* this_ptr_conv = (LDKDataLossProtect*)this_ptr;
5807 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
5809 return DataLossProtect_set_your_last_per_commitment_secret(this_ptr_conv, val_conv);
5812 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1get_1my_1current_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
5813 LDKDataLossProtect* this_ptr_conv = (LDKDataLossProtect*)this_ptr;
5814 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
5815 *ret = DataLossProtect_get_my_current_per_commitment_point(this_ptr_conv);
5819 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1set_1my_1current_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5820 LDKDataLossProtect* this_ptr_conv = (LDKDataLossProtect*)this_ptr;
5821 LDKPublicKey val_conv = *(LDKPublicKey*)val;
5823 return DataLossProtect_set_my_current_per_commitment_point(this_ptr_conv, val_conv);
5826 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) {
5827 LDKThirtyTwoBytes your_last_per_commitment_secret_arg_conv = *(LDKThirtyTwoBytes*)your_last_per_commitment_secret_arg;
5828 FREE((void*)your_last_per_commitment_secret_arg);
5829 LDKPublicKey my_current_per_commitment_point_arg_conv = *(LDKPublicKey*)my_current_per_commitment_point_arg;
5830 FREE((void*)my_current_per_commitment_point_arg);
5831 LDKDataLossProtect* ret = MALLOC(sizeof(LDKDataLossProtect), "LDKDataLossProtect");
5832 *ret = DataLossProtect_new(your_last_per_commitment_secret_arg_conv, my_current_per_commitment_point_arg_conv);
5833 DO_ASSERT(ret->is_owned);
5834 ret->is_owned = false;
5838 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5839 LDKChannelReestablish this_ptr_conv = *(LDKChannelReestablish*)this_ptr;
5840 FREE((void*)this_ptr);
5841 this_ptr_conv.is_owned = true;
5842 return ChannelReestablish_free(this_ptr_conv);
5845 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
5846 LDKChannelReestablish* this_ptr_conv = (LDKChannelReestablish*)this_ptr;
5847 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
5848 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *ChannelReestablish_get_channel_id(this_ptr_conv));
5852 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5853 LDKChannelReestablish* this_ptr_conv = (LDKChannelReestablish*)this_ptr;
5854 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
5856 return ChannelReestablish_set_channel_id(this_ptr_conv, val_conv);
5859 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1get_1next_1local_1commitment_1number(JNIEnv * _env, jclass _b, jlong this_ptr) {
5860 LDKChannelReestablish* this_ptr_conv = (LDKChannelReestablish*)this_ptr;
5861 return ChannelReestablish_get_next_local_commitment_number(this_ptr_conv);
5864 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1set_1next_1local_1commitment_1number(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5865 LDKChannelReestablish* this_ptr_conv = (LDKChannelReestablish*)this_ptr;
5866 return ChannelReestablish_set_next_local_commitment_number(this_ptr_conv, val);
5869 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1get_1next_1remote_1commitment_1number(JNIEnv * _env, jclass _b, jlong this_ptr) {
5870 LDKChannelReestablish* this_ptr_conv = (LDKChannelReestablish*)this_ptr;
5871 return ChannelReestablish_get_next_remote_commitment_number(this_ptr_conv);
5874 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1set_1next_1remote_1commitment_1number(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5875 LDKChannelReestablish* this_ptr_conv = (LDKChannelReestablish*)this_ptr;
5876 return ChannelReestablish_set_next_remote_commitment_number(this_ptr_conv, val);
5879 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5880 LDKAnnouncementSignatures this_ptr_conv = *(LDKAnnouncementSignatures*)this_ptr;
5881 FREE((void*)this_ptr);
5882 this_ptr_conv.is_owned = true;
5883 return AnnouncementSignatures_free(this_ptr_conv);
5886 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
5887 LDKAnnouncementSignatures* this_ptr_conv = (LDKAnnouncementSignatures*)this_ptr;
5888 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
5889 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *AnnouncementSignatures_get_channel_id(this_ptr_conv));
5893 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5894 LDKAnnouncementSignatures* this_ptr_conv = (LDKAnnouncementSignatures*)this_ptr;
5895 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
5897 return AnnouncementSignatures_set_channel_id(this_ptr_conv, val_conv);
5900 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
5901 LDKAnnouncementSignatures* this_ptr_conv = (LDKAnnouncementSignatures*)this_ptr;
5902 return AnnouncementSignatures_get_short_channel_id(this_ptr_conv);
5905 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5906 LDKAnnouncementSignatures* this_ptr_conv = (LDKAnnouncementSignatures*)this_ptr;
5907 return AnnouncementSignatures_set_short_channel_id(this_ptr_conv, val);
5910 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1node_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
5911 LDKAnnouncementSignatures* this_ptr_conv = (LDKAnnouncementSignatures*)this_ptr;
5912 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
5913 *ret = AnnouncementSignatures_get_node_signature(this_ptr_conv);
5917 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1node_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5918 LDKAnnouncementSignatures* this_ptr_conv = (LDKAnnouncementSignatures*)this_ptr;
5919 LDKSignature val_conv = *(LDKSignature*)val;
5921 return AnnouncementSignatures_set_node_signature(this_ptr_conv, val_conv);
5924 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1bitcoin_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
5925 LDKAnnouncementSignatures* this_ptr_conv = (LDKAnnouncementSignatures*)this_ptr;
5926 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
5927 *ret = AnnouncementSignatures_get_bitcoin_signature(this_ptr_conv);
5931 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1bitcoin_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5932 LDKAnnouncementSignatures* this_ptr_conv = (LDKAnnouncementSignatures*)this_ptr;
5933 LDKSignature val_conv = *(LDKSignature*)val;
5935 return AnnouncementSignatures_set_bitcoin_signature(this_ptr_conv, val_conv);
5938 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) {
5939 LDKThirtyTwoBytes channel_id_arg_conv = *(LDKThirtyTwoBytes*)channel_id_arg;
5940 FREE((void*)channel_id_arg);
5941 LDKSignature node_signature_arg_conv = *(LDKSignature*)node_signature_arg;
5942 FREE((void*)node_signature_arg);
5943 LDKSignature bitcoin_signature_arg_conv = *(LDKSignature*)bitcoin_signature_arg;
5944 FREE((void*)bitcoin_signature_arg);
5945 LDKAnnouncementSignatures* ret = MALLOC(sizeof(LDKAnnouncementSignatures), "LDKAnnouncementSignatures");
5946 *ret = AnnouncementSignatures_new(channel_id_arg_conv, short_channel_id_arg, node_signature_arg_conv, bitcoin_signature_arg_conv);
5947 DO_ASSERT(ret->is_owned);
5948 ret->is_owned = false;
5952 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetAddress_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5953 LDKNetAddress this_ptr_conv = *(LDKNetAddress*)this_ptr;
5954 FREE((void*)this_ptr);
5955 return NetAddress_free(this_ptr_conv);
5958 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5959 LDKUnsignedNodeAnnouncement this_ptr_conv = *(LDKUnsignedNodeAnnouncement*)this_ptr;
5960 FREE((void*)this_ptr);
5961 this_ptr_conv.is_owned = true;
5962 return UnsignedNodeAnnouncement_free(this_ptr_conv);
5965 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1features(JNIEnv * _env, jclass _b, jlong this_ptr) {
5966 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
5967 LDKNodeFeatures* ret = MALLOC(sizeof(LDKNodeFeatures), "LDKNodeFeatures");
5968 *ret = UnsignedNodeAnnouncement_get_features(this_ptr_conv);
5969 DO_ASSERT(ret->is_owned);
5970 ret->is_owned = false;
5974 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1features(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5975 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
5976 LDKNodeFeatures val_conv = *(LDKNodeFeatures*)val;
5978 val_conv.is_owned = true;
5979 return UnsignedNodeAnnouncement_set_features(this_ptr_conv, val_conv);
5982 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1timestamp(JNIEnv * _env, jclass _b, jlong this_ptr) {
5983 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
5984 return UnsignedNodeAnnouncement_get_timestamp(this_ptr_conv);
5987 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1timestamp(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
5988 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
5989 return UnsignedNodeAnnouncement_set_timestamp(this_ptr_conv, val);
5992 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1node_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
5993 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
5994 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
5995 *ret = UnsignedNodeAnnouncement_get_node_id(this_ptr_conv);
5999 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1node_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6000 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
6001 LDKPublicKey val_conv = *(LDKPublicKey*)val;
6003 return UnsignedNodeAnnouncement_set_node_id(this_ptr_conv, val_conv);
6006 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1rgb(JNIEnv * _env, jclass _b, jlong this_ptr) {
6007 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
6008 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 3);
6009 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 3, *UnsignedNodeAnnouncement_get_rgb(this_ptr_conv));
6013 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1rgb(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6014 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
6015 LDKThreeBytes val_conv = *(LDKThreeBytes*)val;
6017 return UnsignedNodeAnnouncement_set_rgb(this_ptr_conv, val_conv);
6020 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1alias(JNIEnv * _env, jclass _b, jlong this_ptr) {
6021 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
6022 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
6023 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UnsignedNodeAnnouncement_get_alias(this_ptr_conv));
6027 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1alias(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6028 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
6029 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
6031 return UnsignedNodeAnnouncement_set_alias(this_ptr_conv, val_conv);
6034 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1addresses(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6035 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
6036 LDKCVec_NetAddressZ val_conv = *(LDKCVec_NetAddressZ*)val;
6038 return UnsignedNodeAnnouncement_set_addresses(this_ptr_conv, val_conv);
6041 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6042 LDKNodeAnnouncement this_ptr_conv = *(LDKNodeAnnouncement*)this_ptr;
6043 FREE((void*)this_ptr);
6044 this_ptr_conv.is_owned = true;
6045 return NodeAnnouncement_free(this_ptr_conv);
6048 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1get_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
6049 LDKNodeAnnouncement* this_ptr_conv = (LDKNodeAnnouncement*)this_ptr;
6050 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
6051 *ret = NodeAnnouncement_get_signature(this_ptr_conv);
6055 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1set_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6056 LDKNodeAnnouncement* this_ptr_conv = (LDKNodeAnnouncement*)this_ptr;
6057 LDKSignature val_conv = *(LDKSignature*)val;
6059 return NodeAnnouncement_set_signature(this_ptr_conv, val_conv);
6062 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1get_1contents(JNIEnv * _env, jclass _b, jlong this_ptr) {
6063 LDKNodeAnnouncement* this_ptr_conv = (LDKNodeAnnouncement*)this_ptr;
6064 LDKUnsignedNodeAnnouncement* ret = MALLOC(sizeof(LDKUnsignedNodeAnnouncement), "LDKUnsignedNodeAnnouncement");
6065 *ret = NodeAnnouncement_get_contents(this_ptr_conv);
6066 DO_ASSERT(ret->is_owned);
6067 ret->is_owned = false;
6071 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1set_1contents(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6072 LDKNodeAnnouncement* this_ptr_conv = (LDKNodeAnnouncement*)this_ptr;
6073 LDKUnsignedNodeAnnouncement val_conv = *(LDKUnsignedNodeAnnouncement*)val;
6075 val_conv.is_owned = true;
6076 return NodeAnnouncement_set_contents(this_ptr_conv, val_conv);
6079 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1new(JNIEnv * _env, jclass _b, jlong signature_arg, jlong contents_arg) {
6080 LDKSignature signature_arg_conv = *(LDKSignature*)signature_arg;
6081 FREE((void*)signature_arg);
6082 LDKUnsignedNodeAnnouncement contents_arg_conv = *(LDKUnsignedNodeAnnouncement*)contents_arg;
6083 FREE((void*)contents_arg);
6084 contents_arg_conv.is_owned = true;
6085 LDKNodeAnnouncement* ret = MALLOC(sizeof(LDKNodeAnnouncement), "LDKNodeAnnouncement");
6086 *ret = NodeAnnouncement_new(signature_arg_conv, contents_arg_conv);
6087 DO_ASSERT(ret->is_owned);
6088 ret->is_owned = false;
6092 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6093 LDKUnsignedChannelAnnouncement this_ptr_conv = *(LDKUnsignedChannelAnnouncement*)this_ptr;
6094 FREE((void*)this_ptr);
6095 this_ptr_conv.is_owned = true;
6096 return UnsignedChannelAnnouncement_free(this_ptr_conv);
6099 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1features(JNIEnv * _env, jclass _b, jlong this_ptr) {
6100 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
6101 LDKChannelFeatures* ret = MALLOC(sizeof(LDKChannelFeatures), "LDKChannelFeatures");
6102 *ret = UnsignedChannelAnnouncement_get_features(this_ptr_conv);
6103 DO_ASSERT(ret->is_owned);
6104 ret->is_owned = false;
6108 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1features(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6109 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
6110 LDKChannelFeatures val_conv = *(LDKChannelFeatures*)val;
6112 val_conv.is_owned = true;
6113 return UnsignedChannelAnnouncement_set_features(this_ptr_conv, val_conv);
6116 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
6117 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
6118 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
6119 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UnsignedChannelAnnouncement_get_chain_hash(this_ptr_conv));
6123 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6124 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
6125 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
6127 return UnsignedChannelAnnouncement_set_chain_hash(this_ptr_conv, val_conv);
6130 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
6131 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
6132 return UnsignedChannelAnnouncement_get_short_channel_id(this_ptr_conv);
6135 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6136 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
6137 return UnsignedChannelAnnouncement_set_short_channel_id(this_ptr_conv, val);
6140 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1node_1id_11(JNIEnv * _env, jclass _b, jlong this_ptr) {
6141 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
6142 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
6143 *ret = UnsignedChannelAnnouncement_get_node_id_1(this_ptr_conv);
6147 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1node_1id_11(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6148 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
6149 LDKPublicKey val_conv = *(LDKPublicKey*)val;
6151 return UnsignedChannelAnnouncement_set_node_id_1(this_ptr_conv, val_conv);
6154 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1node_1id_12(JNIEnv * _env, jclass _b, jlong this_ptr) {
6155 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
6156 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
6157 *ret = UnsignedChannelAnnouncement_get_node_id_2(this_ptr_conv);
6161 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1node_1id_12(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6162 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
6163 LDKPublicKey val_conv = *(LDKPublicKey*)val;
6165 return UnsignedChannelAnnouncement_set_node_id_2(this_ptr_conv, val_conv);
6168 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1bitcoin_1key_11(JNIEnv * _env, jclass _b, jlong this_ptr) {
6169 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
6170 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
6171 *ret = UnsignedChannelAnnouncement_get_bitcoin_key_1(this_ptr_conv);
6175 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1bitcoin_1key_11(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6176 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
6177 LDKPublicKey val_conv = *(LDKPublicKey*)val;
6179 return UnsignedChannelAnnouncement_set_bitcoin_key_1(this_ptr_conv, val_conv);
6182 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1bitcoin_1key_12(JNIEnv * _env, jclass _b, jlong this_ptr) {
6183 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
6184 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
6185 *ret = UnsignedChannelAnnouncement_get_bitcoin_key_2(this_ptr_conv);
6189 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1bitcoin_1key_12(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6190 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
6191 LDKPublicKey val_conv = *(LDKPublicKey*)val;
6193 return UnsignedChannelAnnouncement_set_bitcoin_key_2(this_ptr_conv, val_conv);
6196 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6197 LDKChannelAnnouncement this_ptr_conv = *(LDKChannelAnnouncement*)this_ptr;
6198 FREE((void*)this_ptr);
6199 this_ptr_conv.is_owned = true;
6200 return ChannelAnnouncement_free(this_ptr_conv);
6203 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1node_1signature_11(JNIEnv * _env, jclass _b, jlong this_ptr) {
6204 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
6205 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
6206 *ret = ChannelAnnouncement_get_node_signature_1(this_ptr_conv);
6210 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1node_1signature_11(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6211 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
6212 LDKSignature val_conv = *(LDKSignature*)val;
6214 return ChannelAnnouncement_set_node_signature_1(this_ptr_conv, val_conv);
6217 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1node_1signature_12(JNIEnv * _env, jclass _b, jlong this_ptr) {
6218 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
6219 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
6220 *ret = ChannelAnnouncement_get_node_signature_2(this_ptr_conv);
6224 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1node_1signature_12(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6225 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
6226 LDKSignature val_conv = *(LDKSignature*)val;
6228 return ChannelAnnouncement_set_node_signature_2(this_ptr_conv, val_conv);
6231 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1bitcoin_1signature_11(JNIEnv * _env, jclass _b, jlong this_ptr) {
6232 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
6233 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
6234 *ret = ChannelAnnouncement_get_bitcoin_signature_1(this_ptr_conv);
6238 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1bitcoin_1signature_11(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6239 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
6240 LDKSignature val_conv = *(LDKSignature*)val;
6242 return ChannelAnnouncement_set_bitcoin_signature_1(this_ptr_conv, val_conv);
6245 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1bitcoin_1signature_12(JNIEnv * _env, jclass _b, jlong this_ptr) {
6246 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
6247 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
6248 *ret = ChannelAnnouncement_get_bitcoin_signature_2(this_ptr_conv);
6252 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1bitcoin_1signature_12(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6253 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
6254 LDKSignature val_conv = *(LDKSignature*)val;
6256 return ChannelAnnouncement_set_bitcoin_signature_2(this_ptr_conv, val_conv);
6259 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1contents(JNIEnv * _env, jclass _b, jlong this_ptr) {
6260 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
6261 LDKUnsignedChannelAnnouncement* ret = MALLOC(sizeof(LDKUnsignedChannelAnnouncement), "LDKUnsignedChannelAnnouncement");
6262 *ret = ChannelAnnouncement_get_contents(this_ptr_conv);
6263 DO_ASSERT(ret->is_owned);
6264 ret->is_owned = false;
6268 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1contents(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6269 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
6270 LDKUnsignedChannelAnnouncement val_conv = *(LDKUnsignedChannelAnnouncement*)val;
6272 val_conv.is_owned = true;
6273 return ChannelAnnouncement_set_contents(this_ptr_conv, val_conv);
6276 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) {
6277 LDKSignature node_signature_1_arg_conv = *(LDKSignature*)node_signature_1_arg;
6278 FREE((void*)node_signature_1_arg);
6279 LDKSignature node_signature_2_arg_conv = *(LDKSignature*)node_signature_2_arg;
6280 FREE((void*)node_signature_2_arg);
6281 LDKSignature bitcoin_signature_1_arg_conv = *(LDKSignature*)bitcoin_signature_1_arg;
6282 FREE((void*)bitcoin_signature_1_arg);
6283 LDKSignature bitcoin_signature_2_arg_conv = *(LDKSignature*)bitcoin_signature_2_arg;
6284 FREE((void*)bitcoin_signature_2_arg);
6285 LDKUnsignedChannelAnnouncement contents_arg_conv = *(LDKUnsignedChannelAnnouncement*)contents_arg;
6286 FREE((void*)contents_arg);
6287 contents_arg_conv.is_owned = true;
6288 LDKChannelAnnouncement* ret = MALLOC(sizeof(LDKChannelAnnouncement), "LDKChannelAnnouncement");
6289 *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);
6290 DO_ASSERT(ret->is_owned);
6291 ret->is_owned = false;
6295 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6296 LDKUnsignedChannelUpdate this_ptr_conv = *(LDKUnsignedChannelUpdate*)this_ptr;
6297 FREE((void*)this_ptr);
6298 this_ptr_conv.is_owned = true;
6299 return UnsignedChannelUpdate_free(this_ptr_conv);
6302 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
6303 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
6304 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
6305 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UnsignedChannelUpdate_get_chain_hash(this_ptr_conv));
6309 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6310 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
6311 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
6313 return UnsignedChannelUpdate_set_chain_hash(this_ptr_conv, val_conv);
6316 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
6317 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
6318 return UnsignedChannelUpdate_get_short_channel_id(this_ptr_conv);
6321 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6322 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
6323 return UnsignedChannelUpdate_set_short_channel_id(this_ptr_conv, val);
6326 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1timestamp(JNIEnv * _env, jclass _b, jlong this_ptr) {
6327 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
6328 return UnsignedChannelUpdate_get_timestamp(this_ptr_conv);
6331 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1timestamp(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
6332 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
6333 return UnsignedChannelUpdate_set_timestamp(this_ptr_conv, val);
6336 JNIEXPORT jbyte JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1flags(JNIEnv * _env, jclass _b, jlong this_ptr) {
6337 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
6338 return UnsignedChannelUpdate_get_flags(this_ptr_conv);
6341 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1flags(JNIEnv * _env, jclass _b, jlong this_ptr, jbyte val) {
6342 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
6343 return UnsignedChannelUpdate_set_flags(this_ptr_conv, val);
6346 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr) {
6347 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
6348 return UnsignedChannelUpdate_get_cltv_expiry_delta(this_ptr_conv);
6351 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
6352 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
6353 return UnsignedChannelUpdate_set_cltv_expiry_delta(this_ptr_conv, val);
6356 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
6357 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
6358 return UnsignedChannelUpdate_get_htlc_minimum_msat(this_ptr_conv);
6361 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6362 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
6363 return UnsignedChannelUpdate_set_htlc_minimum_msat(this_ptr_conv, val);
6366 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1fee_1base_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
6367 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
6368 return UnsignedChannelUpdate_get_fee_base_msat(this_ptr_conv);
6371 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1fee_1base_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
6372 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
6373 return UnsignedChannelUpdate_set_fee_base_msat(this_ptr_conv, val);
6376 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1fee_1proportional_1millionths(JNIEnv * _env, jclass _b, jlong this_ptr) {
6377 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
6378 return UnsignedChannelUpdate_get_fee_proportional_millionths(this_ptr_conv);
6381 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1fee_1proportional_1millionths(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
6382 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
6383 return UnsignedChannelUpdate_set_fee_proportional_millionths(this_ptr_conv, val);
6386 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6387 LDKChannelUpdate this_ptr_conv = *(LDKChannelUpdate*)this_ptr;
6388 FREE((void*)this_ptr);
6389 this_ptr_conv.is_owned = true;
6390 return ChannelUpdate_free(this_ptr_conv);
6393 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1get_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
6394 LDKChannelUpdate* this_ptr_conv = (LDKChannelUpdate*)this_ptr;
6395 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
6396 *ret = ChannelUpdate_get_signature(this_ptr_conv);
6400 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1set_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6401 LDKChannelUpdate* this_ptr_conv = (LDKChannelUpdate*)this_ptr;
6402 LDKSignature val_conv = *(LDKSignature*)val;
6404 return ChannelUpdate_set_signature(this_ptr_conv, val_conv);
6407 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1get_1contents(JNIEnv * _env, jclass _b, jlong this_ptr) {
6408 LDKChannelUpdate* this_ptr_conv = (LDKChannelUpdate*)this_ptr;
6409 LDKUnsignedChannelUpdate* ret = MALLOC(sizeof(LDKUnsignedChannelUpdate), "LDKUnsignedChannelUpdate");
6410 *ret = ChannelUpdate_get_contents(this_ptr_conv);
6411 DO_ASSERT(ret->is_owned);
6412 ret->is_owned = false;
6416 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1set_1contents(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6417 LDKChannelUpdate* this_ptr_conv = (LDKChannelUpdate*)this_ptr;
6418 LDKUnsignedChannelUpdate val_conv = *(LDKUnsignedChannelUpdate*)val;
6420 val_conv.is_owned = true;
6421 return ChannelUpdate_set_contents(this_ptr_conv, val_conv);
6424 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1new(JNIEnv * _env, jclass _b, jlong signature_arg, jlong contents_arg) {
6425 LDKSignature signature_arg_conv = *(LDKSignature*)signature_arg;
6426 FREE((void*)signature_arg);
6427 LDKUnsignedChannelUpdate contents_arg_conv = *(LDKUnsignedChannelUpdate*)contents_arg;
6428 FREE((void*)contents_arg);
6429 contents_arg_conv.is_owned = true;
6430 LDKChannelUpdate* ret = MALLOC(sizeof(LDKChannelUpdate), "LDKChannelUpdate");
6431 *ret = ChannelUpdate_new(signature_arg_conv, contents_arg_conv);
6432 DO_ASSERT(ret->is_owned);
6433 ret->is_owned = false;
6437 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6438 LDKQueryChannelRange this_ptr_conv = *(LDKQueryChannelRange*)this_ptr;
6439 FREE((void*)this_ptr);
6440 this_ptr_conv.is_owned = true;
6441 return QueryChannelRange_free(this_ptr_conv);
6444 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1get_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
6445 LDKQueryChannelRange* this_ptr_conv = (LDKQueryChannelRange*)this_ptr;
6446 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
6447 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *QueryChannelRange_get_chain_hash(this_ptr_conv));
6451 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1set_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6452 LDKQueryChannelRange* this_ptr_conv = (LDKQueryChannelRange*)this_ptr;
6453 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
6455 return QueryChannelRange_set_chain_hash(this_ptr_conv, val_conv);
6458 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1get_1first_1blocknum(JNIEnv * _env, jclass _b, jlong this_ptr) {
6459 LDKQueryChannelRange* this_ptr_conv = (LDKQueryChannelRange*)this_ptr;
6460 return QueryChannelRange_get_first_blocknum(this_ptr_conv);
6463 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1set_1first_1blocknum(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
6464 LDKQueryChannelRange* this_ptr_conv = (LDKQueryChannelRange*)this_ptr;
6465 return QueryChannelRange_set_first_blocknum(this_ptr_conv, val);
6468 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1get_1number_1of_1blocks(JNIEnv * _env, jclass _b, jlong this_ptr) {
6469 LDKQueryChannelRange* this_ptr_conv = (LDKQueryChannelRange*)this_ptr;
6470 return QueryChannelRange_get_number_of_blocks(this_ptr_conv);
6473 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1set_1number_1of_1blocks(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
6474 LDKQueryChannelRange* this_ptr_conv = (LDKQueryChannelRange*)this_ptr;
6475 return QueryChannelRange_set_number_of_blocks(this_ptr_conv, val);
6478 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1new(JNIEnv * _env, jclass _b, jlong chain_hash_arg, jint first_blocknum_arg, jint number_of_blocks_arg) {
6479 LDKThirtyTwoBytes chain_hash_arg_conv = *(LDKThirtyTwoBytes*)chain_hash_arg;
6480 FREE((void*)chain_hash_arg);
6481 LDKQueryChannelRange* ret = MALLOC(sizeof(LDKQueryChannelRange), "LDKQueryChannelRange");
6482 *ret = QueryChannelRange_new(chain_hash_arg_conv, first_blocknum_arg, number_of_blocks_arg);
6483 DO_ASSERT(ret->is_owned);
6484 ret->is_owned = false;
6488 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6489 LDKReplyChannelRange this_ptr_conv = *(LDKReplyChannelRange*)this_ptr;
6490 FREE((void*)this_ptr);
6491 this_ptr_conv.is_owned = true;
6492 return ReplyChannelRange_free(this_ptr_conv);
6495 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
6496 LDKReplyChannelRange* this_ptr_conv = (LDKReplyChannelRange*)this_ptr;
6497 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
6498 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *ReplyChannelRange_get_chain_hash(this_ptr_conv));
6502 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6503 LDKReplyChannelRange* this_ptr_conv = (LDKReplyChannelRange*)this_ptr;
6504 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
6506 return ReplyChannelRange_set_chain_hash(this_ptr_conv, val_conv);
6509 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1first_1blocknum(JNIEnv * _env, jclass _b, jlong this_ptr) {
6510 LDKReplyChannelRange* this_ptr_conv = (LDKReplyChannelRange*)this_ptr;
6511 return ReplyChannelRange_get_first_blocknum(this_ptr_conv);
6514 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1first_1blocknum(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
6515 LDKReplyChannelRange* this_ptr_conv = (LDKReplyChannelRange*)this_ptr;
6516 return ReplyChannelRange_set_first_blocknum(this_ptr_conv, val);
6519 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1number_1of_1blocks(JNIEnv * _env, jclass _b, jlong this_ptr) {
6520 LDKReplyChannelRange* this_ptr_conv = (LDKReplyChannelRange*)this_ptr;
6521 return ReplyChannelRange_get_number_of_blocks(this_ptr_conv);
6524 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1number_1of_1blocks(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
6525 LDKReplyChannelRange* this_ptr_conv = (LDKReplyChannelRange*)this_ptr;
6526 return ReplyChannelRange_set_number_of_blocks(this_ptr_conv, val);
6529 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1full_1information(JNIEnv * _env, jclass _b, jlong this_ptr) {
6530 LDKReplyChannelRange* this_ptr_conv = (LDKReplyChannelRange*)this_ptr;
6531 return ReplyChannelRange_get_full_information(this_ptr_conv);
6534 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1full_1information(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
6535 LDKReplyChannelRange* this_ptr_conv = (LDKReplyChannelRange*)this_ptr;
6536 return ReplyChannelRange_set_full_information(this_ptr_conv, val);
6539 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1short_1channel_1ids(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6540 LDKReplyChannelRange* this_ptr_conv = (LDKReplyChannelRange*)this_ptr;
6541 LDKCVec_u64Z val_conv = *(LDKCVec_u64Z*)val;
6543 return ReplyChannelRange_set_short_channel_ids(this_ptr_conv, val_conv);
6546 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1new(JNIEnv * _env, jclass _b, jlong chain_hash_arg, jint first_blocknum_arg, jint number_of_blocks_arg, jboolean full_information_arg, jlong short_channel_ids_arg) {
6547 LDKThirtyTwoBytes chain_hash_arg_conv = *(LDKThirtyTwoBytes*)chain_hash_arg;
6548 FREE((void*)chain_hash_arg);
6549 LDKCVec_u64Z short_channel_ids_arg_conv = *(LDKCVec_u64Z*)short_channel_ids_arg;
6550 FREE((void*)short_channel_ids_arg);
6551 LDKReplyChannelRange* ret = MALLOC(sizeof(LDKReplyChannelRange), "LDKReplyChannelRange");
6552 *ret = ReplyChannelRange_new(chain_hash_arg_conv, first_blocknum_arg, number_of_blocks_arg, full_information_arg, short_channel_ids_arg_conv);
6553 DO_ASSERT(ret->is_owned);
6554 ret->is_owned = false;
6558 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6559 LDKQueryShortChannelIds this_ptr_conv = *(LDKQueryShortChannelIds*)this_ptr;
6560 FREE((void*)this_ptr);
6561 this_ptr_conv.is_owned = true;
6562 return QueryShortChannelIds_free(this_ptr_conv);
6565 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1get_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
6566 LDKQueryShortChannelIds* this_ptr_conv = (LDKQueryShortChannelIds*)this_ptr;
6567 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
6568 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *QueryShortChannelIds_get_chain_hash(this_ptr_conv));
6572 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1set_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6573 LDKQueryShortChannelIds* this_ptr_conv = (LDKQueryShortChannelIds*)this_ptr;
6574 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
6576 return QueryShortChannelIds_set_chain_hash(this_ptr_conv, val_conv);
6579 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1set_1short_1channel_1ids(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6580 LDKQueryShortChannelIds* this_ptr_conv = (LDKQueryShortChannelIds*)this_ptr;
6581 LDKCVec_u64Z val_conv = *(LDKCVec_u64Z*)val;
6583 return QueryShortChannelIds_set_short_channel_ids(this_ptr_conv, val_conv);
6586 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1new(JNIEnv * _env, jclass _b, jlong chain_hash_arg, jlong short_channel_ids_arg) {
6587 LDKThirtyTwoBytes chain_hash_arg_conv = *(LDKThirtyTwoBytes*)chain_hash_arg;
6588 FREE((void*)chain_hash_arg);
6589 LDKCVec_u64Z short_channel_ids_arg_conv = *(LDKCVec_u64Z*)short_channel_ids_arg;
6590 FREE((void*)short_channel_ids_arg);
6591 LDKQueryShortChannelIds* ret = MALLOC(sizeof(LDKQueryShortChannelIds), "LDKQueryShortChannelIds");
6592 *ret = QueryShortChannelIds_new(chain_hash_arg_conv, short_channel_ids_arg_conv);
6593 DO_ASSERT(ret->is_owned);
6594 ret->is_owned = false;
6598 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6599 LDKReplyShortChannelIdsEnd this_ptr_conv = *(LDKReplyShortChannelIdsEnd*)this_ptr;
6600 FREE((void*)this_ptr);
6601 this_ptr_conv.is_owned = true;
6602 return ReplyShortChannelIdsEnd_free(this_ptr_conv);
6605 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1get_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
6606 LDKReplyShortChannelIdsEnd* this_ptr_conv = (LDKReplyShortChannelIdsEnd*)this_ptr;
6607 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
6608 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *ReplyShortChannelIdsEnd_get_chain_hash(this_ptr_conv));
6612 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1set_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6613 LDKReplyShortChannelIdsEnd* this_ptr_conv = (LDKReplyShortChannelIdsEnd*)this_ptr;
6614 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
6616 return ReplyShortChannelIdsEnd_set_chain_hash(this_ptr_conv, val_conv);
6619 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1get_1full_1information(JNIEnv * _env, jclass _b, jlong this_ptr) {
6620 LDKReplyShortChannelIdsEnd* this_ptr_conv = (LDKReplyShortChannelIdsEnd*)this_ptr;
6621 return ReplyShortChannelIdsEnd_get_full_information(this_ptr_conv);
6624 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1set_1full_1information(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
6625 LDKReplyShortChannelIdsEnd* this_ptr_conv = (LDKReplyShortChannelIdsEnd*)this_ptr;
6626 return ReplyShortChannelIdsEnd_set_full_information(this_ptr_conv, val);
6629 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1new(JNIEnv * _env, jclass _b, jlong chain_hash_arg, jboolean full_information_arg) {
6630 LDKThirtyTwoBytes chain_hash_arg_conv = *(LDKThirtyTwoBytes*)chain_hash_arg;
6631 FREE((void*)chain_hash_arg);
6632 LDKReplyShortChannelIdsEnd* ret = MALLOC(sizeof(LDKReplyShortChannelIdsEnd), "LDKReplyShortChannelIdsEnd");
6633 *ret = ReplyShortChannelIdsEnd_new(chain_hash_arg_conv, full_information_arg);
6634 DO_ASSERT(ret->is_owned);
6635 ret->is_owned = false;
6639 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6640 LDKGossipTimestampFilter this_ptr_conv = *(LDKGossipTimestampFilter*)this_ptr;
6641 FREE((void*)this_ptr);
6642 this_ptr_conv.is_owned = true;
6643 return GossipTimestampFilter_free(this_ptr_conv);
6646 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1get_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
6647 LDKGossipTimestampFilter* this_ptr_conv = (LDKGossipTimestampFilter*)this_ptr;
6648 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
6649 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *GossipTimestampFilter_get_chain_hash(this_ptr_conv));
6653 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1set_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6654 LDKGossipTimestampFilter* this_ptr_conv = (LDKGossipTimestampFilter*)this_ptr;
6655 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
6657 return GossipTimestampFilter_set_chain_hash(this_ptr_conv, val_conv);
6660 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1get_1first_1timestamp(JNIEnv * _env, jclass _b, jlong this_ptr) {
6661 LDKGossipTimestampFilter* this_ptr_conv = (LDKGossipTimestampFilter*)this_ptr;
6662 return GossipTimestampFilter_get_first_timestamp(this_ptr_conv);
6665 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1set_1first_1timestamp(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
6666 LDKGossipTimestampFilter* this_ptr_conv = (LDKGossipTimestampFilter*)this_ptr;
6667 return GossipTimestampFilter_set_first_timestamp(this_ptr_conv, val);
6670 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1get_1timestamp_1range(JNIEnv * _env, jclass _b, jlong this_ptr) {
6671 LDKGossipTimestampFilter* this_ptr_conv = (LDKGossipTimestampFilter*)this_ptr;
6672 return GossipTimestampFilter_get_timestamp_range(this_ptr_conv);
6675 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1set_1timestamp_1range(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
6676 LDKGossipTimestampFilter* this_ptr_conv = (LDKGossipTimestampFilter*)this_ptr;
6677 return GossipTimestampFilter_set_timestamp_range(this_ptr_conv, val);
6680 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1new(JNIEnv * _env, jclass _b, jlong chain_hash_arg, jint first_timestamp_arg, jint timestamp_range_arg) {
6681 LDKThirtyTwoBytes chain_hash_arg_conv = *(LDKThirtyTwoBytes*)chain_hash_arg;
6682 FREE((void*)chain_hash_arg);
6683 LDKGossipTimestampFilter* ret = MALLOC(sizeof(LDKGossipTimestampFilter), "LDKGossipTimestampFilter");
6684 *ret = GossipTimestampFilter_new(chain_hash_arg_conv, first_timestamp_arg, timestamp_range_arg);
6685 DO_ASSERT(ret->is_owned);
6686 ret->is_owned = false;
6690 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorAction_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6691 LDKErrorAction this_ptr_conv = *(LDKErrorAction*)this_ptr;
6692 FREE((void*)this_ptr);
6693 return ErrorAction_free(this_ptr_conv);
6696 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6697 LDKLightningError this_ptr_conv = *(LDKLightningError*)this_ptr;
6698 FREE((void*)this_ptr);
6699 this_ptr_conv.is_owned = true;
6700 return LightningError_free(this_ptr_conv);
6703 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LightningError_1get_1err(JNIEnv * _env, jclass _b, jlong this_ptr) {
6704 LDKLightningError* this_ptr_conv = (LDKLightningError*)this_ptr;
6705 LDKStr* ret = MALLOC(sizeof(LDKStr), "LDKStr");
6706 *ret = LightningError_get_err(this_ptr_conv);
6710 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1set_1err(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6711 LDKLightningError* this_ptr_conv = (LDKLightningError*)this_ptr;
6712 LDKCVec_u8Z val_conv = *(LDKCVec_u8Z*)val;
6714 return LightningError_set_err(this_ptr_conv, val_conv);
6717 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LightningError_1get_1action(JNIEnv * _env, jclass _b, jlong this_ptr) {
6718 LDKLightningError* this_ptr_conv = (LDKLightningError*)this_ptr;
6719 LDKErrorAction* ret = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
6720 *ret = LightningError_get_action(this_ptr_conv);
6724 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1set_1action(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6725 LDKLightningError* this_ptr_conv = (LDKLightningError*)this_ptr;
6726 LDKErrorAction val_conv = *(LDKErrorAction*)val;
6728 return LightningError_set_action(this_ptr_conv, val_conv);
6731 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LightningError_1new(JNIEnv * _env, jclass _b, jlong err_arg, jlong action_arg) {
6732 LDKCVec_u8Z err_arg_conv = *(LDKCVec_u8Z*)err_arg;
6733 FREE((void*)err_arg);
6734 LDKErrorAction action_arg_conv = *(LDKErrorAction*)action_arg;
6735 FREE((void*)action_arg);
6736 LDKLightningError* ret = MALLOC(sizeof(LDKLightningError), "LDKLightningError");
6737 *ret = LightningError_new(err_arg_conv, action_arg_conv);
6738 DO_ASSERT(ret->is_owned);
6739 ret->is_owned = false;
6743 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6744 LDKCommitmentUpdate this_ptr_conv = *(LDKCommitmentUpdate*)this_ptr;
6745 FREE((void*)this_ptr);
6746 this_ptr_conv.is_owned = true;
6747 return CommitmentUpdate_free(this_ptr_conv);
6750 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1add_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6751 LDKCommitmentUpdate* this_ptr_conv = (LDKCommitmentUpdate*)this_ptr;
6752 LDKCVec_UpdateAddHTLCZ val_conv = *(LDKCVec_UpdateAddHTLCZ*)val;
6754 return CommitmentUpdate_set_update_add_htlcs(this_ptr_conv, val_conv);
6757 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fulfill_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6758 LDKCommitmentUpdate* this_ptr_conv = (LDKCommitmentUpdate*)this_ptr;
6759 LDKCVec_UpdateFulfillHTLCZ val_conv = *(LDKCVec_UpdateFulfillHTLCZ*)val;
6761 return CommitmentUpdate_set_update_fulfill_htlcs(this_ptr_conv, val_conv);
6764 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fail_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6765 LDKCommitmentUpdate* this_ptr_conv = (LDKCommitmentUpdate*)this_ptr;
6766 LDKCVec_UpdateFailHTLCZ val_conv = *(LDKCVec_UpdateFailHTLCZ*)val;
6768 return CommitmentUpdate_set_update_fail_htlcs(this_ptr_conv, val_conv);
6771 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fail_1malformed_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6772 LDKCommitmentUpdate* this_ptr_conv = (LDKCommitmentUpdate*)this_ptr;
6773 LDKCVec_UpdateFailMalformedHTLCZ val_conv = *(LDKCVec_UpdateFailMalformedHTLCZ*)val;
6775 return CommitmentUpdate_set_update_fail_malformed_htlcs(this_ptr_conv, val_conv);
6778 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1update_1fee(JNIEnv * _env, jclass _b, jlong this_ptr) {
6779 LDKCommitmentUpdate* this_ptr_conv = (LDKCommitmentUpdate*)this_ptr;
6780 LDKUpdateFee* ret = MALLOC(sizeof(LDKUpdateFee), "LDKUpdateFee");
6781 *ret = CommitmentUpdate_get_update_fee(this_ptr_conv);
6782 DO_ASSERT(ret->is_owned);
6783 ret->is_owned = false;
6787 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fee(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6788 LDKCommitmentUpdate* this_ptr_conv = (LDKCommitmentUpdate*)this_ptr;
6789 LDKUpdateFee val_conv = *(LDKUpdateFee*)val;
6791 val_conv.is_owned = true;
6792 return CommitmentUpdate_set_update_fee(this_ptr_conv, val_conv);
6795 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1commitment_1signed(JNIEnv * _env, jclass _b, jlong this_ptr) {
6796 LDKCommitmentUpdate* this_ptr_conv = (LDKCommitmentUpdate*)this_ptr;
6797 LDKCommitmentSigned* ret = MALLOC(sizeof(LDKCommitmentSigned), "LDKCommitmentSigned");
6798 *ret = CommitmentUpdate_get_commitment_signed(this_ptr_conv);
6799 DO_ASSERT(ret->is_owned);
6800 ret->is_owned = false;
6804 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1commitment_1signed(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6805 LDKCommitmentUpdate* this_ptr_conv = (LDKCommitmentUpdate*)this_ptr;
6806 LDKCommitmentSigned val_conv = *(LDKCommitmentSigned*)val;
6808 val_conv.is_owned = true;
6809 return CommitmentUpdate_set_commitment_signed(this_ptr_conv, val_conv);
6812 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) {
6813 LDKCVec_UpdateAddHTLCZ update_add_htlcs_arg_conv = *(LDKCVec_UpdateAddHTLCZ*)update_add_htlcs_arg;
6814 FREE((void*)update_add_htlcs_arg);
6815 LDKCVec_UpdateFulfillHTLCZ update_fulfill_htlcs_arg_conv = *(LDKCVec_UpdateFulfillHTLCZ*)update_fulfill_htlcs_arg;
6816 FREE((void*)update_fulfill_htlcs_arg);
6817 LDKCVec_UpdateFailHTLCZ update_fail_htlcs_arg_conv = *(LDKCVec_UpdateFailHTLCZ*)update_fail_htlcs_arg;
6818 FREE((void*)update_fail_htlcs_arg);
6819 LDKCVec_UpdateFailMalformedHTLCZ update_fail_malformed_htlcs_arg_conv = *(LDKCVec_UpdateFailMalformedHTLCZ*)update_fail_malformed_htlcs_arg;
6820 FREE((void*)update_fail_malformed_htlcs_arg);
6821 LDKUpdateFee update_fee_arg_conv = *(LDKUpdateFee*)update_fee_arg;
6822 FREE((void*)update_fee_arg);
6823 update_fee_arg_conv.is_owned = true;
6824 LDKCommitmentSigned commitment_signed_arg_conv = *(LDKCommitmentSigned*)commitment_signed_arg;
6825 FREE((void*)commitment_signed_arg);
6826 commitment_signed_arg_conv.is_owned = true;
6827 LDKCommitmentUpdate* ret = MALLOC(sizeof(LDKCommitmentUpdate), "LDKCommitmentUpdate");
6828 *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);
6829 DO_ASSERT(ret->is_owned);
6830 ret->is_owned = false;
6834 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCFailChannelUpdate_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6835 LDKHTLCFailChannelUpdate this_ptr_conv = *(LDKHTLCFailChannelUpdate*)this_ptr;
6836 FREE((void*)this_ptr);
6837 return HTLCFailChannelUpdate_free(this_ptr_conv);
6840 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6841 LDKChannelMessageHandler this_ptr_conv = *(LDKChannelMessageHandler*)this_ptr;
6842 FREE((void*)this_ptr);
6843 return ChannelMessageHandler_free(this_ptr_conv);
6846 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6847 LDKRoutingMessageHandler this_ptr_conv = *(LDKRoutingMessageHandler*)this_ptr;
6848 FREE((void*)this_ptr);
6849 return RoutingMessageHandler_free(this_ptr_conv);
6852 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1write(JNIEnv * _env, jclass _b, jlong obj) {
6853 LDKAcceptChannel* obj_conv = (LDKAcceptChannel*)obj;
6854 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6855 *ret = AcceptChannel_write(obj_conv);
6859 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1read(JNIEnv * _env, jclass _b, jlong ser) {
6860 LDKu8slice ser_conv = *(LDKu8slice*)ser;
6861 LDKAcceptChannel* ret = MALLOC(sizeof(LDKAcceptChannel), "LDKAcceptChannel");
6862 *ret = AcceptChannel_read(ser_conv);
6863 DO_ASSERT(ret->is_owned);
6864 ret->is_owned = false;
6868 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1write(JNIEnv * _env, jclass _b, jlong obj) {
6869 LDKAnnouncementSignatures* obj_conv = (LDKAnnouncementSignatures*)obj;
6870 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6871 *ret = AnnouncementSignatures_write(obj_conv);
6875 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1read(JNIEnv * _env, jclass _b, jlong ser) {
6876 LDKu8slice ser_conv = *(LDKu8slice*)ser;
6877 LDKAnnouncementSignatures* ret = MALLOC(sizeof(LDKAnnouncementSignatures), "LDKAnnouncementSignatures");
6878 *ret = AnnouncementSignatures_read(ser_conv);
6879 DO_ASSERT(ret->is_owned);
6880 ret->is_owned = false;
6884 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1write(JNIEnv * _env, jclass _b, jlong obj) {
6885 LDKChannelReestablish* obj_conv = (LDKChannelReestablish*)obj;
6886 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6887 *ret = ChannelReestablish_write(obj_conv);
6891 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1read(JNIEnv * _env, jclass _b, jlong ser) {
6892 LDKu8slice ser_conv = *(LDKu8slice*)ser;
6893 LDKChannelReestablish* ret = MALLOC(sizeof(LDKChannelReestablish), "LDKChannelReestablish");
6894 *ret = ChannelReestablish_read(ser_conv);
6895 DO_ASSERT(ret->is_owned);
6896 ret->is_owned = false;
6900 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1write(JNIEnv * _env, jclass _b, jlong obj) {
6901 LDKClosingSigned* obj_conv = (LDKClosingSigned*)obj;
6902 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6903 *ret = ClosingSigned_write(obj_conv);
6907 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1read(JNIEnv * _env, jclass _b, jlong ser) {
6908 LDKu8slice ser_conv = *(LDKu8slice*)ser;
6909 LDKClosingSigned* ret = MALLOC(sizeof(LDKClosingSigned), "LDKClosingSigned");
6910 *ret = ClosingSigned_read(ser_conv);
6911 DO_ASSERT(ret->is_owned);
6912 ret->is_owned = false;
6916 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1write(JNIEnv * _env, jclass _b, jlong obj) {
6917 LDKCommitmentSigned* obj_conv = (LDKCommitmentSigned*)obj;
6918 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6919 *ret = CommitmentSigned_write(obj_conv);
6923 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1read(JNIEnv * _env, jclass _b, jlong ser) {
6924 LDKu8slice ser_conv = *(LDKu8slice*)ser;
6925 LDKCommitmentSigned* ret = MALLOC(sizeof(LDKCommitmentSigned), "LDKCommitmentSigned");
6926 *ret = CommitmentSigned_read(ser_conv);
6927 DO_ASSERT(ret->is_owned);
6928 ret->is_owned = false;
6932 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingCreated_1write(JNIEnv * _env, jclass _b, jlong obj) {
6933 LDKFundingCreated* obj_conv = (LDKFundingCreated*)obj;
6934 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6935 *ret = FundingCreated_write(obj_conv);
6939 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingCreated_1read(JNIEnv * _env, jclass _b, jlong ser) {
6940 LDKu8slice ser_conv = *(LDKu8slice*)ser;
6941 LDKFundingCreated* ret = MALLOC(sizeof(LDKFundingCreated), "LDKFundingCreated");
6942 *ret = FundingCreated_read(ser_conv);
6943 DO_ASSERT(ret->is_owned);
6944 ret->is_owned = false;
6948 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingSigned_1write(JNIEnv * _env, jclass _b, jlong obj) {
6949 LDKFundingSigned* obj_conv = (LDKFundingSigned*)obj;
6950 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6951 *ret = FundingSigned_write(obj_conv);
6955 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingSigned_1read(JNIEnv * _env, jclass _b, jlong ser) {
6956 LDKu8slice ser_conv = *(LDKu8slice*)ser;
6957 LDKFundingSigned* ret = MALLOC(sizeof(LDKFundingSigned), "LDKFundingSigned");
6958 *ret = FundingSigned_read(ser_conv);
6959 DO_ASSERT(ret->is_owned);
6960 ret->is_owned = false;
6964 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingLocked_1write(JNIEnv * _env, jclass _b, jlong obj) {
6965 LDKFundingLocked* obj_conv = (LDKFundingLocked*)obj;
6966 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6967 *ret = FundingLocked_write(obj_conv);
6971 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingLocked_1read(JNIEnv * _env, jclass _b, jlong ser) {
6972 LDKu8slice ser_conv = *(LDKu8slice*)ser;
6973 LDKFundingLocked* ret = MALLOC(sizeof(LDKFundingLocked), "LDKFundingLocked");
6974 *ret = FundingLocked_read(ser_conv);
6975 DO_ASSERT(ret->is_owned);
6976 ret->is_owned = false;
6980 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Init_1write(JNIEnv * _env, jclass _b, jlong obj) {
6981 LDKInit* obj_conv = (LDKInit*)obj;
6982 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6983 *ret = Init_write(obj_conv);
6987 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Init_1read(JNIEnv * _env, jclass _b, jlong ser) {
6988 LDKu8slice ser_conv = *(LDKu8slice*)ser;
6989 LDKInit* ret = MALLOC(sizeof(LDKInit), "LDKInit");
6990 *ret = Init_read(ser_conv);
6991 DO_ASSERT(ret->is_owned);
6992 ret->is_owned = false;
6996 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1write(JNIEnv * _env, jclass _b, jlong obj) {
6997 LDKOpenChannel* obj_conv = (LDKOpenChannel*)obj;
6998 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6999 *ret = OpenChannel_write(obj_conv);
7003 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1read(JNIEnv * _env, jclass _b, jlong ser) {
7004 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7005 LDKOpenChannel* ret = MALLOC(sizeof(LDKOpenChannel), "LDKOpenChannel");
7006 *ret = OpenChannel_read(ser_conv);
7007 DO_ASSERT(ret->is_owned);
7008 ret->is_owned = false;
7012 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1write(JNIEnv * _env, jclass _b, jlong obj) {
7013 LDKRevokeAndACK* obj_conv = (LDKRevokeAndACK*)obj;
7014 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7015 *ret = RevokeAndACK_write(obj_conv);
7019 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1read(JNIEnv * _env, jclass _b, jlong ser) {
7020 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7021 LDKRevokeAndACK* ret = MALLOC(sizeof(LDKRevokeAndACK), "LDKRevokeAndACK");
7022 *ret = RevokeAndACK_read(ser_conv);
7023 DO_ASSERT(ret->is_owned);
7024 ret->is_owned = false;
7028 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Shutdown_1write(JNIEnv * _env, jclass _b, jlong obj) {
7029 LDKShutdown* obj_conv = (LDKShutdown*)obj;
7030 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7031 *ret = Shutdown_write(obj_conv);
7035 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Shutdown_1read(JNIEnv * _env, jclass _b, jlong ser) {
7036 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7037 LDKShutdown* ret = MALLOC(sizeof(LDKShutdown), "LDKShutdown");
7038 *ret = Shutdown_read(ser_conv);
7039 DO_ASSERT(ret->is_owned);
7040 ret->is_owned = false;
7044 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1write(JNIEnv * _env, jclass _b, jlong obj) {
7045 LDKUpdateFailHTLC* obj_conv = (LDKUpdateFailHTLC*)obj;
7046 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7047 *ret = UpdateFailHTLC_write(obj_conv);
7051 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1read(JNIEnv * _env, jclass _b, jlong ser) {
7052 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7053 LDKUpdateFailHTLC* ret = MALLOC(sizeof(LDKUpdateFailHTLC), "LDKUpdateFailHTLC");
7054 *ret = UpdateFailHTLC_read(ser_conv);
7055 DO_ASSERT(ret->is_owned);
7056 ret->is_owned = false;
7060 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1write(JNIEnv * _env, jclass _b, jlong obj) {
7061 LDKUpdateFailMalformedHTLC* obj_conv = (LDKUpdateFailMalformedHTLC*)obj;
7062 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7063 *ret = UpdateFailMalformedHTLC_write(obj_conv);
7067 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1read(JNIEnv * _env, jclass _b, jlong ser) {
7068 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7069 LDKUpdateFailMalformedHTLC* ret = MALLOC(sizeof(LDKUpdateFailMalformedHTLC), "LDKUpdateFailMalformedHTLC");
7070 *ret = UpdateFailMalformedHTLC_read(ser_conv);
7071 DO_ASSERT(ret->is_owned);
7072 ret->is_owned = false;
7076 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFee_1write(JNIEnv * _env, jclass _b, jlong obj) {
7077 LDKUpdateFee* obj_conv = (LDKUpdateFee*)obj;
7078 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7079 *ret = UpdateFee_write(obj_conv);
7083 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFee_1read(JNIEnv * _env, jclass _b, jlong ser) {
7084 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7085 LDKUpdateFee* ret = MALLOC(sizeof(LDKUpdateFee), "LDKUpdateFee");
7086 *ret = UpdateFee_read(ser_conv);
7087 DO_ASSERT(ret->is_owned);
7088 ret->is_owned = false;
7092 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1write(JNIEnv * _env, jclass _b, jlong obj) {
7093 LDKUpdateFulfillHTLC* obj_conv = (LDKUpdateFulfillHTLC*)obj;
7094 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7095 *ret = UpdateFulfillHTLC_write(obj_conv);
7099 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1read(JNIEnv * _env, jclass _b, jlong ser) {
7100 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7101 LDKUpdateFulfillHTLC* ret = MALLOC(sizeof(LDKUpdateFulfillHTLC), "LDKUpdateFulfillHTLC");
7102 *ret = UpdateFulfillHTLC_read(ser_conv);
7103 DO_ASSERT(ret->is_owned);
7104 ret->is_owned = false;
7108 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1write(JNIEnv * _env, jclass _b, jlong obj) {
7109 LDKUpdateAddHTLC* obj_conv = (LDKUpdateAddHTLC*)obj;
7110 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7111 *ret = UpdateAddHTLC_write(obj_conv);
7115 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1read(JNIEnv * _env, jclass _b, jlong ser) {
7116 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7117 LDKUpdateAddHTLC* ret = MALLOC(sizeof(LDKUpdateAddHTLC), "LDKUpdateAddHTLC");
7118 *ret = UpdateAddHTLC_read(ser_conv);
7119 DO_ASSERT(ret->is_owned);
7120 ret->is_owned = false;
7124 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Ping_1write(JNIEnv * _env, jclass _b, jlong obj) {
7125 LDKPing* obj_conv = (LDKPing*)obj;
7126 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7127 *ret = Ping_write(obj_conv);
7131 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Ping_1read(JNIEnv * _env, jclass _b, jlong ser) {
7132 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7133 LDKPing* ret = MALLOC(sizeof(LDKPing), "LDKPing");
7134 *ret = Ping_read(ser_conv);
7135 DO_ASSERT(ret->is_owned);
7136 ret->is_owned = false;
7140 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Pong_1write(JNIEnv * _env, jclass _b, jlong obj) {
7141 LDKPong* obj_conv = (LDKPong*)obj;
7142 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7143 *ret = Pong_write(obj_conv);
7147 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Pong_1read(JNIEnv * _env, jclass _b, jlong ser) {
7148 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7149 LDKPong* ret = MALLOC(sizeof(LDKPong), "LDKPong");
7150 *ret = Pong_read(ser_conv);
7151 DO_ASSERT(ret->is_owned);
7152 ret->is_owned = false;
7156 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1write(JNIEnv * _env, jclass _b, jlong obj) {
7157 LDKUnsignedChannelAnnouncement* obj_conv = (LDKUnsignedChannelAnnouncement*)obj;
7158 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7159 *ret = UnsignedChannelAnnouncement_write(obj_conv);
7163 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1read(JNIEnv * _env, jclass _b, jlong ser) {
7164 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7165 LDKUnsignedChannelAnnouncement* ret = MALLOC(sizeof(LDKUnsignedChannelAnnouncement), "LDKUnsignedChannelAnnouncement");
7166 *ret = UnsignedChannelAnnouncement_read(ser_conv);
7167 DO_ASSERT(ret->is_owned);
7168 ret->is_owned = false;
7172 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1write(JNIEnv * _env, jclass _b, jlong obj) {
7173 LDKChannelAnnouncement* obj_conv = (LDKChannelAnnouncement*)obj;
7174 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7175 *ret = ChannelAnnouncement_write(obj_conv);
7179 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1read(JNIEnv * _env, jclass _b, jlong ser) {
7180 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7181 LDKChannelAnnouncement* ret = MALLOC(sizeof(LDKChannelAnnouncement), "LDKChannelAnnouncement");
7182 *ret = ChannelAnnouncement_read(ser_conv);
7183 DO_ASSERT(ret->is_owned);
7184 ret->is_owned = false;
7188 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1write(JNIEnv * _env, jclass _b, jlong obj) {
7189 LDKUnsignedChannelUpdate* obj_conv = (LDKUnsignedChannelUpdate*)obj;
7190 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7191 *ret = UnsignedChannelUpdate_write(obj_conv);
7195 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1read(JNIEnv * _env, jclass _b, jlong ser) {
7196 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7197 LDKUnsignedChannelUpdate* ret = MALLOC(sizeof(LDKUnsignedChannelUpdate), "LDKUnsignedChannelUpdate");
7198 *ret = UnsignedChannelUpdate_read(ser_conv);
7199 DO_ASSERT(ret->is_owned);
7200 ret->is_owned = false;
7204 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1write(JNIEnv * _env, jclass _b, jlong obj) {
7205 LDKChannelUpdate* obj_conv = (LDKChannelUpdate*)obj;
7206 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7207 *ret = ChannelUpdate_write(obj_conv);
7211 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1read(JNIEnv * _env, jclass _b, jlong ser) {
7212 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7213 LDKChannelUpdate* ret = MALLOC(sizeof(LDKChannelUpdate), "LDKChannelUpdate");
7214 *ret = ChannelUpdate_read(ser_conv);
7215 DO_ASSERT(ret->is_owned);
7216 ret->is_owned = false;
7220 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1write(JNIEnv * _env, jclass _b, jlong obj) {
7221 LDKErrorMessage* obj_conv = (LDKErrorMessage*)obj;
7222 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7223 *ret = ErrorMessage_write(obj_conv);
7227 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1read(JNIEnv * _env, jclass _b, jlong ser) {
7228 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7229 LDKErrorMessage* ret = MALLOC(sizeof(LDKErrorMessage), "LDKErrorMessage");
7230 *ret = ErrorMessage_read(ser_conv);
7231 DO_ASSERT(ret->is_owned);
7232 ret->is_owned = false;
7236 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1write(JNIEnv * _env, jclass _b, jlong obj) {
7237 LDKUnsignedNodeAnnouncement* obj_conv = (LDKUnsignedNodeAnnouncement*)obj;
7238 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7239 *ret = UnsignedNodeAnnouncement_write(obj_conv);
7243 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1read(JNIEnv * _env, jclass _b, jlong ser) {
7244 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7245 LDKUnsignedNodeAnnouncement* ret = MALLOC(sizeof(LDKUnsignedNodeAnnouncement), "LDKUnsignedNodeAnnouncement");
7246 *ret = UnsignedNodeAnnouncement_read(ser_conv);
7247 DO_ASSERT(ret->is_owned);
7248 ret->is_owned = false;
7252 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1write(JNIEnv * _env, jclass _b, jlong obj) {
7253 LDKNodeAnnouncement* obj_conv = (LDKNodeAnnouncement*)obj;
7254 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7255 *ret = NodeAnnouncement_write(obj_conv);
7259 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1read(JNIEnv * _env, jclass _b, jlong ser) {
7260 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7261 LDKNodeAnnouncement* ret = MALLOC(sizeof(LDKNodeAnnouncement), "LDKNodeAnnouncement");
7262 *ret = NodeAnnouncement_read(ser_conv);
7263 DO_ASSERT(ret->is_owned);
7264 ret->is_owned = false;
7268 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1read(JNIEnv * _env, jclass _b, jlong ser) {
7269 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7270 LDKQueryShortChannelIds* ret = MALLOC(sizeof(LDKQueryShortChannelIds), "LDKQueryShortChannelIds");
7271 *ret = QueryShortChannelIds_read(ser_conv);
7272 DO_ASSERT(ret->is_owned);
7273 ret->is_owned = false;
7277 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1write(JNIEnv * _env, jclass _b, jlong obj) {
7278 LDKQueryShortChannelIds* obj_conv = (LDKQueryShortChannelIds*)obj;
7279 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7280 *ret = QueryShortChannelIds_write(obj_conv);
7284 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1read(JNIEnv * _env, jclass _b, jlong ser) {
7285 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7286 LDKReplyShortChannelIdsEnd* ret = MALLOC(sizeof(LDKReplyShortChannelIdsEnd), "LDKReplyShortChannelIdsEnd");
7287 *ret = ReplyShortChannelIdsEnd_read(ser_conv);
7288 DO_ASSERT(ret->is_owned);
7289 ret->is_owned = false;
7293 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1write(JNIEnv * _env, jclass _b, jlong obj) {
7294 LDKReplyShortChannelIdsEnd* obj_conv = (LDKReplyShortChannelIdsEnd*)obj;
7295 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7296 *ret = ReplyShortChannelIdsEnd_write(obj_conv);
7300 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1read(JNIEnv * _env, jclass _b, jlong ser) {
7301 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7302 LDKQueryChannelRange* ret = MALLOC(sizeof(LDKQueryChannelRange), "LDKQueryChannelRange");
7303 *ret = QueryChannelRange_read(ser_conv);
7304 DO_ASSERT(ret->is_owned);
7305 ret->is_owned = false;
7309 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1write(JNIEnv * _env, jclass _b, jlong obj) {
7310 LDKQueryChannelRange* obj_conv = (LDKQueryChannelRange*)obj;
7311 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7312 *ret = QueryChannelRange_write(obj_conv);
7316 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1read(JNIEnv * _env, jclass _b, jlong ser) {
7317 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7318 LDKReplyChannelRange* ret = MALLOC(sizeof(LDKReplyChannelRange), "LDKReplyChannelRange");
7319 *ret = ReplyChannelRange_read(ser_conv);
7320 DO_ASSERT(ret->is_owned);
7321 ret->is_owned = false;
7325 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1write(JNIEnv * _env, jclass _b, jlong obj) {
7326 LDKReplyChannelRange* obj_conv = (LDKReplyChannelRange*)obj;
7327 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7328 *ret = ReplyChannelRange_write(obj_conv);
7332 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1read(JNIEnv * _env, jclass _b, jlong ser) {
7333 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7334 LDKGossipTimestampFilter* ret = MALLOC(sizeof(LDKGossipTimestampFilter), "LDKGossipTimestampFilter");
7335 *ret = GossipTimestampFilter_read(ser_conv);
7336 DO_ASSERT(ret->is_owned);
7337 ret->is_owned = false;
7341 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1write(JNIEnv * _env, jclass _b, jlong obj) {
7342 LDKGossipTimestampFilter* obj_conv = (LDKGossipTimestampFilter*)obj;
7343 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7344 *ret = GossipTimestampFilter_write(obj_conv);
7348 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7349 LDKMessageHandler this_ptr_conv = *(LDKMessageHandler*)this_ptr;
7350 FREE((void*)this_ptr);
7351 this_ptr_conv.is_owned = true;
7352 return MessageHandler_free(this_ptr_conv);
7355 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageHandler_1get_1chan_1handler(JNIEnv * _env, jclass _b, jlong this_ptr) {
7356 LDKMessageHandler* this_ptr_conv = (LDKMessageHandler*)this_ptr;
7357 long ret = (long)MessageHandler_get_chan_handler(this_ptr_conv);
7361 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1set_1chan_1handler(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7362 LDKMessageHandler* this_ptr_conv = (LDKMessageHandler*)this_ptr;
7363 LDKChannelMessageHandler val_conv = *(LDKChannelMessageHandler*)val;
7364 if (val_conv.free == LDKChannelMessageHandler_JCalls_free) {
7365 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
7366 LDKChannelMessageHandler_JCalls_clone(val_conv.this_arg);
7368 return MessageHandler_set_chan_handler(this_ptr_conv, val_conv);
7371 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageHandler_1get_1route_1handler(JNIEnv * _env, jclass _b, jlong this_ptr) {
7372 LDKMessageHandler* this_ptr_conv = (LDKMessageHandler*)this_ptr;
7373 long ret = (long)MessageHandler_get_route_handler(this_ptr_conv);
7377 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1set_1route_1handler(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7378 LDKMessageHandler* this_ptr_conv = (LDKMessageHandler*)this_ptr;
7379 LDKRoutingMessageHandler val_conv = *(LDKRoutingMessageHandler*)val;
7380 if (val_conv.free == LDKRoutingMessageHandler_JCalls_free) {
7381 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
7382 LDKRoutingMessageHandler_JCalls_clone(val_conv.this_arg);
7384 return MessageHandler_set_route_handler(this_ptr_conv, val_conv);
7387 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageHandler_1new(JNIEnv * _env, jclass _b, jlong chan_handler_arg, jlong route_handler_arg) {
7388 LDKChannelMessageHandler chan_handler_arg_conv = *(LDKChannelMessageHandler*)chan_handler_arg;
7389 if (chan_handler_arg_conv.free == LDKChannelMessageHandler_JCalls_free) {
7390 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
7391 LDKChannelMessageHandler_JCalls_clone(chan_handler_arg_conv.this_arg);
7393 LDKRoutingMessageHandler route_handler_arg_conv = *(LDKRoutingMessageHandler*)route_handler_arg;
7394 if (route_handler_arg_conv.free == LDKRoutingMessageHandler_JCalls_free) {
7395 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
7396 LDKRoutingMessageHandler_JCalls_clone(route_handler_arg_conv.this_arg);
7398 LDKMessageHandler* ret = MALLOC(sizeof(LDKMessageHandler), "LDKMessageHandler");
7399 *ret = MessageHandler_new(chan_handler_arg_conv, route_handler_arg_conv);
7400 DO_ASSERT(ret->is_owned);
7401 ret->is_owned = false;
7405 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7406 LDKSocketDescriptor this_ptr_conv = *(LDKSocketDescriptor*)this_ptr;
7407 FREE((void*)this_ptr);
7408 return SocketDescriptor_free(this_ptr_conv);
7411 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7412 LDKPeerHandleError this_ptr_conv = *(LDKPeerHandleError*)this_ptr;
7413 FREE((void*)this_ptr);
7414 this_ptr_conv.is_owned = true;
7415 return PeerHandleError_free(this_ptr_conv);
7418 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1get_1no_1connection_1possible(JNIEnv * _env, jclass _b, jlong this_ptr) {
7419 LDKPeerHandleError* this_ptr_conv = (LDKPeerHandleError*)this_ptr;
7420 return PeerHandleError_get_no_connection_possible(this_ptr_conv);
7423 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1set_1no_1connection_1possible(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
7424 LDKPeerHandleError* this_ptr_conv = (LDKPeerHandleError*)this_ptr;
7425 return PeerHandleError_set_no_connection_possible(this_ptr_conv, val);
7428 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1new(JNIEnv * _env, jclass _b, jboolean no_connection_possible_arg) {
7429 LDKPeerHandleError* ret = MALLOC(sizeof(LDKPeerHandleError), "LDKPeerHandleError");
7430 *ret = PeerHandleError_new(no_connection_possible_arg);
7431 DO_ASSERT(ret->is_owned);
7432 ret->is_owned = false;
7436 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7437 LDKPeerManager this_ptr_conv = *(LDKPeerManager*)this_ptr;
7438 FREE((void*)this_ptr);
7439 this_ptr_conv.is_owned = true;
7440 return PeerManager_free(this_ptr_conv);
7443 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) {
7444 LDKMessageHandler message_handler_conv = *(LDKMessageHandler*)message_handler;
7445 FREE((void*)message_handler);
7446 message_handler_conv.is_owned = true;
7447 LDKSecretKey our_node_secret_conv = *(LDKSecretKey*)our_node_secret;
7448 FREE((void*)our_node_secret);
7449 unsigned char ephemeral_random_data_arr[32];
7450 (*_env)->GetByteArrayRegion (_env, ephemeral_random_data, 0, 32, ephemeral_random_data_arr);
7451 unsigned char (*ephemeral_random_data_ref)[32] = &ephemeral_random_data_arr;
7452 LDKLogger logger_conv = *(LDKLogger*)logger;
7453 if (logger_conv.free == LDKLogger_JCalls_free) {
7454 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
7455 LDKLogger_JCalls_clone(logger_conv.this_arg);
7457 LDKPeerManager* ret = MALLOC(sizeof(LDKPeerManager), "LDKPeerManager");
7458 *ret = PeerManager_new(message_handler_conv, our_node_secret_conv, ephemeral_random_data_ref, logger_conv);
7459 DO_ASSERT(ret->is_owned);
7460 ret->is_owned = false;
7464 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerManager_1get_1peer_1node_1ids(JNIEnv * _env, jclass _b, jlong this_arg) {
7465 LDKPeerManager* this_arg_conv = (LDKPeerManager*)this_arg;
7466 LDKCVec_PublicKeyZ* ret = MALLOC(sizeof(LDKCVec_PublicKeyZ), "LDKCVec_PublicKeyZ");
7467 *ret = PeerManager_get_peer_node_ids(this_arg_conv);
7471 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) {
7472 LDKPeerManager* this_arg_conv = (LDKPeerManager*)this_arg;
7473 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
7474 FREE((void*)their_node_id);
7475 LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)descriptor;
7476 if (descriptor_conv.free == LDKSocketDescriptor_JCalls_free) {
7477 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
7478 LDKSocketDescriptor_JCalls_clone(descriptor_conv.this_arg);
7480 LDKCResult_CVec_u8ZPeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
7481 *ret = PeerManager_new_outbound_connection(this_arg_conv, their_node_id_conv, descriptor_conv);
7485 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerManager_1new_1inbound_1connection(JNIEnv * _env, jclass _b, jlong this_arg, jlong descriptor) {
7486 LDKPeerManager* this_arg_conv = (LDKPeerManager*)this_arg;
7487 LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)descriptor;
7488 if (descriptor_conv.free == LDKSocketDescriptor_JCalls_free) {
7489 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
7490 LDKSocketDescriptor_JCalls_clone(descriptor_conv.this_arg);
7492 LDKCResult_NonePeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
7493 *ret = PeerManager_new_inbound_connection(this_arg_conv, descriptor_conv);
7497 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerManager_1write_1buffer_1space_1avail(JNIEnv * _env, jclass _b, jlong this_arg, jlong descriptor) {
7498 LDKPeerManager* this_arg_conv = (LDKPeerManager*)this_arg;
7499 LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor;
7500 LDKCResult_NonePeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
7501 *ret = PeerManager_write_buffer_space_avail(this_arg_conv, descriptor_conv);
7505 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerManager_1read_1event(JNIEnv * _env, jclass _b, jlong this_arg, jlong peer_descriptor, jlong data) {
7506 LDKPeerManager* this_arg_conv = (LDKPeerManager*)this_arg;
7507 LDKSocketDescriptor* peer_descriptor_conv = (LDKSocketDescriptor*)peer_descriptor;
7508 LDKu8slice data_conv = *(LDKu8slice*)data;
7509 LDKCResult_boolPeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
7510 *ret = PeerManager_read_event(this_arg_conv, peer_descriptor_conv, data_conv);
7514 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1process_1events(JNIEnv * _env, jclass _b, jlong this_arg) {
7515 LDKPeerManager* this_arg_conv = (LDKPeerManager*)this_arg;
7516 return PeerManager_process_events(this_arg_conv);
7519 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1socket_1disconnected(JNIEnv * _env, jclass _b, jlong this_arg, jlong descriptor) {
7520 LDKPeerManager* this_arg_conv = (LDKPeerManager*)this_arg;
7521 LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor;
7522 return PeerManager_socket_disconnected(this_arg_conv, descriptor_conv);
7525 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1timer_1tick_1occured(JNIEnv * _env, jclass _b, jlong this_arg) {
7526 LDKPeerManager* this_arg_conv = (LDKPeerManager*)this_arg;
7527 return PeerManager_timer_tick_occured(this_arg_conv);
7530 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_build_1commitment_1secret(JNIEnv * _env, jclass _b, jbyteArray commitment_seed, jlong idx) {
7531 unsigned char commitment_seed_arr[32];
7532 (*_env)->GetByteArrayRegion (_env, commitment_seed, 0, 32, commitment_seed_arr);
7533 unsigned char (*commitment_seed_ref)[32] = &commitment_seed_arr;
7534 LDKThirtyTwoBytes* ret = MALLOC(sizeof(LDKThirtyTwoBytes), "LDKThirtyTwoBytes");
7535 *ret = build_commitment_secret(commitment_seed_ref, idx);
7539 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_derive_1private_1key(JNIEnv * _env, jclass _b, jlong per_commitment_point, jbyteArray base_secret) {
7540 LDKPublicKey per_commitment_point_conv = *(LDKPublicKey*)per_commitment_point;
7541 FREE((void*)per_commitment_point);
7542 unsigned char base_secret_arr[32];
7543 (*_env)->GetByteArrayRegion (_env, base_secret, 0, 32, base_secret_arr);
7544 unsigned char (*base_secret_ref)[32] = &base_secret_arr;
7545 LDKCResult_SecretKeySecpErrorZ* ret = MALLOC(sizeof(LDKCResult_SecretKeySecpErrorZ), "LDKCResult_SecretKeySecpErrorZ");
7546 *ret = derive_private_key(per_commitment_point_conv, base_secret_ref);
7550 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_derive_1public_1key(JNIEnv * _env, jclass _b, jlong per_commitment_point, jlong base_point) {
7551 LDKPublicKey per_commitment_point_conv = *(LDKPublicKey*)per_commitment_point;
7552 FREE((void*)per_commitment_point);
7553 LDKPublicKey base_point_conv = *(LDKPublicKey*)base_point;
7554 FREE((void*)base_point);
7555 LDKCResult_PublicKeySecpErrorZ* ret = MALLOC(sizeof(LDKCResult_PublicKeySecpErrorZ), "LDKCResult_PublicKeySecpErrorZ");
7556 *ret = derive_public_key(per_commitment_point_conv, base_point_conv);
7560 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_derive_1private_1revocation_1key(JNIEnv * _env, jclass _b, jbyteArray per_commitment_secret, jbyteArray countersignatory_revocation_base_secret) {
7561 unsigned char per_commitment_secret_arr[32];
7562 (*_env)->GetByteArrayRegion (_env, per_commitment_secret, 0, 32, per_commitment_secret_arr);
7563 unsigned char (*per_commitment_secret_ref)[32] = &per_commitment_secret_arr;
7564 unsigned char countersignatory_revocation_base_secret_arr[32];
7565 (*_env)->GetByteArrayRegion (_env, countersignatory_revocation_base_secret, 0, 32, countersignatory_revocation_base_secret_arr);
7566 unsigned char (*countersignatory_revocation_base_secret_ref)[32] = &countersignatory_revocation_base_secret_arr;
7567 LDKCResult_SecretKeySecpErrorZ* ret = MALLOC(sizeof(LDKCResult_SecretKeySecpErrorZ), "LDKCResult_SecretKeySecpErrorZ");
7568 *ret = derive_private_revocation_key(per_commitment_secret_ref, countersignatory_revocation_base_secret_ref);
7572 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_derive_1public_1revocation_1key(JNIEnv * _env, jclass _b, jlong per_commitment_point, jlong countersignatory_revocation_base_point) {
7573 LDKPublicKey per_commitment_point_conv = *(LDKPublicKey*)per_commitment_point;
7574 FREE((void*)per_commitment_point);
7575 LDKPublicKey countersignatory_revocation_base_point_conv = *(LDKPublicKey*)countersignatory_revocation_base_point;
7576 FREE((void*)countersignatory_revocation_base_point);
7577 LDKCResult_PublicKeySecpErrorZ* ret = MALLOC(sizeof(LDKCResult_PublicKeySecpErrorZ), "LDKCResult_PublicKeySecpErrorZ");
7578 *ret = derive_public_revocation_key(per_commitment_point_conv, countersignatory_revocation_base_point_conv);
7582 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7583 LDKTxCreationKeys this_ptr_conv = *(LDKTxCreationKeys*)this_ptr;
7584 FREE((void*)this_ptr);
7585 this_ptr_conv.is_owned = true;
7586 return TxCreationKeys_free(this_ptr_conv);
7589 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
7590 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
7591 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
7592 *ret = TxCreationKeys_get_per_commitment_point(this_ptr_conv);
7596 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7597 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
7598 LDKPublicKey val_conv = *(LDKPublicKey*)val;
7600 return TxCreationKeys_set_per_commitment_point(this_ptr_conv, val_conv);
7603 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1revocation_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
7604 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
7605 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
7606 *ret = TxCreationKeys_get_revocation_key(this_ptr_conv);
7610 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1revocation_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7611 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
7612 LDKPublicKey val_conv = *(LDKPublicKey*)val;
7614 return TxCreationKeys_set_revocation_key(this_ptr_conv, val_conv);
7617 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1broadcaster_1htlc_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
7618 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
7619 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
7620 *ret = TxCreationKeys_get_broadcaster_htlc_key(this_ptr_conv);
7624 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1broadcaster_1htlc_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7625 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
7626 LDKPublicKey val_conv = *(LDKPublicKey*)val;
7628 return TxCreationKeys_set_broadcaster_htlc_key(this_ptr_conv, val_conv);
7631 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1countersignatory_1htlc_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
7632 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
7633 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
7634 *ret = TxCreationKeys_get_countersignatory_htlc_key(this_ptr_conv);
7638 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1countersignatory_1htlc_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7639 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
7640 LDKPublicKey val_conv = *(LDKPublicKey*)val;
7642 return TxCreationKeys_set_countersignatory_htlc_key(this_ptr_conv, val_conv);
7645 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1broadcaster_1delayed_1payment_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
7646 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
7647 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
7648 *ret = TxCreationKeys_get_broadcaster_delayed_payment_key(this_ptr_conv);
7652 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1broadcaster_1delayed_1payment_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7653 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
7654 LDKPublicKey val_conv = *(LDKPublicKey*)val;
7656 return TxCreationKeys_set_broadcaster_delayed_payment_key(this_ptr_conv, val_conv);
7659 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1new(JNIEnv * _env, jclass _b, jlong per_commitment_point_arg, jlong revocation_key_arg, jlong broadcaster_htlc_key_arg, jlong countersignatory_htlc_key_arg, jlong broadcaster_delayed_payment_key_arg) {
7660 LDKPublicKey per_commitment_point_arg_conv = *(LDKPublicKey*)per_commitment_point_arg;
7661 FREE((void*)per_commitment_point_arg);
7662 LDKPublicKey revocation_key_arg_conv = *(LDKPublicKey*)revocation_key_arg;
7663 FREE((void*)revocation_key_arg);
7664 LDKPublicKey broadcaster_htlc_key_arg_conv = *(LDKPublicKey*)broadcaster_htlc_key_arg;
7665 FREE((void*)broadcaster_htlc_key_arg);
7666 LDKPublicKey countersignatory_htlc_key_arg_conv = *(LDKPublicKey*)countersignatory_htlc_key_arg;
7667 FREE((void*)countersignatory_htlc_key_arg);
7668 LDKPublicKey broadcaster_delayed_payment_key_arg_conv = *(LDKPublicKey*)broadcaster_delayed_payment_key_arg;
7669 FREE((void*)broadcaster_delayed_payment_key_arg);
7670 LDKTxCreationKeys* ret = MALLOC(sizeof(LDKTxCreationKeys), "LDKTxCreationKeys");
7671 *ret = TxCreationKeys_new(per_commitment_point_arg_conv, revocation_key_arg_conv, broadcaster_htlc_key_arg_conv, countersignatory_htlc_key_arg_conv, broadcaster_delayed_payment_key_arg_conv);
7672 DO_ASSERT(ret->is_owned);
7673 ret->is_owned = false;
7677 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1write(JNIEnv * _env, jclass _b, jlong obj) {
7678 LDKTxCreationKeys* obj_conv = (LDKTxCreationKeys*)obj;
7679 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7680 *ret = TxCreationKeys_write(obj_conv);
7684 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1read(JNIEnv * _env, jclass _b, jlong ser) {
7685 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7686 LDKTxCreationKeys* ret = MALLOC(sizeof(LDKTxCreationKeys), "LDKTxCreationKeys");
7687 *ret = TxCreationKeys_read(ser_conv);
7688 DO_ASSERT(ret->is_owned);
7689 ret->is_owned = false;
7693 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PreCalculatedTxCreationKeys_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7694 LDKPreCalculatedTxCreationKeys this_ptr_conv = *(LDKPreCalculatedTxCreationKeys*)this_ptr;
7695 FREE((void*)this_ptr);
7696 this_ptr_conv.is_owned = true;
7697 return PreCalculatedTxCreationKeys_free(this_ptr_conv);
7700 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PreCalculatedTxCreationKeys_1new(JNIEnv * _env, jclass _b, jlong keys) {
7701 LDKTxCreationKeys keys_conv = *(LDKTxCreationKeys*)keys;
7703 keys_conv.is_owned = true;
7704 LDKPreCalculatedTxCreationKeys* ret = MALLOC(sizeof(LDKPreCalculatedTxCreationKeys), "LDKPreCalculatedTxCreationKeys");
7705 *ret = PreCalculatedTxCreationKeys_new(keys_conv);
7706 DO_ASSERT(ret->is_owned);
7707 ret->is_owned = false;
7711 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PreCalculatedTxCreationKeys_1trust_1key_1derivation(JNIEnv * _env, jclass _b, jlong this_arg) {
7712 LDKPreCalculatedTxCreationKeys* this_arg_conv = (LDKPreCalculatedTxCreationKeys*)this_arg;
7713 LDKTxCreationKeys* ret = MALLOC(sizeof(LDKTxCreationKeys), "LDKTxCreationKeys");
7714 *ret = PreCalculatedTxCreationKeys_trust_key_derivation(this_arg_conv);
7715 DO_ASSERT(ret->is_owned);
7716 ret->is_owned = false;
7720 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PreCalculatedTxCreationKeys_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_arg) {
7721 LDKPreCalculatedTxCreationKeys* this_arg_conv = (LDKPreCalculatedTxCreationKeys*)this_arg;
7722 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
7723 *ret = PreCalculatedTxCreationKeys_per_commitment_point(this_arg_conv);
7727 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7728 LDKChannelPublicKeys this_ptr_conv = *(LDKChannelPublicKeys*)this_ptr;
7729 FREE((void*)this_ptr);
7730 this_ptr_conv.is_owned = true;
7731 return ChannelPublicKeys_free(this_ptr_conv);
7734 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1funding_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr) {
7735 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
7736 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
7737 *ret = ChannelPublicKeys_get_funding_pubkey(this_ptr_conv);
7741 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1funding_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7742 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
7743 LDKPublicKey val_conv = *(LDKPublicKey*)val;
7745 return ChannelPublicKeys_set_funding_pubkey(this_ptr_conv, val_conv);
7748 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1revocation_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
7749 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
7750 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
7751 *ret = ChannelPublicKeys_get_revocation_basepoint(this_ptr_conv);
7755 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1revocation_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7756 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
7757 LDKPublicKey val_conv = *(LDKPublicKey*)val;
7759 return ChannelPublicKeys_set_revocation_basepoint(this_ptr_conv, val_conv);
7762 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1payment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
7763 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
7764 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
7765 *ret = ChannelPublicKeys_get_payment_point(this_ptr_conv);
7769 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1payment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7770 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
7771 LDKPublicKey val_conv = *(LDKPublicKey*)val;
7773 return ChannelPublicKeys_set_payment_point(this_ptr_conv, val_conv);
7776 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1delayed_1payment_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
7777 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
7778 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
7779 *ret = ChannelPublicKeys_get_delayed_payment_basepoint(this_ptr_conv);
7783 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1delayed_1payment_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7784 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
7785 LDKPublicKey val_conv = *(LDKPublicKey*)val;
7787 return ChannelPublicKeys_set_delayed_payment_basepoint(this_ptr_conv, val_conv);
7790 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1htlc_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
7791 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
7792 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
7793 *ret = ChannelPublicKeys_get_htlc_basepoint(this_ptr_conv);
7797 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1htlc_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7798 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
7799 LDKPublicKey val_conv = *(LDKPublicKey*)val;
7801 return ChannelPublicKeys_set_htlc_basepoint(this_ptr_conv, val_conv);
7804 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) {
7805 LDKPublicKey funding_pubkey_arg_conv = *(LDKPublicKey*)funding_pubkey_arg;
7806 FREE((void*)funding_pubkey_arg);
7807 LDKPublicKey revocation_basepoint_arg_conv = *(LDKPublicKey*)revocation_basepoint_arg;
7808 FREE((void*)revocation_basepoint_arg);
7809 LDKPublicKey payment_point_arg_conv = *(LDKPublicKey*)payment_point_arg;
7810 FREE((void*)payment_point_arg);
7811 LDKPublicKey delayed_payment_basepoint_arg_conv = *(LDKPublicKey*)delayed_payment_basepoint_arg;
7812 FREE((void*)delayed_payment_basepoint_arg);
7813 LDKPublicKey htlc_basepoint_arg_conv = *(LDKPublicKey*)htlc_basepoint_arg;
7814 FREE((void*)htlc_basepoint_arg);
7815 LDKChannelPublicKeys* ret = MALLOC(sizeof(LDKChannelPublicKeys), "LDKChannelPublicKeys");
7816 *ret = ChannelPublicKeys_new(funding_pubkey_arg_conv, revocation_basepoint_arg_conv, payment_point_arg_conv, delayed_payment_basepoint_arg_conv, htlc_basepoint_arg_conv);
7817 DO_ASSERT(ret->is_owned);
7818 ret->is_owned = false;
7822 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1write(JNIEnv * _env, jclass _b, jlong obj) {
7823 LDKChannelPublicKeys* obj_conv = (LDKChannelPublicKeys*)obj;
7824 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7825 *ret = ChannelPublicKeys_write(obj_conv);
7829 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1read(JNIEnv * _env, jclass _b, jlong ser) {
7830 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7831 LDKChannelPublicKeys* ret = MALLOC(sizeof(LDKChannelPublicKeys), "LDKChannelPublicKeys");
7832 *ret = ChannelPublicKeys_read(ser_conv);
7833 DO_ASSERT(ret->is_owned);
7834 ret->is_owned = false;
7838 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1derive_1new(JNIEnv * _env, jclass _b, jlong per_commitment_point, jlong broadcaster_delayed_payment_base, jlong broadcaster_htlc_base, jlong countersignatory_revocation_base, jlong countersignatory_htlc_base) {
7839 LDKPublicKey per_commitment_point_conv = *(LDKPublicKey*)per_commitment_point;
7840 FREE((void*)per_commitment_point);
7841 LDKPublicKey broadcaster_delayed_payment_base_conv = *(LDKPublicKey*)broadcaster_delayed_payment_base;
7842 FREE((void*)broadcaster_delayed_payment_base);
7843 LDKPublicKey broadcaster_htlc_base_conv = *(LDKPublicKey*)broadcaster_htlc_base;
7844 FREE((void*)broadcaster_htlc_base);
7845 LDKPublicKey countersignatory_revocation_base_conv = *(LDKPublicKey*)countersignatory_revocation_base;
7846 FREE((void*)countersignatory_revocation_base);
7847 LDKPublicKey countersignatory_htlc_base_conv = *(LDKPublicKey*)countersignatory_htlc_base;
7848 FREE((void*)countersignatory_htlc_base);
7849 LDKCResult_TxCreationKeysSecpErrorZ* ret = MALLOC(sizeof(LDKCResult_TxCreationKeysSecpErrorZ), "LDKCResult_TxCreationKeysSecpErrorZ");
7850 *ret = TxCreationKeys_derive_new(per_commitment_point_conv, broadcaster_delayed_payment_base_conv, broadcaster_htlc_base_conv, countersignatory_revocation_base_conv, countersignatory_htlc_base_conv);
7854 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_get_1revokeable_1redeemscript(JNIEnv * _env, jclass _b, jlong revocation_key, jshort contest_delay, jlong broadcaster_delayed_payment_key) {
7855 LDKPublicKey revocation_key_conv = *(LDKPublicKey*)revocation_key;
7856 FREE((void*)revocation_key);
7857 LDKPublicKey broadcaster_delayed_payment_key_conv = *(LDKPublicKey*)broadcaster_delayed_payment_key;
7858 FREE((void*)broadcaster_delayed_payment_key);
7859 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7860 *ret = get_revokeable_redeemscript(revocation_key_conv, contest_delay, broadcaster_delayed_payment_key_conv);
7864 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7865 LDKHTLCOutputInCommitment this_ptr_conv = *(LDKHTLCOutputInCommitment*)this_ptr;
7866 FREE((void*)this_ptr);
7867 this_ptr_conv.is_owned = true;
7868 return HTLCOutputInCommitment_free(this_ptr_conv);
7871 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1offered(JNIEnv * _env, jclass _b, jlong this_ptr) {
7872 LDKHTLCOutputInCommitment* this_ptr_conv = (LDKHTLCOutputInCommitment*)this_ptr;
7873 return HTLCOutputInCommitment_get_offered(this_ptr_conv);
7876 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1offered(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
7877 LDKHTLCOutputInCommitment* this_ptr_conv = (LDKHTLCOutputInCommitment*)this_ptr;
7878 return HTLCOutputInCommitment_set_offered(this_ptr_conv, val);
7881 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1amount_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
7882 LDKHTLCOutputInCommitment* this_ptr_conv = (LDKHTLCOutputInCommitment*)this_ptr;
7883 return HTLCOutputInCommitment_get_amount_msat(this_ptr_conv);
7886 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1amount_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7887 LDKHTLCOutputInCommitment* this_ptr_conv = (LDKHTLCOutputInCommitment*)this_ptr;
7888 return HTLCOutputInCommitment_set_amount_msat(this_ptr_conv, val);
7891 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1cltv_1expiry(JNIEnv * _env, jclass _b, jlong this_ptr) {
7892 LDKHTLCOutputInCommitment* this_ptr_conv = (LDKHTLCOutputInCommitment*)this_ptr;
7893 return HTLCOutputInCommitment_get_cltv_expiry(this_ptr_conv);
7896 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1cltv_1expiry(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
7897 LDKHTLCOutputInCommitment* this_ptr_conv = (LDKHTLCOutputInCommitment*)this_ptr;
7898 return HTLCOutputInCommitment_set_cltv_expiry(this_ptr_conv, val);
7901 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1payment_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
7902 LDKHTLCOutputInCommitment* this_ptr_conv = (LDKHTLCOutputInCommitment*)this_ptr;
7903 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
7904 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *HTLCOutputInCommitment_get_payment_hash(this_ptr_conv));
7908 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1payment_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7909 LDKHTLCOutputInCommitment* this_ptr_conv = (LDKHTLCOutputInCommitment*)this_ptr;
7910 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
7912 return HTLCOutputInCommitment_set_payment_hash(this_ptr_conv, val_conv);
7915 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1write(JNIEnv * _env, jclass _b, jlong obj) {
7916 LDKHTLCOutputInCommitment* obj_conv = (LDKHTLCOutputInCommitment*)obj;
7917 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7918 *ret = HTLCOutputInCommitment_write(obj_conv);
7922 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1read(JNIEnv * _env, jclass _b, jlong ser) {
7923 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7924 LDKHTLCOutputInCommitment* ret = MALLOC(sizeof(LDKHTLCOutputInCommitment), "LDKHTLCOutputInCommitment");
7925 *ret = HTLCOutputInCommitment_read(ser_conv);
7926 DO_ASSERT(ret->is_owned);
7927 ret->is_owned = false;
7931 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_get_1htlc_1redeemscript(JNIEnv * _env, jclass _b, jlong htlc, jlong keys) {
7932 LDKHTLCOutputInCommitment* htlc_conv = (LDKHTLCOutputInCommitment*)htlc;
7933 LDKTxCreationKeys* keys_conv = (LDKTxCreationKeys*)keys;
7934 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7935 *ret = get_htlc_redeemscript(htlc_conv, keys_conv);
7939 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_make_1funding_1redeemscript(JNIEnv * _env, jclass _b, jlong broadcaster, jlong countersignatory) {
7940 LDKPublicKey broadcaster_conv = *(LDKPublicKey*)broadcaster;
7941 FREE((void*)broadcaster);
7942 LDKPublicKey countersignatory_conv = *(LDKPublicKey*)countersignatory;
7943 FREE((void*)countersignatory);
7944 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7945 *ret = make_funding_redeemscript(broadcaster_conv, countersignatory_conv);
7949 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_build_1htlc_1transaction(JNIEnv * _env, jclass _b, jbyteArray prev_hash, jint feerate_per_kw, jshort contest_delay, jlong htlc, jlong broadcaster_delayed_payment_key, jlong revocation_key) {
7950 unsigned char prev_hash_arr[32];
7951 (*_env)->GetByteArrayRegion (_env, prev_hash, 0, 32, prev_hash_arr);
7952 unsigned char (*prev_hash_ref)[32] = &prev_hash_arr;
7953 LDKHTLCOutputInCommitment* htlc_conv = (LDKHTLCOutputInCommitment*)htlc;
7954 LDKPublicKey broadcaster_delayed_payment_key_conv = *(LDKPublicKey*)broadcaster_delayed_payment_key;
7955 FREE((void*)broadcaster_delayed_payment_key);
7956 LDKPublicKey revocation_key_conv = *(LDKPublicKey*)revocation_key;
7957 FREE((void*)revocation_key);
7958 LDKTransaction* ret = MALLOC(sizeof(LDKTransaction), "LDKTransaction");
7959 *ret = build_htlc_transaction(prev_hash_ref, feerate_per_kw, contest_delay, htlc_conv, broadcaster_delayed_payment_key_conv, revocation_key_conv);
7963 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7964 LDKHolderCommitmentTransaction this_ptr_conv = *(LDKHolderCommitmentTransaction*)this_ptr;
7965 FREE((void*)this_ptr);
7966 this_ptr_conv.is_owned = true;
7967 return HolderCommitmentTransaction_free(this_ptr_conv);
7970 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1get_1unsigned_1tx(JNIEnv * _env, jclass _b, jlong this_ptr) {
7971 LDKHolderCommitmentTransaction* this_ptr_conv = (LDKHolderCommitmentTransaction*)this_ptr;
7972 LDKTransaction* ret = MALLOC(sizeof(LDKTransaction), "LDKTransaction");
7973 *ret = HolderCommitmentTransaction_get_unsigned_tx(this_ptr_conv);
7977 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1set_1unsigned_1tx(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7978 LDKHolderCommitmentTransaction* this_ptr_conv = (LDKHolderCommitmentTransaction*)this_ptr;
7979 LDKTransaction val_conv = *(LDKTransaction*)val;
7981 return HolderCommitmentTransaction_set_unsigned_tx(this_ptr_conv, val_conv);
7984 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1get_1counterparty_1sig(JNIEnv * _env, jclass _b, jlong this_ptr) {
7985 LDKHolderCommitmentTransaction* this_ptr_conv = (LDKHolderCommitmentTransaction*)this_ptr;
7986 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
7987 *ret = HolderCommitmentTransaction_get_counterparty_sig(this_ptr_conv);
7991 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1set_1counterparty_1sig(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7992 LDKHolderCommitmentTransaction* this_ptr_conv = (LDKHolderCommitmentTransaction*)this_ptr;
7993 LDKSignature val_conv = *(LDKSignature*)val;
7995 return HolderCommitmentTransaction_set_counterparty_sig(this_ptr_conv, val_conv);
7998 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1get_1feerate_1per_1kw(JNIEnv * _env, jclass _b, jlong this_ptr) {
7999 LDKHolderCommitmentTransaction* this_ptr_conv = (LDKHolderCommitmentTransaction*)this_ptr;
8000 return HolderCommitmentTransaction_get_feerate_per_kw(this_ptr_conv);
8003 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1set_1feerate_1per_1kw(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
8004 LDKHolderCommitmentTransaction* this_ptr_conv = (LDKHolderCommitmentTransaction*)this_ptr;
8005 return HolderCommitmentTransaction_set_feerate_per_kw(this_ptr_conv, val);
8008 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1set_1per_1htlc(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
8009 LDKHolderCommitmentTransaction* this_ptr_conv = (LDKHolderCommitmentTransaction*)this_ptr;
8010 LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ val_conv = *(LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ*)val;
8012 return HolderCommitmentTransaction_set_per_htlc(this_ptr_conv, val_conv);
8015 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1new_1missing_1holder_1sig(JNIEnv * _env, jclass _b, jlong unsigned_tx, jlong counterparty_sig, jlong holder_funding_key, jlong counterparty_funding_key, jlong keys, jint feerate_per_kw, jlong htlc_data) {
8016 LDKTransaction unsigned_tx_conv = *(LDKTransaction*)unsigned_tx;
8017 FREE((void*)unsigned_tx);
8018 LDKSignature counterparty_sig_conv = *(LDKSignature*)counterparty_sig;
8019 FREE((void*)counterparty_sig);
8020 LDKPublicKey holder_funding_key_conv = *(LDKPublicKey*)holder_funding_key;
8021 FREE((void*)holder_funding_key);
8022 LDKPublicKey counterparty_funding_key_conv = *(LDKPublicKey*)counterparty_funding_key;
8023 FREE((void*)counterparty_funding_key);
8024 LDKTxCreationKeys keys_conv = *(LDKTxCreationKeys*)keys;
8026 keys_conv.is_owned = true;
8027 LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ htlc_data_conv = *(LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ*)htlc_data;
8028 FREE((void*)htlc_data);
8029 LDKHolderCommitmentTransaction* ret = MALLOC(sizeof(LDKHolderCommitmentTransaction), "LDKHolderCommitmentTransaction");
8030 *ret = HolderCommitmentTransaction_new_missing_holder_sig(unsigned_tx_conv, counterparty_sig_conv, holder_funding_key_conv, counterparty_funding_key_conv, keys_conv, feerate_per_kw, htlc_data_conv);
8031 DO_ASSERT(ret->is_owned);
8032 ret->is_owned = false;
8036 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1trust_1key_1derivation(JNIEnv * _env, jclass _b, jlong this_arg) {
8037 LDKHolderCommitmentTransaction* this_arg_conv = (LDKHolderCommitmentTransaction*)this_arg;
8038 LDKTxCreationKeys* ret = MALLOC(sizeof(LDKTxCreationKeys), "LDKTxCreationKeys");
8039 *ret = HolderCommitmentTransaction_trust_key_derivation(this_arg_conv);
8040 DO_ASSERT(ret->is_owned);
8041 ret->is_owned = false;
8045 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1txid(JNIEnv * _env, jclass _b, jlong this_arg) {
8046 LDKHolderCommitmentTransaction* this_arg_conv = (LDKHolderCommitmentTransaction*)this_arg;
8047 LDKThirtyTwoBytes* ret = MALLOC(sizeof(LDKThirtyTwoBytes), "LDKThirtyTwoBytes");
8048 *ret = HolderCommitmentTransaction_txid(this_arg_conv);
8052 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1get_1holder_1sig(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray funding_key, jlong funding_redeemscript, jlong channel_value_satoshis) {
8053 LDKHolderCommitmentTransaction* this_arg_conv = (LDKHolderCommitmentTransaction*)this_arg;
8054 unsigned char funding_key_arr[32];
8055 (*_env)->GetByteArrayRegion (_env, funding_key, 0, 32, funding_key_arr);
8056 unsigned char (*funding_key_ref)[32] = &funding_key_arr;
8057 LDKu8slice funding_redeemscript_conv = *(LDKu8slice*)funding_redeemscript;
8058 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
8059 *ret = HolderCommitmentTransaction_get_holder_sig(this_arg_conv, funding_key_ref, funding_redeemscript_conv, channel_value_satoshis);
8063 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1get_1htlc_1sigs(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray htlc_base_key, jshort counterparty_selected_contest_delay) {
8064 LDKHolderCommitmentTransaction* this_arg_conv = (LDKHolderCommitmentTransaction*)this_arg;
8065 unsigned char htlc_base_key_arr[32];
8066 (*_env)->GetByteArrayRegion (_env, htlc_base_key, 0, 32, htlc_base_key_arr);
8067 unsigned char (*htlc_base_key_ref)[32] = &htlc_base_key_arr;
8068 LDKCResult_CVec_SignatureZNoneZ* ret = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
8069 *ret = HolderCommitmentTransaction_get_htlc_sigs(this_arg_conv, htlc_base_key_ref, counterparty_selected_contest_delay);
8073 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1write(JNIEnv * _env, jclass _b, jlong obj) {
8074 LDKHolderCommitmentTransaction* obj_conv = (LDKHolderCommitmentTransaction*)obj;
8075 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
8076 *ret = HolderCommitmentTransaction_write(obj_conv);
8080 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1read(JNIEnv * _env, jclass _b, jlong ser) {
8081 LDKu8slice ser_conv = *(LDKu8slice*)ser;
8082 LDKHolderCommitmentTransaction* ret = MALLOC(sizeof(LDKHolderCommitmentTransaction), "LDKHolderCommitmentTransaction");
8083 *ret = HolderCommitmentTransaction_read(ser_conv);
8084 DO_ASSERT(ret->is_owned);
8085 ret->is_owned = false;
8089 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
8090 LDKInitFeatures this_ptr_conv = *(LDKInitFeatures*)this_ptr;
8091 FREE((void*)this_ptr);
8092 this_ptr_conv.is_owned = true;
8093 return InitFeatures_free(this_ptr_conv);
8096 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
8097 LDKNodeFeatures this_ptr_conv = *(LDKNodeFeatures*)this_ptr;
8098 FREE((void*)this_ptr);
8099 this_ptr_conv.is_owned = true;
8100 return NodeFeatures_free(this_ptr_conv);
8103 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
8104 LDKChannelFeatures this_ptr_conv = *(LDKChannelFeatures*)this_ptr;
8105 FREE((void*)this_ptr);
8106 this_ptr_conv.is_owned = true;
8107 return ChannelFeatures_free(this_ptr_conv);
8110 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
8111 LDKRouteHop this_ptr_conv = *(LDKRouteHop*)this_ptr;
8112 FREE((void*)this_ptr);
8113 this_ptr_conv.is_owned = true;
8114 return RouteHop_free(this_ptr_conv);
8117 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr) {
8118 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
8119 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
8120 *ret = RouteHop_get_pubkey(this_ptr_conv);
8124 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
8125 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
8126 LDKPublicKey val_conv = *(LDKPublicKey*)val;
8128 return RouteHop_set_pubkey(this_ptr_conv, val_conv);
8131 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1node_1features(JNIEnv * _env, jclass _b, jlong this_ptr) {
8132 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
8133 LDKNodeFeatures* ret = MALLOC(sizeof(LDKNodeFeatures), "LDKNodeFeatures");
8134 *ret = RouteHop_get_node_features(this_ptr_conv);
8135 DO_ASSERT(ret->is_owned);
8136 ret->is_owned = false;
8140 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1node_1features(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
8141 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
8142 LDKNodeFeatures val_conv = *(LDKNodeFeatures*)val;
8144 val_conv.is_owned = true;
8145 return RouteHop_set_node_features(this_ptr_conv, val_conv);
8148 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
8149 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
8150 return RouteHop_get_short_channel_id(this_ptr_conv);
8153 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
8154 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
8155 return RouteHop_set_short_channel_id(this_ptr_conv, val);
8158 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1channel_1features(JNIEnv * _env, jclass _b, jlong this_ptr) {
8159 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
8160 LDKChannelFeatures* ret = MALLOC(sizeof(LDKChannelFeatures), "LDKChannelFeatures");
8161 *ret = RouteHop_get_channel_features(this_ptr_conv);
8162 DO_ASSERT(ret->is_owned);
8163 ret->is_owned = false;
8167 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1channel_1features(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
8168 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
8169 LDKChannelFeatures val_conv = *(LDKChannelFeatures*)val;
8171 val_conv.is_owned = true;
8172 return RouteHop_set_channel_features(this_ptr_conv, val_conv);
8175 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1fee_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
8176 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
8177 return RouteHop_get_fee_msat(this_ptr_conv);
8180 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1fee_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
8181 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
8182 return RouteHop_set_fee_msat(this_ptr_conv, val);
8185 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr) {
8186 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
8187 return RouteHop_get_cltv_expiry_delta(this_ptr_conv);
8190 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
8191 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
8192 return RouteHop_set_cltv_expiry_delta(this_ptr_conv, val);
8195 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHop_1new(JNIEnv * _env, jclass _b, jlong pubkey_arg, jlong node_features_arg, jlong short_channel_id_arg, jlong channel_features_arg, jlong fee_msat_arg, jint cltv_expiry_delta_arg) {
8196 LDKPublicKey pubkey_arg_conv = *(LDKPublicKey*)pubkey_arg;
8197 FREE((void*)pubkey_arg);
8198 LDKNodeFeatures node_features_arg_conv = *(LDKNodeFeatures*)node_features_arg;
8199 FREE((void*)node_features_arg);
8200 node_features_arg_conv.is_owned = true;
8201 LDKChannelFeatures channel_features_arg_conv = *(LDKChannelFeatures*)channel_features_arg;
8202 FREE((void*)channel_features_arg);
8203 channel_features_arg_conv.is_owned = true;
8204 LDKRouteHop* ret = MALLOC(sizeof(LDKRouteHop), "LDKRouteHop");
8205 *ret = RouteHop_new(pubkey_arg_conv, node_features_arg_conv, short_channel_id_arg, channel_features_arg_conv, fee_msat_arg, cltv_expiry_delta_arg);
8206 DO_ASSERT(ret->is_owned);
8207 ret->is_owned = false;
8211 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Route_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
8212 LDKRoute this_ptr_conv = *(LDKRoute*)this_ptr;
8213 FREE((void*)this_ptr);
8214 this_ptr_conv.is_owned = true;
8215 return Route_free(this_ptr_conv);
8218 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Route_1set_1paths(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
8219 LDKRoute* this_ptr_conv = (LDKRoute*)this_ptr;
8220 LDKCVec_CVec_RouteHopZZ val_conv = *(LDKCVec_CVec_RouteHopZZ*)val;
8222 return Route_set_paths(this_ptr_conv, val_conv);
8225 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Route_1new(JNIEnv * _env, jclass _b, jlong paths_arg) {
8226 LDKCVec_CVec_RouteHopZZ paths_arg_conv = *(LDKCVec_CVec_RouteHopZZ*)paths_arg;
8227 FREE((void*)paths_arg);
8228 LDKRoute* ret = MALLOC(sizeof(LDKRoute), "LDKRoute");
8229 *ret = Route_new(paths_arg_conv);
8230 DO_ASSERT(ret->is_owned);
8231 ret->is_owned = false;
8235 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Route_1write(JNIEnv * _env, jclass _b, jlong obj) {
8236 LDKRoute* obj_conv = (LDKRoute*)obj;
8237 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
8238 *ret = Route_write(obj_conv);
8242 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Route_1read(JNIEnv * _env, jclass _b, jlong ser) {
8243 LDKu8slice ser_conv = *(LDKu8slice*)ser;
8244 LDKRoute* ret = MALLOC(sizeof(LDKRoute), "LDKRoute");
8245 *ret = Route_read(ser_conv);
8246 DO_ASSERT(ret->is_owned);
8247 ret->is_owned = false;
8251 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
8252 LDKRouteHint this_ptr_conv = *(LDKRouteHint*)this_ptr;
8253 FREE((void*)this_ptr);
8254 this_ptr_conv.is_owned = true;
8255 return RouteHint_free(this_ptr_conv);
8258 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1src_1node_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
8259 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
8260 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
8261 *ret = RouteHint_get_src_node_id(this_ptr_conv);
8265 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1src_1node_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
8266 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
8267 LDKPublicKey val_conv = *(LDKPublicKey*)val;
8269 return RouteHint_set_src_node_id(this_ptr_conv, val_conv);
8272 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
8273 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
8274 return RouteHint_get_short_channel_id(this_ptr_conv);
8277 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
8278 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
8279 return RouteHint_set_short_channel_id(this_ptr_conv, val);
8282 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1fees(JNIEnv * _env, jclass _b, jlong this_ptr) {
8283 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
8284 LDKRoutingFees* ret = MALLOC(sizeof(LDKRoutingFees), "LDKRoutingFees");
8285 *ret = RouteHint_get_fees(this_ptr_conv);
8286 DO_ASSERT(ret->is_owned);
8287 ret->is_owned = false;
8291 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1fees(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
8292 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
8293 LDKRoutingFees val_conv = *(LDKRoutingFees*)val;
8295 val_conv.is_owned = true;
8296 return RouteHint_set_fees(this_ptr_conv, val_conv);
8299 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr) {
8300 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
8301 return RouteHint_get_cltv_expiry_delta(this_ptr_conv);
8304 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
8305 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
8306 return RouteHint_set_cltv_expiry_delta(this_ptr_conv, val);
8309 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
8310 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
8311 return RouteHint_get_htlc_minimum_msat(this_ptr_conv);
8314 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
8315 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
8316 return RouteHint_set_htlc_minimum_msat(this_ptr_conv, val);
8319 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) {
8320 LDKPublicKey src_node_id_arg_conv = *(LDKPublicKey*)src_node_id_arg;
8321 FREE((void*)src_node_id_arg);
8322 LDKRoutingFees fees_arg_conv = *(LDKRoutingFees*)fees_arg;
8323 FREE((void*)fees_arg);
8324 fees_arg_conv.is_owned = true;
8325 LDKRouteHint* ret = MALLOC(sizeof(LDKRouteHint), "LDKRouteHint");
8326 *ret = RouteHint_new(src_node_id_arg_conv, short_channel_id_arg, fees_arg_conv, cltv_expiry_delta_arg, htlc_minimum_msat_arg);
8327 DO_ASSERT(ret->is_owned);
8328 ret->is_owned = false;
8332 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) {
8333 LDKPublicKey our_node_id_conv = *(LDKPublicKey*)our_node_id;
8334 FREE((void*)our_node_id);
8335 LDKNetworkGraph* network_conv = (LDKNetworkGraph*)network;
8336 LDKPublicKey target_conv = *(LDKPublicKey*)target;
8337 FREE((void*)target);
8338 LDKCVec_ChannelDetailsZ* first_hops_conv = (LDKCVec_ChannelDetailsZ*)first_hops;
8339 LDKCVec_RouteHintZ last_hops_conv = *(LDKCVec_RouteHintZ*)last_hops;
8340 FREE((void*)last_hops);
8341 LDKLogger logger_conv = *(LDKLogger*)logger;
8342 if (logger_conv.free == LDKLogger_JCalls_free) {
8343 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
8344 LDKLogger_JCalls_clone(logger_conv.this_arg);
8346 LDKCResult_RouteLightningErrorZ* ret = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
8347 *ret = get_route(our_node_id_conv, network_conv, target_conv, first_hops_conv, last_hops_conv, final_value_msat, final_cltv, logger_conv);
8351 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
8352 LDKNetworkGraph this_ptr_conv = *(LDKNetworkGraph*)this_ptr;
8353 FREE((void*)this_ptr);
8354 this_ptr_conv.is_owned = true;
8355 return NetworkGraph_free(this_ptr_conv);
8358 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LockedNetworkGraph_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
8359 LDKLockedNetworkGraph this_ptr_conv = *(LDKLockedNetworkGraph*)this_ptr;
8360 FREE((void*)this_ptr);
8361 this_ptr_conv.is_owned = true;
8362 return LockedNetworkGraph_free(this_ptr_conv);
8365 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
8366 LDKNetGraphMsgHandler this_ptr_conv = *(LDKNetGraphMsgHandler*)this_ptr;
8367 FREE((void*)this_ptr);
8368 this_ptr_conv.is_owned = true;
8369 return NetGraphMsgHandler_free(this_ptr_conv);
8372 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1new(JNIEnv * _env, jclass _b, jlong chain_access, jlong logger) {
8373 LDKAccess* chain_access_conv = (LDKAccess*)chain_access;
8374 LDKLogger logger_conv = *(LDKLogger*)logger;
8375 if (logger_conv.free == LDKLogger_JCalls_free) {
8376 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
8377 LDKLogger_JCalls_clone(logger_conv.this_arg);
8379 LDKNetGraphMsgHandler* ret = MALLOC(sizeof(LDKNetGraphMsgHandler), "LDKNetGraphMsgHandler");
8380 *ret = NetGraphMsgHandler_new(chain_access_conv, logger_conv);
8381 DO_ASSERT(ret->is_owned);
8382 ret->is_owned = false;
8386 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1from_1net_1graph(JNIEnv * _env, jclass _b, jlong chain_access, jlong logger, jlong network_graph) {
8387 LDKAccess* chain_access_conv = (LDKAccess*)chain_access;
8388 LDKLogger logger_conv = *(LDKLogger*)logger;
8389 if (logger_conv.free == LDKLogger_JCalls_free) {
8390 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
8391 LDKLogger_JCalls_clone(logger_conv.this_arg);
8393 LDKNetworkGraph network_graph_conv = *(LDKNetworkGraph*)network_graph;
8394 FREE((void*)network_graph);
8395 network_graph_conv.is_owned = true;
8396 LDKNetGraphMsgHandler* ret = MALLOC(sizeof(LDKNetGraphMsgHandler), "LDKNetGraphMsgHandler");
8397 *ret = NetGraphMsgHandler_from_net_graph(chain_access_conv, logger_conv, network_graph_conv);
8398 DO_ASSERT(ret->is_owned);
8399 ret->is_owned = false;
8403 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1read_1locked_1graph(JNIEnv * _env, jclass _b, jlong this_arg) {
8404 LDKNetGraphMsgHandler* this_arg_conv = (LDKNetGraphMsgHandler*)this_arg;
8405 LDKLockedNetworkGraph* ret = MALLOC(sizeof(LDKLockedNetworkGraph), "LDKLockedNetworkGraph");
8406 *ret = NetGraphMsgHandler_read_locked_graph(this_arg_conv);
8407 DO_ASSERT(ret->is_owned);
8408 ret->is_owned = false;
8412 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LockedNetworkGraph_1graph(JNIEnv * _env, jclass _b, jlong this_arg) {
8413 LDKLockedNetworkGraph* this_arg_conv = (LDKLockedNetworkGraph*)this_arg;
8414 LDKNetworkGraph* ret = MALLOC(sizeof(LDKNetworkGraph), "LDKNetworkGraph");
8415 *ret = LockedNetworkGraph_graph(this_arg_conv);
8416 DO_ASSERT(ret->is_owned);
8417 ret->is_owned = false;
8421 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1as_1RoutingMessageHandler(JNIEnv * _env, jclass _b, jlong this_arg) {
8422 LDKNetGraphMsgHandler* this_arg_conv = (LDKNetGraphMsgHandler*)this_arg;
8423 LDKRoutingMessageHandler* ret = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler");
8424 *ret = NetGraphMsgHandler_as_RoutingMessageHandler(this_arg_conv);
8428 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
8429 LDKDirectionalChannelInfo this_ptr_conv = *(LDKDirectionalChannelInfo*)this_ptr;
8430 FREE((void*)this_ptr);
8431 this_ptr_conv.is_owned = true;
8432 return DirectionalChannelInfo_free(this_ptr_conv);
8435 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get_1last_1update(JNIEnv * _env, jclass _b, jlong this_ptr) {
8436 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
8437 return DirectionalChannelInfo_get_last_update(this_ptr_conv);
8440 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1last_1update(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
8441 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
8442 return DirectionalChannelInfo_set_last_update(this_ptr_conv, val);
8445 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get_1enabled(JNIEnv * _env, jclass _b, jlong this_ptr) {
8446 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
8447 return DirectionalChannelInfo_get_enabled(this_ptr_conv);
8450 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1enabled(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
8451 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
8452 return DirectionalChannelInfo_set_enabled(this_ptr_conv, val);
8455 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr) {
8456 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
8457 return DirectionalChannelInfo_get_cltv_expiry_delta(this_ptr_conv);
8460 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
8461 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
8462 return DirectionalChannelInfo_set_cltv_expiry_delta(this_ptr_conv, val);
8465 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
8466 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
8467 return DirectionalChannelInfo_get_htlc_minimum_msat(this_ptr_conv);
8470 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
8471 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
8472 return DirectionalChannelInfo_set_htlc_minimum_msat(this_ptr_conv, val);
8475 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get_1last_1update_1message(JNIEnv * _env, jclass _b, jlong this_ptr) {
8476 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
8477 LDKChannelUpdate* ret = MALLOC(sizeof(LDKChannelUpdate), "LDKChannelUpdate");
8478 *ret = DirectionalChannelInfo_get_last_update_message(this_ptr_conv);
8479 DO_ASSERT(ret->is_owned);
8480 ret->is_owned = false;
8484 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1last_1update_1message(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
8485 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
8486 LDKChannelUpdate val_conv = *(LDKChannelUpdate*)val;
8488 val_conv.is_owned = true;
8489 return DirectionalChannelInfo_set_last_update_message(this_ptr_conv, val_conv);
8492 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1write(JNIEnv * _env, jclass _b, jlong obj) {
8493 LDKDirectionalChannelInfo* obj_conv = (LDKDirectionalChannelInfo*)obj;
8494 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
8495 *ret = DirectionalChannelInfo_write(obj_conv);
8499 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1read(JNIEnv * _env, jclass _b, jlong ser) {
8500 LDKu8slice ser_conv = *(LDKu8slice*)ser;
8501 LDKDirectionalChannelInfo* ret = MALLOC(sizeof(LDKDirectionalChannelInfo), "LDKDirectionalChannelInfo");
8502 *ret = DirectionalChannelInfo_read(ser_conv);
8503 DO_ASSERT(ret->is_owned);
8504 ret->is_owned = false;
8508 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
8509 LDKChannelInfo this_ptr_conv = *(LDKChannelInfo*)this_ptr;
8510 FREE((void*)this_ptr);
8511 this_ptr_conv.is_owned = true;
8512 return ChannelInfo_free(this_ptr_conv);
8515 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1features(JNIEnv * _env, jclass _b, jlong this_ptr) {
8516 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
8517 LDKChannelFeatures* ret = MALLOC(sizeof(LDKChannelFeatures), "LDKChannelFeatures");
8518 *ret = ChannelInfo_get_features(this_ptr_conv);
8519 DO_ASSERT(ret->is_owned);
8520 ret->is_owned = false;
8524 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1features(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
8525 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
8526 LDKChannelFeatures val_conv = *(LDKChannelFeatures*)val;
8528 val_conv.is_owned = true;
8529 return ChannelInfo_set_features(this_ptr_conv, val_conv);
8532 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1node_1one(JNIEnv * _env, jclass _b, jlong this_ptr) {
8533 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
8534 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
8535 *ret = ChannelInfo_get_node_one(this_ptr_conv);
8539 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1node_1one(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
8540 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
8541 LDKPublicKey val_conv = *(LDKPublicKey*)val;
8543 return ChannelInfo_set_node_one(this_ptr_conv, val_conv);
8546 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1one_1to_1two(JNIEnv * _env, jclass _b, jlong this_ptr) {
8547 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
8548 LDKDirectionalChannelInfo* ret = MALLOC(sizeof(LDKDirectionalChannelInfo), "LDKDirectionalChannelInfo");
8549 *ret = ChannelInfo_get_one_to_two(this_ptr_conv);
8550 DO_ASSERT(ret->is_owned);
8551 ret->is_owned = false;
8555 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1one_1to_1two(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
8556 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
8557 LDKDirectionalChannelInfo val_conv = *(LDKDirectionalChannelInfo*)val;
8559 val_conv.is_owned = true;
8560 return ChannelInfo_set_one_to_two(this_ptr_conv, val_conv);
8563 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1node_1two(JNIEnv * _env, jclass _b, jlong this_ptr) {
8564 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
8565 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
8566 *ret = ChannelInfo_get_node_two(this_ptr_conv);
8570 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1node_1two(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
8571 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
8572 LDKPublicKey val_conv = *(LDKPublicKey*)val;
8574 return ChannelInfo_set_node_two(this_ptr_conv, val_conv);
8577 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1two_1to_1one(JNIEnv * _env, jclass _b, jlong this_ptr) {
8578 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
8579 LDKDirectionalChannelInfo* ret = MALLOC(sizeof(LDKDirectionalChannelInfo), "LDKDirectionalChannelInfo");
8580 *ret = ChannelInfo_get_two_to_one(this_ptr_conv);
8581 DO_ASSERT(ret->is_owned);
8582 ret->is_owned = false;
8586 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1two_1to_1one(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
8587 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
8588 LDKDirectionalChannelInfo val_conv = *(LDKDirectionalChannelInfo*)val;
8590 val_conv.is_owned = true;
8591 return ChannelInfo_set_two_to_one(this_ptr_conv, val_conv);
8594 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1announcement_1message(JNIEnv * _env, jclass _b, jlong this_ptr) {
8595 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
8596 LDKChannelAnnouncement* ret = MALLOC(sizeof(LDKChannelAnnouncement), "LDKChannelAnnouncement");
8597 *ret = ChannelInfo_get_announcement_message(this_ptr_conv);
8598 DO_ASSERT(ret->is_owned);
8599 ret->is_owned = false;
8603 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1announcement_1message(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
8604 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
8605 LDKChannelAnnouncement val_conv = *(LDKChannelAnnouncement*)val;
8607 val_conv.is_owned = true;
8608 return ChannelInfo_set_announcement_message(this_ptr_conv, val_conv);
8611 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1write(JNIEnv * _env, jclass _b, jlong obj) {
8612 LDKChannelInfo* obj_conv = (LDKChannelInfo*)obj;
8613 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
8614 *ret = ChannelInfo_write(obj_conv);
8618 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1read(JNIEnv * _env, jclass _b, jlong ser) {
8619 LDKu8slice ser_conv = *(LDKu8slice*)ser;
8620 LDKChannelInfo* ret = MALLOC(sizeof(LDKChannelInfo), "LDKChannelInfo");
8621 *ret = ChannelInfo_read(ser_conv);
8622 DO_ASSERT(ret->is_owned);
8623 ret->is_owned = false;
8627 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingFees_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
8628 LDKRoutingFees this_ptr_conv = *(LDKRoutingFees*)this_ptr;
8629 FREE((void*)this_ptr);
8630 this_ptr_conv.is_owned = true;
8631 return RoutingFees_free(this_ptr_conv);
8634 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_RoutingFees_1get_1base_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
8635 LDKRoutingFees* this_ptr_conv = (LDKRoutingFees*)this_ptr;
8636 return RoutingFees_get_base_msat(this_ptr_conv);
8639 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingFees_1set_1base_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
8640 LDKRoutingFees* this_ptr_conv = (LDKRoutingFees*)this_ptr;
8641 return RoutingFees_set_base_msat(this_ptr_conv, val);
8644 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_RoutingFees_1get_1proportional_1millionths(JNIEnv * _env, jclass _b, jlong this_ptr) {
8645 LDKRoutingFees* this_ptr_conv = (LDKRoutingFees*)this_ptr;
8646 return RoutingFees_get_proportional_millionths(this_ptr_conv);
8649 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingFees_1set_1proportional_1millionths(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
8650 LDKRoutingFees* this_ptr_conv = (LDKRoutingFees*)this_ptr;
8651 return RoutingFees_set_proportional_millionths(this_ptr_conv, val);
8654 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RoutingFees_1new(JNIEnv * _env, jclass _b, jint base_msat_arg, jint proportional_millionths_arg) {
8655 LDKRoutingFees* ret = MALLOC(sizeof(LDKRoutingFees), "LDKRoutingFees");
8656 *ret = RoutingFees_new(base_msat_arg, proportional_millionths_arg);
8657 DO_ASSERT(ret->is_owned);
8658 ret->is_owned = false;
8662 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RoutingFees_1read(JNIEnv * _env, jclass _b, jlong ser) {
8663 LDKu8slice ser_conv = *(LDKu8slice*)ser;
8664 LDKRoutingFees* ret = MALLOC(sizeof(LDKRoutingFees), "LDKRoutingFees");
8665 *ret = RoutingFees_read(ser_conv);
8666 DO_ASSERT(ret->is_owned);
8667 ret->is_owned = false;
8671 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RoutingFees_1write(JNIEnv * _env, jclass _b, jlong obj) {
8672 LDKRoutingFees* obj_conv = (LDKRoutingFees*)obj;
8673 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
8674 *ret = RoutingFees_write(obj_conv);
8678 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
8679 LDKNodeAnnouncementInfo this_ptr_conv = *(LDKNodeAnnouncementInfo*)this_ptr;
8680 FREE((void*)this_ptr);
8681 this_ptr_conv.is_owned = true;
8682 return NodeAnnouncementInfo_free(this_ptr_conv);
8685 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1features(JNIEnv * _env, jclass _b, jlong this_ptr) {
8686 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
8687 LDKNodeFeatures* ret = MALLOC(sizeof(LDKNodeFeatures), "LDKNodeFeatures");
8688 *ret = NodeAnnouncementInfo_get_features(this_ptr_conv);
8689 DO_ASSERT(ret->is_owned);
8690 ret->is_owned = false;
8694 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1features(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
8695 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
8696 LDKNodeFeatures val_conv = *(LDKNodeFeatures*)val;
8698 val_conv.is_owned = true;
8699 return NodeAnnouncementInfo_set_features(this_ptr_conv, val_conv);
8702 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1last_1update(JNIEnv * _env, jclass _b, jlong this_ptr) {
8703 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
8704 return NodeAnnouncementInfo_get_last_update(this_ptr_conv);
8707 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1last_1update(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
8708 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
8709 return NodeAnnouncementInfo_set_last_update(this_ptr_conv, val);
8712 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1rgb(JNIEnv * _env, jclass _b, jlong this_ptr) {
8713 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
8714 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 3);
8715 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 3, *NodeAnnouncementInfo_get_rgb(this_ptr_conv));
8719 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1rgb(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
8720 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
8721 LDKThreeBytes val_conv = *(LDKThreeBytes*)val;
8723 return NodeAnnouncementInfo_set_rgb(this_ptr_conv, val_conv);
8726 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1alias(JNIEnv * _env, jclass _b, jlong this_ptr) {
8727 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
8728 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
8729 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *NodeAnnouncementInfo_get_alias(this_ptr_conv));
8733 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1alias(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
8734 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
8735 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
8737 return NodeAnnouncementInfo_set_alias(this_ptr_conv, val_conv);
8740 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1addresses(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
8741 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
8742 LDKCVec_NetAddressZ val_conv = *(LDKCVec_NetAddressZ*)val;
8744 return NodeAnnouncementInfo_set_addresses(this_ptr_conv, val_conv);
8747 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1announcement_1message(JNIEnv * _env, jclass _b, jlong this_ptr) {
8748 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
8749 LDKNodeAnnouncement* ret = MALLOC(sizeof(LDKNodeAnnouncement), "LDKNodeAnnouncement");
8750 *ret = NodeAnnouncementInfo_get_announcement_message(this_ptr_conv);
8751 DO_ASSERT(ret->is_owned);
8752 ret->is_owned = false;
8756 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1announcement_1message(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
8757 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
8758 LDKNodeAnnouncement val_conv = *(LDKNodeAnnouncement*)val;
8760 val_conv.is_owned = true;
8761 return NodeAnnouncementInfo_set_announcement_message(this_ptr_conv, val_conv);
8764 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1new(JNIEnv * _env, jclass _b, jlong features_arg, jint last_update_arg, jlong rgb_arg, jlong alias_arg, jlong addresses_arg, jlong announcement_message_arg) {
8765 LDKNodeFeatures features_arg_conv = *(LDKNodeFeatures*)features_arg;
8766 FREE((void*)features_arg);
8767 features_arg_conv.is_owned = true;
8768 LDKThreeBytes rgb_arg_conv = *(LDKThreeBytes*)rgb_arg;
8769 FREE((void*)rgb_arg);
8770 LDKThirtyTwoBytes alias_arg_conv = *(LDKThirtyTwoBytes*)alias_arg;
8771 FREE((void*)alias_arg);
8772 LDKCVec_NetAddressZ addresses_arg_conv = *(LDKCVec_NetAddressZ*)addresses_arg;
8773 FREE((void*)addresses_arg);
8774 LDKNodeAnnouncement announcement_message_arg_conv = *(LDKNodeAnnouncement*)announcement_message_arg;
8775 FREE((void*)announcement_message_arg);
8776 announcement_message_arg_conv.is_owned = true;
8777 LDKNodeAnnouncementInfo* ret = MALLOC(sizeof(LDKNodeAnnouncementInfo), "LDKNodeAnnouncementInfo");
8778 *ret = NodeAnnouncementInfo_new(features_arg_conv, last_update_arg, rgb_arg_conv, alias_arg_conv, addresses_arg_conv, announcement_message_arg_conv);
8779 DO_ASSERT(ret->is_owned);
8780 ret->is_owned = false;
8784 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1write(JNIEnv * _env, jclass _b, jlong obj) {
8785 LDKNodeAnnouncementInfo* obj_conv = (LDKNodeAnnouncementInfo*)obj;
8786 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
8787 *ret = NodeAnnouncementInfo_write(obj_conv);
8791 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1read(JNIEnv * _env, jclass _b, jlong ser) {
8792 LDKu8slice ser_conv = *(LDKu8slice*)ser;
8793 LDKNodeAnnouncementInfo* ret = MALLOC(sizeof(LDKNodeAnnouncementInfo), "LDKNodeAnnouncementInfo");
8794 *ret = NodeAnnouncementInfo_read(ser_conv);
8795 DO_ASSERT(ret->is_owned);
8796 ret->is_owned = false;
8800 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
8801 LDKNodeInfo this_ptr_conv = *(LDKNodeInfo*)this_ptr;
8802 FREE((void*)this_ptr);
8803 this_ptr_conv.is_owned = true;
8804 return NodeInfo_free(this_ptr_conv);
8807 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1set_1channels(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
8808 LDKNodeInfo* this_ptr_conv = (LDKNodeInfo*)this_ptr;
8809 LDKCVec_u64Z val_conv = *(LDKCVec_u64Z*)val;
8811 return NodeInfo_set_channels(this_ptr_conv, val_conv);
8814 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeInfo_1get_1lowest_1inbound_1channel_1fees(JNIEnv * _env, jclass _b, jlong this_ptr) {
8815 LDKNodeInfo* this_ptr_conv = (LDKNodeInfo*)this_ptr;
8816 LDKRoutingFees* ret = MALLOC(sizeof(LDKRoutingFees), "LDKRoutingFees");
8817 *ret = NodeInfo_get_lowest_inbound_channel_fees(this_ptr_conv);
8818 DO_ASSERT(ret->is_owned);
8819 ret->is_owned = false;
8823 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1set_1lowest_1inbound_1channel_1fees(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
8824 LDKNodeInfo* this_ptr_conv = (LDKNodeInfo*)this_ptr;
8825 LDKRoutingFees val_conv = *(LDKRoutingFees*)val;
8827 val_conv.is_owned = true;
8828 return NodeInfo_set_lowest_inbound_channel_fees(this_ptr_conv, val_conv);
8831 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeInfo_1get_1announcement_1info(JNIEnv * _env, jclass _b, jlong this_ptr) {
8832 LDKNodeInfo* this_ptr_conv = (LDKNodeInfo*)this_ptr;
8833 LDKNodeAnnouncementInfo* ret = MALLOC(sizeof(LDKNodeAnnouncementInfo), "LDKNodeAnnouncementInfo");
8834 *ret = NodeInfo_get_announcement_info(this_ptr_conv);
8835 DO_ASSERT(ret->is_owned);
8836 ret->is_owned = false;
8840 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1set_1announcement_1info(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
8841 LDKNodeInfo* this_ptr_conv = (LDKNodeInfo*)this_ptr;
8842 LDKNodeAnnouncementInfo val_conv = *(LDKNodeAnnouncementInfo*)val;
8844 val_conv.is_owned = true;
8845 return NodeInfo_set_announcement_info(this_ptr_conv, val_conv);
8848 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) {
8849 LDKCVec_u64Z channels_arg_conv = *(LDKCVec_u64Z*)channels_arg;
8850 FREE((void*)channels_arg);
8851 LDKRoutingFees lowest_inbound_channel_fees_arg_conv = *(LDKRoutingFees*)lowest_inbound_channel_fees_arg;
8852 FREE((void*)lowest_inbound_channel_fees_arg);
8853 lowest_inbound_channel_fees_arg_conv.is_owned = true;
8854 LDKNodeAnnouncementInfo announcement_info_arg_conv = *(LDKNodeAnnouncementInfo*)announcement_info_arg;
8855 FREE((void*)announcement_info_arg);
8856 announcement_info_arg_conv.is_owned = true;
8857 LDKNodeInfo* ret = MALLOC(sizeof(LDKNodeInfo), "LDKNodeInfo");
8858 *ret = NodeInfo_new(channels_arg_conv, lowest_inbound_channel_fees_arg_conv, announcement_info_arg_conv);
8859 DO_ASSERT(ret->is_owned);
8860 ret->is_owned = false;
8864 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeInfo_1write(JNIEnv * _env, jclass _b, jlong obj) {
8865 LDKNodeInfo* obj_conv = (LDKNodeInfo*)obj;
8866 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
8867 *ret = NodeInfo_write(obj_conv);
8871 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeInfo_1read(JNIEnv * _env, jclass _b, jlong ser) {
8872 LDKu8slice ser_conv = *(LDKu8slice*)ser;
8873 LDKNodeInfo* ret = MALLOC(sizeof(LDKNodeInfo), "LDKNodeInfo");
8874 *ret = NodeInfo_read(ser_conv);
8875 DO_ASSERT(ret->is_owned);
8876 ret->is_owned = false;
8880 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1write(JNIEnv * _env, jclass _b, jlong obj) {
8881 LDKNetworkGraph* obj_conv = (LDKNetworkGraph*)obj;
8882 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
8883 *ret = NetworkGraph_write(obj_conv);
8887 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1read(JNIEnv * _env, jclass _b, jlong ser) {
8888 LDKu8slice ser_conv = *(LDKu8slice*)ser;
8889 LDKNetworkGraph* ret = MALLOC(sizeof(LDKNetworkGraph), "LDKNetworkGraph");
8890 *ret = NetworkGraph_read(ser_conv);
8891 DO_ASSERT(ret->is_owned);
8892 ret->is_owned = false;
8896 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1new(JNIEnv * _env, jclass _b) {
8897 LDKNetworkGraph* ret = MALLOC(sizeof(LDKNetworkGraph), "LDKNetworkGraph");
8898 *ret = NetworkGraph_new();
8899 DO_ASSERT(ret->is_owned);
8900 ret->is_owned = false;
8904 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) {
8905 LDKNetworkGraph* this_arg_conv = (LDKNetworkGraph*)this_arg;
8906 return NetworkGraph_close_channel_from_update(this_arg_conv, short_channel_id, is_permanent);