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 static 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 static 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 static jmethodID ordinal_meth = NULL;
53 static jmethodID slicedef_meth = NULL;
54 static 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_read_1bytes (JNIEnv * _env, jclass _b, jlong ptr, jlong len) {
74 jbyteArray ret_arr = (*_env)->NewByteArray(_env, len);
75 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, len, (unsigned char*)ptr);
78 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_get_1u8_1slice_1bytes (JNIEnv * _env, jclass _b, jlong slice_ptr) {
79 LDKu8slice *slice = (LDKu8slice*)slice_ptr;
80 jbyteArray ret_arr = (*_env)->NewByteArray(_env, slice->datalen);
81 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, slice->datalen, slice->data);
84 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_bytes_1to_1u8_1vec (JNIEnv * _env, jclass _b, jbyteArray bytes) {
85 LDKCVec_u8Z *vec = (LDKCVec_u8Z*)MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8");
86 vec->datalen = (*_env)->GetArrayLength(_env, bytes);
87 vec->data = (uint8_t*)malloc(vec->datalen); // May be freed by rust, so don't track allocation
88 (*_env)->GetByteArrayRegion (_env, bytes, 0, vec->datalen, vec->data);
91 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_vec_1slice_1len (JNIEnv * env, jclass _a, jlong ptr) {
92 // Check offsets of a few Vec types are all consistent as we're meant to be generic across types
93 _Static_assert(offsetof(LDKCVec_u8Z, datalen) == offsetof(LDKCVec_SignatureZ, datalen), "Vec<*> needs to be mapped identically");
94 _Static_assert(offsetof(LDKCVec_u8Z, datalen) == offsetof(LDKCVec_MessageSendEventZ, datalen), "Vec<*> needs to be mapped identically");
95 _Static_assert(offsetof(LDKCVec_u8Z, datalen) == offsetof(LDKCVec_EventZ, datalen), "Vec<*> needs to be mapped identically");
96 _Static_assert(offsetof(LDKCVec_u8Z, datalen) == offsetof(LDKCVec_C2Tuple_usizeTransactionZZ, datalen), "Vec<*> needs to be mapped identically");
97 LDKCVec_u8Z *vec = (LDKCVec_u8Z*)ptr;
98 return (long)vec->datalen;
100 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_new_1empty_1slice_1vec (JNIEnv * _env, jclass _b) {
101 // Check sizes of a few Vec types are all consistent as we're meant to be generic across types
102 _Static_assert(sizeof(LDKCVec_u8Z) == sizeof(LDKCVec_SignatureZ), "Vec<*> needs to be mapped identically");
103 _Static_assert(sizeof(LDKCVec_u8Z) == sizeof(LDKCVec_MessageSendEventZ), "Vec<*> needs to be mapped identically");
104 _Static_assert(sizeof(LDKCVec_u8Z) == sizeof(LDKCVec_EventZ), "Vec<*> needs to be mapped identically");
105 _Static_assert(sizeof(LDKCVec_u8Z) == sizeof(LDKCVec_C2Tuple_usizeTransactionZZ), "Vec<*> needs to be mapped identically");
106 LDKCVec_u8Z *vec = (LDKCVec_u8Z*)MALLOC(sizeof(LDKCVec_u8Z), "Empty LDKCVec");
112 // We assume that CVec_u8Z and u8slice are the same size and layout (and thus pointers to the two can be mixed)
113 _Static_assert(sizeof(LDKCVec_u8Z) == sizeof(LDKu8slice), "Vec<u8> and [u8] need to have been mapped identically");
114 _Static_assert(offsetof(LDKCVec_u8Z, data) == offsetof(LDKu8slice, data), "Vec<u8> and [u8] need to have been mapped identically");
115 _Static_assert(offsetof(LDKCVec_u8Z, datalen) == offsetof(LDKu8slice, datalen), "Vec<u8> and [u8] need to have been mapped identically");
117 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKSecretKey_1new(JNIEnv * _env, jclass _b) {
118 LDKSecretKey* key = (LDKSecretKey*)MALLOC(sizeof(LDKSecretKey), "LDKSecretKey");
121 static inline LDKAccessError LDKAccessError_from_java(JNIEnv *env, jclass val) {
122 switch ((*env)->CallIntMethod(env, val, ordinal_meth)) {
123 case 0: return LDKAccessError_UnknownChain;
124 case 1: return LDKAccessError_UnknownTx;
128 static jclass LDKAccessError_class = NULL;
129 static jfieldID LDKAccessError_LDKAccessError_UnknownChain = NULL;
130 static jfieldID LDKAccessError_LDKAccessError_UnknownTx = NULL;
131 JNIEXPORT void JNICALL Java_org_ldk_enums_LDKAccessError_init (JNIEnv * env, jclass clz) {
132 LDKAccessError_class = (*env)->NewGlobalRef(env, clz);
133 DO_ASSERT(LDKAccessError_class != NULL);
134 LDKAccessError_LDKAccessError_UnknownChain = (*env)->GetStaticFieldID(env, LDKAccessError_class, "LDKAccessError_UnknownChain", "Lorg/ldk/enums/LDKAccessError;");
135 DO_ASSERT(LDKAccessError_LDKAccessError_UnknownChain != NULL);
136 LDKAccessError_LDKAccessError_UnknownTx = (*env)->GetStaticFieldID(env, LDKAccessError_class, "LDKAccessError_UnknownTx", "Lorg/ldk/enums/LDKAccessError;");
137 DO_ASSERT(LDKAccessError_LDKAccessError_UnknownTx != NULL);
139 static inline jclass LDKAccessError_to_java(JNIEnv *env, LDKAccessError val) {
141 case LDKAccessError_UnknownChain:
142 return (*env)->GetStaticObjectField(env, LDKAccessError_class, LDKAccessError_LDKAccessError_UnknownChain);
143 case LDKAccessError_UnknownTx:
144 return (*env)->GetStaticObjectField(env, LDKAccessError_class, LDKAccessError_LDKAccessError_UnknownTx);
149 static inline LDKChannelMonitorUpdateErr LDKChannelMonitorUpdateErr_from_java(JNIEnv *env, jclass val) {
150 switch ((*env)->CallIntMethod(env, val, ordinal_meth)) {
151 case 0: return LDKChannelMonitorUpdateErr_TemporaryFailure;
152 case 1: return LDKChannelMonitorUpdateErr_PermanentFailure;
156 static jclass LDKChannelMonitorUpdateErr_class = NULL;
157 static jfieldID LDKChannelMonitorUpdateErr_LDKChannelMonitorUpdateErr_TemporaryFailure = NULL;
158 static jfieldID LDKChannelMonitorUpdateErr_LDKChannelMonitorUpdateErr_PermanentFailure = NULL;
159 JNIEXPORT void JNICALL Java_org_ldk_enums_LDKChannelMonitorUpdateErr_init (JNIEnv * env, jclass clz) {
160 LDKChannelMonitorUpdateErr_class = (*env)->NewGlobalRef(env, clz);
161 DO_ASSERT(LDKChannelMonitorUpdateErr_class != NULL);
162 LDKChannelMonitorUpdateErr_LDKChannelMonitorUpdateErr_TemporaryFailure = (*env)->GetStaticFieldID(env, LDKChannelMonitorUpdateErr_class, "LDKChannelMonitorUpdateErr_TemporaryFailure", "Lorg/ldk/enums/LDKChannelMonitorUpdateErr;");
163 DO_ASSERT(LDKChannelMonitorUpdateErr_LDKChannelMonitorUpdateErr_TemporaryFailure != NULL);
164 LDKChannelMonitorUpdateErr_LDKChannelMonitorUpdateErr_PermanentFailure = (*env)->GetStaticFieldID(env, LDKChannelMonitorUpdateErr_class, "LDKChannelMonitorUpdateErr_PermanentFailure", "Lorg/ldk/enums/LDKChannelMonitorUpdateErr;");
165 DO_ASSERT(LDKChannelMonitorUpdateErr_LDKChannelMonitorUpdateErr_PermanentFailure != NULL);
167 static inline jclass LDKChannelMonitorUpdateErr_to_java(JNIEnv *env, LDKChannelMonitorUpdateErr val) {
169 case LDKChannelMonitorUpdateErr_TemporaryFailure:
170 return (*env)->GetStaticObjectField(env, LDKChannelMonitorUpdateErr_class, LDKChannelMonitorUpdateErr_LDKChannelMonitorUpdateErr_TemporaryFailure);
171 case LDKChannelMonitorUpdateErr_PermanentFailure:
172 return (*env)->GetStaticObjectField(env, LDKChannelMonitorUpdateErr_class, LDKChannelMonitorUpdateErr_LDKChannelMonitorUpdateErr_PermanentFailure);
177 static inline LDKConfirmationTarget LDKConfirmationTarget_from_java(JNIEnv *env, jclass val) {
178 switch ((*env)->CallIntMethod(env, val, ordinal_meth)) {
179 case 0: return LDKConfirmationTarget_Background;
180 case 1: return LDKConfirmationTarget_Normal;
181 case 2: return LDKConfirmationTarget_HighPriority;
185 static jclass LDKConfirmationTarget_class = NULL;
186 static jfieldID LDKConfirmationTarget_LDKConfirmationTarget_Background = NULL;
187 static jfieldID LDKConfirmationTarget_LDKConfirmationTarget_Normal = NULL;
188 static jfieldID LDKConfirmationTarget_LDKConfirmationTarget_HighPriority = NULL;
189 JNIEXPORT void JNICALL Java_org_ldk_enums_LDKConfirmationTarget_init (JNIEnv * env, jclass clz) {
190 LDKConfirmationTarget_class = (*env)->NewGlobalRef(env, clz);
191 DO_ASSERT(LDKConfirmationTarget_class != NULL);
192 LDKConfirmationTarget_LDKConfirmationTarget_Background = (*env)->GetStaticFieldID(env, LDKConfirmationTarget_class, "LDKConfirmationTarget_Background", "Lorg/ldk/enums/LDKConfirmationTarget;");
193 DO_ASSERT(LDKConfirmationTarget_LDKConfirmationTarget_Background != NULL);
194 LDKConfirmationTarget_LDKConfirmationTarget_Normal = (*env)->GetStaticFieldID(env, LDKConfirmationTarget_class, "LDKConfirmationTarget_Normal", "Lorg/ldk/enums/LDKConfirmationTarget;");
195 DO_ASSERT(LDKConfirmationTarget_LDKConfirmationTarget_Normal != NULL);
196 LDKConfirmationTarget_LDKConfirmationTarget_HighPriority = (*env)->GetStaticFieldID(env, LDKConfirmationTarget_class, "LDKConfirmationTarget_HighPriority", "Lorg/ldk/enums/LDKConfirmationTarget;");
197 DO_ASSERT(LDKConfirmationTarget_LDKConfirmationTarget_HighPriority != NULL);
199 static inline jclass LDKConfirmationTarget_to_java(JNIEnv *env, LDKConfirmationTarget val) {
201 case LDKConfirmationTarget_Background:
202 return (*env)->GetStaticObjectField(env, LDKConfirmationTarget_class, LDKConfirmationTarget_LDKConfirmationTarget_Background);
203 case LDKConfirmationTarget_Normal:
204 return (*env)->GetStaticObjectField(env, LDKConfirmationTarget_class, LDKConfirmationTarget_LDKConfirmationTarget_Normal);
205 case LDKConfirmationTarget_HighPriority:
206 return (*env)->GetStaticObjectField(env, LDKConfirmationTarget_class, LDKConfirmationTarget_LDKConfirmationTarget_HighPriority);
211 static inline LDKLevel LDKLevel_from_java(JNIEnv *env, jclass val) {
212 switch ((*env)->CallIntMethod(env, val, ordinal_meth)) {
213 case 0: return LDKLevel_Off;
214 case 1: return LDKLevel_Error;
215 case 2: return LDKLevel_Warn;
216 case 3: return LDKLevel_Info;
217 case 4: return LDKLevel_Debug;
218 case 5: return LDKLevel_Trace;
222 static jclass LDKLevel_class = NULL;
223 static jfieldID LDKLevel_LDKLevel_Off = NULL;
224 static jfieldID LDKLevel_LDKLevel_Error = NULL;
225 static jfieldID LDKLevel_LDKLevel_Warn = NULL;
226 static jfieldID LDKLevel_LDKLevel_Info = NULL;
227 static jfieldID LDKLevel_LDKLevel_Debug = NULL;
228 static jfieldID LDKLevel_LDKLevel_Trace = NULL;
229 JNIEXPORT void JNICALL Java_org_ldk_enums_LDKLevel_init (JNIEnv * env, jclass clz) {
230 LDKLevel_class = (*env)->NewGlobalRef(env, clz);
231 DO_ASSERT(LDKLevel_class != NULL);
232 LDKLevel_LDKLevel_Off = (*env)->GetStaticFieldID(env, LDKLevel_class, "LDKLevel_Off", "Lorg/ldk/enums/LDKLevel;");
233 DO_ASSERT(LDKLevel_LDKLevel_Off != NULL);
234 LDKLevel_LDKLevel_Error = (*env)->GetStaticFieldID(env, LDKLevel_class, "LDKLevel_Error", "Lorg/ldk/enums/LDKLevel;");
235 DO_ASSERT(LDKLevel_LDKLevel_Error != NULL);
236 LDKLevel_LDKLevel_Warn = (*env)->GetStaticFieldID(env, LDKLevel_class, "LDKLevel_Warn", "Lorg/ldk/enums/LDKLevel;");
237 DO_ASSERT(LDKLevel_LDKLevel_Warn != NULL);
238 LDKLevel_LDKLevel_Info = (*env)->GetStaticFieldID(env, LDKLevel_class, "LDKLevel_Info", "Lorg/ldk/enums/LDKLevel;");
239 DO_ASSERT(LDKLevel_LDKLevel_Info != NULL);
240 LDKLevel_LDKLevel_Debug = (*env)->GetStaticFieldID(env, LDKLevel_class, "LDKLevel_Debug", "Lorg/ldk/enums/LDKLevel;");
241 DO_ASSERT(LDKLevel_LDKLevel_Debug != NULL);
242 LDKLevel_LDKLevel_Trace = (*env)->GetStaticFieldID(env, LDKLevel_class, "LDKLevel_Trace", "Lorg/ldk/enums/LDKLevel;");
243 DO_ASSERT(LDKLevel_LDKLevel_Trace != NULL);
245 static inline jclass LDKLevel_to_java(JNIEnv *env, LDKLevel val) {
248 return (*env)->GetStaticObjectField(env, LDKLevel_class, LDKLevel_LDKLevel_Off);
250 return (*env)->GetStaticObjectField(env, LDKLevel_class, LDKLevel_LDKLevel_Error);
252 return (*env)->GetStaticObjectField(env, LDKLevel_class, LDKLevel_LDKLevel_Warn);
254 return (*env)->GetStaticObjectField(env, LDKLevel_class, LDKLevel_LDKLevel_Info);
256 return (*env)->GetStaticObjectField(env, LDKLevel_class, LDKLevel_LDKLevel_Debug);
258 return (*env)->GetStaticObjectField(env, LDKLevel_class, LDKLevel_LDKLevel_Trace);
263 static inline LDKNetwork LDKNetwork_from_java(JNIEnv *env, jclass val) {
264 switch ((*env)->CallIntMethod(env, val, ordinal_meth)) {
265 case 0: return LDKNetwork_Bitcoin;
266 case 1: return LDKNetwork_Testnet;
267 case 2: return LDKNetwork_Regtest;
271 static jclass LDKNetwork_class = NULL;
272 static jfieldID LDKNetwork_LDKNetwork_Bitcoin = NULL;
273 static jfieldID LDKNetwork_LDKNetwork_Testnet = NULL;
274 static jfieldID LDKNetwork_LDKNetwork_Regtest = NULL;
275 JNIEXPORT void JNICALL Java_org_ldk_enums_LDKNetwork_init (JNIEnv * env, jclass clz) {
276 LDKNetwork_class = (*env)->NewGlobalRef(env, clz);
277 DO_ASSERT(LDKNetwork_class != NULL);
278 LDKNetwork_LDKNetwork_Bitcoin = (*env)->GetStaticFieldID(env, LDKNetwork_class, "LDKNetwork_Bitcoin", "Lorg/ldk/enums/LDKNetwork;");
279 DO_ASSERT(LDKNetwork_LDKNetwork_Bitcoin != NULL);
280 LDKNetwork_LDKNetwork_Testnet = (*env)->GetStaticFieldID(env, LDKNetwork_class, "LDKNetwork_Testnet", "Lorg/ldk/enums/LDKNetwork;");
281 DO_ASSERT(LDKNetwork_LDKNetwork_Testnet != NULL);
282 LDKNetwork_LDKNetwork_Regtest = (*env)->GetStaticFieldID(env, LDKNetwork_class, "LDKNetwork_Regtest", "Lorg/ldk/enums/LDKNetwork;");
283 DO_ASSERT(LDKNetwork_LDKNetwork_Regtest != NULL);
285 static inline jclass LDKNetwork_to_java(JNIEnv *env, LDKNetwork val) {
287 case LDKNetwork_Bitcoin:
288 return (*env)->GetStaticObjectField(env, LDKNetwork_class, LDKNetwork_LDKNetwork_Bitcoin);
289 case LDKNetwork_Testnet:
290 return (*env)->GetStaticObjectField(env, LDKNetwork_class, LDKNetwork_LDKNetwork_Testnet);
291 case LDKNetwork_Regtest:
292 return (*env)->GetStaticObjectField(env, LDKNetwork_class, LDKNetwork_LDKNetwork_Regtest);
297 static inline LDKSecp256k1Error LDKSecp256k1Error_from_java(JNIEnv *env, jclass val) {
298 switch ((*env)->CallIntMethod(env, val, ordinal_meth)) {
299 case 0: return LDKSecp256k1Error_IncorrectSignature;
300 case 1: return LDKSecp256k1Error_InvalidMessage;
301 case 2: return LDKSecp256k1Error_InvalidPublicKey;
302 case 3: return LDKSecp256k1Error_InvalidSignature;
303 case 4: return LDKSecp256k1Error_InvalidSecretKey;
304 case 5: return LDKSecp256k1Error_InvalidRecoveryId;
305 case 6: return LDKSecp256k1Error_InvalidTweak;
306 case 7: return LDKSecp256k1Error_NotEnoughMemory;
307 case 8: return LDKSecp256k1Error_CallbackPanicked;
311 static jclass LDKSecp256k1Error_class = NULL;
312 static jfieldID LDKSecp256k1Error_LDKSecp256k1Error_IncorrectSignature = NULL;
313 static jfieldID LDKSecp256k1Error_LDKSecp256k1Error_InvalidMessage = NULL;
314 static jfieldID LDKSecp256k1Error_LDKSecp256k1Error_InvalidPublicKey = NULL;
315 static jfieldID LDKSecp256k1Error_LDKSecp256k1Error_InvalidSignature = NULL;
316 static jfieldID LDKSecp256k1Error_LDKSecp256k1Error_InvalidSecretKey = NULL;
317 static jfieldID LDKSecp256k1Error_LDKSecp256k1Error_InvalidRecoveryId = NULL;
318 static jfieldID LDKSecp256k1Error_LDKSecp256k1Error_InvalidTweak = NULL;
319 static jfieldID LDKSecp256k1Error_LDKSecp256k1Error_NotEnoughMemory = NULL;
320 static jfieldID LDKSecp256k1Error_LDKSecp256k1Error_CallbackPanicked = NULL;
321 JNIEXPORT void JNICALL Java_org_ldk_enums_LDKSecp256k1Error_init (JNIEnv * env, jclass clz) {
322 LDKSecp256k1Error_class = (*env)->NewGlobalRef(env, clz);
323 DO_ASSERT(LDKSecp256k1Error_class != NULL);
324 LDKSecp256k1Error_LDKSecp256k1Error_IncorrectSignature = (*env)->GetStaticFieldID(env, LDKSecp256k1Error_class, "LDKSecp256k1Error_IncorrectSignature", "Lorg/ldk/enums/LDKSecp256k1Error;");
325 DO_ASSERT(LDKSecp256k1Error_LDKSecp256k1Error_IncorrectSignature != NULL);
326 LDKSecp256k1Error_LDKSecp256k1Error_InvalidMessage = (*env)->GetStaticFieldID(env, LDKSecp256k1Error_class, "LDKSecp256k1Error_InvalidMessage", "Lorg/ldk/enums/LDKSecp256k1Error;");
327 DO_ASSERT(LDKSecp256k1Error_LDKSecp256k1Error_InvalidMessage != NULL);
328 LDKSecp256k1Error_LDKSecp256k1Error_InvalidPublicKey = (*env)->GetStaticFieldID(env, LDKSecp256k1Error_class, "LDKSecp256k1Error_InvalidPublicKey", "Lorg/ldk/enums/LDKSecp256k1Error;");
329 DO_ASSERT(LDKSecp256k1Error_LDKSecp256k1Error_InvalidPublicKey != NULL);
330 LDKSecp256k1Error_LDKSecp256k1Error_InvalidSignature = (*env)->GetStaticFieldID(env, LDKSecp256k1Error_class, "LDKSecp256k1Error_InvalidSignature", "Lorg/ldk/enums/LDKSecp256k1Error;");
331 DO_ASSERT(LDKSecp256k1Error_LDKSecp256k1Error_InvalidSignature != NULL);
332 LDKSecp256k1Error_LDKSecp256k1Error_InvalidSecretKey = (*env)->GetStaticFieldID(env, LDKSecp256k1Error_class, "LDKSecp256k1Error_InvalidSecretKey", "Lorg/ldk/enums/LDKSecp256k1Error;");
333 DO_ASSERT(LDKSecp256k1Error_LDKSecp256k1Error_InvalidSecretKey != NULL);
334 LDKSecp256k1Error_LDKSecp256k1Error_InvalidRecoveryId = (*env)->GetStaticFieldID(env, LDKSecp256k1Error_class, "LDKSecp256k1Error_InvalidRecoveryId", "Lorg/ldk/enums/LDKSecp256k1Error;");
335 DO_ASSERT(LDKSecp256k1Error_LDKSecp256k1Error_InvalidRecoveryId != NULL);
336 LDKSecp256k1Error_LDKSecp256k1Error_InvalidTweak = (*env)->GetStaticFieldID(env, LDKSecp256k1Error_class, "LDKSecp256k1Error_InvalidTweak", "Lorg/ldk/enums/LDKSecp256k1Error;");
337 DO_ASSERT(LDKSecp256k1Error_LDKSecp256k1Error_InvalidTweak != NULL);
338 LDKSecp256k1Error_LDKSecp256k1Error_NotEnoughMemory = (*env)->GetStaticFieldID(env, LDKSecp256k1Error_class, "LDKSecp256k1Error_NotEnoughMemory", "Lorg/ldk/enums/LDKSecp256k1Error;");
339 DO_ASSERT(LDKSecp256k1Error_LDKSecp256k1Error_NotEnoughMemory != NULL);
340 LDKSecp256k1Error_LDKSecp256k1Error_CallbackPanicked = (*env)->GetStaticFieldID(env, LDKSecp256k1Error_class, "LDKSecp256k1Error_CallbackPanicked", "Lorg/ldk/enums/LDKSecp256k1Error;");
341 DO_ASSERT(LDKSecp256k1Error_LDKSecp256k1Error_CallbackPanicked != NULL);
343 static inline jclass LDKSecp256k1Error_to_java(JNIEnv *env, LDKSecp256k1Error val) {
345 case LDKSecp256k1Error_IncorrectSignature:
346 return (*env)->GetStaticObjectField(env, LDKSecp256k1Error_class, LDKSecp256k1Error_LDKSecp256k1Error_IncorrectSignature);
347 case LDKSecp256k1Error_InvalidMessage:
348 return (*env)->GetStaticObjectField(env, LDKSecp256k1Error_class, LDKSecp256k1Error_LDKSecp256k1Error_InvalidMessage);
349 case LDKSecp256k1Error_InvalidPublicKey:
350 return (*env)->GetStaticObjectField(env, LDKSecp256k1Error_class, LDKSecp256k1Error_LDKSecp256k1Error_InvalidPublicKey);
351 case LDKSecp256k1Error_InvalidSignature:
352 return (*env)->GetStaticObjectField(env, LDKSecp256k1Error_class, LDKSecp256k1Error_LDKSecp256k1Error_InvalidSignature);
353 case LDKSecp256k1Error_InvalidSecretKey:
354 return (*env)->GetStaticObjectField(env, LDKSecp256k1Error_class, LDKSecp256k1Error_LDKSecp256k1Error_InvalidSecretKey);
355 case LDKSecp256k1Error_InvalidRecoveryId:
356 return (*env)->GetStaticObjectField(env, LDKSecp256k1Error_class, LDKSecp256k1Error_LDKSecp256k1Error_InvalidRecoveryId);
357 case LDKSecp256k1Error_InvalidTweak:
358 return (*env)->GetStaticObjectField(env, LDKSecp256k1Error_class, LDKSecp256k1Error_LDKSecp256k1Error_InvalidTweak);
359 case LDKSecp256k1Error_NotEnoughMemory:
360 return (*env)->GetStaticObjectField(env, LDKSecp256k1Error_class, LDKSecp256k1Error_LDKSecp256k1Error_NotEnoughMemory);
361 case LDKSecp256k1Error_CallbackPanicked:
362 return (*env)->GetStaticObjectField(env, LDKSecp256k1Error_class, LDKSecp256k1Error_LDKSecp256k1Error_CallbackPanicked);
367 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1u8_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
368 LDKCVecTempl_u8 *vec = (LDKCVecTempl_u8*)ptr;
369 return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(uint8_t));
371 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneChannelMonitorUpdateErrZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
372 return ((LDKCResult_NoneChannelMonitorUpdateErrZ*)arg)->result_ok;
374 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneChannelMonitorUpdateErrZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
375 if (((LDKCResult_NoneChannelMonitorUpdateErrZ*)arg)->result_ok) {
376 return (long)((LDKCResult_NoneChannelMonitorUpdateErrZ*)arg)->contents.result;
378 return (long)((LDKCResult_NoneChannelMonitorUpdateErrZ*)arg)->contents.err;
381 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKMonitorUpdateError_1optional_1none (JNIEnv * env, jclass _a) {
382 LDKMonitorUpdateError *ret = MALLOC(sizeof(LDKMonitorUpdateError), "LDKMonitorUpdateError");
386 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneMonitorUpdateErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
387 return ((LDKCResult_NoneMonitorUpdateErrorZ*)arg)->result_ok;
389 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneMonitorUpdateErrorZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
390 if (((LDKCResult_NoneMonitorUpdateErrorZ*)arg)->result_ok) {
391 return (long)((LDKCResult_NoneMonitorUpdateErrorZ*)arg)->contents.result;
393 return (long)((LDKCResult_NoneMonitorUpdateErrorZ*)arg)->contents.err;
396 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKOutPoint_1optional_1none (JNIEnv * env, jclass _a) {
397 LDKOutPoint *ret = MALLOC(sizeof(LDKOutPoint), "LDKOutPoint");
401 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1TxOut_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
402 LDKCVecTempl_TxOut *vec = (LDKCVecTempl_TxOut*)ptr;
403 return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKTxOut));
405 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1Signature_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
406 LDKCVecTempl_Signature *vec = (LDKCVecTempl_Signature*)ptr;
407 return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKSignature));
409 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
410 return ((LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)arg)->result_ok;
412 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
413 if (((LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)arg)->result_ok) {
414 return (long)((LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)arg)->contents.result;
416 return (long)((LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)arg)->contents.err;
419 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SignatureNoneZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
420 return ((LDKCResult_SignatureNoneZ*)arg)->result_ok;
422 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SignatureNoneZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
423 if (((LDKCResult_SignatureNoneZ*)arg)->result_ok) {
424 return (long)((LDKCResult_SignatureNoneZ*)arg)->contents.result;
426 return (long)((LDKCResult_SignatureNoneZ*)arg)->contents.err;
429 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1SignatureZNoneZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
430 return ((LDKCResult_CVec_SignatureZNoneZ*)arg)->result_ok;
432 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1SignatureZNoneZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
433 if (((LDKCResult_CVec_SignatureZNoneZ*)arg)->result_ok) {
434 return (long)((LDKCResult_CVec_SignatureZNoneZ*)arg)->contents.result;
436 return (long)((LDKCResult_CVec_SignatureZNoneZ*)arg)->contents.err;
439 static jclass LDKAPIError_APIMisuseError_class = NULL;
440 static jmethodID LDKAPIError_APIMisuseError_meth = NULL;
441 static jclass LDKAPIError_FeeRateTooHigh_class = NULL;
442 static jmethodID LDKAPIError_FeeRateTooHigh_meth = NULL;
443 static jclass LDKAPIError_RouteError_class = NULL;
444 static jmethodID LDKAPIError_RouteError_meth = NULL;
445 static jclass LDKAPIError_ChannelUnavailable_class = NULL;
446 static jmethodID LDKAPIError_ChannelUnavailable_meth = NULL;
447 static jclass LDKAPIError_MonitorUpdateFailed_class = NULL;
448 static jmethodID LDKAPIError_MonitorUpdateFailed_meth = NULL;
449 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKAPIError_init (JNIEnv * env, jclass _a) {
450 LDKAPIError_APIMisuseError_class =
451 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKAPIError$APIMisuseError;"));
452 DO_ASSERT(LDKAPIError_APIMisuseError_class != NULL);
453 LDKAPIError_APIMisuseError_meth = (*env)->GetMethodID(env, LDKAPIError_APIMisuseError_class, "<init>", "(J)V");
454 DO_ASSERT(LDKAPIError_APIMisuseError_meth != NULL);
455 LDKAPIError_FeeRateTooHigh_class =
456 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKAPIError$FeeRateTooHigh;"));
457 DO_ASSERT(LDKAPIError_FeeRateTooHigh_class != NULL);
458 LDKAPIError_FeeRateTooHigh_meth = (*env)->GetMethodID(env, LDKAPIError_FeeRateTooHigh_class, "<init>", "(JI)V");
459 DO_ASSERT(LDKAPIError_FeeRateTooHigh_meth != NULL);
460 LDKAPIError_RouteError_class =
461 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKAPIError$RouteError;"));
462 DO_ASSERT(LDKAPIError_RouteError_class != NULL);
463 LDKAPIError_RouteError_meth = (*env)->GetMethodID(env, LDKAPIError_RouteError_class, "<init>", "(J)V");
464 DO_ASSERT(LDKAPIError_RouteError_meth != NULL);
465 LDKAPIError_ChannelUnavailable_class =
466 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKAPIError$ChannelUnavailable;"));
467 DO_ASSERT(LDKAPIError_ChannelUnavailable_class != NULL);
468 LDKAPIError_ChannelUnavailable_meth = (*env)->GetMethodID(env, LDKAPIError_ChannelUnavailable_class, "<init>", "(J)V");
469 DO_ASSERT(LDKAPIError_ChannelUnavailable_meth != NULL);
470 LDKAPIError_MonitorUpdateFailed_class =
471 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKAPIError$MonitorUpdateFailed;"));
472 DO_ASSERT(LDKAPIError_MonitorUpdateFailed_class != NULL);
473 LDKAPIError_MonitorUpdateFailed_meth = (*env)->GetMethodID(env, LDKAPIError_MonitorUpdateFailed_class, "<init>", "()V");
474 DO_ASSERT(LDKAPIError_MonitorUpdateFailed_meth != NULL);
476 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKAPIError_1ref_1from_1ptr (JNIEnv * env, jclass _c, jlong ptr) {
477 LDKAPIError *obj = (LDKAPIError*)ptr;
479 case LDKAPIError_APIMisuseError: {
480 long err_ref = (long)&obj->api_misuse_error.err;
481 return (*env)->NewObject(env, LDKAPIError_APIMisuseError_class, LDKAPIError_APIMisuseError_meth, err_ref);
483 case LDKAPIError_FeeRateTooHigh: {
484 long err_ref = (long)&obj->fee_rate_too_high.err;
485 return (*env)->NewObject(env, LDKAPIError_FeeRateTooHigh_class, LDKAPIError_FeeRateTooHigh_meth, err_ref, obj->fee_rate_too_high.feerate);
487 case LDKAPIError_RouteError: {
488 long err_ref = (long)&obj->route_error.err;
489 return (*env)->NewObject(env, LDKAPIError_RouteError_class, LDKAPIError_RouteError_meth, err_ref);
491 case LDKAPIError_ChannelUnavailable: {
492 long err_ref = (long)&obj->channel_unavailable.err;
493 return (*env)->NewObject(env, LDKAPIError_ChannelUnavailable_class, LDKAPIError_ChannelUnavailable_meth, err_ref);
495 case LDKAPIError_MonitorUpdateFailed: {
496 return (*env)->NewObject(env, LDKAPIError_MonitorUpdateFailed_class, LDKAPIError_MonitorUpdateFailed_meth);
501 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneAPIErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
502 return ((LDKCResult_NoneAPIErrorZ*)arg)->result_ok;
504 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneAPIErrorZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
505 if (((LDKCResult_NoneAPIErrorZ*)arg)->result_ok) {
506 return (long)((LDKCResult_NoneAPIErrorZ*)arg)->contents.result;
508 return (long)((LDKCResult_NoneAPIErrorZ*)arg)->contents.err;
511 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKPaymentSendFailure_1optional_1none (JNIEnv * env, jclass _a) {
512 LDKPaymentSendFailure *ret = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
516 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePaymentSendFailureZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
517 return ((LDKCResult_NonePaymentSendFailureZ*)arg)->result_ok;
519 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePaymentSendFailureZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
520 if (((LDKCResult_NonePaymentSendFailureZ*)arg)->result_ok) {
521 return (long)((LDKCResult_NonePaymentSendFailureZ*)arg)->contents.result;
523 return (long)((LDKCResult_NonePaymentSendFailureZ*)arg)->contents.err;
526 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelAnnouncement_1optional_1none (JNIEnv * env, jclass _a) {
527 LDKChannelAnnouncement *ret = MALLOC(sizeof(LDKChannelAnnouncement), "LDKChannelAnnouncement");
531 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelUpdate_1optional_1none (JNIEnv * env, jclass _a) {
532 LDKChannelUpdate *ret = MALLOC(sizeof(LDKChannelUpdate), "LDKChannelUpdate");
536 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKPeerHandleError_1optional_1none (JNIEnv * env, jclass _a) {
537 LDKPeerHandleError *ret = MALLOC(sizeof(LDKPeerHandleError), "LDKPeerHandleError");
541 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePeerHandleErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
542 return ((LDKCResult_NonePeerHandleErrorZ*)arg)->result_ok;
544 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePeerHandleErrorZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
545 if (((LDKCResult_NonePeerHandleErrorZ*)arg)->result_ok) {
546 return (long)((LDKCResult_NonePeerHandleErrorZ*)arg)->contents.result;
548 return (long)((LDKCResult_NonePeerHandleErrorZ*)arg)->contents.err;
551 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKHTLCOutputInCommitment_1optional_1none (JNIEnv * env, jclass _a) {
552 LDKHTLCOutputInCommitment *ret = MALLOC(sizeof(LDKHTLCOutputInCommitment), "LDKHTLCOutputInCommitment");
556 static jclass LDKSpendableOutputDescriptor_StaticOutput_class = NULL;
557 static jmethodID LDKSpendableOutputDescriptor_StaticOutput_meth = NULL;
558 static jclass LDKSpendableOutputDescriptor_DynamicOutputP2WSH_class = NULL;
559 static jmethodID LDKSpendableOutputDescriptor_DynamicOutputP2WSH_meth = NULL;
560 static jclass LDKSpendableOutputDescriptor_StaticOutputCounterpartyPayment_class = NULL;
561 static jmethodID LDKSpendableOutputDescriptor_StaticOutputCounterpartyPayment_meth = NULL;
562 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKSpendableOutputDescriptor_init (JNIEnv * env, jclass _a) {
563 LDKSpendableOutputDescriptor_StaticOutput_class =
564 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKSpendableOutputDescriptor$StaticOutput;"));
565 DO_ASSERT(LDKSpendableOutputDescriptor_StaticOutput_class != NULL);
566 LDKSpendableOutputDescriptor_StaticOutput_meth = (*env)->GetMethodID(env, LDKSpendableOutputDescriptor_StaticOutput_class, "<init>", "(JJ)V");
567 DO_ASSERT(LDKSpendableOutputDescriptor_StaticOutput_meth != NULL);
568 LDKSpendableOutputDescriptor_DynamicOutputP2WSH_class =
569 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKSpendableOutputDescriptor$DynamicOutputP2WSH;"));
570 DO_ASSERT(LDKSpendableOutputDescriptor_DynamicOutputP2WSH_class != NULL);
571 LDKSpendableOutputDescriptor_DynamicOutputP2WSH_meth = (*env)->GetMethodID(env, LDKSpendableOutputDescriptor_DynamicOutputP2WSH_class, "<init>", "(JJSJJJ)V");
572 DO_ASSERT(LDKSpendableOutputDescriptor_DynamicOutputP2WSH_meth != NULL);
573 LDKSpendableOutputDescriptor_StaticOutputCounterpartyPayment_class =
574 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKSpendableOutputDescriptor$StaticOutputCounterpartyPayment;"));
575 DO_ASSERT(LDKSpendableOutputDescriptor_StaticOutputCounterpartyPayment_class != NULL);
576 LDKSpendableOutputDescriptor_StaticOutputCounterpartyPayment_meth = (*env)->GetMethodID(env, LDKSpendableOutputDescriptor_StaticOutputCounterpartyPayment_class, "<init>", "(JJJ)V");
577 DO_ASSERT(LDKSpendableOutputDescriptor_StaticOutputCounterpartyPayment_meth != NULL);
579 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKSpendableOutputDescriptor_1ref_1from_1ptr (JNIEnv * env, jclass _c, jlong ptr) {
580 LDKSpendableOutputDescriptor *obj = (LDKSpendableOutputDescriptor*)ptr;
582 case LDKSpendableOutputDescriptor_StaticOutput: {
583 long outpoint_ref = (long)&obj->static_output.outpoint;
584 long output_ref = (long)&obj->static_output.output;
585 return (*env)->NewObject(env, LDKSpendableOutputDescriptor_StaticOutput_class, LDKSpendableOutputDescriptor_StaticOutput_meth, outpoint_ref, output_ref);
587 case LDKSpendableOutputDescriptor_DynamicOutputP2WSH: {
588 long outpoint_ref = (long)&obj->dynamic_output_p2wsh.outpoint;
589 long per_commitment_point_ref = (long)&obj->dynamic_output_p2wsh.per_commitment_point;
590 long output_ref = (long)&obj->dynamic_output_p2wsh.output;
591 long key_derivation_params_ref = (long)&obj->dynamic_output_p2wsh.key_derivation_params;
592 long revocation_pubkey_ref = (long)&obj->dynamic_output_p2wsh.revocation_pubkey;
593 return (*env)->NewObject(env, LDKSpendableOutputDescriptor_DynamicOutputP2WSH_class, LDKSpendableOutputDescriptor_DynamicOutputP2WSH_meth, outpoint_ref, per_commitment_point_ref, obj->dynamic_output_p2wsh.to_self_delay, output_ref, key_derivation_params_ref, revocation_pubkey_ref);
595 case LDKSpendableOutputDescriptor_StaticOutputCounterpartyPayment: {
596 long outpoint_ref = (long)&obj->static_output_counterparty_payment.outpoint;
597 long output_ref = (long)&obj->static_output_counterparty_payment.output;
598 long key_derivation_params_ref = (long)&obj->static_output_counterparty_payment.key_derivation_params;
599 return (*env)->NewObject(env, LDKSpendableOutputDescriptor_StaticOutputCounterpartyPayment_class, LDKSpendableOutputDescriptor_StaticOutputCounterpartyPayment_meth, outpoint_ref, output_ref, key_derivation_params_ref);
604 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1SpendableOutputDescriptor_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
605 LDKCVecTempl_SpendableOutputDescriptor *vec = (LDKCVecTempl_SpendableOutputDescriptor*)ptr;
606 return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKSpendableOutputDescriptor));
608 static jclass LDKEvent_FundingGenerationReady_class = NULL;
609 static jmethodID LDKEvent_FundingGenerationReady_meth = NULL;
610 static jclass LDKEvent_FundingBroadcastSafe_class = NULL;
611 static jmethodID LDKEvent_FundingBroadcastSafe_meth = NULL;
612 static jclass LDKEvent_PaymentReceived_class = NULL;
613 static jmethodID LDKEvent_PaymentReceived_meth = NULL;
614 static jclass LDKEvent_PaymentSent_class = NULL;
615 static jmethodID LDKEvent_PaymentSent_meth = NULL;
616 static jclass LDKEvent_PaymentFailed_class = NULL;
617 static jmethodID LDKEvent_PaymentFailed_meth = NULL;
618 static jclass LDKEvent_PendingHTLCsForwardable_class = NULL;
619 static jmethodID LDKEvent_PendingHTLCsForwardable_meth = NULL;
620 static jclass LDKEvent_SpendableOutputs_class = NULL;
621 static jmethodID LDKEvent_SpendableOutputs_meth = NULL;
622 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKEvent_init (JNIEnv * env, jclass _a) {
623 LDKEvent_FundingGenerationReady_class =
624 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$FundingGenerationReady;"));
625 DO_ASSERT(LDKEvent_FundingGenerationReady_class != NULL);
626 LDKEvent_FundingGenerationReady_meth = (*env)->GetMethodID(env, LDKEvent_FundingGenerationReady_class, "<init>", "([BJJJ)V");
627 DO_ASSERT(LDKEvent_FundingGenerationReady_meth != NULL);
628 LDKEvent_FundingBroadcastSafe_class =
629 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$FundingBroadcastSafe;"));
630 DO_ASSERT(LDKEvent_FundingBroadcastSafe_class != NULL);
631 LDKEvent_FundingBroadcastSafe_meth = (*env)->GetMethodID(env, LDKEvent_FundingBroadcastSafe_class, "<init>", "(JJ)V");
632 DO_ASSERT(LDKEvent_FundingBroadcastSafe_meth != NULL);
633 LDKEvent_PaymentReceived_class =
634 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$PaymentReceived;"));
635 DO_ASSERT(LDKEvent_PaymentReceived_class != NULL);
636 LDKEvent_PaymentReceived_meth = (*env)->GetMethodID(env, LDKEvent_PaymentReceived_class, "<init>", "([B[BJ)V");
637 DO_ASSERT(LDKEvent_PaymentReceived_meth != NULL);
638 LDKEvent_PaymentSent_class =
639 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$PaymentSent;"));
640 DO_ASSERT(LDKEvent_PaymentSent_class != NULL);
641 LDKEvent_PaymentSent_meth = (*env)->GetMethodID(env, LDKEvent_PaymentSent_class, "<init>", "([B)V");
642 DO_ASSERT(LDKEvent_PaymentSent_meth != NULL);
643 LDKEvent_PaymentFailed_class =
644 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$PaymentFailed;"));
645 DO_ASSERT(LDKEvent_PaymentFailed_class != NULL);
646 LDKEvent_PaymentFailed_meth = (*env)->GetMethodID(env, LDKEvent_PaymentFailed_class, "<init>", "([BZ)V");
647 DO_ASSERT(LDKEvent_PaymentFailed_meth != NULL);
648 LDKEvent_PendingHTLCsForwardable_class =
649 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$PendingHTLCsForwardable;"));
650 DO_ASSERT(LDKEvent_PendingHTLCsForwardable_class != NULL);
651 LDKEvent_PendingHTLCsForwardable_meth = (*env)->GetMethodID(env, LDKEvent_PendingHTLCsForwardable_class, "<init>", "(J)V");
652 DO_ASSERT(LDKEvent_PendingHTLCsForwardable_meth != NULL);
653 LDKEvent_SpendableOutputs_class =
654 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$SpendableOutputs;"));
655 DO_ASSERT(LDKEvent_SpendableOutputs_class != NULL);
656 LDKEvent_SpendableOutputs_meth = (*env)->GetMethodID(env, LDKEvent_SpendableOutputs_class, "<init>", "(J)V");
657 DO_ASSERT(LDKEvent_SpendableOutputs_meth != NULL);
659 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEvent_1ref_1from_1ptr (JNIEnv * env, jclass _c, jlong ptr) {
660 LDKEvent *obj = (LDKEvent*)ptr;
662 case LDKEvent_FundingGenerationReady: {
663 jbyteArray temporary_channel_id_arr = (*env)->NewByteArray(env, 32);
664 (*env)->SetByteArrayRegion(env, temporary_channel_id_arr, 0, 32, obj->funding_generation_ready.temporary_channel_id.data);
665 long output_script_ref = (long)&obj->funding_generation_ready.output_script;
666 return (*env)->NewObject(env, LDKEvent_FundingGenerationReady_class, LDKEvent_FundingGenerationReady_meth, temporary_channel_id_arr, obj->funding_generation_ready.channel_value_satoshis, output_script_ref, obj->funding_generation_ready.user_channel_id);
668 case LDKEvent_FundingBroadcastSafe: {
669 long funding_txo_ref = (long)&obj->funding_broadcast_safe.funding_txo;
670 return (*env)->NewObject(env, LDKEvent_FundingBroadcastSafe_class, LDKEvent_FundingBroadcastSafe_meth, funding_txo_ref, obj->funding_broadcast_safe.user_channel_id);
672 case LDKEvent_PaymentReceived: {
673 jbyteArray payment_hash_arr = (*env)->NewByteArray(env, 32);
674 (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->payment_received.payment_hash.data);
675 jbyteArray payment_secret_arr = (*env)->NewByteArray(env, 32);
676 (*env)->SetByteArrayRegion(env, payment_secret_arr, 0, 32, obj->payment_received.payment_secret.data);
677 return (*env)->NewObject(env, LDKEvent_PaymentReceived_class, LDKEvent_PaymentReceived_meth, payment_hash_arr, payment_secret_arr, obj->payment_received.amt);
679 case LDKEvent_PaymentSent: {
680 jbyteArray payment_preimage_arr = (*env)->NewByteArray(env, 32);
681 (*env)->SetByteArrayRegion(env, payment_preimage_arr, 0, 32, obj->payment_sent.payment_preimage.data);
682 return (*env)->NewObject(env, LDKEvent_PaymentSent_class, LDKEvent_PaymentSent_meth, payment_preimage_arr);
684 case LDKEvent_PaymentFailed: {
685 jbyteArray payment_hash_arr = (*env)->NewByteArray(env, 32);
686 (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->payment_failed.payment_hash.data);
687 return (*env)->NewObject(env, LDKEvent_PaymentFailed_class, LDKEvent_PaymentFailed_meth, payment_hash_arr, obj->payment_failed.rejected_by_dest);
689 case LDKEvent_PendingHTLCsForwardable: {
690 return (*env)->NewObject(env, LDKEvent_PendingHTLCsForwardable_class, LDKEvent_PendingHTLCsForwardable_meth, obj->pending_htl_cs_forwardable.time_forwardable);
692 case LDKEvent_SpendableOutputs: {
693 long outputs_ref = (long)&obj->spendable_outputs.outputs;
694 return (*env)->NewObject(env, LDKEvent_SpendableOutputs_class, LDKEvent_SpendableOutputs_meth, outputs_ref);
699 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKAcceptChannel_1optional_1none (JNIEnv * env, jclass _a) {
700 LDKAcceptChannel *ret = MALLOC(sizeof(LDKAcceptChannel), "LDKAcceptChannel");
704 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKOpenChannel_1optional_1none (JNIEnv * env, jclass _a) {
705 LDKOpenChannel *ret = MALLOC(sizeof(LDKOpenChannel), "LDKOpenChannel");
709 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKFundingCreated_1optional_1none (JNIEnv * env, jclass _a) {
710 LDKFundingCreated *ret = MALLOC(sizeof(LDKFundingCreated), "LDKFundingCreated");
714 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKFundingSigned_1optional_1none (JNIEnv * env, jclass _a) {
715 LDKFundingSigned *ret = MALLOC(sizeof(LDKFundingSigned), "LDKFundingSigned");
719 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKFundingLocked_1optional_1none (JNIEnv * env, jclass _a) {
720 LDKFundingLocked *ret = MALLOC(sizeof(LDKFundingLocked), "LDKFundingLocked");
724 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKAnnouncementSignatures_1optional_1none (JNIEnv * env, jclass _a) {
725 LDKAnnouncementSignatures *ret = MALLOC(sizeof(LDKAnnouncementSignatures), "LDKAnnouncementSignatures");
729 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCommitmentUpdate_1optional_1none (JNIEnv * env, jclass _a) {
730 LDKCommitmentUpdate *ret = MALLOC(sizeof(LDKCommitmentUpdate), "LDKCommitmentUpdate");
734 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKRevokeAndACK_1optional_1none (JNIEnv * env, jclass _a) {
735 LDKRevokeAndACK *ret = MALLOC(sizeof(LDKRevokeAndACK), "LDKRevokeAndACK");
739 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKClosingSigned_1optional_1none (JNIEnv * env, jclass _a) {
740 LDKClosingSigned *ret = MALLOC(sizeof(LDKClosingSigned), "LDKClosingSigned");
744 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKShutdown_1optional_1none (JNIEnv * env, jclass _a) {
745 LDKShutdown *ret = MALLOC(sizeof(LDKShutdown), "LDKShutdown");
749 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelReestablish_1optional_1none (JNIEnv * env, jclass _a) {
750 LDKChannelReestablish *ret = MALLOC(sizeof(LDKChannelReestablish), "LDKChannelReestablish");
754 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKNodeAnnouncement_1optional_1none (JNIEnv * env, jclass _a) {
755 LDKNodeAnnouncement *ret = MALLOC(sizeof(LDKNodeAnnouncement), "LDKNodeAnnouncement");
759 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKErrorMessage_1optional_1none (JNIEnv * env, jclass _a) {
760 LDKErrorMessage *ret = MALLOC(sizeof(LDKErrorMessage), "LDKErrorMessage");
764 static jclass LDKErrorAction_DisconnectPeer_class = NULL;
765 static jmethodID LDKErrorAction_DisconnectPeer_meth = NULL;
766 static jclass LDKErrorAction_IgnoreError_class = NULL;
767 static jmethodID LDKErrorAction_IgnoreError_meth = NULL;
768 static jclass LDKErrorAction_SendErrorMessage_class = NULL;
769 static jmethodID LDKErrorAction_SendErrorMessage_meth = NULL;
770 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKErrorAction_init (JNIEnv * env, jclass _a) {
771 LDKErrorAction_DisconnectPeer_class =
772 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKErrorAction$DisconnectPeer;"));
773 DO_ASSERT(LDKErrorAction_DisconnectPeer_class != NULL);
774 LDKErrorAction_DisconnectPeer_meth = (*env)->GetMethodID(env, LDKErrorAction_DisconnectPeer_class, "<init>", "(J)V");
775 DO_ASSERT(LDKErrorAction_DisconnectPeer_meth != NULL);
776 LDKErrorAction_IgnoreError_class =
777 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKErrorAction$IgnoreError;"));
778 DO_ASSERT(LDKErrorAction_IgnoreError_class != NULL);
779 LDKErrorAction_IgnoreError_meth = (*env)->GetMethodID(env, LDKErrorAction_IgnoreError_class, "<init>", "()V");
780 DO_ASSERT(LDKErrorAction_IgnoreError_meth != NULL);
781 LDKErrorAction_SendErrorMessage_class =
782 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKErrorAction$SendErrorMessage;"));
783 DO_ASSERT(LDKErrorAction_SendErrorMessage_class != NULL);
784 LDKErrorAction_SendErrorMessage_meth = (*env)->GetMethodID(env, LDKErrorAction_SendErrorMessage_class, "<init>", "(J)V");
785 DO_ASSERT(LDKErrorAction_SendErrorMessage_meth != NULL);
787 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKErrorAction_1ref_1from_1ptr (JNIEnv * env, jclass _c, jlong ptr) {
788 LDKErrorAction *obj = (LDKErrorAction*)ptr;
790 case LDKErrorAction_DisconnectPeer: {
791 long msg_ref = (long)&obj->disconnect_peer.msg;
792 return (*env)->NewObject(env, LDKErrorAction_DisconnectPeer_class, LDKErrorAction_DisconnectPeer_meth, msg_ref);
794 case LDKErrorAction_IgnoreError: {
795 return (*env)->NewObject(env, LDKErrorAction_IgnoreError_class, LDKErrorAction_IgnoreError_meth);
797 case LDKErrorAction_SendErrorMessage: {
798 long msg_ref = (long)&obj->send_error_message.msg;
799 return (*env)->NewObject(env, LDKErrorAction_SendErrorMessage_class, LDKErrorAction_SendErrorMessage_meth, msg_ref);
804 static jclass LDKHTLCFailChannelUpdate_ChannelUpdateMessage_class = NULL;
805 static jmethodID LDKHTLCFailChannelUpdate_ChannelUpdateMessage_meth = NULL;
806 static jclass LDKHTLCFailChannelUpdate_ChannelClosed_class = NULL;
807 static jmethodID LDKHTLCFailChannelUpdate_ChannelClosed_meth = NULL;
808 static jclass LDKHTLCFailChannelUpdate_NodeFailure_class = NULL;
809 static jmethodID LDKHTLCFailChannelUpdate_NodeFailure_meth = NULL;
810 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKHTLCFailChannelUpdate_init (JNIEnv * env, jclass _a) {
811 LDKHTLCFailChannelUpdate_ChannelUpdateMessage_class =
812 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKHTLCFailChannelUpdate$ChannelUpdateMessage;"));
813 DO_ASSERT(LDKHTLCFailChannelUpdate_ChannelUpdateMessage_class != NULL);
814 LDKHTLCFailChannelUpdate_ChannelUpdateMessage_meth = (*env)->GetMethodID(env, LDKHTLCFailChannelUpdate_ChannelUpdateMessage_class, "<init>", "(J)V");
815 DO_ASSERT(LDKHTLCFailChannelUpdate_ChannelUpdateMessage_meth != NULL);
816 LDKHTLCFailChannelUpdate_ChannelClosed_class =
817 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKHTLCFailChannelUpdate$ChannelClosed;"));
818 DO_ASSERT(LDKHTLCFailChannelUpdate_ChannelClosed_class != NULL);
819 LDKHTLCFailChannelUpdate_ChannelClosed_meth = (*env)->GetMethodID(env, LDKHTLCFailChannelUpdate_ChannelClosed_class, "<init>", "(JZ)V");
820 DO_ASSERT(LDKHTLCFailChannelUpdate_ChannelClosed_meth != NULL);
821 LDKHTLCFailChannelUpdate_NodeFailure_class =
822 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKHTLCFailChannelUpdate$NodeFailure;"));
823 DO_ASSERT(LDKHTLCFailChannelUpdate_NodeFailure_class != NULL);
824 LDKHTLCFailChannelUpdate_NodeFailure_meth = (*env)->GetMethodID(env, LDKHTLCFailChannelUpdate_NodeFailure_class, "<init>", "(JZ)V");
825 DO_ASSERT(LDKHTLCFailChannelUpdate_NodeFailure_meth != NULL);
827 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKHTLCFailChannelUpdate_1ref_1from_1ptr (JNIEnv * env, jclass _c, jlong ptr) {
828 LDKHTLCFailChannelUpdate *obj = (LDKHTLCFailChannelUpdate*)ptr;
830 case LDKHTLCFailChannelUpdate_ChannelUpdateMessage: {
831 long msg_ref = (long)&obj->channel_update_message.msg;
832 return (*env)->NewObject(env, LDKHTLCFailChannelUpdate_ChannelUpdateMessage_class, LDKHTLCFailChannelUpdate_ChannelUpdateMessage_meth, msg_ref);
834 case LDKHTLCFailChannelUpdate_ChannelClosed: {
835 return (*env)->NewObject(env, LDKHTLCFailChannelUpdate_ChannelClosed_class, LDKHTLCFailChannelUpdate_ChannelClosed_meth, obj->channel_closed.short_channel_id, obj->channel_closed.is_permanent);
837 case LDKHTLCFailChannelUpdate_NodeFailure: {
838 long node_id_ref = (long)&obj->node_failure.node_id;
839 return (*env)->NewObject(env, LDKHTLCFailChannelUpdate_NodeFailure_class, LDKHTLCFailChannelUpdate_NodeFailure_meth, node_id_ref, obj->node_failure.is_permanent);
844 static jclass LDKMessageSendEvent_SendAcceptChannel_class = NULL;
845 static jmethodID LDKMessageSendEvent_SendAcceptChannel_meth = NULL;
846 static jclass LDKMessageSendEvent_SendOpenChannel_class = NULL;
847 static jmethodID LDKMessageSendEvent_SendOpenChannel_meth = NULL;
848 static jclass LDKMessageSendEvent_SendFundingCreated_class = NULL;
849 static jmethodID LDKMessageSendEvent_SendFundingCreated_meth = NULL;
850 static jclass LDKMessageSendEvent_SendFundingSigned_class = NULL;
851 static jmethodID LDKMessageSendEvent_SendFundingSigned_meth = NULL;
852 static jclass LDKMessageSendEvent_SendFundingLocked_class = NULL;
853 static jmethodID LDKMessageSendEvent_SendFundingLocked_meth = NULL;
854 static jclass LDKMessageSendEvent_SendAnnouncementSignatures_class = NULL;
855 static jmethodID LDKMessageSendEvent_SendAnnouncementSignatures_meth = NULL;
856 static jclass LDKMessageSendEvent_UpdateHTLCs_class = NULL;
857 static jmethodID LDKMessageSendEvent_UpdateHTLCs_meth = NULL;
858 static jclass LDKMessageSendEvent_SendRevokeAndACK_class = NULL;
859 static jmethodID LDKMessageSendEvent_SendRevokeAndACK_meth = NULL;
860 static jclass LDKMessageSendEvent_SendClosingSigned_class = NULL;
861 static jmethodID LDKMessageSendEvent_SendClosingSigned_meth = NULL;
862 static jclass LDKMessageSendEvent_SendShutdown_class = NULL;
863 static jmethodID LDKMessageSendEvent_SendShutdown_meth = NULL;
864 static jclass LDKMessageSendEvent_SendChannelReestablish_class = NULL;
865 static jmethodID LDKMessageSendEvent_SendChannelReestablish_meth = NULL;
866 static jclass LDKMessageSendEvent_BroadcastChannelAnnouncement_class = NULL;
867 static jmethodID LDKMessageSendEvent_BroadcastChannelAnnouncement_meth = NULL;
868 static jclass LDKMessageSendEvent_BroadcastNodeAnnouncement_class = NULL;
869 static jmethodID LDKMessageSendEvent_BroadcastNodeAnnouncement_meth = NULL;
870 static jclass LDKMessageSendEvent_BroadcastChannelUpdate_class = NULL;
871 static jmethodID LDKMessageSendEvent_BroadcastChannelUpdate_meth = NULL;
872 static jclass LDKMessageSendEvent_HandleError_class = NULL;
873 static jmethodID LDKMessageSendEvent_HandleError_meth = NULL;
874 static jclass LDKMessageSendEvent_PaymentFailureNetworkUpdate_class = NULL;
875 static jmethodID LDKMessageSendEvent_PaymentFailureNetworkUpdate_meth = NULL;
876 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKMessageSendEvent_init (JNIEnv * env, jclass _a) {
877 LDKMessageSendEvent_SendAcceptChannel_class =
878 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendAcceptChannel;"));
879 DO_ASSERT(LDKMessageSendEvent_SendAcceptChannel_class != NULL);
880 LDKMessageSendEvent_SendAcceptChannel_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendAcceptChannel_class, "<init>", "(JJ)V");
881 DO_ASSERT(LDKMessageSendEvent_SendAcceptChannel_meth != NULL);
882 LDKMessageSendEvent_SendOpenChannel_class =
883 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendOpenChannel;"));
884 DO_ASSERT(LDKMessageSendEvent_SendOpenChannel_class != NULL);
885 LDKMessageSendEvent_SendOpenChannel_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendOpenChannel_class, "<init>", "(JJ)V");
886 DO_ASSERT(LDKMessageSendEvent_SendOpenChannel_meth != NULL);
887 LDKMessageSendEvent_SendFundingCreated_class =
888 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendFundingCreated;"));
889 DO_ASSERT(LDKMessageSendEvent_SendFundingCreated_class != NULL);
890 LDKMessageSendEvent_SendFundingCreated_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendFundingCreated_class, "<init>", "(JJ)V");
891 DO_ASSERT(LDKMessageSendEvent_SendFundingCreated_meth != NULL);
892 LDKMessageSendEvent_SendFundingSigned_class =
893 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendFundingSigned;"));
894 DO_ASSERT(LDKMessageSendEvent_SendFundingSigned_class != NULL);
895 LDKMessageSendEvent_SendFundingSigned_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendFundingSigned_class, "<init>", "(JJ)V");
896 DO_ASSERT(LDKMessageSendEvent_SendFundingSigned_meth != NULL);
897 LDKMessageSendEvent_SendFundingLocked_class =
898 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendFundingLocked;"));
899 DO_ASSERT(LDKMessageSendEvent_SendFundingLocked_class != NULL);
900 LDKMessageSendEvent_SendFundingLocked_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendFundingLocked_class, "<init>", "(JJ)V");
901 DO_ASSERT(LDKMessageSendEvent_SendFundingLocked_meth != NULL);
902 LDKMessageSendEvent_SendAnnouncementSignatures_class =
903 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendAnnouncementSignatures;"));
904 DO_ASSERT(LDKMessageSendEvent_SendAnnouncementSignatures_class != NULL);
905 LDKMessageSendEvent_SendAnnouncementSignatures_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendAnnouncementSignatures_class, "<init>", "(JJ)V");
906 DO_ASSERT(LDKMessageSendEvent_SendAnnouncementSignatures_meth != NULL);
907 LDKMessageSendEvent_UpdateHTLCs_class =
908 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$UpdateHTLCs;"));
909 DO_ASSERT(LDKMessageSendEvent_UpdateHTLCs_class != NULL);
910 LDKMessageSendEvent_UpdateHTLCs_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_UpdateHTLCs_class, "<init>", "(JJ)V");
911 DO_ASSERT(LDKMessageSendEvent_UpdateHTLCs_meth != NULL);
912 LDKMessageSendEvent_SendRevokeAndACK_class =
913 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendRevokeAndACK;"));
914 DO_ASSERT(LDKMessageSendEvent_SendRevokeAndACK_class != NULL);
915 LDKMessageSendEvent_SendRevokeAndACK_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendRevokeAndACK_class, "<init>", "(JJ)V");
916 DO_ASSERT(LDKMessageSendEvent_SendRevokeAndACK_meth != NULL);
917 LDKMessageSendEvent_SendClosingSigned_class =
918 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendClosingSigned;"));
919 DO_ASSERT(LDKMessageSendEvent_SendClosingSigned_class != NULL);
920 LDKMessageSendEvent_SendClosingSigned_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendClosingSigned_class, "<init>", "(JJ)V");
921 DO_ASSERT(LDKMessageSendEvent_SendClosingSigned_meth != NULL);
922 LDKMessageSendEvent_SendShutdown_class =
923 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendShutdown;"));
924 DO_ASSERT(LDKMessageSendEvent_SendShutdown_class != NULL);
925 LDKMessageSendEvent_SendShutdown_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendShutdown_class, "<init>", "(JJ)V");
926 DO_ASSERT(LDKMessageSendEvent_SendShutdown_meth != NULL);
927 LDKMessageSendEvent_SendChannelReestablish_class =
928 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendChannelReestablish;"));
929 DO_ASSERT(LDKMessageSendEvent_SendChannelReestablish_class != NULL);
930 LDKMessageSendEvent_SendChannelReestablish_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendChannelReestablish_class, "<init>", "(JJ)V");
931 DO_ASSERT(LDKMessageSendEvent_SendChannelReestablish_meth != NULL);
932 LDKMessageSendEvent_BroadcastChannelAnnouncement_class =
933 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$BroadcastChannelAnnouncement;"));
934 DO_ASSERT(LDKMessageSendEvent_BroadcastChannelAnnouncement_class != NULL);
935 LDKMessageSendEvent_BroadcastChannelAnnouncement_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_BroadcastChannelAnnouncement_class, "<init>", "(JJ)V");
936 DO_ASSERT(LDKMessageSendEvent_BroadcastChannelAnnouncement_meth != NULL);
937 LDKMessageSendEvent_BroadcastNodeAnnouncement_class =
938 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$BroadcastNodeAnnouncement;"));
939 DO_ASSERT(LDKMessageSendEvent_BroadcastNodeAnnouncement_class != NULL);
940 LDKMessageSendEvent_BroadcastNodeAnnouncement_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_BroadcastNodeAnnouncement_class, "<init>", "(J)V");
941 DO_ASSERT(LDKMessageSendEvent_BroadcastNodeAnnouncement_meth != NULL);
942 LDKMessageSendEvent_BroadcastChannelUpdate_class =
943 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$BroadcastChannelUpdate;"));
944 DO_ASSERT(LDKMessageSendEvent_BroadcastChannelUpdate_class != NULL);
945 LDKMessageSendEvent_BroadcastChannelUpdate_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_BroadcastChannelUpdate_class, "<init>", "(J)V");
946 DO_ASSERT(LDKMessageSendEvent_BroadcastChannelUpdate_meth != NULL);
947 LDKMessageSendEvent_HandleError_class =
948 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$HandleError;"));
949 DO_ASSERT(LDKMessageSendEvent_HandleError_class != NULL);
950 LDKMessageSendEvent_HandleError_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_HandleError_class, "<init>", "(JJ)V");
951 DO_ASSERT(LDKMessageSendEvent_HandleError_meth != NULL);
952 LDKMessageSendEvent_PaymentFailureNetworkUpdate_class =
953 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$PaymentFailureNetworkUpdate;"));
954 DO_ASSERT(LDKMessageSendEvent_PaymentFailureNetworkUpdate_class != NULL);
955 LDKMessageSendEvent_PaymentFailureNetworkUpdate_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_PaymentFailureNetworkUpdate_class, "<init>", "(J)V");
956 DO_ASSERT(LDKMessageSendEvent_PaymentFailureNetworkUpdate_meth != NULL);
958 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1from_1ptr (JNIEnv * env, jclass _c, jlong ptr) {
959 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)ptr;
961 case LDKMessageSendEvent_SendAcceptChannel: {
962 long node_id_ref = (long)&obj->send_accept_channel.node_id;
963 long msg_ref = (long)&obj->send_accept_channel.msg;
964 return (*env)->NewObject(env, LDKMessageSendEvent_SendAcceptChannel_class, LDKMessageSendEvent_SendAcceptChannel_meth, node_id_ref, msg_ref);
966 case LDKMessageSendEvent_SendOpenChannel: {
967 long node_id_ref = (long)&obj->send_open_channel.node_id;
968 long msg_ref = (long)&obj->send_open_channel.msg;
969 return (*env)->NewObject(env, LDKMessageSendEvent_SendOpenChannel_class, LDKMessageSendEvent_SendOpenChannel_meth, node_id_ref, msg_ref);
971 case LDKMessageSendEvent_SendFundingCreated: {
972 long node_id_ref = (long)&obj->send_funding_created.node_id;
973 long msg_ref = (long)&obj->send_funding_created.msg;
974 return (*env)->NewObject(env, LDKMessageSendEvent_SendFundingCreated_class, LDKMessageSendEvent_SendFundingCreated_meth, node_id_ref, msg_ref);
976 case LDKMessageSendEvent_SendFundingSigned: {
977 long node_id_ref = (long)&obj->send_funding_signed.node_id;
978 long msg_ref = (long)&obj->send_funding_signed.msg;
979 return (*env)->NewObject(env, LDKMessageSendEvent_SendFundingSigned_class, LDKMessageSendEvent_SendFundingSigned_meth, node_id_ref, msg_ref);
981 case LDKMessageSendEvent_SendFundingLocked: {
982 long node_id_ref = (long)&obj->send_funding_locked.node_id;
983 long msg_ref = (long)&obj->send_funding_locked.msg;
984 return (*env)->NewObject(env, LDKMessageSendEvent_SendFundingLocked_class, LDKMessageSendEvent_SendFundingLocked_meth, node_id_ref, msg_ref);
986 case LDKMessageSendEvent_SendAnnouncementSignatures: {
987 long node_id_ref = (long)&obj->send_announcement_signatures.node_id;
988 long msg_ref = (long)&obj->send_announcement_signatures.msg;
989 return (*env)->NewObject(env, LDKMessageSendEvent_SendAnnouncementSignatures_class, LDKMessageSendEvent_SendAnnouncementSignatures_meth, node_id_ref, msg_ref);
991 case LDKMessageSendEvent_UpdateHTLCs: {
992 long node_id_ref = (long)&obj->update_htl_cs.node_id;
993 long updates_ref = (long)&obj->update_htl_cs.updates;
994 return (*env)->NewObject(env, LDKMessageSendEvent_UpdateHTLCs_class, LDKMessageSendEvent_UpdateHTLCs_meth, node_id_ref, updates_ref);
996 case LDKMessageSendEvent_SendRevokeAndACK: {
997 long node_id_ref = (long)&obj->send_revoke_and_ack.node_id;
998 long msg_ref = (long)&obj->send_revoke_and_ack.msg;
999 return (*env)->NewObject(env, LDKMessageSendEvent_SendRevokeAndACK_class, LDKMessageSendEvent_SendRevokeAndACK_meth, node_id_ref, msg_ref);
1001 case LDKMessageSendEvent_SendClosingSigned: {
1002 long node_id_ref = (long)&obj->send_closing_signed.node_id;
1003 long msg_ref = (long)&obj->send_closing_signed.msg;
1004 return (*env)->NewObject(env, LDKMessageSendEvent_SendClosingSigned_class, LDKMessageSendEvent_SendClosingSigned_meth, node_id_ref, msg_ref);
1006 case LDKMessageSendEvent_SendShutdown: {
1007 long node_id_ref = (long)&obj->send_shutdown.node_id;
1008 long msg_ref = (long)&obj->send_shutdown.msg;
1009 return (*env)->NewObject(env, LDKMessageSendEvent_SendShutdown_class, LDKMessageSendEvent_SendShutdown_meth, node_id_ref, msg_ref);
1011 case LDKMessageSendEvent_SendChannelReestablish: {
1012 long node_id_ref = (long)&obj->send_channel_reestablish.node_id;
1013 long msg_ref = (long)&obj->send_channel_reestablish.msg;
1014 return (*env)->NewObject(env, LDKMessageSendEvent_SendChannelReestablish_class, LDKMessageSendEvent_SendChannelReestablish_meth, node_id_ref, msg_ref);
1016 case LDKMessageSendEvent_BroadcastChannelAnnouncement: {
1017 long msg_ref = (long)&obj->broadcast_channel_announcement.msg;
1018 long update_msg_ref = (long)&obj->broadcast_channel_announcement.update_msg;
1019 return (*env)->NewObject(env, LDKMessageSendEvent_BroadcastChannelAnnouncement_class, LDKMessageSendEvent_BroadcastChannelAnnouncement_meth, msg_ref, update_msg_ref);
1021 case LDKMessageSendEvent_BroadcastNodeAnnouncement: {
1022 long msg_ref = (long)&obj->broadcast_node_announcement.msg;
1023 return (*env)->NewObject(env, LDKMessageSendEvent_BroadcastNodeAnnouncement_class, LDKMessageSendEvent_BroadcastNodeAnnouncement_meth, msg_ref);
1025 case LDKMessageSendEvent_BroadcastChannelUpdate: {
1026 long msg_ref = (long)&obj->broadcast_channel_update.msg;
1027 return (*env)->NewObject(env, LDKMessageSendEvent_BroadcastChannelUpdate_class, LDKMessageSendEvent_BroadcastChannelUpdate_meth, msg_ref);
1029 case LDKMessageSendEvent_HandleError: {
1030 long node_id_ref = (long)&obj->handle_error.node_id;
1031 long action_ref = (long)&obj->handle_error.action;
1032 return (*env)->NewObject(env, LDKMessageSendEvent_HandleError_class, LDKMessageSendEvent_HandleError_meth, node_id_ref, action_ref);
1034 case LDKMessageSendEvent_PaymentFailureNetworkUpdate: {
1035 long update_ref = (long)&obj->payment_failure_network_update.update;
1036 return (*env)->NewObject(env, LDKMessageSendEvent_PaymentFailureNetworkUpdate_class, LDKMessageSendEvent_PaymentFailureNetworkUpdate_meth, update_ref);
1041 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1MessageSendEvent_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
1042 LDKCVecTempl_MessageSendEvent *vec = (LDKCVecTempl_MessageSendEvent*)ptr;
1043 return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKMessageSendEvent));
1045 typedef struct LDKMessageSendEventsProvider_JCalls {
1046 atomic_size_t refcnt;
1049 jmethodID get_and_clear_pending_msg_events_meth;
1050 } LDKMessageSendEventsProvider_JCalls;
1051 LDKCVec_MessageSendEventZ get_and_clear_pending_msg_events_jcall(const void* this_arg) {
1052 LDKMessageSendEventsProvider_JCalls *j_calls = (LDKMessageSendEventsProvider_JCalls*) this_arg;
1054 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1055 LDKCVec_MessageSendEventZ* ret = (LDKCVec_MessageSendEventZ*)(*env)->CallLongMethod(env, j_calls->o, j_calls->get_and_clear_pending_msg_events_meth);
1056 LDKCVec_MessageSendEventZ res = *ret;
1060 static void LDKMessageSendEventsProvider_JCalls_free(void* this_arg) {
1061 LDKMessageSendEventsProvider_JCalls *j_calls = (LDKMessageSendEventsProvider_JCalls*) this_arg;
1062 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
1064 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1065 (*env)->DeleteGlobalRef(env, j_calls->o);
1069 static void* LDKMessageSendEventsProvider_JCalls_clone(const void* this_arg) {
1070 LDKMessageSendEventsProvider_JCalls *j_calls = (LDKMessageSendEventsProvider_JCalls*) this_arg;
1071 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
1072 return (void*) this_arg;
1074 static inline LDKMessageSendEventsProvider LDKMessageSendEventsProvider_init (JNIEnv * env, jclass _a, jobject o) {
1075 jclass c = (*env)->GetObjectClass(env, o);
1076 DO_ASSERT(c != NULL);
1077 LDKMessageSendEventsProvider_JCalls *calls = MALLOC(sizeof(LDKMessageSendEventsProvider_JCalls), "LDKMessageSendEventsProvider_JCalls");
1078 atomic_init(&calls->refcnt, 1);
1079 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
1080 calls->o = (*env)->NewGlobalRef(env, o);
1081 calls->get_and_clear_pending_msg_events_meth = (*env)->GetMethodID(env, c, "get_and_clear_pending_msg_events", "()J");
1082 DO_ASSERT(calls->get_and_clear_pending_msg_events_meth != NULL);
1084 LDKMessageSendEventsProvider ret = {
1085 .this_arg = (void*) calls,
1086 .get_and_clear_pending_msg_events = get_and_clear_pending_msg_events_jcall,
1087 .free = LDKMessageSendEventsProvider_JCalls_free,
1091 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEventsProvider_1new (JNIEnv * env, jclass _a, jobject o) {
1092 LDKMessageSendEventsProvider *res_ptr = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
1093 *res_ptr = LDKMessageSendEventsProvider_init(env, _a, o);
1094 return (long)res_ptr;
1096 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEventsProvider_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
1097 return ((LDKMessageSendEventsProvider_JCalls*)val)->o;
1099 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEventsProvider_1call_1get_1and_1clear_1pending_1msg_1events(JNIEnv * _env, jclass _b, jlong arg) {
1100 LDKMessageSendEventsProvider* arg_conv = (LDKMessageSendEventsProvider*)arg;
1101 LDKCVec_MessageSendEventZ* ret = MALLOC(sizeof(LDKCVec_MessageSendEventZ), "LDKCVec_MessageSendEventZ");
1102 *ret = (arg_conv->get_and_clear_pending_msg_events)(arg_conv->this_arg);
1106 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1Event_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
1107 LDKCVecTempl_Event *vec = (LDKCVecTempl_Event*)ptr;
1108 return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKEvent));
1110 typedef struct LDKEventsProvider_JCalls {
1111 atomic_size_t refcnt;
1114 jmethodID get_and_clear_pending_events_meth;
1115 } LDKEventsProvider_JCalls;
1116 LDKCVec_EventZ get_and_clear_pending_events_jcall(const void* this_arg) {
1117 LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) this_arg;
1119 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1120 LDKCVec_EventZ* ret = (LDKCVec_EventZ*)(*env)->CallLongMethod(env, j_calls->o, j_calls->get_and_clear_pending_events_meth);
1121 LDKCVec_EventZ res = *ret;
1125 static void LDKEventsProvider_JCalls_free(void* this_arg) {
1126 LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) this_arg;
1127 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
1129 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1130 (*env)->DeleteGlobalRef(env, j_calls->o);
1134 static void* LDKEventsProvider_JCalls_clone(const void* this_arg) {
1135 LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) this_arg;
1136 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
1137 return (void*) this_arg;
1139 static inline LDKEventsProvider LDKEventsProvider_init (JNIEnv * env, jclass _a, jobject o) {
1140 jclass c = (*env)->GetObjectClass(env, o);
1141 DO_ASSERT(c != NULL);
1142 LDKEventsProvider_JCalls *calls = MALLOC(sizeof(LDKEventsProvider_JCalls), "LDKEventsProvider_JCalls");
1143 atomic_init(&calls->refcnt, 1);
1144 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
1145 calls->o = (*env)->NewGlobalRef(env, o);
1146 calls->get_and_clear_pending_events_meth = (*env)->GetMethodID(env, c, "get_and_clear_pending_events", "()J");
1147 DO_ASSERT(calls->get_and_clear_pending_events_meth != NULL);
1149 LDKEventsProvider ret = {
1150 .this_arg = (void*) calls,
1151 .get_and_clear_pending_events = get_and_clear_pending_events_jcall,
1152 .free = LDKEventsProvider_JCalls_free,
1156 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKEventsProvider_1new (JNIEnv * env, jclass _a, jobject o) {
1157 LDKEventsProvider *res_ptr = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider");
1158 *res_ptr = LDKEventsProvider_init(env, _a, o);
1159 return (long)res_ptr;
1161 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEventsProvider_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
1162 return ((LDKEventsProvider_JCalls*)val)->o;
1164 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKEventsProvider_1call_1get_1and_1clear_1pending_1events(JNIEnv * _env, jclass _b, jlong arg) {
1165 LDKEventsProvider* arg_conv = (LDKEventsProvider*)arg;
1166 LDKCVec_EventZ* ret = MALLOC(sizeof(LDKCVec_EventZ), "LDKCVec_EventZ");
1167 *ret = (arg_conv->get_and_clear_pending_events)(arg_conv->this_arg);
1171 typedef struct LDKLogger_JCalls {
1172 atomic_size_t refcnt;
1177 void log_jcall(const void* this_arg, const char *record) {
1178 LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) this_arg;
1180 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1181 jstring record_conv = (*env)->NewStringUTF(env, record);
1182 return (*env)->CallVoidMethod(env, j_calls->o, j_calls->log_meth, record_conv);
1184 static void LDKLogger_JCalls_free(void* this_arg) {
1185 LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) this_arg;
1186 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
1188 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1189 (*env)->DeleteGlobalRef(env, j_calls->o);
1193 static void* LDKLogger_JCalls_clone(const void* this_arg) {
1194 LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) this_arg;
1195 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
1196 return (void*) this_arg;
1198 static inline LDKLogger LDKLogger_init (JNIEnv * env, jclass _a, jobject o) {
1199 jclass c = (*env)->GetObjectClass(env, o);
1200 DO_ASSERT(c != NULL);
1201 LDKLogger_JCalls *calls = MALLOC(sizeof(LDKLogger_JCalls), "LDKLogger_JCalls");
1202 atomic_init(&calls->refcnt, 1);
1203 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
1204 calls->o = (*env)->NewGlobalRef(env, o);
1205 calls->log_meth = (*env)->GetMethodID(env, c, "log", "(Ljava/lang/String;)V");
1206 DO_ASSERT(calls->log_meth != NULL);
1209 .this_arg = (void*) calls,
1211 .free = LDKLogger_JCalls_free,
1215 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKLogger_1new (JNIEnv * env, jclass _a, jobject o) {
1216 LDKLogger *res_ptr = MALLOC(sizeof(LDKLogger), "LDKLogger");
1217 *res_ptr = LDKLogger_init(env, _a, o);
1218 return (long)res_ptr;
1220 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKLogger_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
1221 return ((LDKLogger_JCalls*)val)->o;
1223 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelHandshakeConfig_1optional_1none (JNIEnv * env, jclass _a) {
1224 LDKChannelHandshakeConfig *ret = MALLOC(sizeof(LDKChannelHandshakeConfig), "LDKChannelHandshakeConfig");
1228 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelHandshakeLimits_1optional_1none (JNIEnv * env, jclass _a) {
1229 LDKChannelHandshakeLimits *ret = MALLOC(sizeof(LDKChannelHandshakeLimits), "LDKChannelHandshakeLimits");
1233 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelConfig_1optional_1none (JNIEnv * env, jclass _a) {
1234 LDKChannelConfig *ret = MALLOC(sizeof(LDKChannelConfig), "LDKChannelConfig");
1238 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKUserConfig_1optional_1none (JNIEnv * env, jclass _a) {
1239 LDKUserConfig *ret = MALLOC(sizeof(LDKUserConfig), "LDKUserConfig");
1243 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxOutAccessErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
1244 return ((LDKCResult_TxOutAccessErrorZ*)arg)->result_ok;
1246 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxOutAccessErrorZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
1247 if (((LDKCResult_TxOutAccessErrorZ*)arg)->result_ok) {
1248 return (long)((LDKCResult_TxOutAccessErrorZ*)arg)->contents.result;
1250 return (long)((LDKCResult_TxOutAccessErrorZ*)arg)->contents.err;
1253 typedef struct LDKAccess_JCalls {
1254 atomic_size_t refcnt;
1257 jmethodID get_utxo_meth;
1259 LDKCResult_TxOutAccessErrorZ get_utxo_jcall(const void* this_arg, const uint8_t (*genesis_hash)[32], uint64_t short_channel_id) {
1260 LDKAccess_JCalls *j_calls = (LDKAccess_JCalls*) this_arg;
1262 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1263 jbyteArray genesis_hash_arr = (*env)->NewByteArray(env, 32);
1264 (*env)->SetByteArrayRegion(env, genesis_hash_arr, 0, 32, *genesis_hash);
1265 LDKCResult_TxOutAccessErrorZ* ret = (LDKCResult_TxOutAccessErrorZ*)(*env)->CallLongMethod(env, j_calls->o, j_calls->get_utxo_meth, genesis_hash_arr, short_channel_id);
1266 LDKCResult_TxOutAccessErrorZ res = *ret;
1270 static void LDKAccess_JCalls_free(void* this_arg) {
1271 LDKAccess_JCalls *j_calls = (LDKAccess_JCalls*) this_arg;
1272 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
1274 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1275 (*env)->DeleteGlobalRef(env, j_calls->o);
1279 static void* LDKAccess_JCalls_clone(const void* this_arg) {
1280 LDKAccess_JCalls *j_calls = (LDKAccess_JCalls*) this_arg;
1281 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
1282 return (void*) this_arg;
1284 static inline LDKAccess LDKAccess_init (JNIEnv * env, jclass _a, jobject o) {
1285 jclass c = (*env)->GetObjectClass(env, o);
1286 DO_ASSERT(c != NULL);
1287 LDKAccess_JCalls *calls = MALLOC(sizeof(LDKAccess_JCalls), "LDKAccess_JCalls");
1288 atomic_init(&calls->refcnt, 1);
1289 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
1290 calls->o = (*env)->NewGlobalRef(env, o);
1291 calls->get_utxo_meth = (*env)->GetMethodID(env, c, "get_utxo", "([BJ)J");
1292 DO_ASSERT(calls->get_utxo_meth != NULL);
1295 .this_arg = (void*) calls,
1296 .get_utxo = get_utxo_jcall,
1297 .free = LDKAccess_JCalls_free,
1301 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKAccess_1new (JNIEnv * env, jclass _a, jobject o) {
1302 LDKAccess *res_ptr = MALLOC(sizeof(LDKAccess), "LDKAccess");
1303 *res_ptr = LDKAccess_init(env, _a, o);
1304 return (long)res_ptr;
1306 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKAccess_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
1307 return ((LDKAccess_JCalls*)val)->o;
1309 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) {
1310 LDKAccess* arg_conv = (LDKAccess*)arg;
1311 unsigned char genesis_hash_arr[32];
1312 (*_env)->GetByteArrayRegion (_env, genesis_hash, 0, 32, genesis_hash_arr);
1313 unsigned char (*genesis_hash_ref)[32] = &genesis_hash_arr;
1314 LDKCResult_TxOutAccessErrorZ* ret = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ");
1315 *ret = (arg_conv->get_utxo)(arg_conv->this_arg, genesis_hash_ref, short_channel_id);
1319 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelPublicKeys_1optional_1none (JNIEnv * env, jclass _a) {
1320 LDKChannelPublicKeys *ret = MALLOC(sizeof(LDKChannelPublicKeys), "LDKChannelPublicKeys");
1324 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKPreCalculatedTxCreationKeys_1optional_1none (JNIEnv * env, jclass _a) {
1325 LDKPreCalculatedTxCreationKeys *ret = MALLOC(sizeof(LDKPreCalculatedTxCreationKeys), "LDKPreCalculatedTxCreationKeys");
1329 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1HTLCOutputInCommitment_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
1330 LDKCVecTempl_HTLCOutputInCommitment *vec = (LDKCVecTempl_HTLCOutputInCommitment*)ptr;
1331 return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKHTLCOutputInCommitment));
1333 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKHolderCommitmentTransaction_1optional_1none (JNIEnv * env, jclass _a) {
1334 LDKHolderCommitmentTransaction *ret = MALLOC(sizeof(LDKHolderCommitmentTransaction), "LDKHolderCommitmentTransaction");
1338 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKUnsignedChannelAnnouncement_1optional_1none (JNIEnv * env, jclass _a) {
1339 LDKUnsignedChannelAnnouncement *ret = MALLOC(sizeof(LDKUnsignedChannelAnnouncement), "LDKUnsignedChannelAnnouncement");
1343 typedef struct LDKChannelKeys_JCalls {
1344 atomic_size_t refcnt;
1347 jmethodID get_per_commitment_point_meth;
1348 jmethodID release_commitment_secret_meth;
1349 jmethodID key_derivation_params_meth;
1350 jmethodID sign_counterparty_commitment_meth;
1351 jmethodID sign_holder_commitment_meth;
1352 jmethodID sign_holder_commitment_htlc_transactions_meth;
1353 jmethodID sign_justice_transaction_meth;
1354 jmethodID sign_counterparty_htlc_transaction_meth;
1355 jmethodID sign_closing_transaction_meth;
1356 jmethodID sign_channel_announcement_meth;
1357 jmethodID on_accept_meth;
1358 } LDKChannelKeys_JCalls;
1359 LDKPublicKey get_per_commitment_point_jcall(const void* this_arg, uint64_t idx) {
1360 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
1362 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1363 LDKPublicKey* ret = (LDKPublicKey*)(*env)->CallLongMethod(env, j_calls->o, j_calls->get_per_commitment_point_meth, idx);
1364 LDKPublicKey res = *ret;
1368 LDKThirtyTwoBytes release_commitment_secret_jcall(const void* this_arg, uint64_t idx) {
1369 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
1371 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1372 jbyteArray jret = (*env)->CallObjectMethod(env, j_calls->o, j_calls->release_commitment_secret_meth, idx);
1373 LDKThirtyTwoBytes ret;
1374 (*env)->GetByteArrayRegion(env, jret, 0, 32, ret.data);
1377 LDKC2Tuple_u64u64Z key_derivation_params_jcall(const void* this_arg) {
1378 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
1380 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1381 LDKC2Tuple_u64u64Z* ret = (LDKC2Tuple_u64u64Z*)(*env)->CallLongMethod(env, j_calls->o, j_calls->key_derivation_params_meth);
1382 LDKC2Tuple_u64u64Z res = *ret;
1386 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) {
1387 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
1389 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1390 long commitment_tx_ref = (long)&commitment_tx;
1391 long htlcs_ref = (long)&htlcs;
1392 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);
1393 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ res = *ret;
1397 LDKCResult_SignatureNoneZ sign_holder_commitment_jcall(const void* this_arg, const LDKHolderCommitmentTransaction *holder_commitment_tx) {
1398 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
1400 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1401 LDKCResult_SignatureNoneZ* ret = (LDKCResult_SignatureNoneZ*)(*env)->CallLongMethod(env, j_calls->o, j_calls->sign_holder_commitment_meth, holder_commitment_tx);
1402 LDKCResult_SignatureNoneZ res = *ret;
1406 LDKCResult_CVec_SignatureZNoneZ sign_holder_commitment_htlc_transactions_jcall(const void* this_arg, const LDKHolderCommitmentTransaction *holder_commitment_tx) {
1407 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
1409 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1410 LDKCResult_CVec_SignatureZNoneZ* ret = (LDKCResult_CVec_SignatureZNoneZ*)(*env)->CallLongMethod(env, j_calls->o, j_calls->sign_holder_commitment_htlc_transactions_meth, holder_commitment_tx);
1411 LDKCResult_CVec_SignatureZNoneZ res = *ret;
1415 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) {
1416 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
1418 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1419 long justice_tx_ref = (long)&justice_tx;
1420 jbyteArray per_commitment_key_arr = (*env)->NewByteArray(env, 32);
1421 (*env)->SetByteArrayRegion(env, per_commitment_key_arr, 0, 32, *per_commitment_key);
1422 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);
1423 LDKCResult_SignatureNoneZ res = *ret;
1427 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) {
1428 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
1430 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1431 long htlc_tx_ref = (long)&htlc_tx;
1432 long per_commitment_point_ref = (long)&per_commitment_point;
1433 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);
1434 LDKCResult_SignatureNoneZ res = *ret;
1438 LDKCResult_SignatureNoneZ sign_closing_transaction_jcall(const void* this_arg, LDKTransaction closing_tx) {
1439 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
1441 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1442 long closing_tx_ref = (long)&closing_tx;
1443 LDKCResult_SignatureNoneZ* ret = (LDKCResult_SignatureNoneZ*)(*env)->CallLongMethod(env, j_calls->o, j_calls->sign_closing_transaction_meth, closing_tx_ref);
1444 LDKCResult_SignatureNoneZ res = *ret;
1448 LDKCResult_SignatureNoneZ sign_channel_announcement_jcall(const void* this_arg, const LDKUnsignedChannelAnnouncement *msg) {
1449 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
1451 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1452 LDKCResult_SignatureNoneZ* ret = (LDKCResult_SignatureNoneZ*)(*env)->CallLongMethod(env, j_calls->o, j_calls->sign_channel_announcement_meth, msg);
1453 LDKCResult_SignatureNoneZ res = *ret;
1457 void on_accept_jcall(void* this_arg, const LDKChannelPublicKeys *channel_points, uint16_t counterparty_selected_contest_delay, uint16_t holder_selected_contest_delay) {
1458 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
1460 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1461 return (*env)->CallVoidMethod(env, j_calls->o, j_calls->on_accept_meth, channel_points, counterparty_selected_contest_delay, holder_selected_contest_delay);
1463 static void LDKChannelKeys_JCalls_free(void* this_arg) {
1464 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
1465 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
1467 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1468 (*env)->DeleteGlobalRef(env, j_calls->o);
1472 static void* LDKChannelKeys_JCalls_clone(const void* this_arg) {
1473 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
1474 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
1475 return (void*) this_arg;
1477 static inline LDKChannelKeys LDKChannelKeys_init (JNIEnv * env, jclass _a, jobject o) {
1478 jclass c = (*env)->GetObjectClass(env, o);
1479 DO_ASSERT(c != NULL);
1480 LDKChannelKeys_JCalls *calls = MALLOC(sizeof(LDKChannelKeys_JCalls), "LDKChannelKeys_JCalls");
1481 atomic_init(&calls->refcnt, 1);
1482 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
1483 calls->o = (*env)->NewGlobalRef(env, o);
1484 calls->get_per_commitment_point_meth = (*env)->GetMethodID(env, c, "get_per_commitment_point", "(J)J");
1485 DO_ASSERT(calls->get_per_commitment_point_meth != NULL);
1486 calls->release_commitment_secret_meth = (*env)->GetMethodID(env, c, "release_commitment_secret", "(J)[B");
1487 DO_ASSERT(calls->release_commitment_secret_meth != NULL);
1488 calls->key_derivation_params_meth = (*env)->GetMethodID(env, c, "key_derivation_params", "()J");
1489 DO_ASSERT(calls->key_derivation_params_meth != NULL);
1490 calls->sign_counterparty_commitment_meth = (*env)->GetMethodID(env, c, "sign_counterparty_commitment", "(IJJJ)J");
1491 DO_ASSERT(calls->sign_counterparty_commitment_meth != NULL);
1492 calls->sign_holder_commitment_meth = (*env)->GetMethodID(env, c, "sign_holder_commitment", "(J)J");
1493 DO_ASSERT(calls->sign_holder_commitment_meth != NULL);
1494 calls->sign_holder_commitment_htlc_transactions_meth = (*env)->GetMethodID(env, c, "sign_holder_commitment_htlc_transactions", "(J)J");
1495 DO_ASSERT(calls->sign_holder_commitment_htlc_transactions_meth != NULL);
1496 calls->sign_justice_transaction_meth = (*env)->GetMethodID(env, c, "sign_justice_transaction", "(JJJ[BJ)J");
1497 DO_ASSERT(calls->sign_justice_transaction_meth != NULL);
1498 calls->sign_counterparty_htlc_transaction_meth = (*env)->GetMethodID(env, c, "sign_counterparty_htlc_transaction", "(JJJJJ)J");
1499 DO_ASSERT(calls->sign_counterparty_htlc_transaction_meth != NULL);
1500 calls->sign_closing_transaction_meth = (*env)->GetMethodID(env, c, "sign_closing_transaction", "(J)J");
1501 DO_ASSERT(calls->sign_closing_transaction_meth != NULL);
1502 calls->sign_channel_announcement_meth = (*env)->GetMethodID(env, c, "sign_channel_announcement", "(J)J");
1503 DO_ASSERT(calls->sign_channel_announcement_meth != NULL);
1504 calls->on_accept_meth = (*env)->GetMethodID(env, c, "on_accept", "(JSS)V");
1505 DO_ASSERT(calls->on_accept_meth != NULL);
1507 LDKChannelKeys ret = {
1508 .this_arg = (void*) calls,
1509 .get_per_commitment_point = get_per_commitment_point_jcall,
1510 .release_commitment_secret = release_commitment_secret_jcall,
1511 .key_derivation_params = key_derivation_params_jcall,
1512 .sign_counterparty_commitment = sign_counterparty_commitment_jcall,
1513 .sign_holder_commitment = sign_holder_commitment_jcall,
1514 .sign_holder_commitment_htlc_transactions = sign_holder_commitment_htlc_transactions_jcall,
1515 .sign_justice_transaction = sign_justice_transaction_jcall,
1516 .sign_counterparty_htlc_transaction = sign_counterparty_htlc_transaction_jcall,
1517 .sign_closing_transaction = sign_closing_transaction_jcall,
1518 .sign_channel_announcement = sign_channel_announcement_jcall,
1519 .on_accept = on_accept_jcall,
1520 .clone = LDKChannelKeys_JCalls_clone,
1521 .free = LDKChannelKeys_JCalls_free,
1525 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKChannelKeys_1new (JNIEnv * env, jclass _a, jobject o) {
1526 LDKChannelKeys *res_ptr = MALLOC(sizeof(LDKChannelKeys), "LDKChannelKeys");
1527 *res_ptr = LDKChannelKeys_init(env, _a, o);
1528 return (long)res_ptr;
1530 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKChannelKeys_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
1531 return ((LDKChannelKeys_JCalls*)val)->o;
1533 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelKeys_1call_1get_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong arg, jlong idx) {
1534 LDKChannelKeys* arg_conv = (LDKChannelKeys*)arg;
1535 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
1536 *ret = (arg_conv->get_per_commitment_point)(arg_conv->this_arg, idx);
1540 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_LDKChannelKeys_1call_1release_1commitment_1secret(JNIEnv * _env, jclass _b, jlong arg, jlong idx) {
1541 LDKChannelKeys* arg_conv = (LDKChannelKeys*)arg;
1542 jbyteArray _arr = (*_env)->NewByteArray(_env, 32);
1543 (*_env)->SetByteArrayRegion(_env, _arr, 0, 32, (arg_conv->release_commitment_secret)(arg_conv->this_arg, idx).data);
1547 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelKeys_1call_1key_1derivation_1params(JNIEnv * _env, jclass _b, jlong arg) {
1548 LDKChannelKeys* arg_conv = (LDKChannelKeys*)arg;
1549 LDKC2Tuple_u64u64Z* ret = MALLOC(sizeof(LDKC2Tuple_u64u64Z), "LDKC2Tuple_u64u64Z");
1550 *ret = (arg_conv->key_derivation_params)(arg_conv->this_arg);
1554 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) {
1555 LDKChannelKeys* arg_conv = (LDKChannelKeys*)arg;
1556 LDKTransaction commitment_tx_conv = *(LDKTransaction*)commitment_tx;
1557 FREE((void*)commitment_tx);
1558 LDKPreCalculatedTxCreationKeys* keys_conv = (LDKPreCalculatedTxCreationKeys*)keys;
1559 LDKCVec_HTLCOutputInCommitmentZ htlcs_conv = *(LDKCVec_HTLCOutputInCommitmentZ*)htlcs;
1561 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
1562 *ret = (arg_conv->sign_counterparty_commitment)(arg_conv->this_arg, feerate_per_kw, commitment_tx_conv, keys_conv, htlcs_conv);
1566 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelKeys_1call_1sign_1holder_1commitment(JNIEnv * _env, jclass _b, jlong arg, jlong holder_commitment_tx) {
1567 LDKChannelKeys* arg_conv = (LDKChannelKeys*)arg;
1568 LDKHolderCommitmentTransaction* holder_commitment_tx_conv = (LDKHolderCommitmentTransaction*)holder_commitment_tx;
1569 LDKCResult_SignatureNoneZ* ret = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
1570 *ret = (arg_conv->sign_holder_commitment)(arg_conv->this_arg, holder_commitment_tx_conv);
1574 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) {
1575 LDKChannelKeys* arg_conv = (LDKChannelKeys*)arg;
1576 LDKHolderCommitmentTransaction* holder_commitment_tx_conv = (LDKHolderCommitmentTransaction*)holder_commitment_tx;
1577 LDKCResult_CVec_SignatureZNoneZ* ret = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
1578 *ret = (arg_conv->sign_holder_commitment_htlc_transactions)(arg_conv->this_arg, holder_commitment_tx_conv);
1582 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) {
1583 LDKChannelKeys* arg_conv = (LDKChannelKeys*)arg;
1584 LDKTransaction justice_tx_conv = *(LDKTransaction*)justice_tx;
1585 FREE((void*)justice_tx);
1586 unsigned char per_commitment_key_arr[32];
1587 (*_env)->GetByteArrayRegion (_env, per_commitment_key, 0, 32, per_commitment_key_arr);
1588 unsigned char (*per_commitment_key_ref)[32] = &per_commitment_key_arr;
1589 LDKHTLCOutputInCommitment* htlc_conv = (LDKHTLCOutputInCommitment*)htlc;
1590 LDKCResult_SignatureNoneZ* ret = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
1591 *ret = (arg_conv->sign_justice_transaction)(arg_conv->this_arg, justice_tx_conv, input, amount, per_commitment_key_ref, htlc_conv);
1595 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) {
1596 LDKChannelKeys* arg_conv = (LDKChannelKeys*)arg;
1597 LDKTransaction htlc_tx_conv = *(LDKTransaction*)htlc_tx;
1598 FREE((void*)htlc_tx);
1599 LDKPublicKey per_commitment_point_conv = *(LDKPublicKey*)per_commitment_point;
1600 FREE((void*)per_commitment_point);
1601 LDKHTLCOutputInCommitment* htlc_conv = (LDKHTLCOutputInCommitment*)htlc;
1602 LDKCResult_SignatureNoneZ* ret = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
1603 *ret = (arg_conv->sign_counterparty_htlc_transaction)(arg_conv->this_arg, htlc_tx_conv, input, amount, per_commitment_point_conv, htlc_conv);
1607 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelKeys_1call_1sign_1closing_1transaction(JNIEnv * _env, jclass _b, jlong arg, jlong closing_tx) {
1608 LDKChannelKeys* arg_conv = (LDKChannelKeys*)arg;
1609 LDKTransaction closing_tx_conv = *(LDKTransaction*)closing_tx;
1610 FREE((void*)closing_tx);
1611 LDKCResult_SignatureNoneZ* ret = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
1612 *ret = (arg_conv->sign_closing_transaction)(arg_conv->this_arg, closing_tx_conv);
1616 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelKeys_1call_1sign_1channel_1announcement(JNIEnv * _env, jclass _b, jlong arg, jlong msg) {
1617 LDKChannelKeys* arg_conv = (LDKChannelKeys*)arg;
1618 LDKUnsignedChannelAnnouncement* msg_conv = (LDKUnsignedChannelAnnouncement*)msg;
1619 LDKCResult_SignatureNoneZ* ret = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
1620 *ret = (arg_conv->sign_channel_announcement)(arg_conv->this_arg, msg_conv);
1624 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) {
1625 LDKChannelKeys* arg_conv = (LDKChannelKeys*)arg;
1626 LDKChannelPublicKeys* channel_points_conv = (LDKChannelPublicKeys*)channel_points;
1627 return (arg_conv->on_accept)(arg_conv->this_arg, channel_points_conv, counterparty_selected_contest_delay, holder_selected_contest_delay);
1630 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelMonitor_1optional_1none (JNIEnv * env, jclass _a) {
1631 LDKChannelMonitor *ret = MALLOC(sizeof(LDKChannelMonitor), "LDKChannelMonitor");
1635 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelMonitorUpdate_1optional_1none (JNIEnv * env, jclass _a) {
1636 LDKChannelMonitorUpdate *ret = MALLOC(sizeof(LDKChannelMonitorUpdate), "LDKChannelMonitorUpdate");
1640 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKMonitorEvent_1optional_1none (JNIEnv * env, jclass _a) {
1641 LDKMonitorEvent *ret = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
1645 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1MonitorEvent_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
1646 LDKCVecTempl_MonitorEvent *vec = (LDKCVecTempl_MonitorEvent*)ptr;
1647 return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKMonitorEvent));
1649 typedef struct LDKWatch_JCalls {
1650 atomic_size_t refcnt;
1653 jmethodID watch_channel_meth;
1654 jmethodID update_channel_meth;
1655 jmethodID release_pending_monitor_events_meth;
1657 LDKCResult_NoneChannelMonitorUpdateErrZ watch_channel_jcall(const void* this_arg, LDKOutPoint funding_txo, LDKChannelMonitor monitor) {
1658 LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
1660 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1661 long funding_txo_ref = (long)&funding_txo;
1662 long monitor_ref = (long)&monitor;
1663 LDKCResult_NoneChannelMonitorUpdateErrZ* ret = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(*env)->CallLongMethod(env, j_calls->o, j_calls->watch_channel_meth, funding_txo_ref, monitor_ref);
1664 LDKCResult_NoneChannelMonitorUpdateErrZ res = *ret;
1668 LDKCResult_NoneChannelMonitorUpdateErrZ update_channel_jcall(const void* this_arg, LDKOutPoint funding_txo, LDKChannelMonitorUpdate update) {
1669 LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
1671 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1672 long funding_txo_ref = (long)&funding_txo;
1673 long update_ref = (long)&update;
1674 LDKCResult_NoneChannelMonitorUpdateErrZ* ret = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(*env)->CallLongMethod(env, j_calls->o, j_calls->update_channel_meth, funding_txo_ref, update_ref);
1675 LDKCResult_NoneChannelMonitorUpdateErrZ res = *ret;
1679 LDKCVec_MonitorEventZ release_pending_monitor_events_jcall(const void* this_arg) {
1680 LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
1682 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1683 LDKCVec_MonitorEventZ* ret = (LDKCVec_MonitorEventZ*)(*env)->CallLongMethod(env, j_calls->o, j_calls->release_pending_monitor_events_meth);
1684 LDKCVec_MonitorEventZ res = *ret;
1688 static void LDKWatch_JCalls_free(void* this_arg) {
1689 LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
1690 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
1692 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1693 (*env)->DeleteGlobalRef(env, j_calls->o);
1697 static void* LDKWatch_JCalls_clone(const void* this_arg) {
1698 LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
1699 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
1700 return (void*) this_arg;
1702 static inline LDKWatch LDKWatch_init (JNIEnv * env, jclass _a, jobject o) {
1703 jclass c = (*env)->GetObjectClass(env, o);
1704 DO_ASSERT(c != NULL);
1705 LDKWatch_JCalls *calls = MALLOC(sizeof(LDKWatch_JCalls), "LDKWatch_JCalls");
1706 atomic_init(&calls->refcnt, 1);
1707 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
1708 calls->o = (*env)->NewGlobalRef(env, o);
1709 calls->watch_channel_meth = (*env)->GetMethodID(env, c, "watch_channel", "(JJ)J");
1710 DO_ASSERT(calls->watch_channel_meth != NULL);
1711 calls->update_channel_meth = (*env)->GetMethodID(env, c, "update_channel", "(JJ)J");
1712 DO_ASSERT(calls->update_channel_meth != NULL);
1713 calls->release_pending_monitor_events_meth = (*env)->GetMethodID(env, c, "release_pending_monitor_events", "()J");
1714 DO_ASSERT(calls->release_pending_monitor_events_meth != NULL);
1717 .this_arg = (void*) calls,
1718 .watch_channel = watch_channel_jcall,
1719 .update_channel = update_channel_jcall,
1720 .release_pending_monitor_events = release_pending_monitor_events_jcall,
1721 .free = LDKWatch_JCalls_free,
1725 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKWatch_1new (JNIEnv * env, jclass _a, jobject o) {
1726 LDKWatch *res_ptr = MALLOC(sizeof(LDKWatch), "LDKWatch");
1727 *res_ptr = LDKWatch_init(env, _a, o);
1728 return (long)res_ptr;
1730 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKWatch_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
1731 return ((LDKWatch_JCalls*)val)->o;
1733 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKWatch_1call_1watch_1channel(JNIEnv * _env, jclass _b, jlong arg, jlong funding_txo, jlong monitor) {
1734 LDKWatch* arg_conv = (LDKWatch*)arg;
1735 LDKOutPoint funding_txo_conv = *(LDKOutPoint*)funding_txo;
1736 FREE((void*)funding_txo);
1737 funding_txo_conv.is_owned = true;
1738 LDKChannelMonitor monitor_conv = *(LDKChannelMonitor*)monitor;
1739 FREE((void*)monitor);
1740 monitor_conv.is_owned = true;
1741 LDKCResult_NoneChannelMonitorUpdateErrZ* ret = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
1742 *ret = (arg_conv->watch_channel)(arg_conv->this_arg, funding_txo_conv, monitor_conv);
1746 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKWatch_1call_1update_1channel(JNIEnv * _env, jclass _b, jlong arg, jlong funding_txo, jlong update) {
1747 LDKWatch* arg_conv = (LDKWatch*)arg;
1748 LDKOutPoint funding_txo_conv = *(LDKOutPoint*)funding_txo;
1749 FREE((void*)funding_txo);
1750 funding_txo_conv.is_owned = true;
1751 LDKChannelMonitorUpdate update_conv = *(LDKChannelMonitorUpdate*)update;
1752 FREE((void*)update);
1753 update_conv.is_owned = true;
1754 LDKCResult_NoneChannelMonitorUpdateErrZ* ret = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
1755 *ret = (arg_conv->update_channel)(arg_conv->this_arg, funding_txo_conv, update_conv);
1759 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKWatch_1call_1release_1pending_1monitor_1events(JNIEnv * _env, jclass _b, jlong arg) {
1760 LDKWatch* arg_conv = (LDKWatch*)arg;
1761 LDKCVec_MonitorEventZ* ret = MALLOC(sizeof(LDKCVec_MonitorEventZ), "LDKCVec_MonitorEventZ");
1762 *ret = (arg_conv->release_pending_monitor_events)(arg_conv->this_arg);
1766 typedef struct LDKFilter_JCalls {
1767 atomic_size_t refcnt;
1770 jmethodID register_tx_meth;
1771 jmethodID register_output_meth;
1773 void register_tx_jcall(const void* this_arg, const uint8_t (*txid)[32], LDKu8slice script_pubkey) {
1774 LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg;
1776 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1777 jbyteArray txid_arr = (*env)->NewByteArray(env, 32);
1778 (*env)->SetByteArrayRegion(env, txid_arr, 0, 32, *txid);
1779 long script_pubkey_ref = (long)&script_pubkey;
1780 return (*env)->CallVoidMethod(env, j_calls->o, j_calls->register_tx_meth, txid_arr, script_pubkey_ref);
1782 void register_output_jcall(const void* this_arg, const LDKOutPoint *outpoint, LDKu8slice script_pubkey) {
1783 LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg;
1785 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1786 long script_pubkey_ref = (long)&script_pubkey;
1787 return (*env)->CallVoidMethod(env, j_calls->o, j_calls->register_output_meth, outpoint, script_pubkey_ref);
1789 static void LDKFilter_JCalls_free(void* this_arg) {
1790 LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg;
1791 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
1793 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1794 (*env)->DeleteGlobalRef(env, j_calls->o);
1798 static void* LDKFilter_JCalls_clone(const void* this_arg) {
1799 LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg;
1800 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
1801 return (void*) this_arg;
1803 static inline LDKFilter LDKFilter_init (JNIEnv * env, jclass _a, jobject o) {
1804 jclass c = (*env)->GetObjectClass(env, o);
1805 DO_ASSERT(c != NULL);
1806 LDKFilter_JCalls *calls = MALLOC(sizeof(LDKFilter_JCalls), "LDKFilter_JCalls");
1807 atomic_init(&calls->refcnt, 1);
1808 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
1809 calls->o = (*env)->NewGlobalRef(env, o);
1810 calls->register_tx_meth = (*env)->GetMethodID(env, c, "register_tx", "([BJ)V");
1811 DO_ASSERT(calls->register_tx_meth != NULL);
1812 calls->register_output_meth = (*env)->GetMethodID(env, c, "register_output", "(JJ)V");
1813 DO_ASSERT(calls->register_output_meth != NULL);
1816 .this_arg = (void*) calls,
1817 .register_tx = register_tx_jcall,
1818 .register_output = register_output_jcall,
1819 .free = LDKFilter_JCalls_free,
1823 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKFilter_1new (JNIEnv * env, jclass _a, jobject o) {
1824 LDKFilter *res_ptr = MALLOC(sizeof(LDKFilter), "LDKFilter");
1825 *res_ptr = LDKFilter_init(env, _a, o);
1826 return (long)res_ptr;
1828 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKFilter_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
1829 return ((LDKFilter_JCalls*)val)->o;
1831 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKFilter_1call_1register_1tx(JNIEnv * _env, jclass _b, jlong arg, jbyteArray txid, jlong script_pubkey) {
1832 LDKFilter* arg_conv = (LDKFilter*)arg;
1833 unsigned char txid_arr[32];
1834 (*_env)->GetByteArrayRegion (_env, txid, 0, 32, txid_arr);
1835 unsigned char (*txid_ref)[32] = &txid_arr;
1836 LDKu8slice script_pubkey_conv = *(LDKu8slice*)script_pubkey;
1837 return (arg_conv->register_tx)(arg_conv->this_arg, txid_ref, script_pubkey_conv);
1840 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKFilter_1call_1register_1output(JNIEnv * _env, jclass _b, jlong arg, jlong outpoint, jlong script_pubkey) {
1841 LDKFilter* arg_conv = (LDKFilter*)arg;
1842 LDKOutPoint* outpoint_conv = (LDKOutPoint*)outpoint;
1843 LDKu8slice script_pubkey_conv = *(LDKu8slice*)script_pubkey;
1844 return (arg_conv->register_output)(arg_conv->this_arg, outpoint_conv, script_pubkey_conv);
1847 typedef struct LDKBroadcasterInterface_JCalls {
1848 atomic_size_t refcnt;
1851 jmethodID broadcast_transaction_meth;
1852 } LDKBroadcasterInterface_JCalls;
1853 void broadcast_transaction_jcall(const void* this_arg, LDKTransaction tx) {
1854 LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_JCalls*) this_arg;
1856 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1857 long tx_ref = (long)&tx;
1858 return (*env)->CallVoidMethod(env, j_calls->o, j_calls->broadcast_transaction_meth, tx_ref);
1860 static void LDKBroadcasterInterface_JCalls_free(void* this_arg) {
1861 LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_JCalls*) this_arg;
1862 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
1864 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1865 (*env)->DeleteGlobalRef(env, j_calls->o);
1869 static void* LDKBroadcasterInterface_JCalls_clone(const void* this_arg) {
1870 LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_JCalls*) this_arg;
1871 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
1872 return (void*) this_arg;
1874 static inline LDKBroadcasterInterface LDKBroadcasterInterface_init (JNIEnv * env, jclass _a, jobject o) {
1875 jclass c = (*env)->GetObjectClass(env, o);
1876 DO_ASSERT(c != NULL);
1877 LDKBroadcasterInterface_JCalls *calls = MALLOC(sizeof(LDKBroadcasterInterface_JCalls), "LDKBroadcasterInterface_JCalls");
1878 atomic_init(&calls->refcnt, 1);
1879 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
1880 calls->o = (*env)->NewGlobalRef(env, o);
1881 calls->broadcast_transaction_meth = (*env)->GetMethodID(env, c, "broadcast_transaction", "(J)V");
1882 DO_ASSERT(calls->broadcast_transaction_meth != NULL);
1884 LDKBroadcasterInterface ret = {
1885 .this_arg = (void*) calls,
1886 .broadcast_transaction = broadcast_transaction_jcall,
1887 .free = LDKBroadcasterInterface_JCalls_free,
1891 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKBroadcasterInterface_1new (JNIEnv * env, jclass _a, jobject o) {
1892 LDKBroadcasterInterface *res_ptr = MALLOC(sizeof(LDKBroadcasterInterface), "LDKBroadcasterInterface");
1893 *res_ptr = LDKBroadcasterInterface_init(env, _a, o);
1894 return (long)res_ptr;
1896 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKBroadcasterInterface_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
1897 return ((LDKBroadcasterInterface_JCalls*)val)->o;
1899 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKBroadcasterInterface_1call_1broadcast_1transaction(JNIEnv * _env, jclass _b, jlong arg, jlong tx) {
1900 LDKBroadcasterInterface* arg_conv = (LDKBroadcasterInterface*)arg;
1901 LDKTransaction tx_conv = *(LDKTransaction*)tx;
1903 return (arg_conv->broadcast_transaction)(arg_conv->this_arg, tx_conv);
1906 typedef struct LDKFeeEstimator_JCalls {
1907 atomic_size_t refcnt;
1910 jmethodID get_est_sat_per_1000_weight_meth;
1911 } LDKFeeEstimator_JCalls;
1912 uint32_t get_est_sat_per_1000_weight_jcall(const void* this_arg, LDKConfirmationTarget confirmation_target) {
1913 LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) this_arg;
1915 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1916 jclass confirmation_target_conv = LDKConfirmationTarget_to_java(env, confirmation_target);
1917 return (*env)->CallIntMethod(env, j_calls->o, j_calls->get_est_sat_per_1000_weight_meth, confirmation_target_conv);
1919 static void LDKFeeEstimator_JCalls_free(void* this_arg) {
1920 LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) this_arg;
1921 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
1923 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1924 (*env)->DeleteGlobalRef(env, j_calls->o);
1928 static void* LDKFeeEstimator_JCalls_clone(const void* this_arg) {
1929 LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) this_arg;
1930 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
1931 return (void*) this_arg;
1933 static inline LDKFeeEstimator LDKFeeEstimator_init (JNIEnv * env, jclass _a, jobject o) {
1934 jclass c = (*env)->GetObjectClass(env, o);
1935 DO_ASSERT(c != NULL);
1936 LDKFeeEstimator_JCalls *calls = MALLOC(sizeof(LDKFeeEstimator_JCalls), "LDKFeeEstimator_JCalls");
1937 atomic_init(&calls->refcnt, 1);
1938 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
1939 calls->o = (*env)->NewGlobalRef(env, o);
1940 calls->get_est_sat_per_1000_weight_meth = (*env)->GetMethodID(env, c, "get_est_sat_per_1000_weight", "(Lorg/ldk/enums/LDKConfirmationTarget;)I");
1941 DO_ASSERT(calls->get_est_sat_per_1000_weight_meth != NULL);
1943 LDKFeeEstimator ret = {
1944 .this_arg = (void*) calls,
1945 .get_est_sat_per_1000_weight = get_est_sat_per_1000_weight_jcall,
1946 .free = LDKFeeEstimator_JCalls_free,
1950 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKFeeEstimator_1new (JNIEnv * env, jclass _a, jobject o) {
1951 LDKFeeEstimator *res_ptr = MALLOC(sizeof(LDKFeeEstimator), "LDKFeeEstimator");
1952 *res_ptr = LDKFeeEstimator_init(env, _a, o);
1953 return (long)res_ptr;
1955 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKFeeEstimator_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
1956 return ((LDKFeeEstimator_JCalls*)val)->o;
1958 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) {
1959 LDKFeeEstimator* arg_conv = (LDKFeeEstimator*)arg;
1960 LDKConfirmationTarget confirmation_target_conv = LDKConfirmationTarget_from_java(_env, confirmation_target);
1961 return (arg_conv->get_est_sat_per_1000_weight)(arg_conv->this_arg, confirmation_target_conv);
1964 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChainMonitor_1optional_1none (JNIEnv * env, jclass _a) {
1965 LDKChainMonitor *ret = MALLOC(sizeof(LDKChainMonitor), "LDKChainMonitor");
1969 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1C2TupleTempl_1usize_1_1Transaction_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
1970 LDKCVecTempl_C2TupleTempl_usize__Transaction *vec = (LDKCVecTempl_C2TupleTempl_usize__Transaction*)ptr;
1971 return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKC2TupleTempl_usize__Transaction));
1973 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKHTLCUpdate_1optional_1none (JNIEnv * env, jclass _a) {
1974 LDKHTLCUpdate *ret = MALLOC(sizeof(LDKHTLCUpdate), "LDKHTLCUpdate");
1978 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1Transaction_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
1979 LDKCVecTempl_Transaction *vec = (LDKCVecTempl_Transaction*)ptr;
1980 return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKTransaction));
1982 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1C2TupleTempl_1ThirtyTwoBytes_1_1CVecTempl_1TxOut_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
1983 LDKCVecTempl_C2TupleTempl_ThirtyTwoBytes__CVecTempl_TxOut *vec = (LDKCVecTempl_C2TupleTempl_ThirtyTwoBytes__CVecTempl_TxOut*)ptr;
1984 return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKC2TupleTempl_ThirtyTwoBytes__CVecTempl_TxOut));
1986 typedef struct LDKKeysInterface_JCalls {
1987 atomic_size_t refcnt;
1990 jmethodID get_node_secret_meth;
1991 jmethodID get_destination_script_meth;
1992 jmethodID get_shutdown_pubkey_meth;
1993 jmethodID get_channel_keys_meth;
1994 jmethodID get_secure_random_bytes_meth;
1995 } LDKKeysInterface_JCalls;
1996 LDKSecretKey get_node_secret_jcall(const void* this_arg) {
1997 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
1999 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2000 LDKSecretKey* ret = (LDKSecretKey*)(*env)->CallLongMethod(env, j_calls->o, j_calls->get_node_secret_meth);
2001 LDKSecretKey res = *ret;
2005 LDKCVec_u8Z get_destination_script_jcall(const void* this_arg) {
2006 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
2008 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2009 LDKCVec_u8Z* ret = (LDKCVec_u8Z*)(*env)->CallLongMethod(env, j_calls->o, j_calls->get_destination_script_meth);
2010 LDKCVec_u8Z res = *ret;
2014 LDKPublicKey get_shutdown_pubkey_jcall(const void* this_arg) {
2015 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
2017 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2018 LDKPublicKey* ret = (LDKPublicKey*)(*env)->CallLongMethod(env, j_calls->o, j_calls->get_shutdown_pubkey_meth);
2019 LDKPublicKey res = *ret;
2023 LDKChannelKeys get_channel_keys_jcall(const void* this_arg, bool inbound, uint64_t channel_value_satoshis) {
2024 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
2026 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2027 LDKChannelKeys* ret = (LDKChannelKeys*)(*env)->CallLongMethod(env, j_calls->o, j_calls->get_channel_keys_meth, inbound, channel_value_satoshis);
2028 LDKChannelKeys res = *ret;
2032 LDKThirtyTwoBytes get_secure_random_bytes_jcall(const void* this_arg) {
2033 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
2035 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2036 jbyteArray jret = (*env)->CallObjectMethod(env, j_calls->o, j_calls->get_secure_random_bytes_meth);
2037 LDKThirtyTwoBytes ret;
2038 (*env)->GetByteArrayRegion(env, jret, 0, 32, ret.data);
2041 static void LDKKeysInterface_JCalls_free(void* this_arg) {
2042 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
2043 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
2045 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2046 (*env)->DeleteGlobalRef(env, j_calls->o);
2050 static void* LDKKeysInterface_JCalls_clone(const void* this_arg) {
2051 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
2052 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
2053 return (void*) this_arg;
2055 static inline LDKKeysInterface LDKKeysInterface_init (JNIEnv * env, jclass _a, jobject o) {
2056 jclass c = (*env)->GetObjectClass(env, o);
2057 DO_ASSERT(c != NULL);
2058 LDKKeysInterface_JCalls *calls = MALLOC(sizeof(LDKKeysInterface_JCalls), "LDKKeysInterface_JCalls");
2059 atomic_init(&calls->refcnt, 1);
2060 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
2061 calls->o = (*env)->NewGlobalRef(env, o);
2062 calls->get_node_secret_meth = (*env)->GetMethodID(env, c, "get_node_secret", "()J");
2063 DO_ASSERT(calls->get_node_secret_meth != NULL);
2064 calls->get_destination_script_meth = (*env)->GetMethodID(env, c, "get_destination_script", "()J");
2065 DO_ASSERT(calls->get_destination_script_meth != NULL);
2066 calls->get_shutdown_pubkey_meth = (*env)->GetMethodID(env, c, "get_shutdown_pubkey", "()J");
2067 DO_ASSERT(calls->get_shutdown_pubkey_meth != NULL);
2068 calls->get_channel_keys_meth = (*env)->GetMethodID(env, c, "get_channel_keys", "(ZJ)J");
2069 DO_ASSERT(calls->get_channel_keys_meth != NULL);
2070 calls->get_secure_random_bytes_meth = (*env)->GetMethodID(env, c, "get_secure_random_bytes", "()[B");
2071 DO_ASSERT(calls->get_secure_random_bytes_meth != NULL);
2073 LDKKeysInterface ret = {
2074 .this_arg = (void*) calls,
2075 .get_node_secret = get_node_secret_jcall,
2076 .get_destination_script = get_destination_script_jcall,
2077 .get_shutdown_pubkey = get_shutdown_pubkey_jcall,
2078 .get_channel_keys = get_channel_keys_jcall,
2079 .get_secure_random_bytes = get_secure_random_bytes_jcall,
2080 .free = LDKKeysInterface_JCalls_free,
2084 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKKeysInterface_1new (JNIEnv * env, jclass _a, jobject o) {
2085 LDKKeysInterface *res_ptr = MALLOC(sizeof(LDKKeysInterface), "LDKKeysInterface");
2086 *res_ptr = LDKKeysInterface_init(env, _a, o);
2087 return (long)res_ptr;
2089 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKKeysInterface_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
2090 return ((LDKKeysInterface_JCalls*)val)->o;
2092 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKKeysInterface_1call_1get_1node_1secret(JNIEnv * _env, jclass _b, jlong arg) {
2093 LDKKeysInterface* arg_conv = (LDKKeysInterface*)arg;
2094 LDKSecretKey* ret = MALLOC(sizeof(LDKSecretKey), "LDKSecretKey");
2095 *ret = (arg_conv->get_node_secret)(arg_conv->this_arg);
2099 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKKeysInterface_1call_1get_1destination_1script(JNIEnv * _env, jclass _b, jlong arg) {
2100 LDKKeysInterface* arg_conv = (LDKKeysInterface*)arg;
2101 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
2102 *ret = (arg_conv->get_destination_script)(arg_conv->this_arg);
2106 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKKeysInterface_1call_1get_1shutdown_1pubkey(JNIEnv * _env, jclass _b, jlong arg) {
2107 LDKKeysInterface* arg_conv = (LDKKeysInterface*)arg;
2108 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
2109 *ret = (arg_conv->get_shutdown_pubkey)(arg_conv->this_arg);
2113 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) {
2114 LDKKeysInterface* arg_conv = (LDKKeysInterface*)arg;
2115 LDKChannelKeys* ret = MALLOC(sizeof(LDKChannelKeys), "LDKChannelKeys");
2116 *ret = (arg_conv->get_channel_keys)(arg_conv->this_arg, inbound, channel_value_satoshis);
2120 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_LDKKeysInterface_1call_1get_1secure_1random_1bytes(JNIEnv * _env, jclass _b, jlong arg) {
2121 LDKKeysInterface* arg_conv = (LDKKeysInterface*)arg;
2122 jbyteArray _arr = (*_env)->NewByteArray(_env, 32);
2123 (*_env)->SetByteArrayRegion(_env, _arr, 0, 32, (arg_conv->get_secure_random_bytes)(arg_conv->this_arg).data);
2127 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKInMemoryChannelKeys_1optional_1none (JNIEnv * env, jclass _a) {
2128 LDKInMemoryChannelKeys *ret = MALLOC(sizeof(LDKInMemoryChannelKeys), "LDKInMemoryChannelKeys");
2132 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKKeysManager_1optional_1none (JNIEnv * env, jclass _a) {
2133 LDKKeysManager *ret = MALLOC(sizeof(LDKKeysManager), "LDKKeysManager");
2137 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelManager_1optional_1none (JNIEnv * env, jclass _a) {
2138 LDKChannelManager *ret = MALLOC(sizeof(LDKChannelManager), "LDKChannelManager");
2142 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelDetails_1optional_1none (JNIEnv * env, jclass _a) {
2143 LDKChannelDetails *ret = MALLOC(sizeof(LDKChannelDetails), "LDKChannelDetails");
2147 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKInitFeatures_1optional_1none (JNIEnv * env, jclass _a) {
2148 LDKInitFeatures *ret = MALLOC(sizeof(LDKInitFeatures), "LDKInitFeatures");
2152 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1ChannelDetails_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
2153 LDKCVecTempl_ChannelDetails *vec = (LDKCVecTempl_ChannelDetails*)ptr;
2154 return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKChannelDetails));
2156 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKRoute_1optional_1none (JNIEnv * env, jclass _a) {
2157 LDKRoute *ret = MALLOC(sizeof(LDKRoute), "LDKRoute");
2161 static jclass LDKNetAddress_IPv4_class = NULL;
2162 static jmethodID LDKNetAddress_IPv4_meth = NULL;
2163 static jclass LDKNetAddress_IPv6_class = NULL;
2164 static jmethodID LDKNetAddress_IPv6_meth = NULL;
2165 static jclass LDKNetAddress_OnionV2_class = NULL;
2166 static jmethodID LDKNetAddress_OnionV2_meth = NULL;
2167 static jclass LDKNetAddress_OnionV3_class = NULL;
2168 static jmethodID LDKNetAddress_OnionV3_meth = NULL;
2169 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKNetAddress_init (JNIEnv * env, jclass _a) {
2170 LDKNetAddress_IPv4_class =
2171 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKNetAddress$IPv4;"));
2172 DO_ASSERT(LDKNetAddress_IPv4_class != NULL);
2173 LDKNetAddress_IPv4_meth = (*env)->GetMethodID(env, LDKNetAddress_IPv4_class, "<init>", "(JS)V");
2174 DO_ASSERT(LDKNetAddress_IPv4_meth != NULL);
2175 LDKNetAddress_IPv6_class =
2176 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKNetAddress$IPv6;"));
2177 DO_ASSERT(LDKNetAddress_IPv6_class != NULL);
2178 LDKNetAddress_IPv6_meth = (*env)->GetMethodID(env, LDKNetAddress_IPv6_class, "<init>", "(JS)V");
2179 DO_ASSERT(LDKNetAddress_IPv6_meth != NULL);
2180 LDKNetAddress_OnionV2_class =
2181 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKNetAddress$OnionV2;"));
2182 DO_ASSERT(LDKNetAddress_OnionV2_class != NULL);
2183 LDKNetAddress_OnionV2_meth = (*env)->GetMethodID(env, LDKNetAddress_OnionV2_class, "<init>", "(JS)V");
2184 DO_ASSERT(LDKNetAddress_OnionV2_meth != NULL);
2185 LDKNetAddress_OnionV3_class =
2186 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKNetAddress$OnionV3;"));
2187 DO_ASSERT(LDKNetAddress_OnionV3_class != NULL);
2188 LDKNetAddress_OnionV3_meth = (*env)->GetMethodID(env, LDKNetAddress_OnionV3_class, "<init>", "([BSBS)V");
2189 DO_ASSERT(LDKNetAddress_OnionV3_meth != NULL);
2191 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKNetAddress_1ref_1from_1ptr (JNIEnv * env, jclass _c, jlong ptr) {
2192 LDKNetAddress *obj = (LDKNetAddress*)ptr;
2194 case LDKNetAddress_IPv4: {
2195 long addr_ref = (long)&obj->i_pv4.addr;
2196 return (*env)->NewObject(env, LDKNetAddress_IPv4_class, LDKNetAddress_IPv4_meth, addr_ref, obj->i_pv4.port);
2198 case LDKNetAddress_IPv6: {
2199 long addr_ref = (long)&obj->i_pv6.addr;
2200 return (*env)->NewObject(env, LDKNetAddress_IPv6_class, LDKNetAddress_IPv6_meth, addr_ref, obj->i_pv6.port);
2202 case LDKNetAddress_OnionV2: {
2203 long addr_ref = (long)&obj->onion_v2.addr;
2204 return (*env)->NewObject(env, LDKNetAddress_OnionV2_class, LDKNetAddress_OnionV2_meth, addr_ref, obj->onion_v2.port);
2206 case LDKNetAddress_OnionV3: {
2207 jbyteArray ed25519_pubkey_arr = (*env)->NewByteArray(env, 32);
2208 (*env)->SetByteArrayRegion(env, ed25519_pubkey_arr, 0, 32, obj->onion_v3.ed25519_pubkey.data);
2209 return (*env)->NewObject(env, LDKNetAddress_OnionV3_class, LDKNetAddress_OnionV3_meth, ed25519_pubkey_arr, obj->onion_v3.checksum, obj->onion_v3.version, obj->onion_v3.port);
2214 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1NetAddress_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
2215 LDKCVecTempl_NetAddress *vec = (LDKCVecTempl_NetAddress*)ptr;
2216 return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKNetAddress));
2218 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKUpdateAddHTLC_1optional_1none (JNIEnv * env, jclass _a) {
2219 LDKUpdateAddHTLC *ret = MALLOC(sizeof(LDKUpdateAddHTLC), "LDKUpdateAddHTLC");
2223 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKUpdateFulfillHTLC_1optional_1none (JNIEnv * env, jclass _a) {
2224 LDKUpdateFulfillHTLC *ret = MALLOC(sizeof(LDKUpdateFulfillHTLC), "LDKUpdateFulfillHTLC");
2228 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKUpdateFailHTLC_1optional_1none (JNIEnv * env, jclass _a) {
2229 LDKUpdateFailHTLC *ret = MALLOC(sizeof(LDKUpdateFailHTLC), "LDKUpdateFailHTLC");
2233 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKUpdateFailMalformedHTLC_1optional_1none (JNIEnv * env, jclass _a) {
2234 LDKUpdateFailMalformedHTLC *ret = MALLOC(sizeof(LDKUpdateFailMalformedHTLC), "LDKUpdateFailMalformedHTLC");
2238 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCommitmentSigned_1optional_1none (JNIEnv * env, jclass _a) {
2239 LDKCommitmentSigned *ret = MALLOC(sizeof(LDKCommitmentSigned), "LDKCommitmentSigned");
2243 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKUpdateFee_1optional_1none (JNIEnv * env, jclass _a) {
2244 LDKUpdateFee *ret = MALLOC(sizeof(LDKUpdateFee), "LDKUpdateFee");
2248 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKInit_1optional_1none (JNIEnv * env, jclass _a) {
2249 LDKInit *ret = MALLOC(sizeof(LDKInit), "LDKInit");
2253 typedef struct LDKChannelMessageHandler_JCalls {
2254 atomic_size_t refcnt;
2257 LDKMessageSendEventsProvider_JCalls* MessageSendEventsProvider;
2258 jmethodID handle_open_channel_meth;
2259 jmethodID handle_accept_channel_meth;
2260 jmethodID handle_funding_created_meth;
2261 jmethodID handle_funding_signed_meth;
2262 jmethodID handle_funding_locked_meth;
2263 jmethodID handle_shutdown_meth;
2264 jmethodID handle_closing_signed_meth;
2265 jmethodID handle_update_add_htlc_meth;
2266 jmethodID handle_update_fulfill_htlc_meth;
2267 jmethodID handle_update_fail_htlc_meth;
2268 jmethodID handle_update_fail_malformed_htlc_meth;
2269 jmethodID handle_commitment_signed_meth;
2270 jmethodID handle_revoke_and_ack_meth;
2271 jmethodID handle_update_fee_meth;
2272 jmethodID handle_announcement_signatures_meth;
2273 jmethodID peer_disconnected_meth;
2274 jmethodID peer_connected_meth;
2275 jmethodID handle_channel_reestablish_meth;
2276 jmethodID handle_error_meth;
2277 } LDKChannelMessageHandler_JCalls;
2278 void handle_open_channel_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKInitFeatures their_features, const LDKOpenChannel *msg) {
2279 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
2281 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2282 long their_node_id_ref = (long)&their_node_id;
2283 long their_features_ref = (long)&their_features;
2284 return (*env)->CallVoidMethod(env, j_calls->o, j_calls->handle_open_channel_meth, their_node_id_ref, their_features_ref, msg);
2286 void handle_accept_channel_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKInitFeatures their_features, const LDKAcceptChannel *msg) {
2287 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
2289 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2290 long their_node_id_ref = (long)&their_node_id;
2291 long their_features_ref = (long)&their_features;
2292 return (*env)->CallVoidMethod(env, j_calls->o, j_calls->handle_accept_channel_meth, their_node_id_ref, their_features_ref, msg);
2294 void handle_funding_created_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingCreated *msg) {
2295 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
2297 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2298 long their_node_id_ref = (long)&their_node_id;
2299 return (*env)->CallVoidMethod(env, j_calls->o, j_calls->handle_funding_created_meth, their_node_id_ref, msg);
2301 void handle_funding_signed_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingSigned *msg) {
2302 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
2304 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2305 long their_node_id_ref = (long)&their_node_id;
2306 return (*env)->CallVoidMethod(env, j_calls->o, j_calls->handle_funding_signed_meth, their_node_id_ref, msg);
2308 void handle_funding_locked_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingLocked *msg) {
2309 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
2311 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2312 long their_node_id_ref = (long)&their_node_id;
2313 return (*env)->CallVoidMethod(env, j_calls->o, j_calls->handle_funding_locked_meth, their_node_id_ref, msg);
2315 void handle_shutdown_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKShutdown *msg) {
2316 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
2318 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2319 long their_node_id_ref = (long)&their_node_id;
2320 return (*env)->CallVoidMethod(env, j_calls->o, j_calls->handle_shutdown_meth, their_node_id_ref, msg);
2322 void handle_closing_signed_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKClosingSigned *msg) {
2323 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
2325 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2326 long their_node_id_ref = (long)&their_node_id;
2327 return (*env)->CallVoidMethod(env, j_calls->o, j_calls->handle_closing_signed_meth, their_node_id_ref, msg);
2329 void handle_update_add_htlc_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateAddHTLC *msg) {
2330 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
2332 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2333 long their_node_id_ref = (long)&their_node_id;
2334 return (*env)->CallVoidMethod(env, j_calls->o, j_calls->handle_update_add_htlc_meth, their_node_id_ref, msg);
2336 void handle_update_fulfill_htlc_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFulfillHTLC *msg) {
2337 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
2339 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2340 long their_node_id_ref = (long)&their_node_id;
2341 return (*env)->CallVoidMethod(env, j_calls->o, j_calls->handle_update_fulfill_htlc_meth, their_node_id_ref, msg);
2343 void handle_update_fail_htlc_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFailHTLC *msg) {
2344 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
2346 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2347 long their_node_id_ref = (long)&their_node_id;
2348 return (*env)->CallVoidMethod(env, j_calls->o, j_calls->handle_update_fail_htlc_meth, their_node_id_ref, msg);
2350 void handle_update_fail_malformed_htlc_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFailMalformedHTLC *msg) {
2351 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
2353 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2354 long their_node_id_ref = (long)&their_node_id;
2355 return (*env)->CallVoidMethod(env, j_calls->o, j_calls->handle_update_fail_malformed_htlc_meth, their_node_id_ref, msg);
2357 void handle_commitment_signed_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKCommitmentSigned *msg) {
2358 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
2360 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2361 long their_node_id_ref = (long)&their_node_id;
2362 return (*env)->CallVoidMethod(env, j_calls->o, j_calls->handle_commitment_signed_meth, their_node_id_ref, msg);
2364 void handle_revoke_and_ack_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKRevokeAndACK *msg) {
2365 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
2367 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2368 long their_node_id_ref = (long)&their_node_id;
2369 return (*env)->CallVoidMethod(env, j_calls->o, j_calls->handle_revoke_and_ack_meth, their_node_id_ref, msg);
2371 void handle_update_fee_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFee *msg) {
2372 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
2374 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2375 long their_node_id_ref = (long)&their_node_id;
2376 return (*env)->CallVoidMethod(env, j_calls->o, j_calls->handle_update_fee_meth, their_node_id_ref, msg);
2378 void handle_announcement_signatures_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKAnnouncementSignatures *msg) {
2379 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
2381 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2382 long their_node_id_ref = (long)&their_node_id;
2383 return (*env)->CallVoidMethod(env, j_calls->o, j_calls->handle_announcement_signatures_meth, their_node_id_ref, msg);
2385 void peer_disconnected_jcall(const void* this_arg, LDKPublicKey their_node_id, bool no_connection_possible) {
2386 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
2388 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2389 long their_node_id_ref = (long)&their_node_id;
2390 return (*env)->CallVoidMethod(env, j_calls->o, j_calls->peer_disconnected_meth, their_node_id_ref, no_connection_possible);
2392 void peer_connected_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit *msg) {
2393 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
2395 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2396 long their_node_id_ref = (long)&their_node_id;
2397 return (*env)->CallVoidMethod(env, j_calls->o, j_calls->peer_connected_meth, their_node_id_ref, msg);
2399 void handle_channel_reestablish_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKChannelReestablish *msg) {
2400 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
2402 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2403 long their_node_id_ref = (long)&their_node_id;
2404 return (*env)->CallVoidMethod(env, j_calls->o, j_calls->handle_channel_reestablish_meth, their_node_id_ref, msg);
2406 void handle_error_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKErrorMessage *msg) {
2407 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
2409 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2410 long their_node_id_ref = (long)&their_node_id;
2411 return (*env)->CallVoidMethod(env, j_calls->o, j_calls->handle_error_meth, their_node_id_ref, msg);
2413 static void LDKChannelMessageHandler_JCalls_free(void* this_arg) {
2414 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
2415 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
2417 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2418 (*env)->DeleteGlobalRef(env, j_calls->o);
2422 static void* LDKChannelMessageHandler_JCalls_clone(const void* this_arg) {
2423 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
2424 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
2425 atomic_fetch_add_explicit(&j_calls->MessageSendEventsProvider->refcnt, 1, memory_order_release);
2426 return (void*) this_arg;
2428 static inline LDKChannelMessageHandler LDKChannelMessageHandler_init (JNIEnv * env, jclass _a, jobject o, jobject MessageSendEventsProvider) {
2429 jclass c = (*env)->GetObjectClass(env, o);
2430 DO_ASSERT(c != NULL);
2431 LDKChannelMessageHandler_JCalls *calls = MALLOC(sizeof(LDKChannelMessageHandler_JCalls), "LDKChannelMessageHandler_JCalls");
2432 atomic_init(&calls->refcnt, 1);
2433 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
2434 calls->o = (*env)->NewGlobalRef(env, o);
2435 calls->handle_open_channel_meth = (*env)->GetMethodID(env, c, "handle_open_channel", "(JJJ)V");
2436 DO_ASSERT(calls->handle_open_channel_meth != NULL);
2437 calls->handle_accept_channel_meth = (*env)->GetMethodID(env, c, "handle_accept_channel", "(JJJ)V");
2438 DO_ASSERT(calls->handle_accept_channel_meth != NULL);
2439 calls->handle_funding_created_meth = (*env)->GetMethodID(env, c, "handle_funding_created", "(JJ)V");
2440 DO_ASSERT(calls->handle_funding_created_meth != NULL);
2441 calls->handle_funding_signed_meth = (*env)->GetMethodID(env, c, "handle_funding_signed", "(JJ)V");
2442 DO_ASSERT(calls->handle_funding_signed_meth != NULL);
2443 calls->handle_funding_locked_meth = (*env)->GetMethodID(env, c, "handle_funding_locked", "(JJ)V");
2444 DO_ASSERT(calls->handle_funding_locked_meth != NULL);
2445 calls->handle_shutdown_meth = (*env)->GetMethodID(env, c, "handle_shutdown", "(JJ)V");
2446 DO_ASSERT(calls->handle_shutdown_meth != NULL);
2447 calls->handle_closing_signed_meth = (*env)->GetMethodID(env, c, "handle_closing_signed", "(JJ)V");
2448 DO_ASSERT(calls->handle_closing_signed_meth != NULL);
2449 calls->handle_update_add_htlc_meth = (*env)->GetMethodID(env, c, "handle_update_add_htlc", "(JJ)V");
2450 DO_ASSERT(calls->handle_update_add_htlc_meth != NULL);
2451 calls->handle_update_fulfill_htlc_meth = (*env)->GetMethodID(env, c, "handle_update_fulfill_htlc", "(JJ)V");
2452 DO_ASSERT(calls->handle_update_fulfill_htlc_meth != NULL);
2453 calls->handle_update_fail_htlc_meth = (*env)->GetMethodID(env, c, "handle_update_fail_htlc", "(JJ)V");
2454 DO_ASSERT(calls->handle_update_fail_htlc_meth != NULL);
2455 calls->handle_update_fail_malformed_htlc_meth = (*env)->GetMethodID(env, c, "handle_update_fail_malformed_htlc", "(JJ)V");
2456 DO_ASSERT(calls->handle_update_fail_malformed_htlc_meth != NULL);
2457 calls->handle_commitment_signed_meth = (*env)->GetMethodID(env, c, "handle_commitment_signed", "(JJ)V");
2458 DO_ASSERT(calls->handle_commitment_signed_meth != NULL);
2459 calls->handle_revoke_and_ack_meth = (*env)->GetMethodID(env, c, "handle_revoke_and_ack", "(JJ)V");
2460 DO_ASSERT(calls->handle_revoke_and_ack_meth != NULL);
2461 calls->handle_update_fee_meth = (*env)->GetMethodID(env, c, "handle_update_fee", "(JJ)V");
2462 DO_ASSERT(calls->handle_update_fee_meth != NULL);
2463 calls->handle_announcement_signatures_meth = (*env)->GetMethodID(env, c, "handle_announcement_signatures", "(JJ)V");
2464 DO_ASSERT(calls->handle_announcement_signatures_meth != NULL);
2465 calls->peer_disconnected_meth = (*env)->GetMethodID(env, c, "peer_disconnected", "(JZ)V");
2466 DO_ASSERT(calls->peer_disconnected_meth != NULL);
2467 calls->peer_connected_meth = (*env)->GetMethodID(env, c, "peer_connected", "(JJ)V");
2468 DO_ASSERT(calls->peer_connected_meth != NULL);
2469 calls->handle_channel_reestablish_meth = (*env)->GetMethodID(env, c, "handle_channel_reestablish", "(JJ)V");
2470 DO_ASSERT(calls->handle_channel_reestablish_meth != NULL);
2471 calls->handle_error_meth = (*env)->GetMethodID(env, c, "handle_error", "(JJ)V");
2472 DO_ASSERT(calls->handle_error_meth != NULL);
2474 LDKChannelMessageHandler ret = {
2475 .this_arg = (void*) calls,
2476 .handle_open_channel = handle_open_channel_jcall,
2477 .handle_accept_channel = handle_accept_channel_jcall,
2478 .handle_funding_created = handle_funding_created_jcall,
2479 .handle_funding_signed = handle_funding_signed_jcall,
2480 .handle_funding_locked = handle_funding_locked_jcall,
2481 .handle_shutdown = handle_shutdown_jcall,
2482 .handle_closing_signed = handle_closing_signed_jcall,
2483 .handle_update_add_htlc = handle_update_add_htlc_jcall,
2484 .handle_update_fulfill_htlc = handle_update_fulfill_htlc_jcall,
2485 .handle_update_fail_htlc = handle_update_fail_htlc_jcall,
2486 .handle_update_fail_malformed_htlc = handle_update_fail_malformed_htlc_jcall,
2487 .handle_commitment_signed = handle_commitment_signed_jcall,
2488 .handle_revoke_and_ack = handle_revoke_and_ack_jcall,
2489 .handle_update_fee = handle_update_fee_jcall,
2490 .handle_announcement_signatures = handle_announcement_signatures_jcall,
2491 .peer_disconnected = peer_disconnected_jcall,
2492 .peer_connected = peer_connected_jcall,
2493 .handle_channel_reestablish = handle_channel_reestablish_jcall,
2494 .handle_error = handle_error_jcall,
2495 .free = LDKChannelMessageHandler_JCalls_free,
2496 .MessageSendEventsProvider = LDKMessageSendEventsProvider_init(env, _a, MessageSendEventsProvider),
2498 calls->MessageSendEventsProvider = ret.MessageSendEventsProvider.this_arg;
2501 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1new (JNIEnv * env, jclass _a, jobject o, jobject MessageSendEventsProvider) {
2502 LDKChannelMessageHandler *res_ptr = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler");
2503 *res_ptr = LDKChannelMessageHandler_init(env, _a, o, MessageSendEventsProvider);
2504 return (long)res_ptr;
2506 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
2507 return ((LDKChannelMessageHandler_JCalls*)val)->o;
2509 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) {
2510 LDKChannelMessageHandler* arg_conv = (LDKChannelMessageHandler*)arg;
2511 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
2512 FREE((void*)their_node_id);
2513 LDKInitFeatures their_features_conv = *(LDKInitFeatures*)their_features;
2514 FREE((void*)their_features);
2515 their_features_conv.is_owned = true;
2516 LDKOpenChannel* msg_conv = (LDKOpenChannel*)msg;
2517 return (arg_conv->handle_open_channel)(arg_conv->this_arg, their_node_id_conv, their_features_conv, msg_conv);
2520 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) {
2521 LDKChannelMessageHandler* arg_conv = (LDKChannelMessageHandler*)arg;
2522 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
2523 FREE((void*)their_node_id);
2524 LDKInitFeatures their_features_conv = *(LDKInitFeatures*)their_features;
2525 FREE((void*)their_features);
2526 their_features_conv.is_owned = true;
2527 LDKAcceptChannel* msg_conv = (LDKAcceptChannel*)msg;
2528 return (arg_conv->handle_accept_channel)(arg_conv->this_arg, their_node_id_conv, their_features_conv, msg_conv);
2531 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) {
2532 LDKChannelMessageHandler* arg_conv = (LDKChannelMessageHandler*)arg;
2533 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
2534 FREE((void*)their_node_id);
2535 LDKFundingCreated* msg_conv = (LDKFundingCreated*)msg;
2536 return (arg_conv->handle_funding_created)(arg_conv->this_arg, their_node_id_conv, msg_conv);
2539 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) {
2540 LDKChannelMessageHandler* arg_conv = (LDKChannelMessageHandler*)arg;
2541 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
2542 FREE((void*)their_node_id);
2543 LDKFundingSigned* msg_conv = (LDKFundingSigned*)msg;
2544 return (arg_conv->handle_funding_signed)(arg_conv->this_arg, their_node_id_conv, msg_conv);
2547 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) {
2548 LDKChannelMessageHandler* arg_conv = (LDKChannelMessageHandler*)arg;
2549 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
2550 FREE((void*)their_node_id);
2551 LDKFundingLocked* msg_conv = (LDKFundingLocked*)msg;
2552 return (arg_conv->handle_funding_locked)(arg_conv->this_arg, their_node_id_conv, msg_conv);
2555 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1call_1handle_1shutdown(JNIEnv * _env, jclass _b, jlong arg, jlong their_node_id, jlong msg) {
2556 LDKChannelMessageHandler* arg_conv = (LDKChannelMessageHandler*)arg;
2557 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
2558 FREE((void*)their_node_id);
2559 LDKShutdown* msg_conv = (LDKShutdown*)msg;
2560 return (arg_conv->handle_shutdown)(arg_conv->this_arg, their_node_id_conv, msg_conv);
2563 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) {
2564 LDKChannelMessageHandler* arg_conv = (LDKChannelMessageHandler*)arg;
2565 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
2566 FREE((void*)their_node_id);
2567 LDKClosingSigned* msg_conv = (LDKClosingSigned*)msg;
2568 return (arg_conv->handle_closing_signed)(arg_conv->this_arg, their_node_id_conv, msg_conv);
2571 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) {
2572 LDKChannelMessageHandler* arg_conv = (LDKChannelMessageHandler*)arg;
2573 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
2574 FREE((void*)their_node_id);
2575 LDKUpdateAddHTLC* msg_conv = (LDKUpdateAddHTLC*)msg;
2576 return (arg_conv->handle_update_add_htlc)(arg_conv->this_arg, their_node_id_conv, msg_conv);
2579 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) {
2580 LDKChannelMessageHandler* arg_conv = (LDKChannelMessageHandler*)arg;
2581 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
2582 FREE((void*)their_node_id);
2583 LDKUpdateFulfillHTLC* msg_conv = (LDKUpdateFulfillHTLC*)msg;
2584 return (arg_conv->handle_update_fulfill_htlc)(arg_conv->this_arg, their_node_id_conv, msg_conv);
2587 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) {
2588 LDKChannelMessageHandler* arg_conv = (LDKChannelMessageHandler*)arg;
2589 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
2590 FREE((void*)their_node_id);
2591 LDKUpdateFailHTLC* msg_conv = (LDKUpdateFailHTLC*)msg;
2592 return (arg_conv->handle_update_fail_htlc)(arg_conv->this_arg, their_node_id_conv, msg_conv);
2595 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) {
2596 LDKChannelMessageHandler* arg_conv = (LDKChannelMessageHandler*)arg;
2597 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
2598 FREE((void*)their_node_id);
2599 LDKUpdateFailMalformedHTLC* msg_conv = (LDKUpdateFailMalformedHTLC*)msg;
2600 return (arg_conv->handle_update_fail_malformed_htlc)(arg_conv->this_arg, their_node_id_conv, msg_conv);
2603 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) {
2604 LDKChannelMessageHandler* arg_conv = (LDKChannelMessageHandler*)arg;
2605 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
2606 FREE((void*)their_node_id);
2607 LDKCommitmentSigned* msg_conv = (LDKCommitmentSigned*)msg;
2608 return (arg_conv->handle_commitment_signed)(arg_conv->this_arg, their_node_id_conv, msg_conv);
2611 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) {
2612 LDKChannelMessageHandler* arg_conv = (LDKChannelMessageHandler*)arg;
2613 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
2614 FREE((void*)their_node_id);
2615 LDKRevokeAndACK* msg_conv = (LDKRevokeAndACK*)msg;
2616 return (arg_conv->handle_revoke_and_ack)(arg_conv->this_arg, their_node_id_conv, msg_conv);
2619 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) {
2620 LDKChannelMessageHandler* arg_conv = (LDKChannelMessageHandler*)arg;
2621 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
2622 FREE((void*)their_node_id);
2623 LDKUpdateFee* msg_conv = (LDKUpdateFee*)msg;
2624 return (arg_conv->handle_update_fee)(arg_conv->this_arg, their_node_id_conv, msg_conv);
2627 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) {
2628 LDKChannelMessageHandler* arg_conv = (LDKChannelMessageHandler*)arg;
2629 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
2630 FREE((void*)their_node_id);
2631 LDKAnnouncementSignatures* msg_conv = (LDKAnnouncementSignatures*)msg;
2632 return (arg_conv->handle_announcement_signatures)(arg_conv->this_arg, their_node_id_conv, msg_conv);
2635 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) {
2636 LDKChannelMessageHandler* arg_conv = (LDKChannelMessageHandler*)arg;
2637 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
2638 FREE((void*)their_node_id);
2639 return (arg_conv->peer_disconnected)(arg_conv->this_arg, their_node_id_conv, no_connection_possible);
2642 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1call_1peer_1connected(JNIEnv * _env, jclass _b, jlong arg, jlong their_node_id, jlong msg) {
2643 LDKChannelMessageHandler* arg_conv = (LDKChannelMessageHandler*)arg;
2644 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
2645 FREE((void*)their_node_id);
2646 LDKInit* msg_conv = (LDKInit*)msg;
2647 return (arg_conv->peer_connected)(arg_conv->this_arg, their_node_id_conv, msg_conv);
2650 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) {
2651 LDKChannelMessageHandler* arg_conv = (LDKChannelMessageHandler*)arg;
2652 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
2653 FREE((void*)their_node_id);
2654 LDKChannelReestablish* msg_conv = (LDKChannelReestablish*)msg;
2655 return (arg_conv->handle_channel_reestablish)(arg_conv->this_arg, their_node_id_conv, msg_conv);
2658 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1call_1handle_1error(JNIEnv * _env, jclass _b, jlong arg, jlong their_node_id, jlong msg) {
2659 LDKChannelMessageHandler* arg_conv = (LDKChannelMessageHandler*)arg;
2660 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
2661 FREE((void*)their_node_id);
2662 LDKErrorMessage* msg_conv = (LDKErrorMessage*)msg;
2663 return (arg_conv->handle_error)(arg_conv->this_arg, their_node_id_conv, msg_conv);
2666 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelManagerReadArgs_1optional_1none (JNIEnv * env, jclass _a) {
2667 LDKChannelManagerReadArgs *ret = MALLOC(sizeof(LDKChannelManagerReadArgs), "LDKChannelManagerReadArgs");
2671 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1ChannelMonitor_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
2672 LDKCVecTempl_ChannelMonitor *vec = (LDKCVecTempl_ChannelMonitor*)ptr;
2673 return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKChannelMonitor));
2675 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKDecodeError_1optional_1none (JNIEnv * env, jclass _a) {
2676 LDKDecodeError *ret = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
2680 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKPing_1optional_1none (JNIEnv * env, jclass _a) {
2681 LDKPing *ret = MALLOC(sizeof(LDKPing), "LDKPing");
2685 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKPong_1optional_1none (JNIEnv * env, jclass _a) {
2686 LDKPong *ret = MALLOC(sizeof(LDKPong), "LDKPong");
2690 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKDataLossProtect_1optional_1none (JNIEnv * env, jclass _a) {
2691 LDKDataLossProtect *ret = MALLOC(sizeof(LDKDataLossProtect), "LDKDataLossProtect");
2695 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKUnsignedNodeAnnouncement_1optional_1none (JNIEnv * env, jclass _a) {
2696 LDKUnsignedNodeAnnouncement *ret = MALLOC(sizeof(LDKUnsignedNodeAnnouncement), "LDKUnsignedNodeAnnouncement");
2700 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKNodeFeatures_1optional_1none (JNIEnv * env, jclass _a) {
2701 LDKNodeFeatures *ret = MALLOC(sizeof(LDKNodeFeatures), "LDKNodeFeatures");
2705 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelFeatures_1optional_1none (JNIEnv * env, jclass _a) {
2706 LDKChannelFeatures *ret = MALLOC(sizeof(LDKChannelFeatures), "LDKChannelFeatures");
2710 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKUnsignedChannelUpdate_1optional_1none (JNIEnv * env, jclass _a) {
2711 LDKUnsignedChannelUpdate *ret = MALLOC(sizeof(LDKUnsignedChannelUpdate), "LDKUnsignedChannelUpdate");
2715 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKQueryChannelRange_1optional_1none (JNIEnv * env, jclass _a) {
2716 LDKQueryChannelRange *ret = MALLOC(sizeof(LDKQueryChannelRange), "LDKQueryChannelRange");
2720 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKReplyChannelRange_1optional_1none (JNIEnv * env, jclass _a) {
2721 LDKReplyChannelRange *ret = MALLOC(sizeof(LDKReplyChannelRange), "LDKReplyChannelRange");
2725 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1u64_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
2726 LDKCVecTempl_u64 *vec = (LDKCVecTempl_u64*)ptr;
2727 return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(uint64_t));
2729 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKQueryShortChannelIds_1optional_1none (JNIEnv * env, jclass _a) {
2730 LDKQueryShortChannelIds *ret = MALLOC(sizeof(LDKQueryShortChannelIds), "LDKQueryShortChannelIds");
2734 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKReplyShortChannelIdsEnd_1optional_1none (JNIEnv * env, jclass _a) {
2735 LDKReplyShortChannelIdsEnd *ret = MALLOC(sizeof(LDKReplyShortChannelIdsEnd), "LDKReplyShortChannelIdsEnd");
2739 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKGossipTimestampFilter_1optional_1none (JNIEnv * env, jclass _a) {
2740 LDKGossipTimestampFilter *ret = MALLOC(sizeof(LDKGossipTimestampFilter), "LDKGossipTimestampFilter");
2744 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKLightningError_1optional_1none (JNIEnv * env, jclass _a) {
2745 LDKLightningError *ret = MALLOC(sizeof(LDKLightningError), "LDKLightningError");
2749 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1UpdateAddHTLC_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
2750 LDKCVecTempl_UpdateAddHTLC *vec = (LDKCVecTempl_UpdateAddHTLC*)ptr;
2751 return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKUpdateAddHTLC));
2753 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1UpdateFulfillHTLC_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
2754 LDKCVecTempl_UpdateFulfillHTLC *vec = (LDKCVecTempl_UpdateFulfillHTLC*)ptr;
2755 return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKUpdateFulfillHTLC));
2757 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1UpdateFailHTLC_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
2758 LDKCVecTempl_UpdateFailHTLC *vec = (LDKCVecTempl_UpdateFailHTLC*)ptr;
2759 return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKUpdateFailHTLC));
2761 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1UpdateFailMalformedHTLC_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
2762 LDKCVecTempl_UpdateFailMalformedHTLC *vec = (LDKCVecTempl_UpdateFailMalformedHTLC*)ptr;
2763 return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKUpdateFailMalformedHTLC));
2765 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolLightningErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
2766 return ((LDKCResult_boolLightningErrorZ*)arg)->result_ok;
2768 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolLightningErrorZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
2769 if (((LDKCResult_boolLightningErrorZ*)arg)->result_ok) {
2770 return (long)((LDKCResult_boolLightningErrorZ*)arg)->contents.result;
2772 return (long)((LDKCResult_boolLightningErrorZ*)arg)->contents.err;
2775 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1C3TupleTempl_1ChannelAnnouncement_1_1ChannelUpdate_1_1ChannelUpdate_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
2776 LDKCVecTempl_C3TupleTempl_ChannelAnnouncement__ChannelUpdate__ChannelUpdate *vec = (LDKCVecTempl_C3TupleTempl_ChannelAnnouncement__ChannelUpdate__ChannelUpdate*)ptr;
2777 return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKC3TupleTempl_ChannelAnnouncement__ChannelUpdate__ChannelUpdate));
2779 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1NodeAnnouncement_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
2780 LDKCVecTempl_NodeAnnouncement *vec = (LDKCVecTempl_NodeAnnouncement*)ptr;
2781 return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKNodeAnnouncement));
2783 typedef struct LDKRoutingMessageHandler_JCalls {
2784 atomic_size_t refcnt;
2787 jmethodID handle_node_announcement_meth;
2788 jmethodID handle_channel_announcement_meth;
2789 jmethodID handle_channel_update_meth;
2790 jmethodID handle_htlc_fail_channel_update_meth;
2791 jmethodID get_next_channel_announcements_meth;
2792 jmethodID get_next_node_announcements_meth;
2793 jmethodID should_request_full_sync_meth;
2794 } LDKRoutingMessageHandler_JCalls;
2795 LDKCResult_boolLightningErrorZ handle_node_announcement_jcall(const void* this_arg, const LDKNodeAnnouncement *msg) {
2796 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
2798 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2799 LDKCResult_boolLightningErrorZ* ret = (LDKCResult_boolLightningErrorZ*)(*env)->CallLongMethod(env, j_calls->o, j_calls->handle_node_announcement_meth, msg);
2800 LDKCResult_boolLightningErrorZ res = *ret;
2804 LDKCResult_boolLightningErrorZ handle_channel_announcement_jcall(const void* this_arg, const LDKChannelAnnouncement *msg) {
2805 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
2807 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2808 LDKCResult_boolLightningErrorZ* ret = (LDKCResult_boolLightningErrorZ*)(*env)->CallLongMethod(env, j_calls->o, j_calls->handle_channel_announcement_meth, msg);
2809 LDKCResult_boolLightningErrorZ res = *ret;
2813 LDKCResult_boolLightningErrorZ handle_channel_update_jcall(const void* this_arg, const LDKChannelUpdate *msg) {
2814 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
2816 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2817 LDKCResult_boolLightningErrorZ* ret = (LDKCResult_boolLightningErrorZ*)(*env)->CallLongMethod(env, j_calls->o, j_calls->handle_channel_update_meth, msg);
2818 LDKCResult_boolLightningErrorZ res = *ret;
2822 void handle_htlc_fail_channel_update_jcall(const void* this_arg, const LDKHTLCFailChannelUpdate *update) {
2823 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
2825 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2826 return (*env)->CallVoidMethod(env, j_calls->o, j_calls->handle_htlc_fail_channel_update_meth, update);
2828 LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ get_next_channel_announcements_jcall(const void* this_arg, uint64_t starting_point, uint8_t batch_amount) {
2829 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
2831 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2832 LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ* ret = (LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ*)(*env)->CallLongMethod(env, j_calls->o, j_calls->get_next_channel_announcements_meth, starting_point, batch_amount);
2833 LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ res = *ret;
2837 LDKCVec_NodeAnnouncementZ get_next_node_announcements_jcall(const void* this_arg, LDKPublicKey starting_point, uint8_t batch_amount) {
2838 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
2840 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2841 long starting_point_ref = (long)&starting_point;
2842 LDKCVec_NodeAnnouncementZ* ret = (LDKCVec_NodeAnnouncementZ*)(*env)->CallLongMethod(env, j_calls->o, j_calls->get_next_node_announcements_meth, starting_point_ref, batch_amount);
2843 LDKCVec_NodeAnnouncementZ res = *ret;
2847 bool should_request_full_sync_jcall(const void* this_arg, LDKPublicKey node_id) {
2848 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
2850 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2851 long node_id_ref = (long)&node_id;
2852 return (*env)->CallBooleanMethod(env, j_calls->o, j_calls->should_request_full_sync_meth, node_id_ref);
2854 static void LDKRoutingMessageHandler_JCalls_free(void* this_arg) {
2855 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
2856 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
2858 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2859 (*env)->DeleteGlobalRef(env, j_calls->o);
2863 static void* LDKRoutingMessageHandler_JCalls_clone(const void* this_arg) {
2864 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
2865 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
2866 return (void*) this_arg;
2868 static inline LDKRoutingMessageHandler LDKRoutingMessageHandler_init (JNIEnv * env, jclass _a, jobject o) {
2869 jclass c = (*env)->GetObjectClass(env, o);
2870 DO_ASSERT(c != NULL);
2871 LDKRoutingMessageHandler_JCalls *calls = MALLOC(sizeof(LDKRoutingMessageHandler_JCalls), "LDKRoutingMessageHandler_JCalls");
2872 atomic_init(&calls->refcnt, 1);
2873 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
2874 calls->o = (*env)->NewGlobalRef(env, o);
2875 calls->handle_node_announcement_meth = (*env)->GetMethodID(env, c, "handle_node_announcement", "(J)J");
2876 DO_ASSERT(calls->handle_node_announcement_meth != NULL);
2877 calls->handle_channel_announcement_meth = (*env)->GetMethodID(env, c, "handle_channel_announcement", "(J)J");
2878 DO_ASSERT(calls->handle_channel_announcement_meth != NULL);
2879 calls->handle_channel_update_meth = (*env)->GetMethodID(env, c, "handle_channel_update", "(J)J");
2880 DO_ASSERT(calls->handle_channel_update_meth != NULL);
2881 calls->handle_htlc_fail_channel_update_meth = (*env)->GetMethodID(env, c, "handle_htlc_fail_channel_update", "(J)V");
2882 DO_ASSERT(calls->handle_htlc_fail_channel_update_meth != NULL);
2883 calls->get_next_channel_announcements_meth = (*env)->GetMethodID(env, c, "get_next_channel_announcements", "(JB)J");
2884 DO_ASSERT(calls->get_next_channel_announcements_meth != NULL);
2885 calls->get_next_node_announcements_meth = (*env)->GetMethodID(env, c, "get_next_node_announcements", "(JB)J");
2886 DO_ASSERT(calls->get_next_node_announcements_meth != NULL);
2887 calls->should_request_full_sync_meth = (*env)->GetMethodID(env, c, "should_request_full_sync", "(J)Z");
2888 DO_ASSERT(calls->should_request_full_sync_meth != NULL);
2890 LDKRoutingMessageHandler ret = {
2891 .this_arg = (void*) calls,
2892 .handle_node_announcement = handle_node_announcement_jcall,
2893 .handle_channel_announcement = handle_channel_announcement_jcall,
2894 .handle_channel_update = handle_channel_update_jcall,
2895 .handle_htlc_fail_channel_update = handle_htlc_fail_channel_update_jcall,
2896 .get_next_channel_announcements = get_next_channel_announcements_jcall,
2897 .get_next_node_announcements = get_next_node_announcements_jcall,
2898 .should_request_full_sync = should_request_full_sync_jcall,
2899 .free = LDKRoutingMessageHandler_JCalls_free,
2903 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKRoutingMessageHandler_1new (JNIEnv * env, jclass _a, jobject o) {
2904 LDKRoutingMessageHandler *res_ptr = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler");
2905 *res_ptr = LDKRoutingMessageHandler_init(env, _a, o);
2906 return (long)res_ptr;
2908 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKRoutingMessageHandler_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
2909 return ((LDKRoutingMessageHandler_JCalls*)val)->o;
2911 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKRoutingMessageHandler_1call_1handle_1node_1announcement(JNIEnv * _env, jclass _b, jlong arg, jlong msg) {
2912 LDKRoutingMessageHandler* arg_conv = (LDKRoutingMessageHandler*)arg;
2913 LDKNodeAnnouncement* msg_conv = (LDKNodeAnnouncement*)msg;
2914 LDKCResult_boolLightningErrorZ* ret = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
2915 *ret = (arg_conv->handle_node_announcement)(arg_conv->this_arg, msg_conv);
2919 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKRoutingMessageHandler_1call_1handle_1channel_1announcement(JNIEnv * _env, jclass _b, jlong arg, jlong msg) {
2920 LDKRoutingMessageHandler* arg_conv = (LDKRoutingMessageHandler*)arg;
2921 LDKChannelAnnouncement* msg_conv = (LDKChannelAnnouncement*)msg;
2922 LDKCResult_boolLightningErrorZ* ret = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
2923 *ret = (arg_conv->handle_channel_announcement)(arg_conv->this_arg, msg_conv);
2927 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKRoutingMessageHandler_1call_1handle_1channel_1update(JNIEnv * _env, jclass _b, jlong arg, jlong msg) {
2928 LDKRoutingMessageHandler* arg_conv = (LDKRoutingMessageHandler*)arg;
2929 LDKChannelUpdate* msg_conv = (LDKChannelUpdate*)msg;
2930 LDKCResult_boolLightningErrorZ* ret = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
2931 *ret = (arg_conv->handle_channel_update)(arg_conv->this_arg, msg_conv);
2935 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKRoutingMessageHandler_1call_1handle_1htlc_1fail_1channel_1update(JNIEnv * _env, jclass _b, jlong arg, jlong update) {
2936 LDKRoutingMessageHandler* arg_conv = (LDKRoutingMessageHandler*)arg;
2937 LDKHTLCFailChannelUpdate* update_conv = (LDKHTLCFailChannelUpdate*)update;
2938 return (arg_conv->handle_htlc_fail_channel_update)(arg_conv->this_arg, update_conv);
2941 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) {
2942 LDKRoutingMessageHandler* arg_conv = (LDKRoutingMessageHandler*)arg;
2943 LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ* ret = MALLOC(sizeof(LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ), "LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ");
2944 *ret = (arg_conv->get_next_channel_announcements)(arg_conv->this_arg, starting_point, batch_amount);
2948 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) {
2949 LDKRoutingMessageHandler* arg_conv = (LDKRoutingMessageHandler*)arg;
2950 LDKPublicKey starting_point_conv = *(LDKPublicKey*)starting_point;
2951 FREE((void*)starting_point);
2952 LDKCVec_NodeAnnouncementZ* ret = MALLOC(sizeof(LDKCVec_NodeAnnouncementZ), "LDKCVec_NodeAnnouncementZ");
2953 *ret = (arg_conv->get_next_node_announcements)(arg_conv->this_arg, starting_point_conv, batch_amount);
2957 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKRoutingMessageHandler_1call_1should_1request_1full_1sync(JNIEnv * _env, jclass _b, jlong arg, jlong node_id) {
2958 LDKRoutingMessageHandler* arg_conv = (LDKRoutingMessageHandler*)arg;
2959 LDKPublicKey node_id_conv = *(LDKPublicKey*)node_id;
2960 FREE((void*)node_id);
2961 return (arg_conv->should_request_full_sync)(arg_conv->this_arg, node_id_conv);
2964 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKMessageHandler_1optional_1none (JNIEnv * env, jclass _a) {
2965 LDKMessageHandler *ret = MALLOC(sizeof(LDKMessageHandler), "LDKMessageHandler");
2969 typedef struct LDKSocketDescriptor_JCalls {
2970 atomic_size_t refcnt;
2973 jmethodID send_data_meth;
2974 jmethodID disconnect_socket_meth;
2976 jmethodID hash_meth;
2977 } LDKSocketDescriptor_JCalls;
2978 uintptr_t send_data_jcall(void* this_arg, LDKu8slice data, bool resume_read) {
2979 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
2981 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2982 long data_ref = (long)&data;
2983 return (*env)->CallLongMethod(env, j_calls->o, j_calls->send_data_meth, data_ref, resume_read);
2985 void disconnect_socket_jcall(void* this_arg) {
2986 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
2988 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2989 return (*env)->CallVoidMethod(env, j_calls->o, j_calls->disconnect_socket_meth);
2991 bool eq_jcall(const void* this_arg, const void *other_arg) {
2992 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
2994 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2995 return (*env)->CallBooleanMethod(env, j_calls->o, j_calls->eq_meth, other_arg);
2997 uint64_t hash_jcall(const void* this_arg) {
2998 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
3000 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
3001 return (*env)->CallLongMethod(env, j_calls->o, j_calls->hash_meth);
3003 static void LDKSocketDescriptor_JCalls_free(void* this_arg) {
3004 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
3005 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
3007 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
3008 (*env)->DeleteGlobalRef(env, j_calls->o);
3012 static void* LDKSocketDescriptor_JCalls_clone(const void* this_arg) {
3013 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
3014 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
3015 return (void*) this_arg;
3017 static inline LDKSocketDescriptor LDKSocketDescriptor_init (JNIEnv * env, jclass _a, jobject o) {
3018 jclass c = (*env)->GetObjectClass(env, o);
3019 DO_ASSERT(c != NULL);
3020 LDKSocketDescriptor_JCalls *calls = MALLOC(sizeof(LDKSocketDescriptor_JCalls), "LDKSocketDescriptor_JCalls");
3021 atomic_init(&calls->refcnt, 1);
3022 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
3023 calls->o = (*env)->NewGlobalRef(env, o);
3024 calls->send_data_meth = (*env)->GetMethodID(env, c, "send_data", "(JZ)J");
3025 DO_ASSERT(calls->send_data_meth != NULL);
3026 calls->disconnect_socket_meth = (*env)->GetMethodID(env, c, "disconnect_socket", "()V");
3027 DO_ASSERT(calls->disconnect_socket_meth != NULL);
3028 calls->eq_meth = (*env)->GetMethodID(env, c, "eq", "(J)Z");
3029 DO_ASSERT(calls->eq_meth != NULL);
3030 calls->hash_meth = (*env)->GetMethodID(env, c, "hash", "()J");
3031 DO_ASSERT(calls->hash_meth != NULL);
3033 LDKSocketDescriptor ret = {
3034 .this_arg = (void*) calls,
3035 .send_data = send_data_jcall,
3036 .disconnect_socket = disconnect_socket_jcall,
3039 .clone = LDKSocketDescriptor_JCalls_clone,
3040 .free = LDKSocketDescriptor_JCalls_free,
3044 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKSocketDescriptor_1new (JNIEnv * env, jclass _a, jobject o) {
3045 LDKSocketDescriptor *res_ptr = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor");
3046 *res_ptr = LDKSocketDescriptor_init(env, _a, o);
3047 return (long)res_ptr;
3049 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKSocketDescriptor_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
3050 return ((LDKSocketDescriptor_JCalls*)val)->o;
3052 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKSocketDescriptor_1call_1send_1data(JNIEnv * _env, jclass _b, jlong arg, jlong data, jboolean resume_read) {
3053 LDKSocketDescriptor* arg_conv = (LDKSocketDescriptor*)arg;
3054 LDKu8slice data_conv = *(LDKu8slice*)data;
3055 return (arg_conv->send_data)(arg_conv->this_arg, data_conv, resume_read);
3058 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKSocketDescriptor_1call_1disconnect_1socket(JNIEnv * _env, jclass _b, jlong arg) {
3059 LDKSocketDescriptor* arg_conv = (LDKSocketDescriptor*)arg;
3060 return (arg_conv->disconnect_socket)(arg_conv->this_arg);
3063 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKSocketDescriptor_1call_1hash(JNIEnv * _env, jclass _b, jlong arg) {
3064 LDKSocketDescriptor* arg_conv = (LDKSocketDescriptor*)arg;
3065 return (arg_conv->hash)(arg_conv->this_arg);
3068 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKPeerManager_1optional_1none (JNIEnv * env, jclass _a) {
3069 LDKPeerManager *ret = MALLOC(sizeof(LDKPeerManager), "LDKPeerManager");
3073 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1PublicKey_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
3074 LDKCVecTempl_PublicKey *vec = (LDKCVecTempl_PublicKey*)ptr;
3075 return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKPublicKey));
3077 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1u8ZPeerHandleErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
3078 return ((LDKCResult_CVec_u8ZPeerHandleErrorZ*)arg)->result_ok;
3080 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1u8ZPeerHandleErrorZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
3081 if (((LDKCResult_CVec_u8ZPeerHandleErrorZ*)arg)->result_ok) {
3082 return (long)((LDKCResult_CVec_u8ZPeerHandleErrorZ*)arg)->contents.result;
3084 return (long)((LDKCResult_CVec_u8ZPeerHandleErrorZ*)arg)->contents.err;
3087 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolPeerHandleErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
3088 return ((LDKCResult_boolPeerHandleErrorZ*)arg)->result_ok;
3090 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolPeerHandleErrorZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
3091 if (((LDKCResult_boolPeerHandleErrorZ*)arg)->result_ok) {
3092 return (long)((LDKCResult_boolPeerHandleErrorZ*)arg)->contents.result;
3094 return (long)((LDKCResult_boolPeerHandleErrorZ*)arg)->contents.err;
3097 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SecretKeySecpErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
3098 return ((LDKCResult_SecretKeySecpErrorZ*)arg)->result_ok;
3100 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SecretKeySecpErrorZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
3101 if (((LDKCResult_SecretKeySecpErrorZ*)arg)->result_ok) {
3102 return (long)((LDKCResult_SecretKeySecpErrorZ*)arg)->contents.result;
3104 return (long)((LDKCResult_SecretKeySecpErrorZ*)arg)->contents.err;
3107 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PublicKeySecpErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
3108 return ((LDKCResult_PublicKeySecpErrorZ*)arg)->result_ok;
3110 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PublicKeySecpErrorZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
3111 if (((LDKCResult_PublicKeySecpErrorZ*)arg)->result_ok) {
3112 return (long)((LDKCResult_PublicKeySecpErrorZ*)arg)->contents.result;
3114 return (long)((LDKCResult_PublicKeySecpErrorZ*)arg)->contents.err;
3117 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKTxCreationKeys_1optional_1none (JNIEnv * env, jclass _a) {
3118 LDKTxCreationKeys *ret = MALLOC(sizeof(LDKTxCreationKeys), "LDKTxCreationKeys");
3122 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxCreationKeysSecpErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
3123 return ((LDKCResult_TxCreationKeysSecpErrorZ*)arg)->result_ok;
3125 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxCreationKeysSecpErrorZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
3126 if (((LDKCResult_TxCreationKeysSecpErrorZ*)arg)->result_ok) {
3127 return (long)((LDKCResult_TxCreationKeysSecpErrorZ*)arg)->contents.result;
3129 return (long)((LDKCResult_TxCreationKeysSecpErrorZ*)arg)->contents.err;
3132 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1C2TupleTempl_1HTLCOutputInCommitment_1_1Signature_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
3133 LDKCVecTempl_C2TupleTempl_HTLCOutputInCommitment__Signature *vec = (LDKCVecTempl_C2TupleTempl_HTLCOutputInCommitment__Signature*)ptr;
3134 return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKC2TupleTempl_HTLCOutputInCommitment__Signature));
3136 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKRouteHop_1optional_1none (JNIEnv * env, jclass _a) {
3137 LDKRouteHop *ret = MALLOC(sizeof(LDKRouteHop), "LDKRouteHop");
3141 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1RouteHop_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
3142 LDKCVecTempl_RouteHop *vec = (LDKCVecTempl_RouteHop*)ptr;
3143 return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKRouteHop));
3145 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1CVecTempl_1RouteHop_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
3146 LDKCVecTempl_CVecTempl_RouteHop *vec = (LDKCVecTempl_CVecTempl_RouteHop*)ptr;
3147 return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKCVecTempl_RouteHop));
3149 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKRouteHint_1optional_1none (JNIEnv * env, jclass _a) {
3150 LDKRouteHint *ret = MALLOC(sizeof(LDKRouteHint), "LDKRouteHint");
3154 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKRoutingFees_1optional_1none (JNIEnv * env, jclass _a) {
3155 LDKRoutingFees *ret = MALLOC(sizeof(LDKRoutingFees), "LDKRoutingFees");
3159 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteLightningErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
3160 return ((LDKCResult_RouteLightningErrorZ*)arg)->result_ok;
3162 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteLightningErrorZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
3163 if (((LDKCResult_RouteLightningErrorZ*)arg)->result_ok) {
3164 return (long)((LDKCResult_RouteLightningErrorZ*)arg)->contents.result;
3166 return (long)((LDKCResult_RouteLightningErrorZ*)arg)->contents.err;
3169 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKNetworkGraph_1optional_1none (JNIEnv * env, jclass _a) {
3170 LDKNetworkGraph *ret = MALLOC(sizeof(LDKNetworkGraph), "LDKNetworkGraph");
3174 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1RouteHint_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
3175 LDKCVecTempl_RouteHint *vec = (LDKCVecTempl_RouteHint*)ptr;
3176 return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKRouteHint));
3178 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKLockedNetworkGraph_1optional_1none (JNIEnv * env, jclass _a) {
3179 LDKLockedNetworkGraph *ret = MALLOC(sizeof(LDKLockedNetworkGraph), "LDKLockedNetworkGraph");
3183 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKNetGraphMsgHandler_1optional_1none (JNIEnv * env, jclass _a) {
3184 LDKNetGraphMsgHandler *ret = MALLOC(sizeof(LDKNetGraphMsgHandler), "LDKNetGraphMsgHandler");
3188 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKDirectionalChannelInfo_1optional_1none (JNIEnv * env, jclass _a) {
3189 LDKDirectionalChannelInfo *ret = MALLOC(sizeof(LDKDirectionalChannelInfo), "LDKDirectionalChannelInfo");
3193 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelInfo_1optional_1none (JNIEnv * env, jclass _a) {
3194 LDKChannelInfo *ret = MALLOC(sizeof(LDKChannelInfo), "LDKChannelInfo");
3198 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKNodeAnnouncementInfo_1optional_1none (JNIEnv * env, jclass _a) {
3199 LDKNodeAnnouncementInfo *ret = MALLOC(sizeof(LDKNodeAnnouncementInfo), "LDKNodeAnnouncementInfo");
3203 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKNodeInfo_1optional_1none (JNIEnv * env, jclass _a) {
3204 LDKNodeInfo *ret = MALLOC(sizeof(LDKNodeInfo), "LDKNodeInfo");
3208 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1HTLCOutputInCommitmentSignatureZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3209 LDKC2Tuple_HTLCOutputInCommitmentSignatureZ arg_conv = *(LDKC2Tuple_HTLCOutputInCommitmentSignatureZ*)arg;
3211 return C2Tuple_HTLCOutputInCommitmentSignatureZ_free(arg_conv);
3214 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3215 LDKC2Tuple_OutPointScriptZ arg_conv = *(LDKC2Tuple_OutPointScriptZ*)arg;
3217 return C2Tuple_OutPointScriptZ_free(arg_conv);
3220 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3221 LDKC2Tuple_SignatureCVec_SignatureZZ arg_conv = *(LDKC2Tuple_SignatureCVec_SignatureZZ*)arg;
3223 return C2Tuple_SignatureCVec_SignatureZZ_free(arg_conv);
3226 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1TxOutZZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3227 LDKC2Tuple_TxidCVec_TxOutZZ arg_conv = *(LDKC2Tuple_TxidCVec_TxOutZZ*)arg;
3229 return C2Tuple_TxidCVec_TxOutZZ_free(arg_conv);
3232 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u64u64Z_1free(JNIEnv * _env, jclass _b, jlong arg) {
3233 LDKC2Tuple_u64u64Z arg_conv = *(LDKC2Tuple_u64u64Z*)arg;
3235 return C2Tuple_u64u64Z_free(arg_conv);
3238 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3239 LDKC2Tuple_usizeTransactionZ arg_conv = *(LDKC2Tuple_usizeTransactionZ*)arg;
3241 return C2Tuple_usizeTransactionZ_free(arg_conv);
3244 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3245 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ arg_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)arg;
3247 return C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(arg_conv);
3250 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3251 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ arg_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)arg;
3253 return CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(arg_conv);
3256 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
3257 LDKC2Tuple_SignatureCVec_SignatureZZ arg_conv = *(LDKC2Tuple_SignatureCVec_SignatureZZ*)arg;
3259 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
3260 *ret = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(arg_conv);
3264 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3265 LDKCResult_CVec_SignatureZNoneZ arg_conv = *(LDKCResult_CVec_SignatureZNoneZ*)arg;
3267 return CResult_CVec_SignatureZNoneZ_free(arg_conv);
3270 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
3271 LDKCVec_SignatureZ arg_conv = *(LDKCVec_SignatureZ*)arg;
3273 LDKCResult_CVec_SignatureZNoneZ* ret = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
3274 *ret = CResult_CVec_SignatureZNoneZ_ok(arg_conv);
3278 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
3279 LDKPeerHandleError arg_conv = *(LDKPeerHandleError*)arg;
3281 LDKCResult_CVec_u8ZPeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
3282 *ret = CResult_CVec_u8ZPeerHandleErrorZ_err(arg_conv);
3286 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3287 LDKCResult_CVec_u8ZPeerHandleErrorZ arg_conv = *(LDKCResult_CVec_u8ZPeerHandleErrorZ*)arg;
3289 return CResult_CVec_u8ZPeerHandleErrorZ_free(arg_conv);
3292 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
3293 LDKCVec_u8Z arg_conv = *(LDKCVec_u8Z*)arg;
3295 LDKCResult_CVec_u8ZPeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
3296 *ret = CResult_CVec_u8ZPeerHandleErrorZ_ok(arg_conv);
3300 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
3301 LDKAPIError arg_conv = *(LDKAPIError*)arg;
3303 LDKCResult_NoneAPIErrorZ* ret = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
3304 *ret = CResult_NoneAPIErrorZ_err(arg_conv);
3308 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3309 LDKCResult_NoneAPIErrorZ arg_conv = *(LDKCResult_NoneAPIErrorZ*)arg;
3311 return CResult_NoneAPIErrorZ_free(arg_conv);
3314 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1err(JNIEnv * _env, jclass _b, jclass arg) {
3315 LDKChannelMonitorUpdateErr arg_conv = *(LDKChannelMonitorUpdateErr*)arg;
3317 LDKCResult_NoneChannelMonitorUpdateErrZ* ret = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
3318 *ret = CResult_NoneChannelMonitorUpdateErrZ_err(arg_conv);
3322 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3323 LDKCResult_NoneChannelMonitorUpdateErrZ arg_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)arg;
3325 return CResult_NoneChannelMonitorUpdateErrZ_free(arg_conv);
3328 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
3329 LDKMonitorUpdateError arg_conv = *(LDKMonitorUpdateError*)arg;
3331 LDKCResult_NoneMonitorUpdateErrorZ* ret = MALLOC(sizeof(LDKCResult_NoneMonitorUpdateErrorZ), "LDKCResult_NoneMonitorUpdateErrorZ");
3332 *ret = CResult_NoneMonitorUpdateErrorZ_err(arg_conv);
3336 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3337 LDKCResult_NoneMonitorUpdateErrorZ arg_conv = *(LDKCResult_NoneMonitorUpdateErrorZ*)arg;
3339 return CResult_NoneMonitorUpdateErrorZ_free(arg_conv);
3342 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
3343 LDKPaymentSendFailure arg_conv = *(LDKPaymentSendFailure*)arg;
3345 LDKCResult_NonePaymentSendFailureZ* ret = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
3346 *ret = CResult_NonePaymentSendFailureZ_err(arg_conv);
3350 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3351 LDKCResult_NonePaymentSendFailureZ arg_conv = *(LDKCResult_NonePaymentSendFailureZ*)arg;
3353 return CResult_NonePaymentSendFailureZ_free(arg_conv);
3356 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
3357 LDKPeerHandleError arg_conv = *(LDKPeerHandleError*)arg;
3359 LDKCResult_NonePeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
3360 *ret = CResult_NonePeerHandleErrorZ_err(arg_conv);
3364 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3365 LDKCResult_NonePeerHandleErrorZ arg_conv = *(LDKCResult_NonePeerHandleErrorZ*)arg;
3367 return CResult_NonePeerHandleErrorZ_free(arg_conv);
3370 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeySecpErrorZ_1err(JNIEnv * _env, jclass _b, jclass arg) {
3371 LDKSecp256k1Error arg_conv = *(LDKSecp256k1Error*)arg;
3373 LDKCResult_PublicKeySecpErrorZ* ret = MALLOC(sizeof(LDKCResult_PublicKeySecpErrorZ), "LDKCResult_PublicKeySecpErrorZ");
3374 *ret = CResult_PublicKeySecpErrorZ_err(arg_conv);
3378 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeySecpErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3379 LDKCResult_PublicKeySecpErrorZ arg_conv = *(LDKCResult_PublicKeySecpErrorZ*)arg;
3381 return CResult_PublicKeySecpErrorZ_free(arg_conv);
3384 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeySecpErrorZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
3385 LDKPublicKey arg_conv = *(LDKPublicKey*)arg;
3387 LDKCResult_PublicKeySecpErrorZ* ret = MALLOC(sizeof(LDKCResult_PublicKeySecpErrorZ), "LDKCResult_PublicKeySecpErrorZ");
3388 *ret = CResult_PublicKeySecpErrorZ_ok(arg_conv);
3392 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
3393 LDKLightningError arg_conv = *(LDKLightningError*)arg;
3395 LDKCResult_RouteLightningErrorZ* ret = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
3396 *ret = CResult_RouteLightningErrorZ_err(arg_conv);
3400 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3401 LDKCResult_RouteLightningErrorZ arg_conv = *(LDKCResult_RouteLightningErrorZ*)arg;
3403 return CResult_RouteLightningErrorZ_free(arg_conv);
3406 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
3407 LDKRoute arg_conv = *(LDKRoute*)arg;
3409 LDKCResult_RouteLightningErrorZ* ret = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
3410 *ret = CResult_RouteLightningErrorZ_ok(arg_conv);
3414 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeySecpErrorZ_1err(JNIEnv * _env, jclass _b, jclass arg) {
3415 LDKSecp256k1Error arg_conv = *(LDKSecp256k1Error*)arg;
3417 LDKCResult_SecretKeySecpErrorZ* ret = MALLOC(sizeof(LDKCResult_SecretKeySecpErrorZ), "LDKCResult_SecretKeySecpErrorZ");
3418 *ret = CResult_SecretKeySecpErrorZ_err(arg_conv);
3422 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeySecpErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3423 LDKCResult_SecretKeySecpErrorZ arg_conv = *(LDKCResult_SecretKeySecpErrorZ*)arg;
3425 return CResult_SecretKeySecpErrorZ_free(arg_conv);
3428 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeySecpErrorZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
3429 LDKSecretKey arg_conv = *(LDKSecretKey*)arg;
3431 LDKCResult_SecretKeySecpErrorZ* ret = MALLOC(sizeof(LDKCResult_SecretKeySecpErrorZ), "LDKCResult_SecretKeySecpErrorZ");
3432 *ret = CResult_SecretKeySecpErrorZ_ok(arg_conv);
3436 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3437 LDKCResult_SignatureNoneZ arg_conv = *(LDKCResult_SignatureNoneZ*)arg;
3439 return CResult_SignatureNoneZ_free(arg_conv);
3442 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
3443 LDKSignature arg_conv = *(LDKSignature*)arg;
3445 LDKCResult_SignatureNoneZ* ret = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
3446 *ret = CResult_SignatureNoneZ_ok(arg_conv);
3450 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysSecpErrorZ_1err(JNIEnv * _env, jclass _b, jclass arg) {
3451 LDKSecp256k1Error arg_conv = *(LDKSecp256k1Error*)arg;
3453 LDKCResult_TxCreationKeysSecpErrorZ* ret = MALLOC(sizeof(LDKCResult_TxCreationKeysSecpErrorZ), "LDKCResult_TxCreationKeysSecpErrorZ");
3454 *ret = CResult_TxCreationKeysSecpErrorZ_err(arg_conv);
3458 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysSecpErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3459 LDKCResult_TxCreationKeysSecpErrorZ arg_conv = *(LDKCResult_TxCreationKeysSecpErrorZ*)arg;
3461 return CResult_TxCreationKeysSecpErrorZ_free(arg_conv);
3464 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysSecpErrorZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
3465 LDKTxCreationKeys arg_conv = *(LDKTxCreationKeys*)arg;
3467 LDKCResult_TxCreationKeysSecpErrorZ* ret = MALLOC(sizeof(LDKCResult_TxCreationKeysSecpErrorZ), "LDKCResult_TxCreationKeysSecpErrorZ");
3468 *ret = CResult_TxCreationKeysSecpErrorZ_ok(arg_conv);
3472 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1err(JNIEnv * _env, jclass _b, jclass arg) {
3473 LDKAccessError arg_conv = *(LDKAccessError*)arg;
3475 LDKCResult_TxOutAccessErrorZ* ret = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ");
3476 *ret = CResult_TxOutAccessErrorZ_err(arg_conv);
3480 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3481 LDKCResult_TxOutAccessErrorZ arg_conv = *(LDKCResult_TxOutAccessErrorZ*)arg;
3483 return CResult_TxOutAccessErrorZ_free(arg_conv);
3486 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
3487 LDKTxOut arg_conv = *(LDKTxOut*)arg;
3489 LDKCResult_TxOutAccessErrorZ* ret = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ");
3490 *ret = CResult_TxOutAccessErrorZ_ok(arg_conv);
3494 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
3495 LDKLightningError arg_conv = *(LDKLightningError*)arg;
3497 LDKCResult_boolLightningErrorZ* ret = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
3498 *ret = CResult_boolLightningErrorZ_err(arg_conv);
3502 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3503 LDKCResult_boolLightningErrorZ arg_conv = *(LDKCResult_boolLightningErrorZ*)arg;
3505 return CResult_boolLightningErrorZ_free(arg_conv);
3508 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1ok(JNIEnv * _env, jclass _b, jboolean arg) {
3509 LDKCResult_boolLightningErrorZ* ret = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
3510 *ret = CResult_boolLightningErrorZ_ok(arg);
3514 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
3515 LDKPeerHandleError arg_conv = *(LDKPeerHandleError*)arg;
3517 LDKCResult_boolPeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
3518 *ret = CResult_boolPeerHandleErrorZ_err(arg_conv);
3522 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3523 LDKCResult_boolPeerHandleErrorZ arg_conv = *(LDKCResult_boolPeerHandleErrorZ*)arg;
3525 return CResult_boolPeerHandleErrorZ_free(arg_conv);
3528 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1ok(JNIEnv * _env, jclass _b, jboolean arg) {
3529 LDKCResult_boolPeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
3530 *ret = CResult_boolPeerHandleErrorZ_ok(arg);
3534 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1HTLCOutputInCommitmentSignatureZZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3535 LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ arg_conv = *(LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ*)arg;
3537 return CVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ_free(arg_conv);
3540 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1TxidCVec_1TxOutZZZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3541 LDKCVec_C2Tuple_TxidCVec_TxOutZZZ arg_conv = *(LDKCVec_C2Tuple_TxidCVec_TxOutZZZ*)arg;
3543 return CVec_C2Tuple_TxidCVec_TxOutZZZ_free(arg_conv);
3546 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1usizeTransactionZZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3547 LDKCVec_C2Tuple_usizeTransactionZZ arg_conv = *(LDKCVec_C2Tuple_usizeTransactionZZ*)arg;
3549 return CVec_C2Tuple_usizeTransactionZZ_free(arg_conv);
3552 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3553 LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ arg_conv = *(LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ*)arg;
3555 return CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(arg_conv);
3558 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1CVec_1RouteHopZZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3559 LDKCVec_CVec_RouteHopZZ arg_conv = *(LDKCVec_CVec_RouteHopZZ*)arg;
3561 return CVec_CVec_RouteHopZZ_free(arg_conv);
3564 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ChannelDetailsZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3565 LDKCVec_ChannelDetailsZ arg_conv = *(LDKCVec_ChannelDetailsZ*)arg;
3567 return CVec_ChannelDetailsZ_free(arg_conv);
3570 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ChannelMonitorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3571 LDKCVec_ChannelMonitorZ arg_conv = *(LDKCVec_ChannelMonitorZ*)arg;
3573 return CVec_ChannelMonitorZ_free(arg_conv);
3576 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1EventZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3577 LDKCVec_EventZ arg_conv = *(LDKCVec_EventZ*)arg;
3579 return CVec_EventZ_free(arg_conv);
3582 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1HTLCOutputInCommitmentZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3583 LDKCVec_HTLCOutputInCommitmentZ arg_conv = *(LDKCVec_HTLCOutputInCommitmentZ*)arg;
3585 return CVec_HTLCOutputInCommitmentZ_free(arg_conv);
3588 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1MessageSendEventZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3589 LDKCVec_MessageSendEventZ arg_conv = *(LDKCVec_MessageSendEventZ*)arg;
3591 return CVec_MessageSendEventZ_free(arg_conv);
3594 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1MonitorEventZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3595 LDKCVec_MonitorEventZ arg_conv = *(LDKCVec_MonitorEventZ*)arg;
3597 return CVec_MonitorEventZ_free(arg_conv);
3600 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1NetAddressZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3601 LDKCVec_NetAddressZ arg_conv = *(LDKCVec_NetAddressZ*)arg;
3603 return CVec_NetAddressZ_free(arg_conv);
3606 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1NodeAnnouncementZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3607 LDKCVec_NodeAnnouncementZ arg_conv = *(LDKCVec_NodeAnnouncementZ*)arg;
3609 return CVec_NodeAnnouncementZ_free(arg_conv);
3612 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1PublicKeyZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3613 LDKCVec_PublicKeyZ arg_conv = *(LDKCVec_PublicKeyZ*)arg;
3615 return CVec_PublicKeyZ_free(arg_conv);
3618 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHintZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3619 LDKCVec_RouteHintZ arg_conv = *(LDKCVec_RouteHintZ*)arg;
3621 return CVec_RouteHintZ_free(arg_conv);
3624 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHopZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3625 LDKCVec_RouteHopZ arg_conv = *(LDKCVec_RouteHopZ*)arg;
3627 return CVec_RouteHopZ_free(arg_conv);
3630 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1SignatureZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3631 LDKCVec_SignatureZ arg_conv = *(LDKCVec_SignatureZ*)arg;
3633 return CVec_SignatureZ_free(arg_conv);
3636 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1SpendableOutputDescriptorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3637 LDKCVec_SpendableOutputDescriptorZ arg_conv = *(LDKCVec_SpendableOutputDescriptorZ*)arg;
3639 return CVec_SpendableOutputDescriptorZ_free(arg_conv);
3642 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1TransactionZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3643 LDKCVec_TransactionZ arg_conv = *(LDKCVec_TransactionZ*)arg;
3645 return CVec_TransactionZ_free(arg_conv);
3648 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1TxOutZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3649 LDKCVec_TxOutZ arg_conv = *(LDKCVec_TxOutZ*)arg;
3651 return CVec_TxOutZ_free(arg_conv);
3654 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateAddHTLCZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3655 LDKCVec_UpdateAddHTLCZ arg_conv = *(LDKCVec_UpdateAddHTLCZ*)arg;
3657 return CVec_UpdateAddHTLCZ_free(arg_conv);
3660 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateFailHTLCZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3661 LDKCVec_UpdateFailHTLCZ arg_conv = *(LDKCVec_UpdateFailHTLCZ*)arg;
3663 return CVec_UpdateFailHTLCZ_free(arg_conv);
3666 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateFailMalformedHTLCZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3667 LDKCVec_UpdateFailMalformedHTLCZ arg_conv = *(LDKCVec_UpdateFailMalformedHTLCZ*)arg;
3669 return CVec_UpdateFailMalformedHTLCZ_free(arg_conv);
3672 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateFulfillHTLCZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3673 LDKCVec_UpdateFulfillHTLCZ arg_conv = *(LDKCVec_UpdateFulfillHTLCZ*)arg;
3675 return CVec_UpdateFulfillHTLCZ_free(arg_conv);
3678 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1u64Z_1free(JNIEnv * _env, jclass _b, jlong arg) {
3679 LDKCVec_u64Z arg_conv = *(LDKCVec_u64Z*)arg;
3681 return CVec_u64Z_free(arg_conv);
3684 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1u8Z_1free(JNIEnv * _env, jclass _b, jlong arg) {
3685 LDKCVec_u8Z arg_conv = *(LDKCVec_u8Z*)arg;
3687 return CVec_u8Z_free(arg_conv);
3690 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Transaction_1free(JNIEnv * _env, jclass _b, jlong _res) {
3691 LDKTransaction _res_conv = *(LDKTransaction*)_res;
3693 return Transaction_free(_res_conv);
3696 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxOut_1free(JNIEnv * _env, jclass _b, jlong _res) {
3697 LDKTxOut _res_conv = *(LDKTxOut*)_res;
3699 return TxOut_free(_res_conv);
3702 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1new(JNIEnv * _env, jclass _b, jlong a, jlong b) {
3703 LDKTransaction b_conv = *(LDKTransaction*)b;
3705 LDKC2Tuple_usizeTransactionZ* ret = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ");
3706 *ret = C2Tuple_usizeTransactionZ_new(a, b_conv);
3710 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1ok(JNIEnv * _env, jclass _b) {
3711 LDKCResult_NoneChannelMonitorUpdateErrZ* ret = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
3712 *ret = CResult_NoneChannelMonitorUpdateErrZ_ok();
3716 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1ok(JNIEnv * _env, jclass _b) {
3717 LDKCResult_NoneMonitorUpdateErrorZ* ret = MALLOC(sizeof(LDKCResult_NoneMonitorUpdateErrorZ), "LDKCResult_NoneMonitorUpdateErrorZ");
3718 *ret = CResult_NoneMonitorUpdateErrorZ_ok();
3722 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1new(JNIEnv * _env, jclass _b, jlong a, jlong b) {
3723 LDKOutPoint a_conv = *(LDKOutPoint*)a;
3725 a_conv.is_owned = true;
3726 LDKCVec_u8Z b_conv = *(LDKCVec_u8Z*)b;
3728 LDKC2Tuple_OutPointScriptZ* ret = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ");
3729 *ret = C2Tuple_OutPointScriptZ_new(a_conv, b_conv);
3733 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1TxOutZZ_1new(JNIEnv * _env, jclass _b, jbyteArray a, jlong b) {
3734 LDKThirtyTwoBytes a_ref;
3735 (*_env)->GetByteArrayRegion (_env, a, 0, 32, a_ref.data);
3736 LDKCVec_TxOutZ b_conv = *(LDKCVec_TxOutZ*)b;
3738 LDKC2Tuple_TxidCVec_TxOutZZ* ret = MALLOC(sizeof(LDKC2Tuple_TxidCVec_TxOutZZ), "LDKC2Tuple_TxidCVec_TxOutZZ");
3739 *ret = C2Tuple_TxidCVec_TxOutZZ_new(a_ref, b_conv);
3743 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u64u64Z_1new(JNIEnv * _env, jclass _b, jlong a, jlong b) {
3744 LDKC2Tuple_u64u64Z* ret = MALLOC(sizeof(LDKC2Tuple_u64u64Z), "LDKC2Tuple_u64u64Z");
3745 *ret = C2Tuple_u64u64Z_new(a, b);
3749 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1new(JNIEnv * _env, jclass _b, jlong a, jlong b) {
3750 LDKSignature a_conv = *(LDKSignature*)a;
3752 LDKCVec_SignatureZ b_conv = *(LDKCVec_SignatureZ*)b;
3754 LDKC2Tuple_SignatureCVec_SignatureZZ* ret = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ");
3755 *ret = C2Tuple_SignatureCVec_SignatureZZ_new(a_conv, b_conv);
3759 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1err(JNIEnv * _env, jclass _b) {
3760 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
3761 *ret = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err();
3765 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1err(JNIEnv * _env, jclass _b) {
3766 LDKCResult_SignatureNoneZ* ret = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
3767 *ret = CResult_SignatureNoneZ_err();
3771 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1err(JNIEnv * _env, jclass _b) {
3772 LDKCResult_CVec_SignatureZNoneZ* ret = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
3773 *ret = CResult_CVec_SignatureZNoneZ_err();
3777 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1ok(JNIEnv * _env, jclass _b) {
3778 LDKCResult_NoneAPIErrorZ* ret = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
3779 *ret = CResult_NoneAPIErrorZ_ok();
3783 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1ok(JNIEnv * _env, jclass _b) {
3784 LDKCResult_NonePaymentSendFailureZ* ret = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
3785 *ret = CResult_NonePaymentSendFailureZ_ok();
3789 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1new(JNIEnv * _env, jclass _b, jlong a, jlong b, jlong c) {
3790 LDKChannelAnnouncement a_conv = *(LDKChannelAnnouncement*)a;
3792 a_conv.is_owned = true;
3793 LDKChannelUpdate b_conv = *(LDKChannelUpdate*)b;
3795 b_conv.is_owned = true;
3796 LDKChannelUpdate c_conv = *(LDKChannelUpdate*)c;
3798 c_conv.is_owned = true;
3799 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ");
3800 *ret = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(a_conv, b_conv, c_conv);
3804 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1ok(JNIEnv * _env, jclass _b) {
3805 LDKCResult_NonePeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
3806 *ret = CResult_NonePeerHandleErrorZ_ok();
3810 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1HTLCOutputInCommitmentSignatureZ_1new(JNIEnv * _env, jclass _b, jlong a, jlong b) {
3811 LDKHTLCOutputInCommitment a_conv = *(LDKHTLCOutputInCommitment*)a;
3813 a_conv.is_owned = true;
3814 LDKSignature b_conv = *(LDKSignature*)b;
3816 LDKC2Tuple_HTLCOutputInCommitmentSignatureZ* ret = MALLOC(sizeof(LDKC2Tuple_HTLCOutputInCommitmentSignatureZ), "LDKC2Tuple_HTLCOutputInCommitmentSignatureZ");
3817 *ret = C2Tuple_HTLCOutputInCommitmentSignatureZ_new(a_conv, b_conv);
3821 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Event_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3822 LDKEvent this_ptr_conv = *(LDKEvent*)this_ptr;
3823 FREE((void*)this_ptr);
3824 return Event_free(this_ptr_conv);
3827 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3828 LDKMessageSendEvent this_ptr_conv = *(LDKMessageSendEvent*)this_ptr;
3829 FREE((void*)this_ptr);
3830 return MessageSendEvent_free(this_ptr_conv);
3833 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageSendEventsProvider_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3834 LDKMessageSendEventsProvider this_ptr_conv = *(LDKMessageSendEventsProvider*)this_ptr;
3835 FREE((void*)this_ptr);
3836 return MessageSendEventsProvider_free(this_ptr_conv);
3839 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EventsProvider_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3840 LDKEventsProvider this_ptr_conv = *(LDKEventsProvider*)this_ptr;
3841 FREE((void*)this_ptr);
3842 return EventsProvider_free(this_ptr_conv);
3845 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_APIError_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3846 LDKAPIError this_ptr_conv = *(LDKAPIError*)this_ptr;
3847 FREE((void*)this_ptr);
3848 return APIError_free(this_ptr_conv);
3851 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1max(JNIEnv * _env, jclass _b) {
3852 jclass ret = LDKLevel_to_java(_env, Level_max());
3856 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Logger_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3857 LDKLogger this_ptr_conv = *(LDKLogger*)this_ptr;
3858 FREE((void*)this_ptr);
3859 return Logger_free(this_ptr_conv);
3862 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3863 LDKChannelHandshakeConfig this_ptr_conv = *(LDKChannelHandshakeConfig*)this_ptr;
3864 FREE((void*)this_ptr);
3865 this_ptr_conv.is_owned = true;
3866 return ChannelHandshakeConfig_free(this_ptr_conv);
3869 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1minimum_1depth(JNIEnv * _env, jclass _b, jlong this_ptr) {
3870 LDKChannelHandshakeConfig* this_ptr_conv = (LDKChannelHandshakeConfig*)this_ptr;
3871 return ChannelHandshakeConfig_get_minimum_depth(this_ptr_conv);
3874 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1minimum_1depth(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
3875 LDKChannelHandshakeConfig* this_ptr_conv = (LDKChannelHandshakeConfig*)this_ptr;
3876 return ChannelHandshakeConfig_set_minimum_depth(this_ptr_conv, val);
3879 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1our_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr) {
3880 LDKChannelHandshakeConfig* this_ptr_conv = (LDKChannelHandshakeConfig*)this_ptr;
3881 return ChannelHandshakeConfig_get_our_to_self_delay(this_ptr_conv);
3884 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1our_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
3885 LDKChannelHandshakeConfig* this_ptr_conv = (LDKChannelHandshakeConfig*)this_ptr;
3886 return ChannelHandshakeConfig_set_our_to_self_delay(this_ptr_conv, val);
3889 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1our_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
3890 LDKChannelHandshakeConfig* this_ptr_conv = (LDKChannelHandshakeConfig*)this_ptr;
3891 return ChannelHandshakeConfig_get_our_htlc_minimum_msat(this_ptr_conv);
3894 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1our_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3895 LDKChannelHandshakeConfig* this_ptr_conv = (LDKChannelHandshakeConfig*)this_ptr;
3896 return ChannelHandshakeConfig_set_our_htlc_minimum_msat(this_ptr_conv, val);
3899 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) {
3900 LDKChannelHandshakeConfig* ret = MALLOC(sizeof(LDKChannelHandshakeConfig), "LDKChannelHandshakeConfig");
3901 *ret = ChannelHandshakeConfig_new(minimum_depth_arg, our_to_self_delay_arg, our_htlc_minimum_msat_arg);
3902 DO_ASSERT(ret->is_owned);
3903 ret->is_owned = false;
3907 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1default(JNIEnv * _env, jclass _b) {
3908 LDKChannelHandshakeConfig* ret = MALLOC(sizeof(LDKChannelHandshakeConfig), "LDKChannelHandshakeConfig");
3909 *ret = ChannelHandshakeConfig_default();
3910 DO_ASSERT(ret->is_owned);
3911 ret->is_owned = false;
3915 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3916 LDKChannelHandshakeLimits this_ptr_conv = *(LDKChannelHandshakeLimits*)this_ptr;
3917 FREE((void*)this_ptr);
3918 this_ptr_conv.is_owned = true;
3919 return ChannelHandshakeLimits_free(this_ptr_conv);
3922 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1min_1funding_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
3923 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
3924 return ChannelHandshakeLimits_get_min_funding_satoshis(this_ptr_conv);
3927 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1min_1funding_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3928 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
3929 return ChannelHandshakeLimits_set_min_funding_satoshis(this_ptr_conv, val);
3932 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1max_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
3933 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
3934 return ChannelHandshakeLimits_get_max_htlc_minimum_msat(this_ptr_conv);
3937 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1max_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3938 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
3939 return ChannelHandshakeLimits_set_max_htlc_minimum_msat(this_ptr_conv, val);
3942 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1min_1max_1htlc_1value_1in_1flight_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
3943 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
3944 return ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(this_ptr_conv);
3947 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) {
3948 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
3949 return ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(this_ptr_conv, val);
3952 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1max_1channel_1reserve_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
3953 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
3954 return ChannelHandshakeLimits_get_max_channel_reserve_satoshis(this_ptr_conv);
3957 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1max_1channel_1reserve_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3958 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
3959 return ChannelHandshakeLimits_set_max_channel_reserve_satoshis(this_ptr_conv, val);
3962 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1min_1max_1accepted_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr) {
3963 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
3964 return ChannelHandshakeLimits_get_min_max_accepted_htlcs(this_ptr_conv);
3967 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1min_1max_1accepted_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
3968 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
3969 return ChannelHandshakeLimits_set_min_max_accepted_htlcs(this_ptr_conv, val);
3972 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1min_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
3973 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
3974 return ChannelHandshakeLimits_get_min_dust_limit_satoshis(this_ptr_conv);
3977 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1min_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3978 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
3979 return ChannelHandshakeLimits_set_min_dust_limit_satoshis(this_ptr_conv, val);
3982 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1max_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
3983 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
3984 return ChannelHandshakeLimits_get_max_dust_limit_satoshis(this_ptr_conv);
3987 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1max_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3988 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
3989 return ChannelHandshakeLimits_set_max_dust_limit_satoshis(this_ptr_conv, val);
3992 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1max_1minimum_1depth(JNIEnv * _env, jclass _b, jlong this_ptr) {
3993 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
3994 return ChannelHandshakeLimits_get_max_minimum_depth(this_ptr_conv);
3997 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1max_1minimum_1depth(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
3998 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
3999 return ChannelHandshakeLimits_set_max_minimum_depth(this_ptr_conv, val);
4002 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1force_1announced_1channel_1preference(JNIEnv * _env, jclass _b, jlong this_ptr) {
4003 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
4004 return ChannelHandshakeLimits_get_force_announced_channel_preference(this_ptr_conv);
4007 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1force_1announced_1channel_1preference(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
4008 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
4009 return ChannelHandshakeLimits_set_force_announced_channel_preference(this_ptr_conv, val);
4012 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1their_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr) {
4013 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
4014 return ChannelHandshakeLimits_get_their_to_self_delay(this_ptr_conv);
4017 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1their_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
4018 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
4019 return ChannelHandshakeLimits_set_their_to_self_delay(this_ptr_conv, val);
4022 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) {
4023 LDKChannelHandshakeLimits* ret = MALLOC(sizeof(LDKChannelHandshakeLimits), "LDKChannelHandshakeLimits");
4024 *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);
4025 DO_ASSERT(ret->is_owned);
4026 ret->is_owned = false;
4030 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1default(JNIEnv * _env, jclass _b) {
4031 LDKChannelHandshakeLimits* ret = MALLOC(sizeof(LDKChannelHandshakeLimits), "LDKChannelHandshakeLimits");
4032 *ret = ChannelHandshakeLimits_default();
4033 DO_ASSERT(ret->is_owned);
4034 ret->is_owned = false;
4038 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4039 LDKChannelConfig this_ptr_conv = *(LDKChannelConfig*)this_ptr;
4040 FREE((void*)this_ptr);
4041 this_ptr_conv.is_owned = true;
4042 return ChannelConfig_free(this_ptr_conv);
4045 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1fee_1proportional_1millionths(JNIEnv * _env, jclass _b, jlong this_ptr) {
4046 LDKChannelConfig* this_ptr_conv = (LDKChannelConfig*)this_ptr;
4047 return ChannelConfig_get_fee_proportional_millionths(this_ptr_conv);
4050 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1fee_1proportional_1millionths(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
4051 LDKChannelConfig* this_ptr_conv = (LDKChannelConfig*)this_ptr;
4052 return ChannelConfig_set_fee_proportional_millionths(this_ptr_conv, val);
4055 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1announced_1channel(JNIEnv * _env, jclass _b, jlong this_ptr) {
4056 LDKChannelConfig* this_ptr_conv = (LDKChannelConfig*)this_ptr;
4057 return ChannelConfig_get_announced_channel(this_ptr_conv);
4060 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1announced_1channel(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
4061 LDKChannelConfig* this_ptr_conv = (LDKChannelConfig*)this_ptr;
4062 return ChannelConfig_set_announced_channel(this_ptr_conv, val);
4065 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1commit_1upfront_1shutdown_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr) {
4066 LDKChannelConfig* this_ptr_conv = (LDKChannelConfig*)this_ptr;
4067 return ChannelConfig_get_commit_upfront_shutdown_pubkey(this_ptr_conv);
4070 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1commit_1upfront_1shutdown_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
4071 LDKChannelConfig* this_ptr_conv = (LDKChannelConfig*)this_ptr;
4072 return ChannelConfig_set_commit_upfront_shutdown_pubkey(this_ptr_conv, val);
4075 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) {
4076 LDKChannelConfig* ret = MALLOC(sizeof(LDKChannelConfig), "LDKChannelConfig");
4077 *ret = ChannelConfig_new(fee_proportional_millionths_arg, announced_channel_arg, commit_upfront_shutdown_pubkey_arg);
4078 DO_ASSERT(ret->is_owned);
4079 ret->is_owned = false;
4083 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1default(JNIEnv * _env, jclass _b) {
4084 LDKChannelConfig* ret = MALLOC(sizeof(LDKChannelConfig), "LDKChannelConfig");
4085 *ret = ChannelConfig_default();
4086 DO_ASSERT(ret->is_owned);
4087 ret->is_owned = false;
4091 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1write(JNIEnv * _env, jclass _b, jlong obj) {
4092 LDKChannelConfig* obj_conv = (LDKChannelConfig*)obj;
4093 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
4094 *ret = ChannelConfig_write(obj_conv);
4098 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1read(JNIEnv * _env, jclass _b, jlong ser) {
4099 LDKu8slice ser_conv = *(LDKu8slice*)ser;
4100 LDKChannelConfig* ret = MALLOC(sizeof(LDKChannelConfig), "LDKChannelConfig");
4101 *ret = ChannelConfig_read(ser_conv);
4102 DO_ASSERT(ret->is_owned);
4103 ret->is_owned = false;
4107 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4108 LDKUserConfig this_ptr_conv = *(LDKUserConfig*)this_ptr;
4109 FREE((void*)this_ptr);
4110 this_ptr_conv.is_owned = true;
4111 return UserConfig_free(this_ptr_conv);
4114 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1own_1channel_1config(JNIEnv * _env, jclass _b, jlong this_ptr) {
4115 LDKUserConfig* this_ptr_conv = (LDKUserConfig*)this_ptr;
4116 LDKChannelHandshakeConfig* ret = MALLOC(sizeof(LDKChannelHandshakeConfig), "LDKChannelHandshakeConfig");
4117 *ret = UserConfig_get_own_channel_config(this_ptr_conv);
4118 DO_ASSERT(ret->is_owned);
4119 ret->is_owned = false;
4123 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1own_1channel_1config(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4124 LDKUserConfig* this_ptr_conv = (LDKUserConfig*)this_ptr;
4125 LDKChannelHandshakeConfig val_conv = *(LDKChannelHandshakeConfig*)val;
4127 val_conv.is_owned = true;
4128 return UserConfig_set_own_channel_config(this_ptr_conv, val_conv);
4131 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1peer_1channel_1config_1limits(JNIEnv * _env, jclass _b, jlong this_ptr) {
4132 LDKUserConfig* this_ptr_conv = (LDKUserConfig*)this_ptr;
4133 LDKChannelHandshakeLimits* ret = MALLOC(sizeof(LDKChannelHandshakeLimits), "LDKChannelHandshakeLimits");
4134 *ret = UserConfig_get_peer_channel_config_limits(this_ptr_conv);
4135 DO_ASSERT(ret->is_owned);
4136 ret->is_owned = false;
4140 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1peer_1channel_1config_1limits(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4141 LDKUserConfig* this_ptr_conv = (LDKUserConfig*)this_ptr;
4142 LDKChannelHandshakeLimits val_conv = *(LDKChannelHandshakeLimits*)val;
4144 val_conv.is_owned = true;
4145 return UserConfig_set_peer_channel_config_limits(this_ptr_conv, val_conv);
4148 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1channel_1options(JNIEnv * _env, jclass _b, jlong this_ptr) {
4149 LDKUserConfig* this_ptr_conv = (LDKUserConfig*)this_ptr;
4150 LDKChannelConfig* ret = MALLOC(sizeof(LDKChannelConfig), "LDKChannelConfig");
4151 *ret = UserConfig_get_channel_options(this_ptr_conv);
4152 DO_ASSERT(ret->is_owned);
4153 ret->is_owned = false;
4157 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1channel_1options(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4158 LDKUserConfig* this_ptr_conv = (LDKUserConfig*)this_ptr;
4159 LDKChannelConfig val_conv = *(LDKChannelConfig*)val;
4161 val_conv.is_owned = true;
4162 return UserConfig_set_channel_options(this_ptr_conv, val_conv);
4165 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) {
4166 LDKChannelHandshakeConfig own_channel_config_arg_conv = *(LDKChannelHandshakeConfig*)own_channel_config_arg;
4167 FREE((void*)own_channel_config_arg);
4168 own_channel_config_arg_conv.is_owned = true;
4169 LDKChannelHandshakeLimits peer_channel_config_limits_arg_conv = *(LDKChannelHandshakeLimits*)peer_channel_config_limits_arg;
4170 FREE((void*)peer_channel_config_limits_arg);
4171 peer_channel_config_limits_arg_conv.is_owned = true;
4172 LDKChannelConfig channel_options_arg_conv = *(LDKChannelConfig*)channel_options_arg;
4173 FREE((void*)channel_options_arg);
4174 channel_options_arg_conv.is_owned = true;
4175 LDKUserConfig* ret = MALLOC(sizeof(LDKUserConfig), "LDKUserConfig");
4176 *ret = UserConfig_new(own_channel_config_arg_conv, peer_channel_config_limits_arg_conv, channel_options_arg_conv);
4177 DO_ASSERT(ret->is_owned);
4178 ret->is_owned = false;
4182 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UserConfig_1default(JNIEnv * _env, jclass _b) {
4183 LDKUserConfig* ret = MALLOC(sizeof(LDKUserConfig), "LDKUserConfig");
4184 *ret = UserConfig_default();
4185 DO_ASSERT(ret->is_owned);
4186 ret->is_owned = false;
4190 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Access_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4191 LDKAccess this_ptr_conv = *(LDKAccess*)this_ptr;
4192 FREE((void*)this_ptr);
4193 return Access_free(this_ptr_conv);
4196 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Watch_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4197 LDKWatch this_ptr_conv = *(LDKWatch*)this_ptr;
4198 FREE((void*)this_ptr);
4199 return Watch_free(this_ptr_conv);
4202 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Filter_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4203 LDKFilter this_ptr_conv = *(LDKFilter*)this_ptr;
4204 FREE((void*)this_ptr);
4205 return Filter_free(this_ptr_conv);
4208 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BroadcasterInterface_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4209 LDKBroadcasterInterface this_ptr_conv = *(LDKBroadcasterInterface*)this_ptr;
4210 FREE((void*)this_ptr);
4211 return BroadcasterInterface_free(this_ptr_conv);
4214 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FeeEstimator_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4215 LDKFeeEstimator this_ptr_conv = *(LDKFeeEstimator*)this_ptr;
4216 FREE((void*)this_ptr);
4217 return FeeEstimator_free(this_ptr_conv);
4220 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4221 LDKChainMonitor this_ptr_conv = *(LDKChainMonitor*)this_ptr;
4222 FREE((void*)this_ptr);
4223 this_ptr_conv.is_owned = true;
4224 return ChainMonitor_free(this_ptr_conv);
4227 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1block_1connected(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray header, jlong txdata, jint height) {
4228 LDKChainMonitor* this_arg_conv = (LDKChainMonitor*)this_arg;
4229 unsigned char header_arr[80];
4230 (*_env)->GetByteArrayRegion (_env, header, 0, 80, header_arr);
4231 unsigned char (*header_ref)[80] = &header_arr;
4232 LDKCVec_C2Tuple_usizeTransactionZZ txdata_conv = *(LDKCVec_C2Tuple_usizeTransactionZZ*)txdata;
4233 FREE((void*)txdata);
4234 return ChainMonitor_block_connected(this_arg_conv, header_ref, txdata_conv, height);
4237 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1block_1disconnected(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray header, jint disconnected_height) {
4238 LDKChainMonitor* this_arg_conv = (LDKChainMonitor*)this_arg;
4239 unsigned char header_arr[80];
4240 (*_env)->GetByteArrayRegion (_env, header, 0, 80, header_arr);
4241 unsigned char (*header_ref)[80] = &header_arr;
4242 return ChainMonitor_block_disconnected(this_arg_conv, header_ref, disconnected_height);
4245 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1new(JNIEnv * _env, jclass _b, jlong chain_source, jlong broadcaster, jlong logger, jlong feeest) {
4246 LDKFilter* chain_source_conv = (LDKFilter*)chain_source;
4247 LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)broadcaster;
4248 if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
4249 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
4250 LDKBroadcasterInterface_JCalls_clone(broadcaster_conv.this_arg);
4252 LDKLogger logger_conv = *(LDKLogger*)logger;
4253 if (logger_conv.free == LDKLogger_JCalls_free) {
4254 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
4255 LDKLogger_JCalls_clone(logger_conv.this_arg);
4257 LDKFeeEstimator feeest_conv = *(LDKFeeEstimator*)feeest;
4258 if (feeest_conv.free == LDKFeeEstimator_JCalls_free) {
4259 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
4260 LDKFeeEstimator_JCalls_clone(feeest_conv.this_arg);
4262 LDKChainMonitor* ret = MALLOC(sizeof(LDKChainMonitor), "LDKChainMonitor");
4263 *ret = ChainMonitor_new(chain_source_conv, broadcaster_conv, logger_conv, feeest_conv);
4264 DO_ASSERT(ret->is_owned);
4265 ret->is_owned = false;
4269 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1as_1Watch(JNIEnv * _env, jclass _b, jlong this_arg) {
4270 LDKChainMonitor* this_arg_conv = (LDKChainMonitor*)this_arg;
4271 LDKWatch* ret = MALLOC(sizeof(LDKWatch), "LDKWatch");
4272 *ret = ChainMonitor_as_Watch(this_arg_conv);
4276 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1as_1EventsProvider(JNIEnv * _env, jclass _b, jlong this_arg) {
4277 LDKChainMonitor* this_arg_conv = (LDKChainMonitor*)this_arg;
4278 LDKEventsProvider* ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider");
4279 *ret = ChainMonitor_as_EventsProvider(this_arg_conv);
4283 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4284 LDKChannelMonitorUpdate this_ptr_conv = *(LDKChannelMonitorUpdate*)this_ptr;
4285 FREE((void*)this_ptr);
4286 this_ptr_conv.is_owned = true;
4287 return ChannelMonitorUpdate_free(this_ptr_conv);
4290 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1get_1update_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4291 LDKChannelMonitorUpdate* this_ptr_conv = (LDKChannelMonitorUpdate*)this_ptr;
4292 return ChannelMonitorUpdate_get_update_id(this_ptr_conv);
4295 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1set_1update_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4296 LDKChannelMonitorUpdate* this_ptr_conv = (LDKChannelMonitorUpdate*)this_ptr;
4297 return ChannelMonitorUpdate_set_update_id(this_ptr_conv, val);
4300 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1write(JNIEnv * _env, jclass _b, jlong obj) {
4301 LDKChannelMonitorUpdate* obj_conv = (LDKChannelMonitorUpdate*)obj;
4302 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
4303 *ret = ChannelMonitorUpdate_write(obj_conv);
4307 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1read(JNIEnv * _env, jclass _b, jlong ser) {
4308 LDKu8slice ser_conv = *(LDKu8slice*)ser;
4309 LDKChannelMonitorUpdate* ret = MALLOC(sizeof(LDKChannelMonitorUpdate), "LDKChannelMonitorUpdate");
4310 *ret = ChannelMonitorUpdate_read(ser_conv);
4311 DO_ASSERT(ret->is_owned);
4312 ret->is_owned = false;
4316 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorUpdateError_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4317 LDKMonitorUpdateError this_ptr_conv = *(LDKMonitorUpdateError*)this_ptr;
4318 FREE((void*)this_ptr);
4319 this_ptr_conv.is_owned = true;
4320 return MonitorUpdateError_free(this_ptr_conv);
4323 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4324 LDKMonitorEvent this_ptr_conv = *(LDKMonitorEvent*)this_ptr;
4325 FREE((void*)this_ptr);
4326 this_ptr_conv.is_owned = true;
4327 return MonitorEvent_free(this_ptr_conv);
4330 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4331 LDKHTLCUpdate this_ptr_conv = *(LDKHTLCUpdate*)this_ptr;
4332 FREE((void*)this_ptr);
4333 this_ptr_conv.is_owned = true;
4334 return HTLCUpdate_free(this_ptr_conv);
4337 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1write(JNIEnv * _env, jclass _b, jlong obj) {
4338 LDKHTLCUpdate* obj_conv = (LDKHTLCUpdate*)obj;
4339 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
4340 *ret = HTLCUpdate_write(obj_conv);
4344 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1read(JNIEnv * _env, jclass _b, jlong ser) {
4345 LDKu8slice ser_conv = *(LDKu8slice*)ser;
4346 LDKHTLCUpdate* ret = MALLOC(sizeof(LDKHTLCUpdate), "LDKHTLCUpdate");
4347 *ret = HTLCUpdate_read(ser_conv);
4348 DO_ASSERT(ret->is_owned);
4349 ret->is_owned = false;
4353 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4354 LDKChannelMonitor this_ptr_conv = *(LDKChannelMonitor*)this_ptr;
4355 FREE((void*)this_ptr);
4356 this_ptr_conv.is_owned = true;
4357 return ChannelMonitor_free(this_ptr_conv);
4360 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1update_1monitor(JNIEnv * _env, jclass _b, jlong this_arg, jlong updates, jlong broadcaster, jlong logger) {
4361 LDKChannelMonitor* this_arg_conv = (LDKChannelMonitor*)this_arg;
4362 LDKChannelMonitorUpdate updates_conv = *(LDKChannelMonitorUpdate*)updates;
4363 FREE((void*)updates);
4364 updates_conv.is_owned = true;
4365 LDKBroadcasterInterface* broadcaster_conv = (LDKBroadcasterInterface*)broadcaster;
4366 LDKLogger* logger_conv = (LDKLogger*)logger;
4367 LDKCResult_NoneMonitorUpdateErrorZ* ret = MALLOC(sizeof(LDKCResult_NoneMonitorUpdateErrorZ), "LDKCResult_NoneMonitorUpdateErrorZ");
4368 *ret = ChannelMonitor_update_monitor(this_arg_conv, updates_conv, broadcaster_conv, logger_conv);
4372 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1latest_1update_1id(JNIEnv * _env, jclass _b, jlong this_arg) {
4373 LDKChannelMonitor* this_arg_conv = (LDKChannelMonitor*)this_arg;
4374 return ChannelMonitor_get_latest_update_id(this_arg_conv);
4377 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1funding_1txo(JNIEnv * _env, jclass _b, jlong this_arg) {
4378 LDKChannelMonitor* this_arg_conv = (LDKChannelMonitor*)this_arg;
4379 LDKC2Tuple_OutPointScriptZ* ret = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ");
4380 *ret = ChannelMonitor_get_funding_txo(this_arg_conv);
4384 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1and_1clear_1pending_1monitor_1events(JNIEnv * _env, jclass _b, jlong this_arg) {
4385 LDKChannelMonitor* this_arg_conv = (LDKChannelMonitor*)this_arg;
4386 LDKCVec_MonitorEventZ* ret = MALLOC(sizeof(LDKCVec_MonitorEventZ), "LDKCVec_MonitorEventZ");
4387 *ret = ChannelMonitor_get_and_clear_pending_monitor_events(this_arg_conv);
4391 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1and_1clear_1pending_1events(JNIEnv * _env, jclass _b, jlong this_arg) {
4392 LDKChannelMonitor* this_arg_conv = (LDKChannelMonitor*)this_arg;
4393 LDKCVec_EventZ* ret = MALLOC(sizeof(LDKCVec_EventZ), "LDKCVec_EventZ");
4394 *ret = ChannelMonitor_get_and_clear_pending_events(this_arg_conv);
4398 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1latest_1holder_1commitment_1txn(JNIEnv * _env, jclass _b, jlong this_arg, jlong logger) {
4399 LDKChannelMonitor* this_arg_conv = (LDKChannelMonitor*)this_arg;
4400 LDKLogger* logger_conv = (LDKLogger*)logger;
4401 LDKCVec_TransactionZ* ret = MALLOC(sizeof(LDKCVec_TransactionZ), "LDKCVec_TransactionZ");
4402 *ret = ChannelMonitor_get_latest_holder_commitment_txn(this_arg_conv, logger_conv);
4406 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) {
4407 LDKChannelMonitor* this_arg_conv = (LDKChannelMonitor*)this_arg;
4408 unsigned char header_arr[80];
4409 (*_env)->GetByteArrayRegion (_env, header, 0, 80, header_arr);
4410 unsigned char (*header_ref)[80] = &header_arr;
4411 LDKCVec_C2Tuple_usizeTransactionZZ txdata_conv = *(LDKCVec_C2Tuple_usizeTransactionZZ*)txdata;
4412 FREE((void*)txdata);
4413 LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)broadcaster;
4414 if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
4415 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
4416 LDKBroadcasterInterface_JCalls_clone(broadcaster_conv.this_arg);
4418 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)fee_estimator;
4419 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
4420 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
4421 LDKFeeEstimator_JCalls_clone(fee_estimator_conv.this_arg);
4423 LDKLogger logger_conv = *(LDKLogger*)logger;
4424 if (logger_conv.free == LDKLogger_JCalls_free) {
4425 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
4426 LDKLogger_JCalls_clone(logger_conv.this_arg);
4428 LDKCVec_C2Tuple_TxidCVec_TxOutZZZ* ret = MALLOC(sizeof(LDKCVec_C2Tuple_TxidCVec_TxOutZZZ), "LDKCVec_C2Tuple_TxidCVec_TxOutZZZ");
4429 *ret = ChannelMonitor_block_connected(this_arg_conv, header_ref, txdata_conv, height, broadcaster_conv, fee_estimator_conv, logger_conv);
4433 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) {
4434 LDKChannelMonitor* this_arg_conv = (LDKChannelMonitor*)this_arg;
4435 unsigned char header_arr[80];
4436 (*_env)->GetByteArrayRegion (_env, header, 0, 80, header_arr);
4437 unsigned char (*header_ref)[80] = &header_arr;
4438 LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)broadcaster;
4439 if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
4440 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
4441 LDKBroadcasterInterface_JCalls_clone(broadcaster_conv.this_arg);
4443 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)fee_estimator;
4444 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
4445 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
4446 LDKFeeEstimator_JCalls_clone(fee_estimator_conv.this_arg);
4448 LDKLogger logger_conv = *(LDKLogger*)logger;
4449 if (logger_conv.free == LDKLogger_JCalls_free) {
4450 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
4451 LDKLogger_JCalls_clone(logger_conv.this_arg);
4453 return ChannelMonitor_block_disconnected(this_arg_conv, header_ref, height, broadcaster_conv, fee_estimator_conv, logger_conv);
4456 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4457 LDKOutPoint this_ptr_conv = *(LDKOutPoint*)this_ptr;
4458 FREE((void*)this_ptr);
4459 this_ptr_conv.is_owned = true;
4460 return OutPoint_free(this_ptr_conv);
4463 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OutPoint_1get_1txid(JNIEnv * _env, jclass _b, jlong this_ptr) {
4464 LDKOutPoint* this_ptr_conv = (LDKOutPoint*)this_ptr;
4465 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4466 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *OutPoint_get_txid(this_ptr_conv));
4470 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1set_1txid(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
4471 LDKOutPoint* this_ptr_conv = (LDKOutPoint*)this_ptr;
4472 LDKThirtyTwoBytes val_ref;
4473 (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
4474 return OutPoint_set_txid(this_ptr_conv, val_ref);
4477 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_OutPoint_1get_1index(JNIEnv * _env, jclass _b, jlong this_ptr) {
4478 LDKOutPoint* this_ptr_conv = (LDKOutPoint*)this_ptr;
4479 return OutPoint_get_index(this_ptr_conv);
4482 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1set_1index(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
4483 LDKOutPoint* this_ptr_conv = (LDKOutPoint*)this_ptr;
4484 return OutPoint_set_index(this_ptr_conv, val);
4487 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OutPoint_1new(JNIEnv * _env, jclass _b, jbyteArray txid_arg, jshort index_arg) {
4488 LDKThirtyTwoBytes txid_arg_ref;
4489 (*_env)->GetByteArrayRegion (_env, txid_arg, 0, 32, txid_arg_ref.data);
4490 LDKOutPoint* ret = MALLOC(sizeof(LDKOutPoint), "LDKOutPoint");
4491 *ret = OutPoint_new(txid_arg_ref, index_arg);
4492 DO_ASSERT(ret->is_owned);
4493 ret->is_owned = false;
4497 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OutPoint_1to_1channel_1id(JNIEnv * _env, jclass _b, jlong this_arg) {
4498 LDKOutPoint* this_arg_conv = (LDKOutPoint*)this_arg;
4499 jbyteArray _arr = (*_env)->NewByteArray(_env, 32);
4500 (*_env)->SetByteArrayRegion(_env, _arr, 0, 32, OutPoint_to_channel_id(this_arg_conv).data);
4504 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OutPoint_1write(JNIEnv * _env, jclass _b, jlong obj) {
4505 LDKOutPoint* obj_conv = (LDKOutPoint*)obj;
4506 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
4507 *ret = OutPoint_write(obj_conv);
4511 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OutPoint_1read(JNIEnv * _env, jclass _b, jlong ser) {
4512 LDKu8slice ser_conv = *(LDKu8slice*)ser;
4513 LDKOutPoint* ret = MALLOC(sizeof(LDKOutPoint), "LDKOutPoint");
4514 *ret = OutPoint_read(ser_conv);
4515 DO_ASSERT(ret->is_owned);
4516 ret->is_owned = false;
4520 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4521 LDKSpendableOutputDescriptor this_ptr_conv = *(LDKSpendableOutputDescriptor*)this_ptr;
4522 FREE((void*)this_ptr);
4523 return SpendableOutputDescriptor_free(this_ptr_conv);
4526 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4527 LDKChannelKeys this_ptr_conv = *(LDKChannelKeys*)this_ptr;
4528 FREE((void*)this_ptr);
4529 return ChannelKeys_free(this_ptr_conv);
4532 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_KeysInterface_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4533 LDKKeysInterface this_ptr_conv = *(LDKKeysInterface*)this_ptr;
4534 FREE((void*)this_ptr);
4535 return KeysInterface_free(this_ptr_conv);
4538 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4539 LDKInMemoryChannelKeys this_ptr_conv = *(LDKInMemoryChannelKeys*)this_ptr;
4540 FREE((void*)this_ptr);
4541 this_ptr_conv.is_owned = true;
4542 return InMemoryChannelKeys_free(this_ptr_conv);
4545 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1funding_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
4546 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
4547 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4548 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *InMemoryChannelKeys_get_funding_key(this_ptr_conv));
4552 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1funding_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4553 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
4554 LDKSecretKey val_conv = *(LDKSecretKey*)val;
4556 return InMemoryChannelKeys_set_funding_key(this_ptr_conv, val_conv);
4559 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1revocation_1base_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
4560 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
4561 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4562 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *InMemoryChannelKeys_get_revocation_base_key(this_ptr_conv));
4566 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1revocation_1base_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4567 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
4568 LDKSecretKey val_conv = *(LDKSecretKey*)val;
4570 return InMemoryChannelKeys_set_revocation_base_key(this_ptr_conv, val_conv);
4573 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1payment_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
4574 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
4575 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4576 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *InMemoryChannelKeys_get_payment_key(this_ptr_conv));
4580 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1payment_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4581 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
4582 LDKSecretKey val_conv = *(LDKSecretKey*)val;
4584 return InMemoryChannelKeys_set_payment_key(this_ptr_conv, val_conv);
4587 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1delayed_1payment_1base_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
4588 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
4589 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4590 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *InMemoryChannelKeys_get_delayed_payment_base_key(this_ptr_conv));
4594 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1delayed_1payment_1base_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4595 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
4596 LDKSecretKey val_conv = *(LDKSecretKey*)val;
4598 return InMemoryChannelKeys_set_delayed_payment_base_key(this_ptr_conv, val_conv);
4601 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1htlc_1base_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
4602 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
4603 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4604 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *InMemoryChannelKeys_get_htlc_base_key(this_ptr_conv));
4608 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1htlc_1base_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4609 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
4610 LDKSecretKey val_conv = *(LDKSecretKey*)val;
4612 return InMemoryChannelKeys_set_htlc_base_key(this_ptr_conv, val_conv);
4615 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1commitment_1seed(JNIEnv * _env, jclass _b, jlong this_ptr) {
4616 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
4617 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4618 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *InMemoryChannelKeys_get_commitment_seed(this_ptr_conv));
4622 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1commitment_1seed(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
4623 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
4624 LDKThirtyTwoBytes val_ref;
4625 (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
4626 return InMemoryChannelKeys_set_commitment_seed(this_ptr_conv, val_ref);
4629 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, jbyteArray commitment_seed, jlong channel_value_satoshis, jlong key_derivation_params) {
4630 LDKSecretKey funding_key_conv = *(LDKSecretKey*)funding_key;
4631 FREE((void*)funding_key);
4632 LDKSecretKey revocation_base_key_conv = *(LDKSecretKey*)revocation_base_key;
4633 FREE((void*)revocation_base_key);
4634 LDKSecretKey payment_key_conv = *(LDKSecretKey*)payment_key;
4635 FREE((void*)payment_key);
4636 LDKSecretKey delayed_payment_base_key_conv = *(LDKSecretKey*)delayed_payment_base_key;
4637 FREE((void*)delayed_payment_base_key);
4638 LDKSecretKey htlc_base_key_conv = *(LDKSecretKey*)htlc_base_key;
4639 FREE((void*)htlc_base_key);
4640 LDKThirtyTwoBytes commitment_seed_ref;
4641 (*_env)->GetByteArrayRegion (_env, commitment_seed, 0, 32, commitment_seed_ref.data);
4642 LDKC2Tuple_u64u64Z key_derivation_params_conv = *(LDKC2Tuple_u64u64Z*)key_derivation_params;
4643 FREE((void*)key_derivation_params);
4644 LDKInMemoryChannelKeys* ret = MALLOC(sizeof(LDKInMemoryChannelKeys), "LDKInMemoryChannelKeys");
4645 *ret = InMemoryChannelKeys_new(funding_key_conv, revocation_base_key_conv, payment_key_conv, delayed_payment_base_key_conv, htlc_base_key_conv, commitment_seed_ref, channel_value_satoshis, key_derivation_params_conv);
4646 DO_ASSERT(ret->is_owned);
4647 ret->is_owned = false;
4651 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1counterparty_1pubkeys(JNIEnv * _env, jclass _b, jlong this_arg) {
4652 LDKInMemoryChannelKeys* this_arg_conv = (LDKInMemoryChannelKeys*)this_arg;
4653 LDKChannelPublicKeys* ret = MALLOC(sizeof(LDKChannelPublicKeys), "LDKChannelPublicKeys");
4654 *ret = InMemoryChannelKeys_counterparty_pubkeys(this_arg_conv);
4655 DO_ASSERT(ret->is_owned);
4656 ret->is_owned = false;
4660 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1counterparty_1selected_1contest_1delay(JNIEnv * _env, jclass _b, jlong this_arg) {
4661 LDKInMemoryChannelKeys* this_arg_conv = (LDKInMemoryChannelKeys*)this_arg;
4662 return InMemoryChannelKeys_counterparty_selected_contest_delay(this_arg_conv);
4665 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1holder_1selected_1contest_1delay(JNIEnv * _env, jclass _b, jlong this_arg) {
4666 LDKInMemoryChannelKeys* this_arg_conv = (LDKInMemoryChannelKeys*)this_arg;
4667 return InMemoryChannelKeys_holder_selected_contest_delay(this_arg_conv);
4670 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1as_1ChannelKeys(JNIEnv * _env, jclass _b, jlong this_arg) {
4671 LDKInMemoryChannelKeys* this_arg_conv = (LDKInMemoryChannelKeys*)this_arg;
4672 LDKChannelKeys* ret = MALLOC(sizeof(LDKChannelKeys), "LDKChannelKeys");
4673 *ret = InMemoryChannelKeys_as_ChannelKeys(this_arg_conv);
4677 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1write(JNIEnv * _env, jclass _b, jlong obj) {
4678 LDKInMemoryChannelKeys* obj_conv = (LDKInMemoryChannelKeys*)obj;
4679 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
4680 *ret = InMemoryChannelKeys_write(obj_conv);
4684 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1read(JNIEnv * _env, jclass _b, jlong ser) {
4685 LDKu8slice ser_conv = *(LDKu8slice*)ser;
4686 LDKInMemoryChannelKeys* ret = MALLOC(sizeof(LDKInMemoryChannelKeys), "LDKInMemoryChannelKeys");
4687 *ret = InMemoryChannelKeys_read(ser_conv);
4688 DO_ASSERT(ret->is_owned);
4689 ret->is_owned = false;
4693 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_KeysManager_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4694 LDKKeysManager this_ptr_conv = *(LDKKeysManager*)this_ptr;
4695 FREE((void*)this_ptr);
4696 this_ptr_conv.is_owned = true;
4697 return KeysManager_free(this_ptr_conv);
4700 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) {
4701 unsigned char seed_arr[32];
4702 (*_env)->GetByteArrayRegion (_env, seed, 0, 32, seed_arr);
4703 unsigned char (*seed_ref)[32] = &seed_arr;
4704 LDKNetwork network_conv = LDKNetwork_from_java(_env, network);
4705 LDKKeysManager* ret = MALLOC(sizeof(LDKKeysManager), "LDKKeysManager");
4706 *ret = KeysManager_new(seed_ref, network_conv, starting_time_secs, starting_time_nanos);
4707 DO_ASSERT(ret->is_owned);
4708 ret->is_owned = false;
4712 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) {
4713 LDKKeysManager* this_arg_conv = (LDKKeysManager*)this_arg;
4714 LDKInMemoryChannelKeys* ret = MALLOC(sizeof(LDKInMemoryChannelKeys), "LDKInMemoryChannelKeys");
4715 *ret = KeysManager_derive_channel_keys(this_arg_conv, channel_value_satoshis, params_1, params_2);
4716 DO_ASSERT(ret->is_owned);
4717 ret->is_owned = false;
4721 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_KeysManager_1as_1KeysInterface(JNIEnv * _env, jclass _b, jlong this_arg) {
4722 LDKKeysManager* this_arg_conv = (LDKKeysManager*)this_arg;
4723 LDKKeysInterface* ret = MALLOC(sizeof(LDKKeysInterface), "LDKKeysInterface");
4724 *ret = KeysManager_as_KeysInterface(this_arg_conv);
4728 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4729 LDKChannelManager this_ptr_conv = *(LDKChannelManager*)this_ptr;
4730 FREE((void*)this_ptr);
4731 this_ptr_conv.is_owned = true;
4732 return ChannelManager_free(this_ptr_conv);
4735 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4736 LDKChannelDetails this_ptr_conv = *(LDKChannelDetails*)this_ptr;
4737 FREE((void*)this_ptr);
4738 this_ptr_conv.is_owned = true;
4739 return ChannelDetails_free(this_ptr_conv);
4742 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4743 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
4744 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4745 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *ChannelDetails_get_channel_id(this_ptr_conv));
4749 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
4750 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
4751 LDKThirtyTwoBytes val_ref;
4752 (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
4753 return ChannelDetails_set_channel_id(this_ptr_conv, val_ref);
4756 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1remote_1network_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4757 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
4758 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
4759 *ret = ChannelDetails_get_remote_network_id(this_ptr_conv);
4763 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1remote_1network_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4764 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
4765 LDKPublicKey val_conv = *(LDKPublicKey*)val;
4767 return ChannelDetails_set_remote_network_id(this_ptr_conv, val_conv);
4770 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1counterparty_1features(JNIEnv * _env, jclass _b, jlong this_ptr) {
4771 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
4772 LDKInitFeatures* ret = MALLOC(sizeof(LDKInitFeatures), "LDKInitFeatures");
4773 *ret = ChannelDetails_get_counterparty_features(this_ptr_conv);
4774 DO_ASSERT(ret->is_owned);
4775 ret->is_owned = false;
4779 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1counterparty_1features(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4780 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
4781 LDKInitFeatures val_conv = *(LDKInitFeatures*)val;
4783 val_conv.is_owned = true;
4784 return ChannelDetails_set_counterparty_features(this_ptr_conv, val_conv);
4787 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1channel_1value_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
4788 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
4789 return ChannelDetails_get_channel_value_satoshis(this_ptr_conv);
4792 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1channel_1value_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4793 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
4794 return ChannelDetails_set_channel_value_satoshis(this_ptr_conv, val);
4797 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1user_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4798 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
4799 return ChannelDetails_get_user_id(this_ptr_conv);
4802 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1user_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4803 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
4804 return ChannelDetails_set_user_id(this_ptr_conv, val);
4807 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1outbound_1capacity_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
4808 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
4809 return ChannelDetails_get_outbound_capacity_msat(this_ptr_conv);
4812 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1outbound_1capacity_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4813 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
4814 return ChannelDetails_set_outbound_capacity_msat(this_ptr_conv, val);
4817 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1inbound_1capacity_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
4818 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
4819 return ChannelDetails_get_inbound_capacity_msat(this_ptr_conv);
4822 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1inbound_1capacity_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4823 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
4824 return ChannelDetails_set_inbound_capacity_msat(this_ptr_conv, val);
4827 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1is_1live(JNIEnv * _env, jclass _b, jlong this_ptr) {
4828 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
4829 return ChannelDetails_get_is_live(this_ptr_conv);
4832 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1is_1live(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
4833 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
4834 return ChannelDetails_set_is_live(this_ptr_conv, val);
4837 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4838 LDKPaymentSendFailure this_ptr_conv = *(LDKPaymentSendFailure*)this_ptr;
4839 FREE((void*)this_ptr);
4840 this_ptr_conv.is_owned = true;
4841 return PaymentSendFailure_free(this_ptr_conv);
4844 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) {
4845 LDKNetwork network_conv = LDKNetwork_from_java(_env, network);
4846 LDKFeeEstimator fee_est_conv = *(LDKFeeEstimator*)fee_est;
4847 if (fee_est_conv.free == LDKFeeEstimator_JCalls_free) {
4848 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
4849 LDKFeeEstimator_JCalls_clone(fee_est_conv.this_arg);
4851 LDKWatch chain_monitor_conv = *(LDKWatch*)chain_monitor;
4852 if (chain_monitor_conv.free == LDKWatch_JCalls_free) {
4853 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
4854 LDKWatch_JCalls_clone(chain_monitor_conv.this_arg);
4856 LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)tx_broadcaster;
4857 if (tx_broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
4858 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
4859 LDKBroadcasterInterface_JCalls_clone(tx_broadcaster_conv.this_arg);
4861 LDKLogger logger_conv = *(LDKLogger*)logger;
4862 if (logger_conv.free == LDKLogger_JCalls_free) {
4863 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
4864 LDKLogger_JCalls_clone(logger_conv.this_arg);
4866 LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)keys_manager;
4867 if (keys_manager_conv.free == LDKKeysInterface_JCalls_free) {
4868 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
4869 LDKKeysInterface_JCalls_clone(keys_manager_conv.this_arg);
4871 LDKUserConfig config_conv = *(LDKUserConfig*)config;
4872 FREE((void*)config);
4873 config_conv.is_owned = true;
4874 LDKChannelManager* ret = MALLOC(sizeof(LDKChannelManager), "LDKChannelManager");
4875 *ret = ChannelManager_new(network_conv, fee_est_conv, chain_monitor_conv, tx_broadcaster_conv, logger_conv, keys_manager_conv, config_conv, current_blockchain_height);
4876 DO_ASSERT(ret->is_owned);
4877 ret->is_owned = false;
4881 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) {
4882 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
4883 LDKPublicKey their_network_key_conv = *(LDKPublicKey*)their_network_key;
4884 FREE((void*)their_network_key);
4885 LDKUserConfig override_config_conv = *(LDKUserConfig*)override_config;
4886 FREE((void*)override_config);
4887 override_config_conv.is_owned = true;
4888 LDKCResult_NoneAPIErrorZ* ret = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
4889 *ret = ChannelManager_create_channel(this_arg_conv, their_network_key_conv, channel_value_satoshis, push_msat, user_id, override_config_conv);
4893 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1list_1channels(JNIEnv * _env, jclass _b, jlong this_arg) {
4894 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
4895 LDKCVec_ChannelDetailsZ* ret = MALLOC(sizeof(LDKCVec_ChannelDetailsZ), "LDKCVec_ChannelDetailsZ");
4896 *ret = ChannelManager_list_channels(this_arg_conv);
4900 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1list_1usable_1channels(JNIEnv * _env, jclass _b, jlong this_arg) {
4901 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
4902 LDKCVec_ChannelDetailsZ* ret = MALLOC(sizeof(LDKCVec_ChannelDetailsZ), "LDKCVec_ChannelDetailsZ");
4903 *ret = ChannelManager_list_usable_channels(this_arg_conv);
4907 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1close_1channel(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray channel_id) {
4908 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
4909 unsigned char channel_id_arr[32];
4910 (*_env)->GetByteArrayRegion (_env, channel_id, 0, 32, channel_id_arr);
4911 unsigned char (*channel_id_ref)[32] = &channel_id_arr;
4912 LDKCResult_NoneAPIErrorZ* ret = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
4913 *ret = ChannelManager_close_channel(this_arg_conv, channel_id_ref);
4917 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1close_1channel(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray channel_id) {
4918 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
4919 unsigned char channel_id_arr[32];
4920 (*_env)->GetByteArrayRegion (_env, channel_id, 0, 32, channel_id_arr);
4921 unsigned char (*channel_id_ref)[32] = &channel_id_arr;
4922 return ChannelManager_force_close_channel(this_arg_conv, channel_id_ref);
4925 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1close_1all_1channels(JNIEnv * _env, jclass _b, jlong this_arg) {
4926 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
4927 return ChannelManager_force_close_all_channels(this_arg_conv);
4930 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1send_1payment(JNIEnv * _env, jclass _b, jlong this_arg, jlong route, jbyteArray payment_hash, jbyteArray payment_secret) {
4931 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
4932 LDKRoute* route_conv = (LDKRoute*)route;
4933 LDKThirtyTwoBytes payment_hash_ref;
4934 (*_env)->GetByteArrayRegion (_env, payment_hash, 0, 32, payment_hash_ref.data);
4935 LDKThirtyTwoBytes payment_secret_ref;
4936 (*_env)->GetByteArrayRegion (_env, payment_secret, 0, 32, payment_secret_ref.data);
4937 LDKCResult_NonePaymentSendFailureZ* ret = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
4938 *ret = ChannelManager_send_payment(this_arg_conv, route_conv, payment_hash_ref, payment_secret_ref);
4942 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) {
4943 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
4944 unsigned char temporary_channel_id_arr[32];
4945 (*_env)->GetByteArrayRegion (_env, temporary_channel_id, 0, 32, temporary_channel_id_arr);
4946 unsigned char (*temporary_channel_id_ref)[32] = &temporary_channel_id_arr;
4947 LDKOutPoint funding_txo_conv = *(LDKOutPoint*)funding_txo;
4948 FREE((void*)funding_txo);
4949 funding_txo_conv.is_owned = true;
4950 return ChannelManager_funding_transaction_generated(this_arg_conv, temporary_channel_id_ref, funding_txo_conv);
4953 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1broadcast_1node_1announcement(JNIEnv * _env, jclass _b, jlong this_arg, jlong rgb, jbyteArray alias, jlong addresses) {
4954 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
4955 LDKThreeBytes rgb_conv = *(LDKThreeBytes*)rgb;
4957 LDKThirtyTwoBytes alias_ref;
4958 (*_env)->GetByteArrayRegion (_env, alias, 0, 32, alias_ref.data);
4959 LDKCVec_NetAddressZ addresses_conv = *(LDKCVec_NetAddressZ*)addresses;
4960 FREE((void*)addresses);
4961 return ChannelManager_broadcast_node_announcement(this_arg_conv, rgb_conv, alias_ref, addresses_conv);
4964 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1process_1pending_1htlc_1forwards(JNIEnv * _env, jclass _b, jlong this_arg) {
4965 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
4966 return ChannelManager_process_pending_htlc_forwards(this_arg_conv);
4969 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1timer_1chan_1freshness_1every_1min(JNIEnv * _env, jclass _b, jlong this_arg) {
4970 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
4971 return ChannelManager_timer_chan_freshness_every_min(this_arg_conv);
4974 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelManager_1fail_1htlc_1backwards(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray payment_hash, jbyteArray payment_secret) {
4975 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
4976 unsigned char payment_hash_arr[32];
4977 (*_env)->GetByteArrayRegion (_env, payment_hash, 0, 32, payment_hash_arr);
4978 unsigned char (*payment_hash_ref)[32] = &payment_hash_arr;
4979 LDKThirtyTwoBytes payment_secret_ref;
4980 (*_env)->GetByteArrayRegion (_env, payment_secret, 0, 32, payment_secret_ref.data);
4981 return ChannelManager_fail_htlc_backwards(this_arg_conv, payment_hash_ref, payment_secret_ref);
4984 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelManager_1claim_1funds(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray payment_preimage, jbyteArray payment_secret, jlong expected_amount) {
4985 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
4986 LDKThirtyTwoBytes payment_preimage_ref;
4987 (*_env)->GetByteArrayRegion (_env, payment_preimage, 0, 32, payment_preimage_ref.data);
4988 LDKThirtyTwoBytes payment_secret_ref;
4989 (*_env)->GetByteArrayRegion (_env, payment_secret, 0, 32, payment_secret_ref.data);
4990 return ChannelManager_claim_funds(this_arg_conv, payment_preimage_ref, payment_secret_ref, expected_amount);
4993 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1our_1node_1id(JNIEnv * _env, jclass _b, jlong this_arg) {
4994 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
4995 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
4996 *ret = ChannelManager_get_our_node_id(this_arg_conv);
5000 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) {
5001 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
5002 LDKOutPoint* funding_txo_conv = (LDKOutPoint*)funding_txo;
5003 return ChannelManager_channel_monitor_updated(this_arg_conv, funding_txo_conv, highest_applied_update_id);
5006 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1MessageSendEventsProvider(JNIEnv * _env, jclass _b, jlong this_arg) {
5007 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
5008 LDKMessageSendEventsProvider* ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
5009 *ret = ChannelManager_as_MessageSendEventsProvider(this_arg_conv);
5013 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1EventsProvider(JNIEnv * _env, jclass _b, jlong this_arg) {
5014 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
5015 LDKEventsProvider* ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider");
5016 *ret = ChannelManager_as_EventsProvider(this_arg_conv);
5020 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1block_1connected(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray header, jlong txdata, jint height) {
5021 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
5022 unsigned char header_arr[80];
5023 (*_env)->GetByteArrayRegion (_env, header, 0, 80, header_arr);
5024 unsigned char (*header_ref)[80] = &header_arr;
5025 LDKCVec_C2Tuple_usizeTransactionZZ txdata_conv = *(LDKCVec_C2Tuple_usizeTransactionZZ*)txdata;
5026 FREE((void*)txdata);
5027 return ChannelManager_block_connected(this_arg_conv, header_ref, txdata_conv, height);
5030 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1block_1disconnected(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray header) {
5031 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
5032 unsigned char header_arr[80];
5033 (*_env)->GetByteArrayRegion (_env, header, 0, 80, header_arr);
5034 unsigned char (*header_ref)[80] = &header_arr;
5035 return ChannelManager_block_disconnected(this_arg_conv, header_ref);
5038 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1ChannelMessageHandler(JNIEnv * _env, jclass _b, jlong this_arg) {
5039 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
5040 LDKChannelMessageHandler* ret = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler");
5041 *ret = ChannelManager_as_ChannelMessageHandler(this_arg_conv);
5045 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5046 LDKChannelManagerReadArgs this_ptr_conv = *(LDKChannelManagerReadArgs*)this_ptr;
5047 FREE((void*)this_ptr);
5048 this_ptr_conv.is_owned = true;
5049 return ChannelManagerReadArgs_free(this_ptr_conv);
5052 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1keys_1manager(JNIEnv * _env, jclass _b, jlong this_ptr) {
5053 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
5054 long ret = (long)ChannelManagerReadArgs_get_keys_manager(this_ptr_conv);
5058 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1keys_1manager(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5059 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
5060 LDKKeysInterface val_conv = *(LDKKeysInterface*)val;
5061 if (val_conv.free == LDKKeysInterface_JCalls_free) {
5062 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
5063 LDKKeysInterface_JCalls_clone(val_conv.this_arg);
5065 return ChannelManagerReadArgs_set_keys_manager(this_ptr_conv, val_conv);
5068 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1fee_1estimator(JNIEnv * _env, jclass _b, jlong this_ptr) {
5069 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
5070 long ret = (long)ChannelManagerReadArgs_get_fee_estimator(this_ptr_conv);
5074 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1fee_1estimator(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5075 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
5076 LDKFeeEstimator val_conv = *(LDKFeeEstimator*)val;
5077 if (val_conv.free == LDKFeeEstimator_JCalls_free) {
5078 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
5079 LDKFeeEstimator_JCalls_clone(val_conv.this_arg);
5081 return ChannelManagerReadArgs_set_fee_estimator(this_ptr_conv, val_conv);
5084 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1chain_1monitor(JNIEnv * _env, jclass _b, jlong this_ptr) {
5085 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
5086 long ret = (long)ChannelManagerReadArgs_get_chain_monitor(this_ptr_conv);
5090 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1chain_1monitor(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5091 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
5092 LDKWatch val_conv = *(LDKWatch*)val;
5093 if (val_conv.free == LDKWatch_JCalls_free) {
5094 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
5095 LDKWatch_JCalls_clone(val_conv.this_arg);
5097 return ChannelManagerReadArgs_set_chain_monitor(this_ptr_conv, val_conv);
5100 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1tx_1broadcaster(JNIEnv * _env, jclass _b, jlong this_ptr) {
5101 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
5102 long ret = (long)ChannelManagerReadArgs_get_tx_broadcaster(this_ptr_conv);
5106 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1tx_1broadcaster(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5107 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
5108 LDKBroadcasterInterface val_conv = *(LDKBroadcasterInterface*)val;
5109 if (val_conv.free == LDKBroadcasterInterface_JCalls_free) {
5110 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
5111 LDKBroadcasterInterface_JCalls_clone(val_conv.this_arg);
5113 return ChannelManagerReadArgs_set_tx_broadcaster(this_ptr_conv, val_conv);
5116 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1logger(JNIEnv * _env, jclass _b, jlong this_ptr) {
5117 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
5118 long ret = (long)ChannelManagerReadArgs_get_logger(this_ptr_conv);
5122 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1logger(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5123 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
5124 LDKLogger val_conv = *(LDKLogger*)val;
5125 if (val_conv.free == LDKLogger_JCalls_free) {
5126 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
5127 LDKLogger_JCalls_clone(val_conv.this_arg);
5129 return ChannelManagerReadArgs_set_logger(this_ptr_conv, val_conv);
5132 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1default_1config(JNIEnv * _env, jclass _b, jlong this_ptr) {
5133 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
5134 LDKUserConfig* ret = MALLOC(sizeof(LDKUserConfig), "LDKUserConfig");
5135 *ret = ChannelManagerReadArgs_get_default_config(this_ptr_conv);
5136 DO_ASSERT(ret->is_owned);
5137 ret->is_owned = false;
5141 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1default_1config(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5142 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
5143 LDKUserConfig val_conv = *(LDKUserConfig*)val;
5145 val_conv.is_owned = true;
5146 return ChannelManagerReadArgs_set_default_config(this_ptr_conv, val_conv);
5149 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) {
5150 LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)keys_manager;
5151 if (keys_manager_conv.free == LDKKeysInterface_JCalls_free) {
5152 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
5153 LDKKeysInterface_JCalls_clone(keys_manager_conv.this_arg);
5155 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)fee_estimator;
5156 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
5157 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
5158 LDKFeeEstimator_JCalls_clone(fee_estimator_conv.this_arg);
5160 LDKWatch chain_monitor_conv = *(LDKWatch*)chain_monitor;
5161 if (chain_monitor_conv.free == LDKWatch_JCalls_free) {
5162 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
5163 LDKWatch_JCalls_clone(chain_monitor_conv.this_arg);
5165 LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)tx_broadcaster;
5166 if (tx_broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
5167 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
5168 LDKBroadcasterInterface_JCalls_clone(tx_broadcaster_conv.this_arg);
5170 LDKLogger logger_conv = *(LDKLogger*)logger;
5171 if (logger_conv.free == LDKLogger_JCalls_free) {
5172 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
5173 LDKLogger_JCalls_clone(logger_conv.this_arg);
5175 LDKUserConfig default_config_conv = *(LDKUserConfig*)default_config;
5176 FREE((void*)default_config);
5177 default_config_conv.is_owned = true;
5178 LDKCVec_ChannelMonitorZ channel_monitors_conv = *(LDKCVec_ChannelMonitorZ*)channel_monitors;
5179 FREE((void*)channel_monitors);
5180 LDKChannelManagerReadArgs* ret = MALLOC(sizeof(LDKChannelManagerReadArgs), "LDKChannelManagerReadArgs");
5181 *ret = ChannelManagerReadArgs_new(keys_manager_conv, fee_estimator_conv, chain_monitor_conv, tx_broadcaster_conv, logger_conv, default_config_conv, channel_monitors_conv);
5182 DO_ASSERT(ret->is_owned);
5183 ret->is_owned = false;
5187 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DecodeError_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5188 LDKDecodeError this_ptr_conv = *(LDKDecodeError*)this_ptr;
5189 FREE((void*)this_ptr);
5190 this_ptr_conv.is_owned = true;
5191 return DecodeError_free(this_ptr_conv);
5194 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Init_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5195 LDKInit this_ptr_conv = *(LDKInit*)this_ptr;
5196 FREE((void*)this_ptr);
5197 this_ptr_conv.is_owned = true;
5198 return Init_free(this_ptr_conv);
5201 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5202 LDKErrorMessage this_ptr_conv = *(LDKErrorMessage*)this_ptr;
5203 FREE((void*)this_ptr);
5204 this_ptr_conv.is_owned = true;
5205 return ErrorMessage_free(this_ptr_conv);
5208 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
5209 LDKErrorMessage* this_ptr_conv = (LDKErrorMessage*)this_ptr;
5210 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
5211 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *ErrorMessage_get_channel_id(this_ptr_conv));
5215 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
5216 LDKErrorMessage* this_ptr_conv = (LDKErrorMessage*)this_ptr;
5217 LDKThirtyTwoBytes val_ref;
5218 (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
5219 return ErrorMessage_set_channel_id(this_ptr_conv, val_ref);
5222 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1get_1data(JNIEnv * _env, jclass _b, jlong this_ptr) {
5223 LDKErrorMessage* this_ptr_conv = (LDKErrorMessage*)this_ptr;
5224 LDKStr* ret = MALLOC(sizeof(LDKStr), "LDKStr");
5225 *ret = ErrorMessage_get_data(this_ptr_conv);
5229 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1set_1data(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5230 LDKErrorMessage* this_ptr_conv = (LDKErrorMessage*)this_ptr;
5231 LDKCVec_u8Z val_conv = *(LDKCVec_u8Z*)val;
5233 return ErrorMessage_set_data(this_ptr_conv, val_conv);
5236 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1new(JNIEnv * _env, jclass _b, jbyteArray channel_id_arg, jlong data_arg) {
5237 LDKThirtyTwoBytes channel_id_arg_ref;
5238 (*_env)->GetByteArrayRegion (_env, channel_id_arg, 0, 32, channel_id_arg_ref.data);
5239 LDKCVec_u8Z data_arg_conv = *(LDKCVec_u8Z*)data_arg;
5240 FREE((void*)data_arg);
5241 LDKErrorMessage* ret = MALLOC(sizeof(LDKErrorMessage), "LDKErrorMessage");
5242 *ret = ErrorMessage_new(channel_id_arg_ref, data_arg_conv);
5243 DO_ASSERT(ret->is_owned);
5244 ret->is_owned = false;
5248 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Ping_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5249 LDKPing this_ptr_conv = *(LDKPing*)this_ptr;
5250 FREE((void*)this_ptr);
5251 this_ptr_conv.is_owned = true;
5252 return Ping_free(this_ptr_conv);
5255 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_Ping_1get_1ponglen(JNIEnv * _env, jclass _b, jlong this_ptr) {
5256 LDKPing* this_ptr_conv = (LDKPing*)this_ptr;
5257 return Ping_get_ponglen(this_ptr_conv);
5260 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Ping_1set_1ponglen(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
5261 LDKPing* this_ptr_conv = (LDKPing*)this_ptr;
5262 return Ping_set_ponglen(this_ptr_conv, val);
5265 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_Ping_1get_1byteslen(JNIEnv * _env, jclass _b, jlong this_ptr) {
5266 LDKPing* this_ptr_conv = (LDKPing*)this_ptr;
5267 return Ping_get_byteslen(this_ptr_conv);
5270 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Ping_1set_1byteslen(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
5271 LDKPing* this_ptr_conv = (LDKPing*)this_ptr;
5272 return Ping_set_byteslen(this_ptr_conv, val);
5275 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Ping_1new(JNIEnv * _env, jclass _b, jshort ponglen_arg, jshort byteslen_arg) {
5276 LDKPing* ret = MALLOC(sizeof(LDKPing), "LDKPing");
5277 *ret = Ping_new(ponglen_arg, byteslen_arg);
5278 DO_ASSERT(ret->is_owned);
5279 ret->is_owned = false;
5283 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Pong_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5284 LDKPong this_ptr_conv = *(LDKPong*)this_ptr;
5285 FREE((void*)this_ptr);
5286 this_ptr_conv.is_owned = true;
5287 return Pong_free(this_ptr_conv);
5290 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_Pong_1get_1byteslen(JNIEnv * _env, jclass _b, jlong this_ptr) {
5291 LDKPong* this_ptr_conv = (LDKPong*)this_ptr;
5292 return Pong_get_byteslen(this_ptr_conv);
5295 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Pong_1set_1byteslen(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
5296 LDKPong* this_ptr_conv = (LDKPong*)this_ptr;
5297 return Pong_set_byteslen(this_ptr_conv, val);
5300 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Pong_1new(JNIEnv * _env, jclass _b, jshort byteslen_arg) {
5301 LDKPong* ret = MALLOC(sizeof(LDKPong), "LDKPong");
5302 *ret = Pong_new(byteslen_arg);
5303 DO_ASSERT(ret->is_owned);
5304 ret->is_owned = false;
5308 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5309 LDKOpenChannel this_ptr_conv = *(LDKOpenChannel*)this_ptr;
5310 FREE((void*)this_ptr);
5311 this_ptr_conv.is_owned = true;
5312 return OpenChannel_free(this_ptr_conv);
5315 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
5316 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
5317 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
5318 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *OpenChannel_get_chain_hash(this_ptr_conv));
5322 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
5323 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
5324 LDKThirtyTwoBytes val_ref;
5325 (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
5326 return OpenChannel_set_chain_hash(this_ptr_conv, val_ref);
5329 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1temporary_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
5330 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
5331 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
5332 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *OpenChannel_get_temporary_channel_id(this_ptr_conv));
5336 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1temporary_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
5337 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
5338 LDKThirtyTwoBytes val_ref;
5339 (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
5340 return OpenChannel_set_temporary_channel_id(this_ptr_conv, val_ref);
5343 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1funding_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
5344 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
5345 return OpenChannel_get_funding_satoshis(this_ptr_conv);
5348 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1funding_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5349 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
5350 return OpenChannel_set_funding_satoshis(this_ptr_conv, val);
5353 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1push_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
5354 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
5355 return OpenChannel_get_push_msat(this_ptr_conv);
5358 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1push_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5359 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
5360 return OpenChannel_set_push_msat(this_ptr_conv, val);
5363 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
5364 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
5365 return OpenChannel_get_dust_limit_satoshis(this_ptr_conv);
5368 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5369 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
5370 return OpenChannel_set_dust_limit_satoshis(this_ptr_conv, val);
5373 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1max_1htlc_1value_1in_1flight_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
5374 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
5375 return OpenChannel_get_max_htlc_value_in_flight_msat(this_ptr_conv);
5378 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) {
5379 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
5380 return OpenChannel_set_max_htlc_value_in_flight_msat(this_ptr_conv, val);
5383 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1channel_1reserve_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
5384 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
5385 return OpenChannel_get_channel_reserve_satoshis(this_ptr_conv);
5388 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1channel_1reserve_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5389 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
5390 return OpenChannel_set_channel_reserve_satoshis(this_ptr_conv, val);
5393 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
5394 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
5395 return OpenChannel_get_htlc_minimum_msat(this_ptr_conv);
5398 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5399 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
5400 return OpenChannel_set_htlc_minimum_msat(this_ptr_conv, val);
5403 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1feerate_1per_1kw(JNIEnv * _env, jclass _b, jlong this_ptr) {
5404 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
5405 return OpenChannel_get_feerate_per_kw(this_ptr_conv);
5408 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1feerate_1per_1kw(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
5409 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
5410 return OpenChannel_set_feerate_per_kw(this_ptr_conv, val);
5413 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr) {
5414 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
5415 return OpenChannel_get_to_self_delay(this_ptr_conv);
5418 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
5419 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
5420 return OpenChannel_set_to_self_delay(this_ptr_conv, val);
5423 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1max_1accepted_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr) {
5424 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
5425 return OpenChannel_get_max_accepted_htlcs(this_ptr_conv);
5428 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1max_1accepted_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
5429 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
5430 return OpenChannel_set_max_accepted_htlcs(this_ptr_conv, val);
5433 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1funding_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr) {
5434 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
5435 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
5436 *ret = OpenChannel_get_funding_pubkey(this_ptr_conv);
5440 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1funding_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5441 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
5442 LDKPublicKey val_conv = *(LDKPublicKey*)val;
5444 return OpenChannel_set_funding_pubkey(this_ptr_conv, val_conv);
5447 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1revocation_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
5448 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
5449 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
5450 *ret = OpenChannel_get_revocation_basepoint(this_ptr_conv);
5454 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1revocation_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5455 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
5456 LDKPublicKey val_conv = *(LDKPublicKey*)val;
5458 return OpenChannel_set_revocation_basepoint(this_ptr_conv, val_conv);
5461 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1payment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
5462 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
5463 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
5464 *ret = OpenChannel_get_payment_point(this_ptr_conv);
5468 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1payment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5469 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
5470 LDKPublicKey val_conv = *(LDKPublicKey*)val;
5472 return OpenChannel_set_payment_point(this_ptr_conv, val_conv);
5475 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1delayed_1payment_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
5476 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
5477 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
5478 *ret = OpenChannel_get_delayed_payment_basepoint(this_ptr_conv);
5482 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1delayed_1payment_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5483 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
5484 LDKPublicKey val_conv = *(LDKPublicKey*)val;
5486 return OpenChannel_set_delayed_payment_basepoint(this_ptr_conv, val_conv);
5489 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1htlc_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
5490 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
5491 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
5492 *ret = OpenChannel_get_htlc_basepoint(this_ptr_conv);
5496 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1htlc_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5497 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
5498 LDKPublicKey val_conv = *(LDKPublicKey*)val;
5500 return OpenChannel_set_htlc_basepoint(this_ptr_conv, val_conv);
5503 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1first_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
5504 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
5505 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
5506 *ret = OpenChannel_get_first_per_commitment_point(this_ptr_conv);
5510 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1first_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5511 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
5512 LDKPublicKey val_conv = *(LDKPublicKey*)val;
5514 return OpenChannel_set_first_per_commitment_point(this_ptr_conv, val_conv);
5517 JNIEXPORT jbyte JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1channel_1flags(JNIEnv * _env, jclass _b, jlong this_ptr) {
5518 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
5519 return OpenChannel_get_channel_flags(this_ptr_conv);
5522 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1channel_1flags(JNIEnv * _env, jclass _b, jlong this_ptr, jbyte val) {
5523 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
5524 return OpenChannel_set_channel_flags(this_ptr_conv, val);
5527 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5528 LDKAcceptChannel this_ptr_conv = *(LDKAcceptChannel*)this_ptr;
5529 FREE((void*)this_ptr);
5530 this_ptr_conv.is_owned = true;
5531 return AcceptChannel_free(this_ptr_conv);
5534 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1temporary_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
5535 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
5536 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
5537 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *AcceptChannel_get_temporary_channel_id(this_ptr_conv));
5541 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1temporary_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
5542 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
5543 LDKThirtyTwoBytes val_ref;
5544 (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
5545 return AcceptChannel_set_temporary_channel_id(this_ptr_conv, val_ref);
5548 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
5549 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
5550 return AcceptChannel_get_dust_limit_satoshis(this_ptr_conv);
5553 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5554 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
5555 return AcceptChannel_set_dust_limit_satoshis(this_ptr_conv, val);
5558 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1max_1htlc_1value_1in_1flight_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
5559 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
5560 return AcceptChannel_get_max_htlc_value_in_flight_msat(this_ptr_conv);
5563 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) {
5564 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
5565 return AcceptChannel_set_max_htlc_value_in_flight_msat(this_ptr_conv, val);
5568 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1channel_1reserve_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
5569 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
5570 return AcceptChannel_get_channel_reserve_satoshis(this_ptr_conv);
5573 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1channel_1reserve_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5574 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
5575 return AcceptChannel_set_channel_reserve_satoshis(this_ptr_conv, val);
5578 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
5579 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
5580 return AcceptChannel_get_htlc_minimum_msat(this_ptr_conv);
5583 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5584 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
5585 return AcceptChannel_set_htlc_minimum_msat(this_ptr_conv, val);
5588 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1minimum_1depth(JNIEnv * _env, jclass _b, jlong this_ptr) {
5589 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
5590 return AcceptChannel_get_minimum_depth(this_ptr_conv);
5593 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1minimum_1depth(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
5594 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
5595 return AcceptChannel_set_minimum_depth(this_ptr_conv, val);
5598 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr) {
5599 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
5600 return AcceptChannel_get_to_self_delay(this_ptr_conv);
5603 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
5604 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
5605 return AcceptChannel_set_to_self_delay(this_ptr_conv, val);
5608 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1max_1accepted_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr) {
5609 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
5610 return AcceptChannel_get_max_accepted_htlcs(this_ptr_conv);
5613 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1max_1accepted_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
5614 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
5615 return AcceptChannel_set_max_accepted_htlcs(this_ptr_conv, val);
5618 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1funding_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr) {
5619 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
5620 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
5621 *ret = AcceptChannel_get_funding_pubkey(this_ptr_conv);
5625 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1funding_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5626 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
5627 LDKPublicKey val_conv = *(LDKPublicKey*)val;
5629 return AcceptChannel_set_funding_pubkey(this_ptr_conv, val_conv);
5632 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1revocation_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
5633 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
5634 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
5635 *ret = AcceptChannel_get_revocation_basepoint(this_ptr_conv);
5639 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1revocation_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5640 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
5641 LDKPublicKey val_conv = *(LDKPublicKey*)val;
5643 return AcceptChannel_set_revocation_basepoint(this_ptr_conv, val_conv);
5646 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1payment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
5647 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
5648 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
5649 *ret = AcceptChannel_get_payment_point(this_ptr_conv);
5653 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1payment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5654 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
5655 LDKPublicKey val_conv = *(LDKPublicKey*)val;
5657 return AcceptChannel_set_payment_point(this_ptr_conv, val_conv);
5660 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1delayed_1payment_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
5661 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
5662 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
5663 *ret = AcceptChannel_get_delayed_payment_basepoint(this_ptr_conv);
5667 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1delayed_1payment_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5668 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
5669 LDKPublicKey val_conv = *(LDKPublicKey*)val;
5671 return AcceptChannel_set_delayed_payment_basepoint(this_ptr_conv, val_conv);
5674 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1htlc_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
5675 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
5676 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
5677 *ret = AcceptChannel_get_htlc_basepoint(this_ptr_conv);
5681 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1htlc_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5682 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
5683 LDKPublicKey val_conv = *(LDKPublicKey*)val;
5685 return AcceptChannel_set_htlc_basepoint(this_ptr_conv, val_conv);
5688 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1first_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
5689 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
5690 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
5691 *ret = AcceptChannel_get_first_per_commitment_point(this_ptr_conv);
5695 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1first_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5696 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
5697 LDKPublicKey val_conv = *(LDKPublicKey*)val;
5699 return AcceptChannel_set_first_per_commitment_point(this_ptr_conv, val_conv);
5702 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5703 LDKFundingCreated this_ptr_conv = *(LDKFundingCreated*)this_ptr;
5704 FREE((void*)this_ptr);
5705 this_ptr_conv.is_owned = true;
5706 return FundingCreated_free(this_ptr_conv);
5709 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1temporary_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
5710 LDKFundingCreated* this_ptr_conv = (LDKFundingCreated*)this_ptr;
5711 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
5712 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *FundingCreated_get_temporary_channel_id(this_ptr_conv));
5716 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1temporary_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
5717 LDKFundingCreated* this_ptr_conv = (LDKFundingCreated*)this_ptr;
5718 LDKThirtyTwoBytes val_ref;
5719 (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
5720 return FundingCreated_set_temporary_channel_id(this_ptr_conv, val_ref);
5723 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1funding_1txid(JNIEnv * _env, jclass _b, jlong this_ptr) {
5724 LDKFundingCreated* this_ptr_conv = (LDKFundingCreated*)this_ptr;
5725 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
5726 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *FundingCreated_get_funding_txid(this_ptr_conv));
5730 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1funding_1txid(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
5731 LDKFundingCreated* this_ptr_conv = (LDKFundingCreated*)this_ptr;
5732 LDKThirtyTwoBytes val_ref;
5733 (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
5734 return FundingCreated_set_funding_txid(this_ptr_conv, val_ref);
5737 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1funding_1output_1index(JNIEnv * _env, jclass _b, jlong this_ptr) {
5738 LDKFundingCreated* this_ptr_conv = (LDKFundingCreated*)this_ptr;
5739 return FundingCreated_get_funding_output_index(this_ptr_conv);
5742 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1funding_1output_1index(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
5743 LDKFundingCreated* this_ptr_conv = (LDKFundingCreated*)this_ptr;
5744 return FundingCreated_set_funding_output_index(this_ptr_conv, val);
5747 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
5748 LDKFundingCreated* this_ptr_conv = (LDKFundingCreated*)this_ptr;
5749 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
5750 *ret = FundingCreated_get_signature(this_ptr_conv);
5754 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5755 LDKFundingCreated* this_ptr_conv = (LDKFundingCreated*)this_ptr;
5756 LDKSignature val_conv = *(LDKSignature*)val;
5758 return FundingCreated_set_signature(this_ptr_conv, val_conv);
5761 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingCreated_1new(JNIEnv * _env, jclass _b, jbyteArray temporary_channel_id_arg, jbyteArray funding_txid_arg, jshort funding_output_index_arg, jlong signature_arg) {
5762 LDKThirtyTwoBytes temporary_channel_id_arg_ref;
5763 (*_env)->GetByteArrayRegion (_env, temporary_channel_id_arg, 0, 32, temporary_channel_id_arg_ref.data);
5764 LDKThirtyTwoBytes funding_txid_arg_ref;
5765 (*_env)->GetByteArrayRegion (_env, funding_txid_arg, 0, 32, funding_txid_arg_ref.data);
5766 LDKSignature signature_arg_conv = *(LDKSignature*)signature_arg;
5767 FREE((void*)signature_arg);
5768 LDKFundingCreated* ret = MALLOC(sizeof(LDKFundingCreated), "LDKFundingCreated");
5769 *ret = FundingCreated_new(temporary_channel_id_arg_ref, funding_txid_arg_ref, funding_output_index_arg, signature_arg_conv);
5770 DO_ASSERT(ret->is_owned);
5771 ret->is_owned = false;
5775 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5776 LDKFundingSigned this_ptr_conv = *(LDKFundingSigned*)this_ptr;
5777 FREE((void*)this_ptr);
5778 this_ptr_conv.is_owned = true;
5779 return FundingSigned_free(this_ptr_conv);
5782 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingSigned_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
5783 LDKFundingSigned* this_ptr_conv = (LDKFundingSigned*)this_ptr;
5784 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
5785 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *FundingSigned_get_channel_id(this_ptr_conv));
5789 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
5790 LDKFundingSigned* this_ptr_conv = (LDKFundingSigned*)this_ptr;
5791 LDKThirtyTwoBytes val_ref;
5792 (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
5793 return FundingSigned_set_channel_id(this_ptr_conv, val_ref);
5796 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingSigned_1get_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
5797 LDKFundingSigned* this_ptr_conv = (LDKFundingSigned*)this_ptr;
5798 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
5799 *ret = FundingSigned_get_signature(this_ptr_conv);
5803 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1set_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5804 LDKFundingSigned* this_ptr_conv = (LDKFundingSigned*)this_ptr;
5805 LDKSignature val_conv = *(LDKSignature*)val;
5807 return FundingSigned_set_signature(this_ptr_conv, val_conv);
5810 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingSigned_1new(JNIEnv * _env, jclass _b, jbyteArray channel_id_arg, jlong signature_arg) {
5811 LDKThirtyTwoBytes channel_id_arg_ref;
5812 (*_env)->GetByteArrayRegion (_env, channel_id_arg, 0, 32, channel_id_arg_ref.data);
5813 LDKSignature signature_arg_conv = *(LDKSignature*)signature_arg;
5814 FREE((void*)signature_arg);
5815 LDKFundingSigned* ret = MALLOC(sizeof(LDKFundingSigned), "LDKFundingSigned");
5816 *ret = FundingSigned_new(channel_id_arg_ref, signature_arg_conv);
5817 DO_ASSERT(ret->is_owned);
5818 ret->is_owned = false;
5822 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingLocked_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5823 LDKFundingLocked this_ptr_conv = *(LDKFundingLocked*)this_ptr;
5824 FREE((void*)this_ptr);
5825 this_ptr_conv.is_owned = true;
5826 return FundingLocked_free(this_ptr_conv);
5829 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingLocked_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
5830 LDKFundingLocked* this_ptr_conv = (LDKFundingLocked*)this_ptr;
5831 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
5832 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *FundingLocked_get_channel_id(this_ptr_conv));
5836 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingLocked_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
5837 LDKFundingLocked* this_ptr_conv = (LDKFundingLocked*)this_ptr;
5838 LDKThirtyTwoBytes val_ref;
5839 (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
5840 return FundingLocked_set_channel_id(this_ptr_conv, val_ref);
5843 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingLocked_1get_1next_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
5844 LDKFundingLocked* this_ptr_conv = (LDKFundingLocked*)this_ptr;
5845 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
5846 *ret = FundingLocked_get_next_per_commitment_point(this_ptr_conv);
5850 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingLocked_1set_1next_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5851 LDKFundingLocked* this_ptr_conv = (LDKFundingLocked*)this_ptr;
5852 LDKPublicKey val_conv = *(LDKPublicKey*)val;
5854 return FundingLocked_set_next_per_commitment_point(this_ptr_conv, val_conv);
5857 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingLocked_1new(JNIEnv * _env, jclass _b, jbyteArray channel_id_arg, jlong next_per_commitment_point_arg) {
5858 LDKThirtyTwoBytes channel_id_arg_ref;
5859 (*_env)->GetByteArrayRegion (_env, channel_id_arg, 0, 32, channel_id_arg_ref.data);
5860 LDKPublicKey next_per_commitment_point_arg_conv = *(LDKPublicKey*)next_per_commitment_point_arg;
5861 FREE((void*)next_per_commitment_point_arg);
5862 LDKFundingLocked* ret = MALLOC(sizeof(LDKFundingLocked), "LDKFundingLocked");
5863 *ret = FundingLocked_new(channel_id_arg_ref, next_per_commitment_point_arg_conv);
5864 DO_ASSERT(ret->is_owned);
5865 ret->is_owned = false;
5869 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5870 LDKShutdown this_ptr_conv = *(LDKShutdown*)this_ptr;
5871 FREE((void*)this_ptr);
5872 this_ptr_conv.is_owned = true;
5873 return Shutdown_free(this_ptr_conv);
5876 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Shutdown_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
5877 LDKShutdown* this_ptr_conv = (LDKShutdown*)this_ptr;
5878 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
5879 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *Shutdown_get_channel_id(this_ptr_conv));
5883 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
5884 LDKShutdown* this_ptr_conv = (LDKShutdown*)this_ptr;
5885 LDKThirtyTwoBytes val_ref;
5886 (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
5887 return Shutdown_set_channel_id(this_ptr_conv, val_ref);
5890 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Shutdown_1get_1scriptpubkey(JNIEnv * _env, jclass _b, jlong this_ptr) {
5891 LDKShutdown* this_ptr_conv = (LDKShutdown*)this_ptr;
5892 LDKu8slice* ret = MALLOC(sizeof(LDKu8slice), "LDKu8slice");
5893 *ret = Shutdown_get_scriptpubkey(this_ptr_conv);
5897 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1set_1scriptpubkey(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5898 LDKShutdown* this_ptr_conv = (LDKShutdown*)this_ptr;
5899 LDKCVec_u8Z val_conv = *(LDKCVec_u8Z*)val;
5901 return Shutdown_set_scriptpubkey(this_ptr_conv, val_conv);
5904 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Shutdown_1new(JNIEnv * _env, jclass _b, jbyteArray channel_id_arg, jlong scriptpubkey_arg) {
5905 LDKThirtyTwoBytes channel_id_arg_ref;
5906 (*_env)->GetByteArrayRegion (_env, channel_id_arg, 0, 32, channel_id_arg_ref.data);
5907 LDKCVec_u8Z scriptpubkey_arg_conv = *(LDKCVec_u8Z*)scriptpubkey_arg;
5908 FREE((void*)scriptpubkey_arg);
5909 LDKShutdown* ret = MALLOC(sizeof(LDKShutdown), "LDKShutdown");
5910 *ret = Shutdown_new(channel_id_arg_ref, scriptpubkey_arg_conv);
5911 DO_ASSERT(ret->is_owned);
5912 ret->is_owned = false;
5916 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5917 LDKClosingSigned this_ptr_conv = *(LDKClosingSigned*)this_ptr;
5918 FREE((void*)this_ptr);
5919 this_ptr_conv.is_owned = true;
5920 return ClosingSigned_free(this_ptr_conv);
5923 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
5924 LDKClosingSigned* this_ptr_conv = (LDKClosingSigned*)this_ptr;
5925 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
5926 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *ClosingSigned_get_channel_id(this_ptr_conv));
5930 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
5931 LDKClosingSigned* this_ptr_conv = (LDKClosingSigned*)this_ptr;
5932 LDKThirtyTwoBytes val_ref;
5933 (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
5934 return ClosingSigned_set_channel_id(this_ptr_conv, val_ref);
5937 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1fee_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
5938 LDKClosingSigned* this_ptr_conv = (LDKClosingSigned*)this_ptr;
5939 return ClosingSigned_get_fee_satoshis(this_ptr_conv);
5942 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1fee_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5943 LDKClosingSigned* this_ptr_conv = (LDKClosingSigned*)this_ptr;
5944 return ClosingSigned_set_fee_satoshis(this_ptr_conv, val);
5947 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
5948 LDKClosingSigned* this_ptr_conv = (LDKClosingSigned*)this_ptr;
5949 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
5950 *ret = ClosingSigned_get_signature(this_ptr_conv);
5954 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5955 LDKClosingSigned* this_ptr_conv = (LDKClosingSigned*)this_ptr;
5956 LDKSignature val_conv = *(LDKSignature*)val;
5958 return ClosingSigned_set_signature(this_ptr_conv, val_conv);
5961 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1new(JNIEnv * _env, jclass _b, jbyteArray channel_id_arg, jlong fee_satoshis_arg, jlong signature_arg) {
5962 LDKThirtyTwoBytes channel_id_arg_ref;
5963 (*_env)->GetByteArrayRegion (_env, channel_id_arg, 0, 32, channel_id_arg_ref.data);
5964 LDKSignature signature_arg_conv = *(LDKSignature*)signature_arg;
5965 FREE((void*)signature_arg);
5966 LDKClosingSigned* ret = MALLOC(sizeof(LDKClosingSigned), "LDKClosingSigned");
5967 *ret = ClosingSigned_new(channel_id_arg_ref, fee_satoshis_arg, signature_arg_conv);
5968 DO_ASSERT(ret->is_owned);
5969 ret->is_owned = false;
5973 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5974 LDKUpdateAddHTLC this_ptr_conv = *(LDKUpdateAddHTLC*)this_ptr;
5975 FREE((void*)this_ptr);
5976 this_ptr_conv.is_owned = true;
5977 return UpdateAddHTLC_free(this_ptr_conv);
5980 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
5981 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
5982 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
5983 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateAddHTLC_get_channel_id(this_ptr_conv));
5987 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
5988 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
5989 LDKThirtyTwoBytes val_ref;
5990 (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
5991 return UpdateAddHTLC_set_channel_id(this_ptr_conv, val_ref);
5994 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
5995 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
5996 return UpdateAddHTLC_get_htlc_id(this_ptr_conv);
5999 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6000 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
6001 return UpdateAddHTLC_set_htlc_id(this_ptr_conv, val);
6004 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1amount_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
6005 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
6006 return UpdateAddHTLC_get_amount_msat(this_ptr_conv);
6009 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1amount_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6010 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
6011 return UpdateAddHTLC_set_amount_msat(this_ptr_conv, val);
6014 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1payment_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
6015 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
6016 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
6017 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateAddHTLC_get_payment_hash(this_ptr_conv));
6021 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1payment_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
6022 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
6023 LDKThirtyTwoBytes val_ref;
6024 (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
6025 return UpdateAddHTLC_set_payment_hash(this_ptr_conv, val_ref);
6028 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1cltv_1expiry(JNIEnv * _env, jclass _b, jlong this_ptr) {
6029 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
6030 return UpdateAddHTLC_get_cltv_expiry(this_ptr_conv);
6033 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1cltv_1expiry(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
6034 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
6035 return UpdateAddHTLC_set_cltv_expiry(this_ptr_conv, val);
6038 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6039 LDKUpdateFulfillHTLC this_ptr_conv = *(LDKUpdateFulfillHTLC*)this_ptr;
6040 FREE((void*)this_ptr);
6041 this_ptr_conv.is_owned = true;
6042 return UpdateFulfillHTLC_free(this_ptr_conv);
6045 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
6046 LDKUpdateFulfillHTLC* this_ptr_conv = (LDKUpdateFulfillHTLC*)this_ptr;
6047 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
6048 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateFulfillHTLC_get_channel_id(this_ptr_conv));
6052 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
6053 LDKUpdateFulfillHTLC* this_ptr_conv = (LDKUpdateFulfillHTLC*)this_ptr;
6054 LDKThirtyTwoBytes val_ref;
6055 (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
6056 return UpdateFulfillHTLC_set_channel_id(this_ptr_conv, val_ref);
6059 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
6060 LDKUpdateFulfillHTLC* this_ptr_conv = (LDKUpdateFulfillHTLC*)this_ptr;
6061 return UpdateFulfillHTLC_get_htlc_id(this_ptr_conv);
6064 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1set_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6065 LDKUpdateFulfillHTLC* this_ptr_conv = (LDKUpdateFulfillHTLC*)this_ptr;
6066 return UpdateFulfillHTLC_set_htlc_id(this_ptr_conv, val);
6069 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_1payment_1preimage(JNIEnv * _env, jclass _b, jlong this_ptr) {
6070 LDKUpdateFulfillHTLC* this_ptr_conv = (LDKUpdateFulfillHTLC*)this_ptr;
6071 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
6072 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateFulfillHTLC_get_payment_preimage(this_ptr_conv));
6076 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1set_1payment_1preimage(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
6077 LDKUpdateFulfillHTLC* this_ptr_conv = (LDKUpdateFulfillHTLC*)this_ptr;
6078 LDKThirtyTwoBytes val_ref;
6079 (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
6080 return UpdateFulfillHTLC_set_payment_preimage(this_ptr_conv, val_ref);
6083 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1new(JNIEnv * _env, jclass _b, jbyteArray channel_id_arg, jlong htlc_id_arg, jbyteArray payment_preimage_arg) {
6084 LDKThirtyTwoBytes channel_id_arg_ref;
6085 (*_env)->GetByteArrayRegion (_env, channel_id_arg, 0, 32, channel_id_arg_ref.data);
6086 LDKThirtyTwoBytes payment_preimage_arg_ref;
6087 (*_env)->GetByteArrayRegion (_env, payment_preimage_arg, 0, 32, payment_preimage_arg_ref.data);
6088 LDKUpdateFulfillHTLC* ret = MALLOC(sizeof(LDKUpdateFulfillHTLC), "LDKUpdateFulfillHTLC");
6089 *ret = UpdateFulfillHTLC_new(channel_id_arg_ref, htlc_id_arg, payment_preimage_arg_ref);
6090 DO_ASSERT(ret->is_owned);
6091 ret->is_owned = false;
6095 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6096 LDKUpdateFailHTLC this_ptr_conv = *(LDKUpdateFailHTLC*)this_ptr;
6097 FREE((void*)this_ptr);
6098 this_ptr_conv.is_owned = true;
6099 return UpdateFailHTLC_free(this_ptr_conv);
6102 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
6103 LDKUpdateFailHTLC* this_ptr_conv = (LDKUpdateFailHTLC*)this_ptr;
6104 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
6105 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateFailHTLC_get_channel_id(this_ptr_conv));
6109 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
6110 LDKUpdateFailHTLC* this_ptr_conv = (LDKUpdateFailHTLC*)this_ptr;
6111 LDKThirtyTwoBytes val_ref;
6112 (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
6113 return UpdateFailHTLC_set_channel_id(this_ptr_conv, val_ref);
6116 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1get_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
6117 LDKUpdateFailHTLC* this_ptr_conv = (LDKUpdateFailHTLC*)this_ptr;
6118 return UpdateFailHTLC_get_htlc_id(this_ptr_conv);
6121 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1set_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6122 LDKUpdateFailHTLC* this_ptr_conv = (LDKUpdateFailHTLC*)this_ptr;
6123 return UpdateFailHTLC_set_htlc_id(this_ptr_conv, val);
6126 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6127 LDKUpdateFailMalformedHTLC this_ptr_conv = *(LDKUpdateFailMalformedHTLC*)this_ptr;
6128 FREE((void*)this_ptr);
6129 this_ptr_conv.is_owned = true;
6130 return UpdateFailMalformedHTLC_free(this_ptr_conv);
6133 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
6134 LDKUpdateFailMalformedHTLC* this_ptr_conv = (LDKUpdateFailMalformedHTLC*)this_ptr;
6135 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
6136 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateFailMalformedHTLC_get_channel_id(this_ptr_conv));
6140 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
6141 LDKUpdateFailMalformedHTLC* this_ptr_conv = (LDKUpdateFailMalformedHTLC*)this_ptr;
6142 LDKThirtyTwoBytes val_ref;
6143 (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
6144 return UpdateFailMalformedHTLC_set_channel_id(this_ptr_conv, val_ref);
6147 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1get_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
6148 LDKUpdateFailMalformedHTLC* this_ptr_conv = (LDKUpdateFailMalformedHTLC*)this_ptr;
6149 return UpdateFailMalformedHTLC_get_htlc_id(this_ptr_conv);
6152 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1set_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6153 LDKUpdateFailMalformedHTLC* this_ptr_conv = (LDKUpdateFailMalformedHTLC*)this_ptr;
6154 return UpdateFailMalformedHTLC_set_htlc_id(this_ptr_conv, val);
6157 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1get_1failure_1code(JNIEnv * _env, jclass _b, jlong this_ptr) {
6158 LDKUpdateFailMalformedHTLC* this_ptr_conv = (LDKUpdateFailMalformedHTLC*)this_ptr;
6159 return UpdateFailMalformedHTLC_get_failure_code(this_ptr_conv);
6162 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1set_1failure_1code(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
6163 LDKUpdateFailMalformedHTLC* this_ptr_conv = (LDKUpdateFailMalformedHTLC*)this_ptr;
6164 return UpdateFailMalformedHTLC_set_failure_code(this_ptr_conv, val);
6167 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6168 LDKCommitmentSigned this_ptr_conv = *(LDKCommitmentSigned*)this_ptr;
6169 FREE((void*)this_ptr);
6170 this_ptr_conv.is_owned = true;
6171 return CommitmentSigned_free(this_ptr_conv);
6174 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
6175 LDKCommitmentSigned* this_ptr_conv = (LDKCommitmentSigned*)this_ptr;
6176 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
6177 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *CommitmentSigned_get_channel_id(this_ptr_conv));
6181 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
6182 LDKCommitmentSigned* this_ptr_conv = (LDKCommitmentSigned*)this_ptr;
6183 LDKThirtyTwoBytes val_ref;
6184 (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
6185 return CommitmentSigned_set_channel_id(this_ptr_conv, val_ref);
6188 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1get_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
6189 LDKCommitmentSigned* this_ptr_conv = (LDKCommitmentSigned*)this_ptr;
6190 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
6191 *ret = CommitmentSigned_get_signature(this_ptr_conv);
6195 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6196 LDKCommitmentSigned* this_ptr_conv = (LDKCommitmentSigned*)this_ptr;
6197 LDKSignature val_conv = *(LDKSignature*)val;
6199 return CommitmentSigned_set_signature(this_ptr_conv, val_conv);
6202 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1htlc_1signatures(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6203 LDKCommitmentSigned* this_ptr_conv = (LDKCommitmentSigned*)this_ptr;
6204 LDKCVec_SignatureZ val_conv = *(LDKCVec_SignatureZ*)val;
6206 return CommitmentSigned_set_htlc_signatures(this_ptr_conv, val_conv);
6209 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1new(JNIEnv * _env, jclass _b, jbyteArray channel_id_arg, jlong signature_arg, jlong htlc_signatures_arg) {
6210 LDKThirtyTwoBytes channel_id_arg_ref;
6211 (*_env)->GetByteArrayRegion (_env, channel_id_arg, 0, 32, channel_id_arg_ref.data);
6212 LDKSignature signature_arg_conv = *(LDKSignature*)signature_arg;
6213 FREE((void*)signature_arg);
6214 LDKCVec_SignatureZ htlc_signatures_arg_conv = *(LDKCVec_SignatureZ*)htlc_signatures_arg;
6215 FREE((void*)htlc_signatures_arg);
6216 LDKCommitmentSigned* ret = MALLOC(sizeof(LDKCommitmentSigned), "LDKCommitmentSigned");
6217 *ret = CommitmentSigned_new(channel_id_arg_ref, signature_arg_conv, htlc_signatures_arg_conv);
6218 DO_ASSERT(ret->is_owned);
6219 ret->is_owned = false;
6223 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6224 LDKRevokeAndACK this_ptr_conv = *(LDKRevokeAndACK*)this_ptr;
6225 FREE((void*)this_ptr);
6226 this_ptr_conv.is_owned = true;
6227 return RevokeAndACK_free(this_ptr_conv);
6230 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
6231 LDKRevokeAndACK* this_ptr_conv = (LDKRevokeAndACK*)this_ptr;
6232 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
6233 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *RevokeAndACK_get_channel_id(this_ptr_conv));
6237 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
6238 LDKRevokeAndACK* this_ptr_conv = (LDKRevokeAndACK*)this_ptr;
6239 LDKThirtyTwoBytes val_ref;
6240 (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
6241 return RevokeAndACK_set_channel_id(this_ptr_conv, val_ref);
6244 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1per_1commitment_1secret(JNIEnv * _env, jclass _b, jlong this_ptr) {
6245 LDKRevokeAndACK* this_ptr_conv = (LDKRevokeAndACK*)this_ptr;
6246 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
6247 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *RevokeAndACK_get_per_commitment_secret(this_ptr_conv));
6251 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1set_1per_1commitment_1secret(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
6252 LDKRevokeAndACK* this_ptr_conv = (LDKRevokeAndACK*)this_ptr;
6253 LDKThirtyTwoBytes val_ref;
6254 (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
6255 return RevokeAndACK_set_per_commitment_secret(this_ptr_conv, val_ref);
6258 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1next_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
6259 LDKRevokeAndACK* this_ptr_conv = (LDKRevokeAndACK*)this_ptr;
6260 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
6261 *ret = RevokeAndACK_get_next_per_commitment_point(this_ptr_conv);
6265 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1set_1next_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6266 LDKRevokeAndACK* this_ptr_conv = (LDKRevokeAndACK*)this_ptr;
6267 LDKPublicKey val_conv = *(LDKPublicKey*)val;
6269 return RevokeAndACK_set_next_per_commitment_point(this_ptr_conv, val_conv);
6272 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1new(JNIEnv * _env, jclass _b, jbyteArray channel_id_arg, jbyteArray per_commitment_secret_arg, jlong next_per_commitment_point_arg) {
6273 LDKThirtyTwoBytes channel_id_arg_ref;
6274 (*_env)->GetByteArrayRegion (_env, channel_id_arg, 0, 32, channel_id_arg_ref.data);
6275 LDKThirtyTwoBytes per_commitment_secret_arg_ref;
6276 (*_env)->GetByteArrayRegion (_env, per_commitment_secret_arg, 0, 32, per_commitment_secret_arg_ref.data);
6277 LDKPublicKey next_per_commitment_point_arg_conv = *(LDKPublicKey*)next_per_commitment_point_arg;
6278 FREE((void*)next_per_commitment_point_arg);
6279 LDKRevokeAndACK* ret = MALLOC(sizeof(LDKRevokeAndACK), "LDKRevokeAndACK");
6280 *ret = RevokeAndACK_new(channel_id_arg_ref, per_commitment_secret_arg_ref, next_per_commitment_point_arg_conv);
6281 DO_ASSERT(ret->is_owned);
6282 ret->is_owned = false;
6286 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFee_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6287 LDKUpdateFee this_ptr_conv = *(LDKUpdateFee*)this_ptr;
6288 FREE((void*)this_ptr);
6289 this_ptr_conv.is_owned = true;
6290 return UpdateFee_free(this_ptr_conv);
6293 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFee_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
6294 LDKUpdateFee* this_ptr_conv = (LDKUpdateFee*)this_ptr;
6295 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
6296 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateFee_get_channel_id(this_ptr_conv));
6300 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFee_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
6301 LDKUpdateFee* this_ptr_conv = (LDKUpdateFee*)this_ptr;
6302 LDKThirtyTwoBytes val_ref;
6303 (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
6304 return UpdateFee_set_channel_id(this_ptr_conv, val_ref);
6307 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UpdateFee_1get_1feerate_1per_1kw(JNIEnv * _env, jclass _b, jlong this_ptr) {
6308 LDKUpdateFee* this_ptr_conv = (LDKUpdateFee*)this_ptr;
6309 return UpdateFee_get_feerate_per_kw(this_ptr_conv);
6312 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFee_1set_1feerate_1per_1kw(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
6313 LDKUpdateFee* this_ptr_conv = (LDKUpdateFee*)this_ptr;
6314 return UpdateFee_set_feerate_per_kw(this_ptr_conv, val);
6317 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFee_1new(JNIEnv * _env, jclass _b, jbyteArray channel_id_arg, jint feerate_per_kw_arg) {
6318 LDKThirtyTwoBytes channel_id_arg_ref;
6319 (*_env)->GetByteArrayRegion (_env, channel_id_arg, 0, 32, channel_id_arg_ref.data);
6320 LDKUpdateFee* ret = MALLOC(sizeof(LDKUpdateFee), "LDKUpdateFee");
6321 *ret = UpdateFee_new(channel_id_arg_ref, feerate_per_kw_arg);
6322 DO_ASSERT(ret->is_owned);
6323 ret->is_owned = false;
6327 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6328 LDKDataLossProtect this_ptr_conv = *(LDKDataLossProtect*)this_ptr;
6329 FREE((void*)this_ptr);
6330 this_ptr_conv.is_owned = true;
6331 return DataLossProtect_free(this_ptr_conv);
6334 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1get_1your_1last_1per_1commitment_1secret(JNIEnv * _env, jclass _b, jlong this_ptr) {
6335 LDKDataLossProtect* this_ptr_conv = (LDKDataLossProtect*)this_ptr;
6336 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
6337 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *DataLossProtect_get_your_last_per_commitment_secret(this_ptr_conv));
6341 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1set_1your_1last_1per_1commitment_1secret(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
6342 LDKDataLossProtect* this_ptr_conv = (LDKDataLossProtect*)this_ptr;
6343 LDKThirtyTwoBytes val_ref;
6344 (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
6345 return DataLossProtect_set_your_last_per_commitment_secret(this_ptr_conv, val_ref);
6348 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1get_1my_1current_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
6349 LDKDataLossProtect* this_ptr_conv = (LDKDataLossProtect*)this_ptr;
6350 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
6351 *ret = DataLossProtect_get_my_current_per_commitment_point(this_ptr_conv);
6355 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1set_1my_1current_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6356 LDKDataLossProtect* this_ptr_conv = (LDKDataLossProtect*)this_ptr;
6357 LDKPublicKey val_conv = *(LDKPublicKey*)val;
6359 return DataLossProtect_set_my_current_per_commitment_point(this_ptr_conv, val_conv);
6362 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1new(JNIEnv * _env, jclass _b, jbyteArray your_last_per_commitment_secret_arg, jlong my_current_per_commitment_point_arg) {
6363 LDKThirtyTwoBytes your_last_per_commitment_secret_arg_ref;
6364 (*_env)->GetByteArrayRegion (_env, your_last_per_commitment_secret_arg, 0, 32, your_last_per_commitment_secret_arg_ref.data);
6365 LDKPublicKey my_current_per_commitment_point_arg_conv = *(LDKPublicKey*)my_current_per_commitment_point_arg;
6366 FREE((void*)my_current_per_commitment_point_arg);
6367 LDKDataLossProtect* ret = MALLOC(sizeof(LDKDataLossProtect), "LDKDataLossProtect");
6368 *ret = DataLossProtect_new(your_last_per_commitment_secret_arg_ref, my_current_per_commitment_point_arg_conv);
6369 DO_ASSERT(ret->is_owned);
6370 ret->is_owned = false;
6374 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6375 LDKChannelReestablish this_ptr_conv = *(LDKChannelReestablish*)this_ptr;
6376 FREE((void*)this_ptr);
6377 this_ptr_conv.is_owned = true;
6378 return ChannelReestablish_free(this_ptr_conv);
6381 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
6382 LDKChannelReestablish* this_ptr_conv = (LDKChannelReestablish*)this_ptr;
6383 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
6384 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *ChannelReestablish_get_channel_id(this_ptr_conv));
6388 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
6389 LDKChannelReestablish* this_ptr_conv = (LDKChannelReestablish*)this_ptr;
6390 LDKThirtyTwoBytes val_ref;
6391 (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
6392 return ChannelReestablish_set_channel_id(this_ptr_conv, val_ref);
6395 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1get_1next_1local_1commitment_1number(JNIEnv * _env, jclass _b, jlong this_ptr) {
6396 LDKChannelReestablish* this_ptr_conv = (LDKChannelReestablish*)this_ptr;
6397 return ChannelReestablish_get_next_local_commitment_number(this_ptr_conv);
6400 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1set_1next_1local_1commitment_1number(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6401 LDKChannelReestablish* this_ptr_conv = (LDKChannelReestablish*)this_ptr;
6402 return ChannelReestablish_set_next_local_commitment_number(this_ptr_conv, val);
6405 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1get_1next_1remote_1commitment_1number(JNIEnv * _env, jclass _b, jlong this_ptr) {
6406 LDKChannelReestablish* this_ptr_conv = (LDKChannelReestablish*)this_ptr;
6407 return ChannelReestablish_get_next_remote_commitment_number(this_ptr_conv);
6410 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1set_1next_1remote_1commitment_1number(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6411 LDKChannelReestablish* this_ptr_conv = (LDKChannelReestablish*)this_ptr;
6412 return ChannelReestablish_set_next_remote_commitment_number(this_ptr_conv, val);
6415 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6416 LDKAnnouncementSignatures this_ptr_conv = *(LDKAnnouncementSignatures*)this_ptr;
6417 FREE((void*)this_ptr);
6418 this_ptr_conv.is_owned = true;
6419 return AnnouncementSignatures_free(this_ptr_conv);
6422 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
6423 LDKAnnouncementSignatures* this_ptr_conv = (LDKAnnouncementSignatures*)this_ptr;
6424 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
6425 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *AnnouncementSignatures_get_channel_id(this_ptr_conv));
6429 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
6430 LDKAnnouncementSignatures* this_ptr_conv = (LDKAnnouncementSignatures*)this_ptr;
6431 LDKThirtyTwoBytes val_ref;
6432 (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
6433 return AnnouncementSignatures_set_channel_id(this_ptr_conv, val_ref);
6436 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
6437 LDKAnnouncementSignatures* this_ptr_conv = (LDKAnnouncementSignatures*)this_ptr;
6438 return AnnouncementSignatures_get_short_channel_id(this_ptr_conv);
6441 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6442 LDKAnnouncementSignatures* this_ptr_conv = (LDKAnnouncementSignatures*)this_ptr;
6443 return AnnouncementSignatures_set_short_channel_id(this_ptr_conv, val);
6446 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1node_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
6447 LDKAnnouncementSignatures* this_ptr_conv = (LDKAnnouncementSignatures*)this_ptr;
6448 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
6449 *ret = AnnouncementSignatures_get_node_signature(this_ptr_conv);
6453 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1node_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6454 LDKAnnouncementSignatures* this_ptr_conv = (LDKAnnouncementSignatures*)this_ptr;
6455 LDKSignature val_conv = *(LDKSignature*)val;
6457 return AnnouncementSignatures_set_node_signature(this_ptr_conv, val_conv);
6460 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1bitcoin_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
6461 LDKAnnouncementSignatures* this_ptr_conv = (LDKAnnouncementSignatures*)this_ptr;
6462 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
6463 *ret = AnnouncementSignatures_get_bitcoin_signature(this_ptr_conv);
6467 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1bitcoin_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6468 LDKAnnouncementSignatures* this_ptr_conv = (LDKAnnouncementSignatures*)this_ptr;
6469 LDKSignature val_conv = *(LDKSignature*)val;
6471 return AnnouncementSignatures_set_bitcoin_signature(this_ptr_conv, val_conv);
6474 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1new(JNIEnv * _env, jclass _b, jbyteArray channel_id_arg, jlong short_channel_id_arg, jlong node_signature_arg, jlong bitcoin_signature_arg) {
6475 LDKThirtyTwoBytes channel_id_arg_ref;
6476 (*_env)->GetByteArrayRegion (_env, channel_id_arg, 0, 32, channel_id_arg_ref.data);
6477 LDKSignature node_signature_arg_conv = *(LDKSignature*)node_signature_arg;
6478 FREE((void*)node_signature_arg);
6479 LDKSignature bitcoin_signature_arg_conv = *(LDKSignature*)bitcoin_signature_arg;
6480 FREE((void*)bitcoin_signature_arg);
6481 LDKAnnouncementSignatures* ret = MALLOC(sizeof(LDKAnnouncementSignatures), "LDKAnnouncementSignatures");
6482 *ret = AnnouncementSignatures_new(channel_id_arg_ref, short_channel_id_arg, node_signature_arg_conv, bitcoin_signature_arg_conv);
6483 DO_ASSERT(ret->is_owned);
6484 ret->is_owned = false;
6488 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetAddress_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6489 LDKNetAddress this_ptr_conv = *(LDKNetAddress*)this_ptr;
6490 FREE((void*)this_ptr);
6491 return NetAddress_free(this_ptr_conv);
6494 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6495 LDKUnsignedNodeAnnouncement this_ptr_conv = *(LDKUnsignedNodeAnnouncement*)this_ptr;
6496 FREE((void*)this_ptr);
6497 this_ptr_conv.is_owned = true;
6498 return UnsignedNodeAnnouncement_free(this_ptr_conv);
6501 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1features(JNIEnv * _env, jclass _b, jlong this_ptr) {
6502 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
6503 LDKNodeFeatures* ret = MALLOC(sizeof(LDKNodeFeatures), "LDKNodeFeatures");
6504 *ret = UnsignedNodeAnnouncement_get_features(this_ptr_conv);
6505 DO_ASSERT(ret->is_owned);
6506 ret->is_owned = false;
6510 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1features(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6511 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
6512 LDKNodeFeatures val_conv = *(LDKNodeFeatures*)val;
6514 val_conv.is_owned = true;
6515 return UnsignedNodeAnnouncement_set_features(this_ptr_conv, val_conv);
6518 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1timestamp(JNIEnv * _env, jclass _b, jlong this_ptr) {
6519 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
6520 return UnsignedNodeAnnouncement_get_timestamp(this_ptr_conv);
6523 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1timestamp(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
6524 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
6525 return UnsignedNodeAnnouncement_set_timestamp(this_ptr_conv, val);
6528 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1node_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
6529 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
6530 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
6531 *ret = UnsignedNodeAnnouncement_get_node_id(this_ptr_conv);
6535 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1node_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6536 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
6537 LDKPublicKey val_conv = *(LDKPublicKey*)val;
6539 return UnsignedNodeAnnouncement_set_node_id(this_ptr_conv, val_conv);
6542 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1rgb(JNIEnv * _env, jclass _b, jlong this_ptr) {
6543 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
6544 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 3);
6545 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 3, *UnsignedNodeAnnouncement_get_rgb(this_ptr_conv));
6549 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1rgb(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6550 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
6551 LDKThreeBytes val_conv = *(LDKThreeBytes*)val;
6553 return UnsignedNodeAnnouncement_set_rgb(this_ptr_conv, val_conv);
6556 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1alias(JNIEnv * _env, jclass _b, jlong this_ptr) {
6557 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
6558 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
6559 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UnsignedNodeAnnouncement_get_alias(this_ptr_conv));
6563 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1alias(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
6564 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
6565 LDKThirtyTwoBytes val_ref;
6566 (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
6567 return UnsignedNodeAnnouncement_set_alias(this_ptr_conv, val_ref);
6570 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1addresses(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6571 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
6572 LDKCVec_NetAddressZ val_conv = *(LDKCVec_NetAddressZ*)val;
6574 return UnsignedNodeAnnouncement_set_addresses(this_ptr_conv, val_conv);
6577 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6578 LDKNodeAnnouncement this_ptr_conv = *(LDKNodeAnnouncement*)this_ptr;
6579 FREE((void*)this_ptr);
6580 this_ptr_conv.is_owned = true;
6581 return NodeAnnouncement_free(this_ptr_conv);
6584 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1get_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
6585 LDKNodeAnnouncement* this_ptr_conv = (LDKNodeAnnouncement*)this_ptr;
6586 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
6587 *ret = NodeAnnouncement_get_signature(this_ptr_conv);
6591 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1set_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6592 LDKNodeAnnouncement* this_ptr_conv = (LDKNodeAnnouncement*)this_ptr;
6593 LDKSignature val_conv = *(LDKSignature*)val;
6595 return NodeAnnouncement_set_signature(this_ptr_conv, val_conv);
6598 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1get_1contents(JNIEnv * _env, jclass _b, jlong this_ptr) {
6599 LDKNodeAnnouncement* this_ptr_conv = (LDKNodeAnnouncement*)this_ptr;
6600 LDKUnsignedNodeAnnouncement* ret = MALLOC(sizeof(LDKUnsignedNodeAnnouncement), "LDKUnsignedNodeAnnouncement");
6601 *ret = NodeAnnouncement_get_contents(this_ptr_conv);
6602 DO_ASSERT(ret->is_owned);
6603 ret->is_owned = false;
6607 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1set_1contents(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6608 LDKNodeAnnouncement* this_ptr_conv = (LDKNodeAnnouncement*)this_ptr;
6609 LDKUnsignedNodeAnnouncement val_conv = *(LDKUnsignedNodeAnnouncement*)val;
6611 val_conv.is_owned = true;
6612 return NodeAnnouncement_set_contents(this_ptr_conv, val_conv);
6615 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1new(JNIEnv * _env, jclass _b, jlong signature_arg, jlong contents_arg) {
6616 LDKSignature signature_arg_conv = *(LDKSignature*)signature_arg;
6617 FREE((void*)signature_arg);
6618 LDKUnsignedNodeAnnouncement contents_arg_conv = *(LDKUnsignedNodeAnnouncement*)contents_arg;
6619 FREE((void*)contents_arg);
6620 contents_arg_conv.is_owned = true;
6621 LDKNodeAnnouncement* ret = MALLOC(sizeof(LDKNodeAnnouncement), "LDKNodeAnnouncement");
6622 *ret = NodeAnnouncement_new(signature_arg_conv, contents_arg_conv);
6623 DO_ASSERT(ret->is_owned);
6624 ret->is_owned = false;
6628 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6629 LDKUnsignedChannelAnnouncement this_ptr_conv = *(LDKUnsignedChannelAnnouncement*)this_ptr;
6630 FREE((void*)this_ptr);
6631 this_ptr_conv.is_owned = true;
6632 return UnsignedChannelAnnouncement_free(this_ptr_conv);
6635 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1features(JNIEnv * _env, jclass _b, jlong this_ptr) {
6636 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
6637 LDKChannelFeatures* ret = MALLOC(sizeof(LDKChannelFeatures), "LDKChannelFeatures");
6638 *ret = UnsignedChannelAnnouncement_get_features(this_ptr_conv);
6639 DO_ASSERT(ret->is_owned);
6640 ret->is_owned = false;
6644 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1features(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6645 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
6646 LDKChannelFeatures val_conv = *(LDKChannelFeatures*)val;
6648 val_conv.is_owned = true;
6649 return UnsignedChannelAnnouncement_set_features(this_ptr_conv, val_conv);
6652 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
6653 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
6654 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
6655 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UnsignedChannelAnnouncement_get_chain_hash(this_ptr_conv));
6659 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
6660 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
6661 LDKThirtyTwoBytes val_ref;
6662 (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
6663 return UnsignedChannelAnnouncement_set_chain_hash(this_ptr_conv, val_ref);
6666 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
6667 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
6668 return UnsignedChannelAnnouncement_get_short_channel_id(this_ptr_conv);
6671 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6672 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
6673 return UnsignedChannelAnnouncement_set_short_channel_id(this_ptr_conv, val);
6676 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1node_1id_11(JNIEnv * _env, jclass _b, jlong this_ptr) {
6677 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
6678 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
6679 *ret = UnsignedChannelAnnouncement_get_node_id_1(this_ptr_conv);
6683 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1node_1id_11(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6684 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
6685 LDKPublicKey val_conv = *(LDKPublicKey*)val;
6687 return UnsignedChannelAnnouncement_set_node_id_1(this_ptr_conv, val_conv);
6690 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1node_1id_12(JNIEnv * _env, jclass _b, jlong this_ptr) {
6691 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
6692 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
6693 *ret = UnsignedChannelAnnouncement_get_node_id_2(this_ptr_conv);
6697 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1node_1id_12(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6698 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
6699 LDKPublicKey val_conv = *(LDKPublicKey*)val;
6701 return UnsignedChannelAnnouncement_set_node_id_2(this_ptr_conv, val_conv);
6704 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1bitcoin_1key_11(JNIEnv * _env, jclass _b, jlong this_ptr) {
6705 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
6706 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
6707 *ret = UnsignedChannelAnnouncement_get_bitcoin_key_1(this_ptr_conv);
6711 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1bitcoin_1key_11(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6712 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
6713 LDKPublicKey val_conv = *(LDKPublicKey*)val;
6715 return UnsignedChannelAnnouncement_set_bitcoin_key_1(this_ptr_conv, val_conv);
6718 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1bitcoin_1key_12(JNIEnv * _env, jclass _b, jlong this_ptr) {
6719 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
6720 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
6721 *ret = UnsignedChannelAnnouncement_get_bitcoin_key_2(this_ptr_conv);
6725 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1bitcoin_1key_12(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6726 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
6727 LDKPublicKey val_conv = *(LDKPublicKey*)val;
6729 return UnsignedChannelAnnouncement_set_bitcoin_key_2(this_ptr_conv, val_conv);
6732 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6733 LDKChannelAnnouncement this_ptr_conv = *(LDKChannelAnnouncement*)this_ptr;
6734 FREE((void*)this_ptr);
6735 this_ptr_conv.is_owned = true;
6736 return ChannelAnnouncement_free(this_ptr_conv);
6739 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1node_1signature_11(JNIEnv * _env, jclass _b, jlong this_ptr) {
6740 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
6741 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
6742 *ret = ChannelAnnouncement_get_node_signature_1(this_ptr_conv);
6746 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1node_1signature_11(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6747 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
6748 LDKSignature val_conv = *(LDKSignature*)val;
6750 return ChannelAnnouncement_set_node_signature_1(this_ptr_conv, val_conv);
6753 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1node_1signature_12(JNIEnv * _env, jclass _b, jlong this_ptr) {
6754 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
6755 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
6756 *ret = ChannelAnnouncement_get_node_signature_2(this_ptr_conv);
6760 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1node_1signature_12(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6761 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
6762 LDKSignature val_conv = *(LDKSignature*)val;
6764 return ChannelAnnouncement_set_node_signature_2(this_ptr_conv, val_conv);
6767 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1bitcoin_1signature_11(JNIEnv * _env, jclass _b, jlong this_ptr) {
6768 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
6769 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
6770 *ret = ChannelAnnouncement_get_bitcoin_signature_1(this_ptr_conv);
6774 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1bitcoin_1signature_11(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6775 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
6776 LDKSignature val_conv = *(LDKSignature*)val;
6778 return ChannelAnnouncement_set_bitcoin_signature_1(this_ptr_conv, val_conv);
6781 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1bitcoin_1signature_12(JNIEnv * _env, jclass _b, jlong this_ptr) {
6782 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
6783 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
6784 *ret = ChannelAnnouncement_get_bitcoin_signature_2(this_ptr_conv);
6788 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1bitcoin_1signature_12(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6789 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
6790 LDKSignature val_conv = *(LDKSignature*)val;
6792 return ChannelAnnouncement_set_bitcoin_signature_2(this_ptr_conv, val_conv);
6795 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1contents(JNIEnv * _env, jclass _b, jlong this_ptr) {
6796 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
6797 LDKUnsignedChannelAnnouncement* ret = MALLOC(sizeof(LDKUnsignedChannelAnnouncement), "LDKUnsignedChannelAnnouncement");
6798 *ret = ChannelAnnouncement_get_contents(this_ptr_conv);
6799 DO_ASSERT(ret->is_owned);
6800 ret->is_owned = false;
6804 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1contents(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6805 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
6806 LDKUnsignedChannelAnnouncement val_conv = *(LDKUnsignedChannelAnnouncement*)val;
6808 val_conv.is_owned = true;
6809 return ChannelAnnouncement_set_contents(this_ptr_conv, val_conv);
6812 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) {
6813 LDKSignature node_signature_1_arg_conv = *(LDKSignature*)node_signature_1_arg;
6814 FREE((void*)node_signature_1_arg);
6815 LDKSignature node_signature_2_arg_conv = *(LDKSignature*)node_signature_2_arg;
6816 FREE((void*)node_signature_2_arg);
6817 LDKSignature bitcoin_signature_1_arg_conv = *(LDKSignature*)bitcoin_signature_1_arg;
6818 FREE((void*)bitcoin_signature_1_arg);
6819 LDKSignature bitcoin_signature_2_arg_conv = *(LDKSignature*)bitcoin_signature_2_arg;
6820 FREE((void*)bitcoin_signature_2_arg);
6821 LDKUnsignedChannelAnnouncement contents_arg_conv = *(LDKUnsignedChannelAnnouncement*)contents_arg;
6822 FREE((void*)contents_arg);
6823 contents_arg_conv.is_owned = true;
6824 LDKChannelAnnouncement* ret = MALLOC(sizeof(LDKChannelAnnouncement), "LDKChannelAnnouncement");
6825 *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);
6826 DO_ASSERT(ret->is_owned);
6827 ret->is_owned = false;
6831 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6832 LDKUnsignedChannelUpdate this_ptr_conv = *(LDKUnsignedChannelUpdate*)this_ptr;
6833 FREE((void*)this_ptr);
6834 this_ptr_conv.is_owned = true;
6835 return UnsignedChannelUpdate_free(this_ptr_conv);
6838 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
6839 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
6840 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
6841 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UnsignedChannelUpdate_get_chain_hash(this_ptr_conv));
6845 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
6846 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
6847 LDKThirtyTwoBytes val_ref;
6848 (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
6849 return UnsignedChannelUpdate_set_chain_hash(this_ptr_conv, val_ref);
6852 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
6853 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
6854 return UnsignedChannelUpdate_get_short_channel_id(this_ptr_conv);
6857 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6858 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
6859 return UnsignedChannelUpdate_set_short_channel_id(this_ptr_conv, val);
6862 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1timestamp(JNIEnv * _env, jclass _b, jlong this_ptr) {
6863 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
6864 return UnsignedChannelUpdate_get_timestamp(this_ptr_conv);
6867 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1timestamp(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
6868 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
6869 return UnsignedChannelUpdate_set_timestamp(this_ptr_conv, val);
6872 JNIEXPORT jbyte JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1flags(JNIEnv * _env, jclass _b, jlong this_ptr) {
6873 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
6874 return UnsignedChannelUpdate_get_flags(this_ptr_conv);
6877 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1flags(JNIEnv * _env, jclass _b, jlong this_ptr, jbyte val) {
6878 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
6879 return UnsignedChannelUpdate_set_flags(this_ptr_conv, val);
6882 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr) {
6883 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
6884 return UnsignedChannelUpdate_get_cltv_expiry_delta(this_ptr_conv);
6887 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
6888 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
6889 return UnsignedChannelUpdate_set_cltv_expiry_delta(this_ptr_conv, val);
6892 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
6893 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
6894 return UnsignedChannelUpdate_get_htlc_minimum_msat(this_ptr_conv);
6897 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6898 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
6899 return UnsignedChannelUpdate_set_htlc_minimum_msat(this_ptr_conv, val);
6902 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1fee_1base_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
6903 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
6904 return UnsignedChannelUpdate_get_fee_base_msat(this_ptr_conv);
6907 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1fee_1base_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
6908 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
6909 return UnsignedChannelUpdate_set_fee_base_msat(this_ptr_conv, val);
6912 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1fee_1proportional_1millionths(JNIEnv * _env, jclass _b, jlong this_ptr) {
6913 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
6914 return UnsignedChannelUpdate_get_fee_proportional_millionths(this_ptr_conv);
6917 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1fee_1proportional_1millionths(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
6918 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
6919 return UnsignedChannelUpdate_set_fee_proportional_millionths(this_ptr_conv, val);
6922 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6923 LDKChannelUpdate this_ptr_conv = *(LDKChannelUpdate*)this_ptr;
6924 FREE((void*)this_ptr);
6925 this_ptr_conv.is_owned = true;
6926 return ChannelUpdate_free(this_ptr_conv);
6929 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1get_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
6930 LDKChannelUpdate* this_ptr_conv = (LDKChannelUpdate*)this_ptr;
6931 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
6932 *ret = ChannelUpdate_get_signature(this_ptr_conv);
6936 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1set_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6937 LDKChannelUpdate* this_ptr_conv = (LDKChannelUpdate*)this_ptr;
6938 LDKSignature val_conv = *(LDKSignature*)val;
6940 return ChannelUpdate_set_signature(this_ptr_conv, val_conv);
6943 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1get_1contents(JNIEnv * _env, jclass _b, jlong this_ptr) {
6944 LDKChannelUpdate* this_ptr_conv = (LDKChannelUpdate*)this_ptr;
6945 LDKUnsignedChannelUpdate* ret = MALLOC(sizeof(LDKUnsignedChannelUpdate), "LDKUnsignedChannelUpdate");
6946 *ret = ChannelUpdate_get_contents(this_ptr_conv);
6947 DO_ASSERT(ret->is_owned);
6948 ret->is_owned = false;
6952 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1set_1contents(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6953 LDKChannelUpdate* this_ptr_conv = (LDKChannelUpdate*)this_ptr;
6954 LDKUnsignedChannelUpdate val_conv = *(LDKUnsignedChannelUpdate*)val;
6956 val_conv.is_owned = true;
6957 return ChannelUpdate_set_contents(this_ptr_conv, val_conv);
6960 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1new(JNIEnv * _env, jclass _b, jlong signature_arg, jlong contents_arg) {
6961 LDKSignature signature_arg_conv = *(LDKSignature*)signature_arg;
6962 FREE((void*)signature_arg);
6963 LDKUnsignedChannelUpdate contents_arg_conv = *(LDKUnsignedChannelUpdate*)contents_arg;
6964 FREE((void*)contents_arg);
6965 contents_arg_conv.is_owned = true;
6966 LDKChannelUpdate* ret = MALLOC(sizeof(LDKChannelUpdate), "LDKChannelUpdate");
6967 *ret = ChannelUpdate_new(signature_arg_conv, contents_arg_conv);
6968 DO_ASSERT(ret->is_owned);
6969 ret->is_owned = false;
6973 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6974 LDKQueryChannelRange this_ptr_conv = *(LDKQueryChannelRange*)this_ptr;
6975 FREE((void*)this_ptr);
6976 this_ptr_conv.is_owned = true;
6977 return QueryChannelRange_free(this_ptr_conv);
6980 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1get_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
6981 LDKQueryChannelRange* this_ptr_conv = (LDKQueryChannelRange*)this_ptr;
6982 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
6983 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *QueryChannelRange_get_chain_hash(this_ptr_conv));
6987 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1set_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
6988 LDKQueryChannelRange* this_ptr_conv = (LDKQueryChannelRange*)this_ptr;
6989 LDKThirtyTwoBytes val_ref;
6990 (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
6991 return QueryChannelRange_set_chain_hash(this_ptr_conv, val_ref);
6994 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1get_1first_1blocknum(JNIEnv * _env, jclass _b, jlong this_ptr) {
6995 LDKQueryChannelRange* this_ptr_conv = (LDKQueryChannelRange*)this_ptr;
6996 return QueryChannelRange_get_first_blocknum(this_ptr_conv);
6999 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1set_1first_1blocknum(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
7000 LDKQueryChannelRange* this_ptr_conv = (LDKQueryChannelRange*)this_ptr;
7001 return QueryChannelRange_set_first_blocknum(this_ptr_conv, val);
7004 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1get_1number_1of_1blocks(JNIEnv * _env, jclass _b, jlong this_ptr) {
7005 LDKQueryChannelRange* this_ptr_conv = (LDKQueryChannelRange*)this_ptr;
7006 return QueryChannelRange_get_number_of_blocks(this_ptr_conv);
7009 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1set_1number_1of_1blocks(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
7010 LDKQueryChannelRange* this_ptr_conv = (LDKQueryChannelRange*)this_ptr;
7011 return QueryChannelRange_set_number_of_blocks(this_ptr_conv, val);
7014 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1new(JNIEnv * _env, jclass _b, jbyteArray chain_hash_arg, jint first_blocknum_arg, jint number_of_blocks_arg) {
7015 LDKThirtyTwoBytes chain_hash_arg_ref;
7016 (*_env)->GetByteArrayRegion (_env, chain_hash_arg, 0, 32, chain_hash_arg_ref.data);
7017 LDKQueryChannelRange* ret = MALLOC(sizeof(LDKQueryChannelRange), "LDKQueryChannelRange");
7018 *ret = QueryChannelRange_new(chain_hash_arg_ref, first_blocknum_arg, number_of_blocks_arg);
7019 DO_ASSERT(ret->is_owned);
7020 ret->is_owned = false;
7024 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7025 LDKReplyChannelRange this_ptr_conv = *(LDKReplyChannelRange*)this_ptr;
7026 FREE((void*)this_ptr);
7027 this_ptr_conv.is_owned = true;
7028 return ReplyChannelRange_free(this_ptr_conv);
7031 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
7032 LDKReplyChannelRange* this_ptr_conv = (LDKReplyChannelRange*)this_ptr;
7033 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
7034 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *ReplyChannelRange_get_chain_hash(this_ptr_conv));
7038 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
7039 LDKReplyChannelRange* this_ptr_conv = (LDKReplyChannelRange*)this_ptr;
7040 LDKThirtyTwoBytes val_ref;
7041 (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
7042 return ReplyChannelRange_set_chain_hash(this_ptr_conv, val_ref);
7045 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1first_1blocknum(JNIEnv * _env, jclass _b, jlong this_ptr) {
7046 LDKReplyChannelRange* this_ptr_conv = (LDKReplyChannelRange*)this_ptr;
7047 return ReplyChannelRange_get_first_blocknum(this_ptr_conv);
7050 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1first_1blocknum(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
7051 LDKReplyChannelRange* this_ptr_conv = (LDKReplyChannelRange*)this_ptr;
7052 return ReplyChannelRange_set_first_blocknum(this_ptr_conv, val);
7055 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1number_1of_1blocks(JNIEnv * _env, jclass _b, jlong this_ptr) {
7056 LDKReplyChannelRange* this_ptr_conv = (LDKReplyChannelRange*)this_ptr;
7057 return ReplyChannelRange_get_number_of_blocks(this_ptr_conv);
7060 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1number_1of_1blocks(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
7061 LDKReplyChannelRange* this_ptr_conv = (LDKReplyChannelRange*)this_ptr;
7062 return ReplyChannelRange_set_number_of_blocks(this_ptr_conv, val);
7065 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1full_1information(JNIEnv * _env, jclass _b, jlong this_ptr) {
7066 LDKReplyChannelRange* this_ptr_conv = (LDKReplyChannelRange*)this_ptr;
7067 return ReplyChannelRange_get_full_information(this_ptr_conv);
7070 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1full_1information(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
7071 LDKReplyChannelRange* this_ptr_conv = (LDKReplyChannelRange*)this_ptr;
7072 return ReplyChannelRange_set_full_information(this_ptr_conv, val);
7075 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1short_1channel_1ids(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7076 LDKReplyChannelRange* this_ptr_conv = (LDKReplyChannelRange*)this_ptr;
7077 LDKCVec_u64Z val_conv = *(LDKCVec_u64Z*)val;
7079 return ReplyChannelRange_set_short_channel_ids(this_ptr_conv, val_conv);
7082 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1new(JNIEnv * _env, jclass _b, jbyteArray chain_hash_arg, jint first_blocknum_arg, jint number_of_blocks_arg, jboolean full_information_arg, jlong short_channel_ids_arg) {
7083 LDKThirtyTwoBytes chain_hash_arg_ref;
7084 (*_env)->GetByteArrayRegion (_env, chain_hash_arg, 0, 32, chain_hash_arg_ref.data);
7085 LDKCVec_u64Z short_channel_ids_arg_conv = *(LDKCVec_u64Z*)short_channel_ids_arg;
7086 FREE((void*)short_channel_ids_arg);
7087 LDKReplyChannelRange* ret = MALLOC(sizeof(LDKReplyChannelRange), "LDKReplyChannelRange");
7088 *ret = ReplyChannelRange_new(chain_hash_arg_ref, first_blocknum_arg, number_of_blocks_arg, full_information_arg, short_channel_ids_arg_conv);
7089 DO_ASSERT(ret->is_owned);
7090 ret->is_owned = false;
7094 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7095 LDKQueryShortChannelIds this_ptr_conv = *(LDKQueryShortChannelIds*)this_ptr;
7096 FREE((void*)this_ptr);
7097 this_ptr_conv.is_owned = true;
7098 return QueryShortChannelIds_free(this_ptr_conv);
7101 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1get_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
7102 LDKQueryShortChannelIds* this_ptr_conv = (LDKQueryShortChannelIds*)this_ptr;
7103 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
7104 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *QueryShortChannelIds_get_chain_hash(this_ptr_conv));
7108 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1set_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
7109 LDKQueryShortChannelIds* this_ptr_conv = (LDKQueryShortChannelIds*)this_ptr;
7110 LDKThirtyTwoBytes val_ref;
7111 (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
7112 return QueryShortChannelIds_set_chain_hash(this_ptr_conv, val_ref);
7115 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1set_1short_1channel_1ids(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7116 LDKQueryShortChannelIds* this_ptr_conv = (LDKQueryShortChannelIds*)this_ptr;
7117 LDKCVec_u64Z val_conv = *(LDKCVec_u64Z*)val;
7119 return QueryShortChannelIds_set_short_channel_ids(this_ptr_conv, val_conv);
7122 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1new(JNIEnv * _env, jclass _b, jbyteArray chain_hash_arg, jlong short_channel_ids_arg) {
7123 LDKThirtyTwoBytes chain_hash_arg_ref;
7124 (*_env)->GetByteArrayRegion (_env, chain_hash_arg, 0, 32, chain_hash_arg_ref.data);
7125 LDKCVec_u64Z short_channel_ids_arg_conv = *(LDKCVec_u64Z*)short_channel_ids_arg;
7126 FREE((void*)short_channel_ids_arg);
7127 LDKQueryShortChannelIds* ret = MALLOC(sizeof(LDKQueryShortChannelIds), "LDKQueryShortChannelIds");
7128 *ret = QueryShortChannelIds_new(chain_hash_arg_ref, short_channel_ids_arg_conv);
7129 DO_ASSERT(ret->is_owned);
7130 ret->is_owned = false;
7134 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7135 LDKReplyShortChannelIdsEnd this_ptr_conv = *(LDKReplyShortChannelIdsEnd*)this_ptr;
7136 FREE((void*)this_ptr);
7137 this_ptr_conv.is_owned = true;
7138 return ReplyShortChannelIdsEnd_free(this_ptr_conv);
7141 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1get_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
7142 LDKReplyShortChannelIdsEnd* this_ptr_conv = (LDKReplyShortChannelIdsEnd*)this_ptr;
7143 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
7144 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *ReplyShortChannelIdsEnd_get_chain_hash(this_ptr_conv));
7148 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1set_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
7149 LDKReplyShortChannelIdsEnd* this_ptr_conv = (LDKReplyShortChannelIdsEnd*)this_ptr;
7150 LDKThirtyTwoBytes val_ref;
7151 (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
7152 return ReplyShortChannelIdsEnd_set_chain_hash(this_ptr_conv, val_ref);
7155 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1get_1full_1information(JNIEnv * _env, jclass _b, jlong this_ptr) {
7156 LDKReplyShortChannelIdsEnd* this_ptr_conv = (LDKReplyShortChannelIdsEnd*)this_ptr;
7157 return ReplyShortChannelIdsEnd_get_full_information(this_ptr_conv);
7160 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1set_1full_1information(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
7161 LDKReplyShortChannelIdsEnd* this_ptr_conv = (LDKReplyShortChannelIdsEnd*)this_ptr;
7162 return ReplyShortChannelIdsEnd_set_full_information(this_ptr_conv, val);
7165 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1new(JNIEnv * _env, jclass _b, jbyteArray chain_hash_arg, jboolean full_information_arg) {
7166 LDKThirtyTwoBytes chain_hash_arg_ref;
7167 (*_env)->GetByteArrayRegion (_env, chain_hash_arg, 0, 32, chain_hash_arg_ref.data);
7168 LDKReplyShortChannelIdsEnd* ret = MALLOC(sizeof(LDKReplyShortChannelIdsEnd), "LDKReplyShortChannelIdsEnd");
7169 *ret = ReplyShortChannelIdsEnd_new(chain_hash_arg_ref, full_information_arg);
7170 DO_ASSERT(ret->is_owned);
7171 ret->is_owned = false;
7175 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7176 LDKGossipTimestampFilter this_ptr_conv = *(LDKGossipTimestampFilter*)this_ptr;
7177 FREE((void*)this_ptr);
7178 this_ptr_conv.is_owned = true;
7179 return GossipTimestampFilter_free(this_ptr_conv);
7182 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1get_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
7183 LDKGossipTimestampFilter* this_ptr_conv = (LDKGossipTimestampFilter*)this_ptr;
7184 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
7185 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *GossipTimestampFilter_get_chain_hash(this_ptr_conv));
7189 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1set_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
7190 LDKGossipTimestampFilter* this_ptr_conv = (LDKGossipTimestampFilter*)this_ptr;
7191 LDKThirtyTwoBytes val_ref;
7192 (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
7193 return GossipTimestampFilter_set_chain_hash(this_ptr_conv, val_ref);
7196 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1get_1first_1timestamp(JNIEnv * _env, jclass _b, jlong this_ptr) {
7197 LDKGossipTimestampFilter* this_ptr_conv = (LDKGossipTimestampFilter*)this_ptr;
7198 return GossipTimestampFilter_get_first_timestamp(this_ptr_conv);
7201 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1set_1first_1timestamp(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
7202 LDKGossipTimestampFilter* this_ptr_conv = (LDKGossipTimestampFilter*)this_ptr;
7203 return GossipTimestampFilter_set_first_timestamp(this_ptr_conv, val);
7206 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1get_1timestamp_1range(JNIEnv * _env, jclass _b, jlong this_ptr) {
7207 LDKGossipTimestampFilter* this_ptr_conv = (LDKGossipTimestampFilter*)this_ptr;
7208 return GossipTimestampFilter_get_timestamp_range(this_ptr_conv);
7211 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1set_1timestamp_1range(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
7212 LDKGossipTimestampFilter* this_ptr_conv = (LDKGossipTimestampFilter*)this_ptr;
7213 return GossipTimestampFilter_set_timestamp_range(this_ptr_conv, val);
7216 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1new(JNIEnv * _env, jclass _b, jbyteArray chain_hash_arg, jint first_timestamp_arg, jint timestamp_range_arg) {
7217 LDKThirtyTwoBytes chain_hash_arg_ref;
7218 (*_env)->GetByteArrayRegion (_env, chain_hash_arg, 0, 32, chain_hash_arg_ref.data);
7219 LDKGossipTimestampFilter* ret = MALLOC(sizeof(LDKGossipTimestampFilter), "LDKGossipTimestampFilter");
7220 *ret = GossipTimestampFilter_new(chain_hash_arg_ref, first_timestamp_arg, timestamp_range_arg);
7221 DO_ASSERT(ret->is_owned);
7222 ret->is_owned = false;
7226 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorAction_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7227 LDKErrorAction this_ptr_conv = *(LDKErrorAction*)this_ptr;
7228 FREE((void*)this_ptr);
7229 return ErrorAction_free(this_ptr_conv);
7232 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7233 LDKLightningError this_ptr_conv = *(LDKLightningError*)this_ptr;
7234 FREE((void*)this_ptr);
7235 this_ptr_conv.is_owned = true;
7236 return LightningError_free(this_ptr_conv);
7239 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LightningError_1get_1err(JNIEnv * _env, jclass _b, jlong this_ptr) {
7240 LDKLightningError* this_ptr_conv = (LDKLightningError*)this_ptr;
7241 LDKStr* ret = MALLOC(sizeof(LDKStr), "LDKStr");
7242 *ret = LightningError_get_err(this_ptr_conv);
7246 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1set_1err(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7247 LDKLightningError* this_ptr_conv = (LDKLightningError*)this_ptr;
7248 LDKCVec_u8Z val_conv = *(LDKCVec_u8Z*)val;
7250 return LightningError_set_err(this_ptr_conv, val_conv);
7253 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LightningError_1get_1action(JNIEnv * _env, jclass _b, jlong this_ptr) {
7254 LDKLightningError* this_ptr_conv = (LDKLightningError*)this_ptr;
7255 LDKErrorAction* ret = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
7256 *ret = LightningError_get_action(this_ptr_conv);
7260 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1set_1action(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7261 LDKLightningError* this_ptr_conv = (LDKLightningError*)this_ptr;
7262 LDKErrorAction val_conv = *(LDKErrorAction*)val;
7264 return LightningError_set_action(this_ptr_conv, val_conv);
7267 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LightningError_1new(JNIEnv * _env, jclass _b, jlong err_arg, jlong action_arg) {
7268 LDKCVec_u8Z err_arg_conv = *(LDKCVec_u8Z*)err_arg;
7269 FREE((void*)err_arg);
7270 LDKErrorAction action_arg_conv = *(LDKErrorAction*)action_arg;
7271 FREE((void*)action_arg);
7272 LDKLightningError* ret = MALLOC(sizeof(LDKLightningError), "LDKLightningError");
7273 *ret = LightningError_new(err_arg_conv, action_arg_conv);
7274 DO_ASSERT(ret->is_owned);
7275 ret->is_owned = false;
7279 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7280 LDKCommitmentUpdate this_ptr_conv = *(LDKCommitmentUpdate*)this_ptr;
7281 FREE((void*)this_ptr);
7282 this_ptr_conv.is_owned = true;
7283 return CommitmentUpdate_free(this_ptr_conv);
7286 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1add_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7287 LDKCommitmentUpdate* this_ptr_conv = (LDKCommitmentUpdate*)this_ptr;
7288 LDKCVec_UpdateAddHTLCZ val_conv = *(LDKCVec_UpdateAddHTLCZ*)val;
7290 return CommitmentUpdate_set_update_add_htlcs(this_ptr_conv, val_conv);
7293 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fulfill_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7294 LDKCommitmentUpdate* this_ptr_conv = (LDKCommitmentUpdate*)this_ptr;
7295 LDKCVec_UpdateFulfillHTLCZ val_conv = *(LDKCVec_UpdateFulfillHTLCZ*)val;
7297 return CommitmentUpdate_set_update_fulfill_htlcs(this_ptr_conv, val_conv);
7300 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fail_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7301 LDKCommitmentUpdate* this_ptr_conv = (LDKCommitmentUpdate*)this_ptr;
7302 LDKCVec_UpdateFailHTLCZ val_conv = *(LDKCVec_UpdateFailHTLCZ*)val;
7304 return CommitmentUpdate_set_update_fail_htlcs(this_ptr_conv, val_conv);
7307 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fail_1malformed_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7308 LDKCommitmentUpdate* this_ptr_conv = (LDKCommitmentUpdate*)this_ptr;
7309 LDKCVec_UpdateFailMalformedHTLCZ val_conv = *(LDKCVec_UpdateFailMalformedHTLCZ*)val;
7311 return CommitmentUpdate_set_update_fail_malformed_htlcs(this_ptr_conv, val_conv);
7314 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1update_1fee(JNIEnv * _env, jclass _b, jlong this_ptr) {
7315 LDKCommitmentUpdate* this_ptr_conv = (LDKCommitmentUpdate*)this_ptr;
7316 LDKUpdateFee* ret = MALLOC(sizeof(LDKUpdateFee), "LDKUpdateFee");
7317 *ret = CommitmentUpdate_get_update_fee(this_ptr_conv);
7318 DO_ASSERT(ret->is_owned);
7319 ret->is_owned = false;
7323 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fee(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7324 LDKCommitmentUpdate* this_ptr_conv = (LDKCommitmentUpdate*)this_ptr;
7325 LDKUpdateFee val_conv = *(LDKUpdateFee*)val;
7327 val_conv.is_owned = true;
7328 return CommitmentUpdate_set_update_fee(this_ptr_conv, val_conv);
7331 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1commitment_1signed(JNIEnv * _env, jclass _b, jlong this_ptr) {
7332 LDKCommitmentUpdate* this_ptr_conv = (LDKCommitmentUpdate*)this_ptr;
7333 LDKCommitmentSigned* ret = MALLOC(sizeof(LDKCommitmentSigned), "LDKCommitmentSigned");
7334 *ret = CommitmentUpdate_get_commitment_signed(this_ptr_conv);
7335 DO_ASSERT(ret->is_owned);
7336 ret->is_owned = false;
7340 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1commitment_1signed(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7341 LDKCommitmentUpdate* this_ptr_conv = (LDKCommitmentUpdate*)this_ptr;
7342 LDKCommitmentSigned val_conv = *(LDKCommitmentSigned*)val;
7344 val_conv.is_owned = true;
7345 return CommitmentUpdate_set_commitment_signed(this_ptr_conv, val_conv);
7348 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) {
7349 LDKCVec_UpdateAddHTLCZ update_add_htlcs_arg_conv = *(LDKCVec_UpdateAddHTLCZ*)update_add_htlcs_arg;
7350 FREE((void*)update_add_htlcs_arg);
7351 LDKCVec_UpdateFulfillHTLCZ update_fulfill_htlcs_arg_conv = *(LDKCVec_UpdateFulfillHTLCZ*)update_fulfill_htlcs_arg;
7352 FREE((void*)update_fulfill_htlcs_arg);
7353 LDKCVec_UpdateFailHTLCZ update_fail_htlcs_arg_conv = *(LDKCVec_UpdateFailHTLCZ*)update_fail_htlcs_arg;
7354 FREE((void*)update_fail_htlcs_arg);
7355 LDKCVec_UpdateFailMalformedHTLCZ update_fail_malformed_htlcs_arg_conv = *(LDKCVec_UpdateFailMalformedHTLCZ*)update_fail_malformed_htlcs_arg;
7356 FREE((void*)update_fail_malformed_htlcs_arg);
7357 LDKUpdateFee update_fee_arg_conv = *(LDKUpdateFee*)update_fee_arg;
7358 FREE((void*)update_fee_arg);
7359 update_fee_arg_conv.is_owned = true;
7360 LDKCommitmentSigned commitment_signed_arg_conv = *(LDKCommitmentSigned*)commitment_signed_arg;
7361 FREE((void*)commitment_signed_arg);
7362 commitment_signed_arg_conv.is_owned = true;
7363 LDKCommitmentUpdate* ret = MALLOC(sizeof(LDKCommitmentUpdate), "LDKCommitmentUpdate");
7364 *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);
7365 DO_ASSERT(ret->is_owned);
7366 ret->is_owned = false;
7370 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCFailChannelUpdate_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7371 LDKHTLCFailChannelUpdate this_ptr_conv = *(LDKHTLCFailChannelUpdate*)this_ptr;
7372 FREE((void*)this_ptr);
7373 return HTLCFailChannelUpdate_free(this_ptr_conv);
7376 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7377 LDKChannelMessageHandler this_ptr_conv = *(LDKChannelMessageHandler*)this_ptr;
7378 FREE((void*)this_ptr);
7379 return ChannelMessageHandler_free(this_ptr_conv);
7382 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7383 LDKRoutingMessageHandler this_ptr_conv = *(LDKRoutingMessageHandler*)this_ptr;
7384 FREE((void*)this_ptr);
7385 return RoutingMessageHandler_free(this_ptr_conv);
7388 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1write(JNIEnv * _env, jclass _b, jlong obj) {
7389 LDKAcceptChannel* obj_conv = (LDKAcceptChannel*)obj;
7390 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7391 *ret = AcceptChannel_write(obj_conv);
7395 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1read(JNIEnv * _env, jclass _b, jlong ser) {
7396 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7397 LDKAcceptChannel* ret = MALLOC(sizeof(LDKAcceptChannel), "LDKAcceptChannel");
7398 *ret = AcceptChannel_read(ser_conv);
7399 DO_ASSERT(ret->is_owned);
7400 ret->is_owned = false;
7404 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1write(JNIEnv * _env, jclass _b, jlong obj) {
7405 LDKAnnouncementSignatures* obj_conv = (LDKAnnouncementSignatures*)obj;
7406 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7407 *ret = AnnouncementSignatures_write(obj_conv);
7411 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1read(JNIEnv * _env, jclass _b, jlong ser) {
7412 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7413 LDKAnnouncementSignatures* ret = MALLOC(sizeof(LDKAnnouncementSignatures), "LDKAnnouncementSignatures");
7414 *ret = AnnouncementSignatures_read(ser_conv);
7415 DO_ASSERT(ret->is_owned);
7416 ret->is_owned = false;
7420 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1write(JNIEnv * _env, jclass _b, jlong obj) {
7421 LDKChannelReestablish* obj_conv = (LDKChannelReestablish*)obj;
7422 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7423 *ret = ChannelReestablish_write(obj_conv);
7427 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1read(JNIEnv * _env, jclass _b, jlong ser) {
7428 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7429 LDKChannelReestablish* ret = MALLOC(sizeof(LDKChannelReestablish), "LDKChannelReestablish");
7430 *ret = ChannelReestablish_read(ser_conv);
7431 DO_ASSERT(ret->is_owned);
7432 ret->is_owned = false;
7436 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1write(JNIEnv * _env, jclass _b, jlong obj) {
7437 LDKClosingSigned* obj_conv = (LDKClosingSigned*)obj;
7438 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7439 *ret = ClosingSigned_write(obj_conv);
7443 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1read(JNIEnv * _env, jclass _b, jlong ser) {
7444 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7445 LDKClosingSigned* ret = MALLOC(sizeof(LDKClosingSigned), "LDKClosingSigned");
7446 *ret = ClosingSigned_read(ser_conv);
7447 DO_ASSERT(ret->is_owned);
7448 ret->is_owned = false;
7452 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1write(JNIEnv * _env, jclass _b, jlong obj) {
7453 LDKCommitmentSigned* obj_conv = (LDKCommitmentSigned*)obj;
7454 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7455 *ret = CommitmentSigned_write(obj_conv);
7459 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1read(JNIEnv * _env, jclass _b, jlong ser) {
7460 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7461 LDKCommitmentSigned* ret = MALLOC(sizeof(LDKCommitmentSigned), "LDKCommitmentSigned");
7462 *ret = CommitmentSigned_read(ser_conv);
7463 DO_ASSERT(ret->is_owned);
7464 ret->is_owned = false;
7468 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingCreated_1write(JNIEnv * _env, jclass _b, jlong obj) {
7469 LDKFundingCreated* obj_conv = (LDKFundingCreated*)obj;
7470 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7471 *ret = FundingCreated_write(obj_conv);
7475 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingCreated_1read(JNIEnv * _env, jclass _b, jlong ser) {
7476 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7477 LDKFundingCreated* ret = MALLOC(sizeof(LDKFundingCreated), "LDKFundingCreated");
7478 *ret = FundingCreated_read(ser_conv);
7479 DO_ASSERT(ret->is_owned);
7480 ret->is_owned = false;
7484 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingSigned_1write(JNIEnv * _env, jclass _b, jlong obj) {
7485 LDKFundingSigned* obj_conv = (LDKFundingSigned*)obj;
7486 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7487 *ret = FundingSigned_write(obj_conv);
7491 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingSigned_1read(JNIEnv * _env, jclass _b, jlong ser) {
7492 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7493 LDKFundingSigned* ret = MALLOC(sizeof(LDKFundingSigned), "LDKFundingSigned");
7494 *ret = FundingSigned_read(ser_conv);
7495 DO_ASSERT(ret->is_owned);
7496 ret->is_owned = false;
7500 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingLocked_1write(JNIEnv * _env, jclass _b, jlong obj) {
7501 LDKFundingLocked* obj_conv = (LDKFundingLocked*)obj;
7502 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7503 *ret = FundingLocked_write(obj_conv);
7507 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingLocked_1read(JNIEnv * _env, jclass _b, jlong ser) {
7508 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7509 LDKFundingLocked* ret = MALLOC(sizeof(LDKFundingLocked), "LDKFundingLocked");
7510 *ret = FundingLocked_read(ser_conv);
7511 DO_ASSERT(ret->is_owned);
7512 ret->is_owned = false;
7516 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Init_1write(JNIEnv * _env, jclass _b, jlong obj) {
7517 LDKInit* obj_conv = (LDKInit*)obj;
7518 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7519 *ret = Init_write(obj_conv);
7523 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Init_1read(JNIEnv * _env, jclass _b, jlong ser) {
7524 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7525 LDKInit* ret = MALLOC(sizeof(LDKInit), "LDKInit");
7526 *ret = Init_read(ser_conv);
7527 DO_ASSERT(ret->is_owned);
7528 ret->is_owned = false;
7532 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1write(JNIEnv * _env, jclass _b, jlong obj) {
7533 LDKOpenChannel* obj_conv = (LDKOpenChannel*)obj;
7534 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7535 *ret = OpenChannel_write(obj_conv);
7539 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1read(JNIEnv * _env, jclass _b, jlong ser) {
7540 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7541 LDKOpenChannel* ret = MALLOC(sizeof(LDKOpenChannel), "LDKOpenChannel");
7542 *ret = OpenChannel_read(ser_conv);
7543 DO_ASSERT(ret->is_owned);
7544 ret->is_owned = false;
7548 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1write(JNIEnv * _env, jclass _b, jlong obj) {
7549 LDKRevokeAndACK* obj_conv = (LDKRevokeAndACK*)obj;
7550 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7551 *ret = RevokeAndACK_write(obj_conv);
7555 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1read(JNIEnv * _env, jclass _b, jlong ser) {
7556 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7557 LDKRevokeAndACK* ret = MALLOC(sizeof(LDKRevokeAndACK), "LDKRevokeAndACK");
7558 *ret = RevokeAndACK_read(ser_conv);
7559 DO_ASSERT(ret->is_owned);
7560 ret->is_owned = false;
7564 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Shutdown_1write(JNIEnv * _env, jclass _b, jlong obj) {
7565 LDKShutdown* obj_conv = (LDKShutdown*)obj;
7566 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7567 *ret = Shutdown_write(obj_conv);
7571 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Shutdown_1read(JNIEnv * _env, jclass _b, jlong ser) {
7572 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7573 LDKShutdown* ret = MALLOC(sizeof(LDKShutdown), "LDKShutdown");
7574 *ret = Shutdown_read(ser_conv);
7575 DO_ASSERT(ret->is_owned);
7576 ret->is_owned = false;
7580 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1write(JNIEnv * _env, jclass _b, jlong obj) {
7581 LDKUpdateFailHTLC* obj_conv = (LDKUpdateFailHTLC*)obj;
7582 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7583 *ret = UpdateFailHTLC_write(obj_conv);
7587 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1read(JNIEnv * _env, jclass _b, jlong ser) {
7588 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7589 LDKUpdateFailHTLC* ret = MALLOC(sizeof(LDKUpdateFailHTLC), "LDKUpdateFailHTLC");
7590 *ret = UpdateFailHTLC_read(ser_conv);
7591 DO_ASSERT(ret->is_owned);
7592 ret->is_owned = false;
7596 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1write(JNIEnv * _env, jclass _b, jlong obj) {
7597 LDKUpdateFailMalformedHTLC* obj_conv = (LDKUpdateFailMalformedHTLC*)obj;
7598 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7599 *ret = UpdateFailMalformedHTLC_write(obj_conv);
7603 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1read(JNIEnv * _env, jclass _b, jlong ser) {
7604 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7605 LDKUpdateFailMalformedHTLC* ret = MALLOC(sizeof(LDKUpdateFailMalformedHTLC), "LDKUpdateFailMalformedHTLC");
7606 *ret = UpdateFailMalformedHTLC_read(ser_conv);
7607 DO_ASSERT(ret->is_owned);
7608 ret->is_owned = false;
7612 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFee_1write(JNIEnv * _env, jclass _b, jlong obj) {
7613 LDKUpdateFee* obj_conv = (LDKUpdateFee*)obj;
7614 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7615 *ret = UpdateFee_write(obj_conv);
7619 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFee_1read(JNIEnv * _env, jclass _b, jlong ser) {
7620 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7621 LDKUpdateFee* ret = MALLOC(sizeof(LDKUpdateFee), "LDKUpdateFee");
7622 *ret = UpdateFee_read(ser_conv);
7623 DO_ASSERT(ret->is_owned);
7624 ret->is_owned = false;
7628 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1write(JNIEnv * _env, jclass _b, jlong obj) {
7629 LDKUpdateFulfillHTLC* obj_conv = (LDKUpdateFulfillHTLC*)obj;
7630 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7631 *ret = UpdateFulfillHTLC_write(obj_conv);
7635 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1read(JNIEnv * _env, jclass _b, jlong ser) {
7636 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7637 LDKUpdateFulfillHTLC* ret = MALLOC(sizeof(LDKUpdateFulfillHTLC), "LDKUpdateFulfillHTLC");
7638 *ret = UpdateFulfillHTLC_read(ser_conv);
7639 DO_ASSERT(ret->is_owned);
7640 ret->is_owned = false;
7644 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1write(JNIEnv * _env, jclass _b, jlong obj) {
7645 LDKUpdateAddHTLC* obj_conv = (LDKUpdateAddHTLC*)obj;
7646 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7647 *ret = UpdateAddHTLC_write(obj_conv);
7651 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1read(JNIEnv * _env, jclass _b, jlong ser) {
7652 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7653 LDKUpdateAddHTLC* ret = MALLOC(sizeof(LDKUpdateAddHTLC), "LDKUpdateAddHTLC");
7654 *ret = UpdateAddHTLC_read(ser_conv);
7655 DO_ASSERT(ret->is_owned);
7656 ret->is_owned = false;
7660 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Ping_1write(JNIEnv * _env, jclass _b, jlong obj) {
7661 LDKPing* obj_conv = (LDKPing*)obj;
7662 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7663 *ret = Ping_write(obj_conv);
7667 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Ping_1read(JNIEnv * _env, jclass _b, jlong ser) {
7668 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7669 LDKPing* ret = MALLOC(sizeof(LDKPing), "LDKPing");
7670 *ret = Ping_read(ser_conv);
7671 DO_ASSERT(ret->is_owned);
7672 ret->is_owned = false;
7676 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Pong_1write(JNIEnv * _env, jclass _b, jlong obj) {
7677 LDKPong* obj_conv = (LDKPong*)obj;
7678 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7679 *ret = Pong_write(obj_conv);
7683 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Pong_1read(JNIEnv * _env, jclass _b, jlong ser) {
7684 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7685 LDKPong* ret = MALLOC(sizeof(LDKPong), "LDKPong");
7686 *ret = Pong_read(ser_conv);
7687 DO_ASSERT(ret->is_owned);
7688 ret->is_owned = false;
7692 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1write(JNIEnv * _env, jclass _b, jlong obj) {
7693 LDKUnsignedChannelAnnouncement* obj_conv = (LDKUnsignedChannelAnnouncement*)obj;
7694 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7695 *ret = UnsignedChannelAnnouncement_write(obj_conv);
7699 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1read(JNIEnv * _env, jclass _b, jlong ser) {
7700 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7701 LDKUnsignedChannelAnnouncement* ret = MALLOC(sizeof(LDKUnsignedChannelAnnouncement), "LDKUnsignedChannelAnnouncement");
7702 *ret = UnsignedChannelAnnouncement_read(ser_conv);
7703 DO_ASSERT(ret->is_owned);
7704 ret->is_owned = false;
7708 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1write(JNIEnv * _env, jclass _b, jlong obj) {
7709 LDKChannelAnnouncement* obj_conv = (LDKChannelAnnouncement*)obj;
7710 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7711 *ret = ChannelAnnouncement_write(obj_conv);
7715 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1read(JNIEnv * _env, jclass _b, jlong ser) {
7716 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7717 LDKChannelAnnouncement* ret = MALLOC(sizeof(LDKChannelAnnouncement), "LDKChannelAnnouncement");
7718 *ret = ChannelAnnouncement_read(ser_conv);
7719 DO_ASSERT(ret->is_owned);
7720 ret->is_owned = false;
7724 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1write(JNIEnv * _env, jclass _b, jlong obj) {
7725 LDKUnsignedChannelUpdate* obj_conv = (LDKUnsignedChannelUpdate*)obj;
7726 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7727 *ret = UnsignedChannelUpdate_write(obj_conv);
7731 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1read(JNIEnv * _env, jclass _b, jlong ser) {
7732 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7733 LDKUnsignedChannelUpdate* ret = MALLOC(sizeof(LDKUnsignedChannelUpdate), "LDKUnsignedChannelUpdate");
7734 *ret = UnsignedChannelUpdate_read(ser_conv);
7735 DO_ASSERT(ret->is_owned);
7736 ret->is_owned = false;
7740 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1write(JNIEnv * _env, jclass _b, jlong obj) {
7741 LDKChannelUpdate* obj_conv = (LDKChannelUpdate*)obj;
7742 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7743 *ret = ChannelUpdate_write(obj_conv);
7747 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1read(JNIEnv * _env, jclass _b, jlong ser) {
7748 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7749 LDKChannelUpdate* ret = MALLOC(sizeof(LDKChannelUpdate), "LDKChannelUpdate");
7750 *ret = ChannelUpdate_read(ser_conv);
7751 DO_ASSERT(ret->is_owned);
7752 ret->is_owned = false;
7756 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1write(JNIEnv * _env, jclass _b, jlong obj) {
7757 LDKErrorMessage* obj_conv = (LDKErrorMessage*)obj;
7758 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7759 *ret = ErrorMessage_write(obj_conv);
7763 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1read(JNIEnv * _env, jclass _b, jlong ser) {
7764 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7765 LDKErrorMessage* ret = MALLOC(sizeof(LDKErrorMessage), "LDKErrorMessage");
7766 *ret = ErrorMessage_read(ser_conv);
7767 DO_ASSERT(ret->is_owned);
7768 ret->is_owned = false;
7772 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1write(JNIEnv * _env, jclass _b, jlong obj) {
7773 LDKUnsignedNodeAnnouncement* obj_conv = (LDKUnsignedNodeAnnouncement*)obj;
7774 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7775 *ret = UnsignedNodeAnnouncement_write(obj_conv);
7779 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1read(JNIEnv * _env, jclass _b, jlong ser) {
7780 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7781 LDKUnsignedNodeAnnouncement* ret = MALLOC(sizeof(LDKUnsignedNodeAnnouncement), "LDKUnsignedNodeAnnouncement");
7782 *ret = UnsignedNodeAnnouncement_read(ser_conv);
7783 DO_ASSERT(ret->is_owned);
7784 ret->is_owned = false;
7788 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1write(JNIEnv * _env, jclass _b, jlong obj) {
7789 LDKNodeAnnouncement* obj_conv = (LDKNodeAnnouncement*)obj;
7790 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7791 *ret = NodeAnnouncement_write(obj_conv);
7795 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1read(JNIEnv * _env, jclass _b, jlong ser) {
7796 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7797 LDKNodeAnnouncement* ret = MALLOC(sizeof(LDKNodeAnnouncement), "LDKNodeAnnouncement");
7798 *ret = NodeAnnouncement_read(ser_conv);
7799 DO_ASSERT(ret->is_owned);
7800 ret->is_owned = false;
7804 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1read(JNIEnv * _env, jclass _b, jlong ser) {
7805 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7806 LDKQueryShortChannelIds* ret = MALLOC(sizeof(LDKQueryShortChannelIds), "LDKQueryShortChannelIds");
7807 *ret = QueryShortChannelIds_read(ser_conv);
7808 DO_ASSERT(ret->is_owned);
7809 ret->is_owned = false;
7813 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1write(JNIEnv * _env, jclass _b, jlong obj) {
7814 LDKQueryShortChannelIds* obj_conv = (LDKQueryShortChannelIds*)obj;
7815 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7816 *ret = QueryShortChannelIds_write(obj_conv);
7820 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1read(JNIEnv * _env, jclass _b, jlong ser) {
7821 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7822 LDKReplyShortChannelIdsEnd* ret = MALLOC(sizeof(LDKReplyShortChannelIdsEnd), "LDKReplyShortChannelIdsEnd");
7823 *ret = ReplyShortChannelIdsEnd_read(ser_conv);
7824 DO_ASSERT(ret->is_owned);
7825 ret->is_owned = false;
7829 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1write(JNIEnv * _env, jclass _b, jlong obj) {
7830 LDKReplyShortChannelIdsEnd* obj_conv = (LDKReplyShortChannelIdsEnd*)obj;
7831 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7832 *ret = ReplyShortChannelIdsEnd_write(obj_conv);
7836 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1read(JNIEnv * _env, jclass _b, jlong ser) {
7837 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7838 LDKQueryChannelRange* ret = MALLOC(sizeof(LDKQueryChannelRange), "LDKQueryChannelRange");
7839 *ret = QueryChannelRange_read(ser_conv);
7840 DO_ASSERT(ret->is_owned);
7841 ret->is_owned = false;
7845 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1write(JNIEnv * _env, jclass _b, jlong obj) {
7846 LDKQueryChannelRange* obj_conv = (LDKQueryChannelRange*)obj;
7847 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7848 *ret = QueryChannelRange_write(obj_conv);
7852 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1read(JNIEnv * _env, jclass _b, jlong ser) {
7853 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7854 LDKReplyChannelRange* ret = MALLOC(sizeof(LDKReplyChannelRange), "LDKReplyChannelRange");
7855 *ret = ReplyChannelRange_read(ser_conv);
7856 DO_ASSERT(ret->is_owned);
7857 ret->is_owned = false;
7861 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1write(JNIEnv * _env, jclass _b, jlong obj) {
7862 LDKReplyChannelRange* obj_conv = (LDKReplyChannelRange*)obj;
7863 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7864 *ret = ReplyChannelRange_write(obj_conv);
7868 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1read(JNIEnv * _env, jclass _b, jlong ser) {
7869 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7870 LDKGossipTimestampFilter* ret = MALLOC(sizeof(LDKGossipTimestampFilter), "LDKGossipTimestampFilter");
7871 *ret = GossipTimestampFilter_read(ser_conv);
7872 DO_ASSERT(ret->is_owned);
7873 ret->is_owned = false;
7877 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1write(JNIEnv * _env, jclass _b, jlong obj) {
7878 LDKGossipTimestampFilter* obj_conv = (LDKGossipTimestampFilter*)obj;
7879 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7880 *ret = GossipTimestampFilter_write(obj_conv);
7884 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7885 LDKMessageHandler this_ptr_conv = *(LDKMessageHandler*)this_ptr;
7886 FREE((void*)this_ptr);
7887 this_ptr_conv.is_owned = true;
7888 return MessageHandler_free(this_ptr_conv);
7891 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageHandler_1get_1chan_1handler(JNIEnv * _env, jclass _b, jlong this_ptr) {
7892 LDKMessageHandler* this_ptr_conv = (LDKMessageHandler*)this_ptr;
7893 long ret = (long)MessageHandler_get_chan_handler(this_ptr_conv);
7897 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1set_1chan_1handler(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7898 LDKMessageHandler* this_ptr_conv = (LDKMessageHandler*)this_ptr;
7899 LDKChannelMessageHandler val_conv = *(LDKChannelMessageHandler*)val;
7900 if (val_conv.free == LDKChannelMessageHandler_JCalls_free) {
7901 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
7902 LDKChannelMessageHandler_JCalls_clone(val_conv.this_arg);
7904 return MessageHandler_set_chan_handler(this_ptr_conv, val_conv);
7907 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageHandler_1get_1route_1handler(JNIEnv * _env, jclass _b, jlong this_ptr) {
7908 LDKMessageHandler* this_ptr_conv = (LDKMessageHandler*)this_ptr;
7909 long ret = (long)MessageHandler_get_route_handler(this_ptr_conv);
7913 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1set_1route_1handler(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7914 LDKMessageHandler* this_ptr_conv = (LDKMessageHandler*)this_ptr;
7915 LDKRoutingMessageHandler val_conv = *(LDKRoutingMessageHandler*)val;
7916 if (val_conv.free == LDKRoutingMessageHandler_JCalls_free) {
7917 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
7918 LDKRoutingMessageHandler_JCalls_clone(val_conv.this_arg);
7920 return MessageHandler_set_route_handler(this_ptr_conv, val_conv);
7923 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageHandler_1new(JNIEnv * _env, jclass _b, jlong chan_handler_arg, jlong route_handler_arg) {
7924 LDKChannelMessageHandler chan_handler_arg_conv = *(LDKChannelMessageHandler*)chan_handler_arg;
7925 if (chan_handler_arg_conv.free == LDKChannelMessageHandler_JCalls_free) {
7926 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
7927 LDKChannelMessageHandler_JCalls_clone(chan_handler_arg_conv.this_arg);
7929 LDKRoutingMessageHandler route_handler_arg_conv = *(LDKRoutingMessageHandler*)route_handler_arg;
7930 if (route_handler_arg_conv.free == LDKRoutingMessageHandler_JCalls_free) {
7931 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
7932 LDKRoutingMessageHandler_JCalls_clone(route_handler_arg_conv.this_arg);
7934 LDKMessageHandler* ret = MALLOC(sizeof(LDKMessageHandler), "LDKMessageHandler");
7935 *ret = MessageHandler_new(chan_handler_arg_conv, route_handler_arg_conv);
7936 DO_ASSERT(ret->is_owned);
7937 ret->is_owned = false;
7941 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7942 LDKSocketDescriptor this_ptr_conv = *(LDKSocketDescriptor*)this_ptr;
7943 FREE((void*)this_ptr);
7944 return SocketDescriptor_free(this_ptr_conv);
7947 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7948 LDKPeerHandleError this_ptr_conv = *(LDKPeerHandleError*)this_ptr;
7949 FREE((void*)this_ptr);
7950 this_ptr_conv.is_owned = true;
7951 return PeerHandleError_free(this_ptr_conv);
7954 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1get_1no_1connection_1possible(JNIEnv * _env, jclass _b, jlong this_ptr) {
7955 LDKPeerHandleError* this_ptr_conv = (LDKPeerHandleError*)this_ptr;
7956 return PeerHandleError_get_no_connection_possible(this_ptr_conv);
7959 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1set_1no_1connection_1possible(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
7960 LDKPeerHandleError* this_ptr_conv = (LDKPeerHandleError*)this_ptr;
7961 return PeerHandleError_set_no_connection_possible(this_ptr_conv, val);
7964 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1new(JNIEnv * _env, jclass _b, jboolean no_connection_possible_arg) {
7965 LDKPeerHandleError* ret = MALLOC(sizeof(LDKPeerHandleError), "LDKPeerHandleError");
7966 *ret = PeerHandleError_new(no_connection_possible_arg);
7967 DO_ASSERT(ret->is_owned);
7968 ret->is_owned = false;
7972 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7973 LDKPeerManager this_ptr_conv = *(LDKPeerManager*)this_ptr;
7974 FREE((void*)this_ptr);
7975 this_ptr_conv.is_owned = true;
7976 return PeerManager_free(this_ptr_conv);
7979 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) {
7980 LDKMessageHandler message_handler_conv = *(LDKMessageHandler*)message_handler;
7981 FREE((void*)message_handler);
7982 message_handler_conv.is_owned = true;
7983 LDKSecretKey our_node_secret_conv = *(LDKSecretKey*)our_node_secret;
7984 FREE((void*)our_node_secret);
7985 unsigned char ephemeral_random_data_arr[32];
7986 (*_env)->GetByteArrayRegion (_env, ephemeral_random_data, 0, 32, ephemeral_random_data_arr);
7987 unsigned char (*ephemeral_random_data_ref)[32] = &ephemeral_random_data_arr;
7988 LDKLogger logger_conv = *(LDKLogger*)logger;
7989 if (logger_conv.free == LDKLogger_JCalls_free) {
7990 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
7991 LDKLogger_JCalls_clone(logger_conv.this_arg);
7993 LDKPeerManager* ret = MALLOC(sizeof(LDKPeerManager), "LDKPeerManager");
7994 *ret = PeerManager_new(message_handler_conv, our_node_secret_conv, ephemeral_random_data_ref, logger_conv);
7995 DO_ASSERT(ret->is_owned);
7996 ret->is_owned = false;
8000 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerManager_1get_1peer_1node_1ids(JNIEnv * _env, jclass _b, jlong this_arg) {
8001 LDKPeerManager* this_arg_conv = (LDKPeerManager*)this_arg;
8002 LDKCVec_PublicKeyZ* ret = MALLOC(sizeof(LDKCVec_PublicKeyZ), "LDKCVec_PublicKeyZ");
8003 *ret = PeerManager_get_peer_node_ids(this_arg_conv);
8007 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) {
8008 LDKPeerManager* this_arg_conv = (LDKPeerManager*)this_arg;
8009 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
8010 FREE((void*)their_node_id);
8011 LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)descriptor;
8012 if (descriptor_conv.free == LDKSocketDescriptor_JCalls_free) {
8013 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
8014 LDKSocketDescriptor_JCalls_clone(descriptor_conv.this_arg);
8016 LDKCResult_CVec_u8ZPeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
8017 *ret = PeerManager_new_outbound_connection(this_arg_conv, their_node_id_conv, descriptor_conv);
8021 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerManager_1new_1inbound_1connection(JNIEnv * _env, jclass _b, jlong this_arg, jlong descriptor) {
8022 LDKPeerManager* this_arg_conv = (LDKPeerManager*)this_arg;
8023 LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)descriptor;
8024 if (descriptor_conv.free == LDKSocketDescriptor_JCalls_free) {
8025 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
8026 LDKSocketDescriptor_JCalls_clone(descriptor_conv.this_arg);
8028 LDKCResult_NonePeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
8029 *ret = PeerManager_new_inbound_connection(this_arg_conv, descriptor_conv);
8033 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerManager_1write_1buffer_1space_1avail(JNIEnv * _env, jclass _b, jlong this_arg, jlong descriptor) {
8034 LDKPeerManager* this_arg_conv = (LDKPeerManager*)this_arg;
8035 LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor;
8036 LDKCResult_NonePeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
8037 *ret = PeerManager_write_buffer_space_avail(this_arg_conv, descriptor_conv);
8041 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerManager_1read_1event(JNIEnv * _env, jclass _b, jlong this_arg, jlong peer_descriptor, jlong data) {
8042 LDKPeerManager* this_arg_conv = (LDKPeerManager*)this_arg;
8043 LDKSocketDescriptor* peer_descriptor_conv = (LDKSocketDescriptor*)peer_descriptor;
8044 LDKu8slice data_conv = *(LDKu8slice*)data;
8045 LDKCResult_boolPeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
8046 *ret = PeerManager_read_event(this_arg_conv, peer_descriptor_conv, data_conv);
8050 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1process_1events(JNIEnv * _env, jclass _b, jlong this_arg) {
8051 LDKPeerManager* this_arg_conv = (LDKPeerManager*)this_arg;
8052 return PeerManager_process_events(this_arg_conv);
8055 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1socket_1disconnected(JNIEnv * _env, jclass _b, jlong this_arg, jlong descriptor) {
8056 LDKPeerManager* this_arg_conv = (LDKPeerManager*)this_arg;
8057 LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor;
8058 return PeerManager_socket_disconnected(this_arg_conv, descriptor_conv);
8061 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1timer_1tick_1occured(JNIEnv * _env, jclass _b, jlong this_arg) {
8062 LDKPeerManager* this_arg_conv = (LDKPeerManager*)this_arg;
8063 return PeerManager_timer_tick_occured(this_arg_conv);
8066 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_build_1commitment_1secret(JNIEnv * _env, jclass _b, jbyteArray commitment_seed, jlong idx) {
8067 unsigned char commitment_seed_arr[32];
8068 (*_env)->GetByteArrayRegion (_env, commitment_seed, 0, 32, commitment_seed_arr);
8069 unsigned char (*commitment_seed_ref)[32] = &commitment_seed_arr;
8070 jbyteArray _arr = (*_env)->NewByteArray(_env, 32);
8071 (*_env)->SetByteArrayRegion(_env, _arr, 0, 32, build_commitment_secret(commitment_seed_ref, idx).data);
8075 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_derive_1private_1key(JNIEnv * _env, jclass _b, jlong per_commitment_point, jbyteArray base_secret) {
8076 LDKPublicKey per_commitment_point_conv = *(LDKPublicKey*)per_commitment_point;
8077 FREE((void*)per_commitment_point);
8078 unsigned char base_secret_arr[32];
8079 (*_env)->GetByteArrayRegion (_env, base_secret, 0, 32, base_secret_arr);
8080 unsigned char (*base_secret_ref)[32] = &base_secret_arr;
8081 LDKCResult_SecretKeySecpErrorZ* ret = MALLOC(sizeof(LDKCResult_SecretKeySecpErrorZ), "LDKCResult_SecretKeySecpErrorZ");
8082 *ret = derive_private_key(per_commitment_point_conv, base_secret_ref);
8086 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_derive_1public_1key(JNIEnv * _env, jclass _b, jlong per_commitment_point, jlong base_point) {
8087 LDKPublicKey per_commitment_point_conv = *(LDKPublicKey*)per_commitment_point;
8088 FREE((void*)per_commitment_point);
8089 LDKPublicKey base_point_conv = *(LDKPublicKey*)base_point;
8090 FREE((void*)base_point);
8091 LDKCResult_PublicKeySecpErrorZ* ret = MALLOC(sizeof(LDKCResult_PublicKeySecpErrorZ), "LDKCResult_PublicKeySecpErrorZ");
8092 *ret = derive_public_key(per_commitment_point_conv, base_point_conv);
8096 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) {
8097 unsigned char per_commitment_secret_arr[32];
8098 (*_env)->GetByteArrayRegion (_env, per_commitment_secret, 0, 32, per_commitment_secret_arr);
8099 unsigned char (*per_commitment_secret_ref)[32] = &per_commitment_secret_arr;
8100 unsigned char countersignatory_revocation_base_secret_arr[32];
8101 (*_env)->GetByteArrayRegion (_env, countersignatory_revocation_base_secret, 0, 32, countersignatory_revocation_base_secret_arr);
8102 unsigned char (*countersignatory_revocation_base_secret_ref)[32] = &countersignatory_revocation_base_secret_arr;
8103 LDKCResult_SecretKeySecpErrorZ* ret = MALLOC(sizeof(LDKCResult_SecretKeySecpErrorZ), "LDKCResult_SecretKeySecpErrorZ");
8104 *ret = derive_private_revocation_key(per_commitment_secret_ref, countersignatory_revocation_base_secret_ref);
8108 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) {
8109 LDKPublicKey per_commitment_point_conv = *(LDKPublicKey*)per_commitment_point;
8110 FREE((void*)per_commitment_point);
8111 LDKPublicKey countersignatory_revocation_base_point_conv = *(LDKPublicKey*)countersignatory_revocation_base_point;
8112 FREE((void*)countersignatory_revocation_base_point);
8113 LDKCResult_PublicKeySecpErrorZ* ret = MALLOC(sizeof(LDKCResult_PublicKeySecpErrorZ), "LDKCResult_PublicKeySecpErrorZ");
8114 *ret = derive_public_revocation_key(per_commitment_point_conv, countersignatory_revocation_base_point_conv);
8118 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
8119 LDKTxCreationKeys this_ptr_conv = *(LDKTxCreationKeys*)this_ptr;
8120 FREE((void*)this_ptr);
8121 this_ptr_conv.is_owned = true;
8122 return TxCreationKeys_free(this_ptr_conv);
8125 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
8126 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
8127 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
8128 *ret = TxCreationKeys_get_per_commitment_point(this_ptr_conv);
8132 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
8133 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
8134 LDKPublicKey val_conv = *(LDKPublicKey*)val;
8136 return TxCreationKeys_set_per_commitment_point(this_ptr_conv, val_conv);
8139 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1revocation_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
8140 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
8141 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
8142 *ret = TxCreationKeys_get_revocation_key(this_ptr_conv);
8146 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1revocation_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
8147 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
8148 LDKPublicKey val_conv = *(LDKPublicKey*)val;
8150 return TxCreationKeys_set_revocation_key(this_ptr_conv, val_conv);
8153 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1broadcaster_1htlc_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
8154 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
8155 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
8156 *ret = TxCreationKeys_get_broadcaster_htlc_key(this_ptr_conv);
8160 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1broadcaster_1htlc_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
8161 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
8162 LDKPublicKey val_conv = *(LDKPublicKey*)val;
8164 return TxCreationKeys_set_broadcaster_htlc_key(this_ptr_conv, val_conv);
8167 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1countersignatory_1htlc_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
8168 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
8169 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
8170 *ret = TxCreationKeys_get_countersignatory_htlc_key(this_ptr_conv);
8174 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1countersignatory_1htlc_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
8175 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
8176 LDKPublicKey val_conv = *(LDKPublicKey*)val;
8178 return TxCreationKeys_set_countersignatory_htlc_key(this_ptr_conv, val_conv);
8181 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1broadcaster_1delayed_1payment_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
8182 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
8183 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
8184 *ret = TxCreationKeys_get_broadcaster_delayed_payment_key(this_ptr_conv);
8188 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1broadcaster_1delayed_1payment_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
8189 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
8190 LDKPublicKey val_conv = *(LDKPublicKey*)val;
8192 return TxCreationKeys_set_broadcaster_delayed_payment_key(this_ptr_conv, val_conv);
8195 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) {
8196 LDKPublicKey per_commitment_point_arg_conv = *(LDKPublicKey*)per_commitment_point_arg;
8197 FREE((void*)per_commitment_point_arg);
8198 LDKPublicKey revocation_key_arg_conv = *(LDKPublicKey*)revocation_key_arg;
8199 FREE((void*)revocation_key_arg);
8200 LDKPublicKey broadcaster_htlc_key_arg_conv = *(LDKPublicKey*)broadcaster_htlc_key_arg;
8201 FREE((void*)broadcaster_htlc_key_arg);
8202 LDKPublicKey countersignatory_htlc_key_arg_conv = *(LDKPublicKey*)countersignatory_htlc_key_arg;
8203 FREE((void*)countersignatory_htlc_key_arg);
8204 LDKPublicKey broadcaster_delayed_payment_key_arg_conv = *(LDKPublicKey*)broadcaster_delayed_payment_key_arg;
8205 FREE((void*)broadcaster_delayed_payment_key_arg);
8206 LDKTxCreationKeys* ret = MALLOC(sizeof(LDKTxCreationKeys), "LDKTxCreationKeys");
8207 *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);
8208 DO_ASSERT(ret->is_owned);
8209 ret->is_owned = false;
8213 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1write(JNIEnv * _env, jclass _b, jlong obj) {
8214 LDKTxCreationKeys* obj_conv = (LDKTxCreationKeys*)obj;
8215 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
8216 *ret = TxCreationKeys_write(obj_conv);
8220 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1read(JNIEnv * _env, jclass _b, jlong ser) {
8221 LDKu8slice ser_conv = *(LDKu8slice*)ser;
8222 LDKTxCreationKeys* ret = MALLOC(sizeof(LDKTxCreationKeys), "LDKTxCreationKeys");
8223 *ret = TxCreationKeys_read(ser_conv);
8224 DO_ASSERT(ret->is_owned);
8225 ret->is_owned = false;
8229 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PreCalculatedTxCreationKeys_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
8230 LDKPreCalculatedTxCreationKeys this_ptr_conv = *(LDKPreCalculatedTxCreationKeys*)this_ptr;
8231 FREE((void*)this_ptr);
8232 this_ptr_conv.is_owned = true;
8233 return PreCalculatedTxCreationKeys_free(this_ptr_conv);
8236 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PreCalculatedTxCreationKeys_1new(JNIEnv * _env, jclass _b, jlong keys) {
8237 LDKTxCreationKeys keys_conv = *(LDKTxCreationKeys*)keys;
8239 keys_conv.is_owned = true;
8240 LDKPreCalculatedTxCreationKeys* ret = MALLOC(sizeof(LDKPreCalculatedTxCreationKeys), "LDKPreCalculatedTxCreationKeys");
8241 *ret = PreCalculatedTxCreationKeys_new(keys_conv);
8242 DO_ASSERT(ret->is_owned);
8243 ret->is_owned = false;
8247 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PreCalculatedTxCreationKeys_1trust_1key_1derivation(JNIEnv * _env, jclass _b, jlong this_arg) {
8248 LDKPreCalculatedTxCreationKeys* this_arg_conv = (LDKPreCalculatedTxCreationKeys*)this_arg;
8249 LDKTxCreationKeys* ret = MALLOC(sizeof(LDKTxCreationKeys), "LDKTxCreationKeys");
8250 *ret = PreCalculatedTxCreationKeys_trust_key_derivation(this_arg_conv);
8251 DO_ASSERT(ret->is_owned);
8252 ret->is_owned = false;
8256 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PreCalculatedTxCreationKeys_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_arg) {
8257 LDKPreCalculatedTxCreationKeys* this_arg_conv = (LDKPreCalculatedTxCreationKeys*)this_arg;
8258 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
8259 *ret = PreCalculatedTxCreationKeys_per_commitment_point(this_arg_conv);
8263 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
8264 LDKChannelPublicKeys this_ptr_conv = *(LDKChannelPublicKeys*)this_ptr;
8265 FREE((void*)this_ptr);
8266 this_ptr_conv.is_owned = true;
8267 return ChannelPublicKeys_free(this_ptr_conv);
8270 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1funding_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr) {
8271 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
8272 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
8273 *ret = ChannelPublicKeys_get_funding_pubkey(this_ptr_conv);
8277 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1funding_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
8278 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
8279 LDKPublicKey val_conv = *(LDKPublicKey*)val;
8281 return ChannelPublicKeys_set_funding_pubkey(this_ptr_conv, val_conv);
8284 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1revocation_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
8285 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
8286 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
8287 *ret = ChannelPublicKeys_get_revocation_basepoint(this_ptr_conv);
8291 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1revocation_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
8292 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
8293 LDKPublicKey val_conv = *(LDKPublicKey*)val;
8295 return ChannelPublicKeys_set_revocation_basepoint(this_ptr_conv, val_conv);
8298 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1payment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
8299 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
8300 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
8301 *ret = ChannelPublicKeys_get_payment_point(this_ptr_conv);
8305 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1payment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
8306 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
8307 LDKPublicKey val_conv = *(LDKPublicKey*)val;
8309 return ChannelPublicKeys_set_payment_point(this_ptr_conv, val_conv);
8312 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1delayed_1payment_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
8313 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
8314 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
8315 *ret = ChannelPublicKeys_get_delayed_payment_basepoint(this_ptr_conv);
8319 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1delayed_1payment_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
8320 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
8321 LDKPublicKey val_conv = *(LDKPublicKey*)val;
8323 return ChannelPublicKeys_set_delayed_payment_basepoint(this_ptr_conv, val_conv);
8326 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1htlc_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
8327 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
8328 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
8329 *ret = ChannelPublicKeys_get_htlc_basepoint(this_ptr_conv);
8333 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1htlc_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
8334 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
8335 LDKPublicKey val_conv = *(LDKPublicKey*)val;
8337 return ChannelPublicKeys_set_htlc_basepoint(this_ptr_conv, val_conv);
8340 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) {
8341 LDKPublicKey funding_pubkey_arg_conv = *(LDKPublicKey*)funding_pubkey_arg;
8342 FREE((void*)funding_pubkey_arg);
8343 LDKPublicKey revocation_basepoint_arg_conv = *(LDKPublicKey*)revocation_basepoint_arg;
8344 FREE((void*)revocation_basepoint_arg);
8345 LDKPublicKey payment_point_arg_conv = *(LDKPublicKey*)payment_point_arg;
8346 FREE((void*)payment_point_arg);
8347 LDKPublicKey delayed_payment_basepoint_arg_conv = *(LDKPublicKey*)delayed_payment_basepoint_arg;
8348 FREE((void*)delayed_payment_basepoint_arg);
8349 LDKPublicKey htlc_basepoint_arg_conv = *(LDKPublicKey*)htlc_basepoint_arg;
8350 FREE((void*)htlc_basepoint_arg);
8351 LDKChannelPublicKeys* ret = MALLOC(sizeof(LDKChannelPublicKeys), "LDKChannelPublicKeys");
8352 *ret = ChannelPublicKeys_new(funding_pubkey_arg_conv, revocation_basepoint_arg_conv, payment_point_arg_conv, delayed_payment_basepoint_arg_conv, htlc_basepoint_arg_conv);
8353 DO_ASSERT(ret->is_owned);
8354 ret->is_owned = false;
8358 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1write(JNIEnv * _env, jclass _b, jlong obj) {
8359 LDKChannelPublicKeys* obj_conv = (LDKChannelPublicKeys*)obj;
8360 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
8361 *ret = ChannelPublicKeys_write(obj_conv);
8365 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1read(JNIEnv * _env, jclass _b, jlong ser) {
8366 LDKu8slice ser_conv = *(LDKu8slice*)ser;
8367 LDKChannelPublicKeys* ret = MALLOC(sizeof(LDKChannelPublicKeys), "LDKChannelPublicKeys");
8368 *ret = ChannelPublicKeys_read(ser_conv);
8369 DO_ASSERT(ret->is_owned);
8370 ret->is_owned = false;
8374 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) {
8375 LDKPublicKey per_commitment_point_conv = *(LDKPublicKey*)per_commitment_point;
8376 FREE((void*)per_commitment_point);
8377 LDKPublicKey broadcaster_delayed_payment_base_conv = *(LDKPublicKey*)broadcaster_delayed_payment_base;
8378 FREE((void*)broadcaster_delayed_payment_base);
8379 LDKPublicKey broadcaster_htlc_base_conv = *(LDKPublicKey*)broadcaster_htlc_base;
8380 FREE((void*)broadcaster_htlc_base);
8381 LDKPublicKey countersignatory_revocation_base_conv = *(LDKPublicKey*)countersignatory_revocation_base;
8382 FREE((void*)countersignatory_revocation_base);
8383 LDKPublicKey countersignatory_htlc_base_conv = *(LDKPublicKey*)countersignatory_htlc_base;
8384 FREE((void*)countersignatory_htlc_base);
8385 LDKCResult_TxCreationKeysSecpErrorZ* ret = MALLOC(sizeof(LDKCResult_TxCreationKeysSecpErrorZ), "LDKCResult_TxCreationKeysSecpErrorZ");
8386 *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);
8390 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) {
8391 LDKPublicKey revocation_key_conv = *(LDKPublicKey*)revocation_key;
8392 FREE((void*)revocation_key);
8393 LDKPublicKey broadcaster_delayed_payment_key_conv = *(LDKPublicKey*)broadcaster_delayed_payment_key;
8394 FREE((void*)broadcaster_delayed_payment_key);
8395 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
8396 *ret = get_revokeable_redeemscript(revocation_key_conv, contest_delay, broadcaster_delayed_payment_key_conv);
8400 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
8401 LDKHTLCOutputInCommitment this_ptr_conv = *(LDKHTLCOutputInCommitment*)this_ptr;
8402 FREE((void*)this_ptr);
8403 this_ptr_conv.is_owned = true;
8404 return HTLCOutputInCommitment_free(this_ptr_conv);
8407 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1offered(JNIEnv * _env, jclass _b, jlong this_ptr) {
8408 LDKHTLCOutputInCommitment* this_ptr_conv = (LDKHTLCOutputInCommitment*)this_ptr;
8409 return HTLCOutputInCommitment_get_offered(this_ptr_conv);
8412 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1offered(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
8413 LDKHTLCOutputInCommitment* this_ptr_conv = (LDKHTLCOutputInCommitment*)this_ptr;
8414 return HTLCOutputInCommitment_set_offered(this_ptr_conv, val);
8417 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1amount_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
8418 LDKHTLCOutputInCommitment* this_ptr_conv = (LDKHTLCOutputInCommitment*)this_ptr;
8419 return HTLCOutputInCommitment_get_amount_msat(this_ptr_conv);
8422 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1amount_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
8423 LDKHTLCOutputInCommitment* this_ptr_conv = (LDKHTLCOutputInCommitment*)this_ptr;
8424 return HTLCOutputInCommitment_set_amount_msat(this_ptr_conv, val);
8427 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1cltv_1expiry(JNIEnv * _env, jclass _b, jlong this_ptr) {
8428 LDKHTLCOutputInCommitment* this_ptr_conv = (LDKHTLCOutputInCommitment*)this_ptr;
8429 return HTLCOutputInCommitment_get_cltv_expiry(this_ptr_conv);
8432 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1cltv_1expiry(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
8433 LDKHTLCOutputInCommitment* this_ptr_conv = (LDKHTLCOutputInCommitment*)this_ptr;
8434 return HTLCOutputInCommitment_set_cltv_expiry(this_ptr_conv, val);
8437 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1payment_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
8438 LDKHTLCOutputInCommitment* this_ptr_conv = (LDKHTLCOutputInCommitment*)this_ptr;
8439 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
8440 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *HTLCOutputInCommitment_get_payment_hash(this_ptr_conv));
8444 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1payment_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
8445 LDKHTLCOutputInCommitment* this_ptr_conv = (LDKHTLCOutputInCommitment*)this_ptr;
8446 LDKThirtyTwoBytes val_ref;
8447 (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
8448 return HTLCOutputInCommitment_set_payment_hash(this_ptr_conv, val_ref);
8451 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1write(JNIEnv * _env, jclass _b, jlong obj) {
8452 LDKHTLCOutputInCommitment* obj_conv = (LDKHTLCOutputInCommitment*)obj;
8453 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
8454 *ret = HTLCOutputInCommitment_write(obj_conv);
8458 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1read(JNIEnv * _env, jclass _b, jlong ser) {
8459 LDKu8slice ser_conv = *(LDKu8slice*)ser;
8460 LDKHTLCOutputInCommitment* ret = MALLOC(sizeof(LDKHTLCOutputInCommitment), "LDKHTLCOutputInCommitment");
8461 *ret = HTLCOutputInCommitment_read(ser_conv);
8462 DO_ASSERT(ret->is_owned);
8463 ret->is_owned = false;
8467 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_get_1htlc_1redeemscript(JNIEnv * _env, jclass _b, jlong htlc, jlong keys) {
8468 LDKHTLCOutputInCommitment* htlc_conv = (LDKHTLCOutputInCommitment*)htlc;
8469 LDKTxCreationKeys* keys_conv = (LDKTxCreationKeys*)keys;
8470 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
8471 *ret = get_htlc_redeemscript(htlc_conv, keys_conv);
8475 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_make_1funding_1redeemscript(JNIEnv * _env, jclass _b, jlong broadcaster, jlong countersignatory) {
8476 LDKPublicKey broadcaster_conv = *(LDKPublicKey*)broadcaster;
8477 FREE((void*)broadcaster);
8478 LDKPublicKey countersignatory_conv = *(LDKPublicKey*)countersignatory;
8479 FREE((void*)countersignatory);
8480 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
8481 *ret = make_funding_redeemscript(broadcaster_conv, countersignatory_conv);
8485 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) {
8486 unsigned char prev_hash_arr[32];
8487 (*_env)->GetByteArrayRegion (_env, prev_hash, 0, 32, prev_hash_arr);
8488 unsigned char (*prev_hash_ref)[32] = &prev_hash_arr;
8489 LDKHTLCOutputInCommitment* htlc_conv = (LDKHTLCOutputInCommitment*)htlc;
8490 LDKPublicKey broadcaster_delayed_payment_key_conv = *(LDKPublicKey*)broadcaster_delayed_payment_key;
8491 FREE((void*)broadcaster_delayed_payment_key);
8492 LDKPublicKey revocation_key_conv = *(LDKPublicKey*)revocation_key;
8493 FREE((void*)revocation_key);
8494 LDKTransaction* ret = MALLOC(sizeof(LDKTransaction), "LDKTransaction");
8495 *ret = build_htlc_transaction(prev_hash_ref, feerate_per_kw, contest_delay, htlc_conv, broadcaster_delayed_payment_key_conv, revocation_key_conv);
8499 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
8500 LDKHolderCommitmentTransaction this_ptr_conv = *(LDKHolderCommitmentTransaction*)this_ptr;
8501 FREE((void*)this_ptr);
8502 this_ptr_conv.is_owned = true;
8503 return HolderCommitmentTransaction_free(this_ptr_conv);
8506 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1get_1unsigned_1tx(JNIEnv * _env, jclass _b, jlong this_ptr) {
8507 LDKHolderCommitmentTransaction* this_ptr_conv = (LDKHolderCommitmentTransaction*)this_ptr;
8508 LDKTransaction* ret = MALLOC(sizeof(LDKTransaction), "LDKTransaction");
8509 *ret = HolderCommitmentTransaction_get_unsigned_tx(this_ptr_conv);
8513 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1set_1unsigned_1tx(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
8514 LDKHolderCommitmentTransaction* this_ptr_conv = (LDKHolderCommitmentTransaction*)this_ptr;
8515 LDKTransaction val_conv = *(LDKTransaction*)val;
8517 return HolderCommitmentTransaction_set_unsigned_tx(this_ptr_conv, val_conv);
8520 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1get_1counterparty_1sig(JNIEnv * _env, jclass _b, jlong this_ptr) {
8521 LDKHolderCommitmentTransaction* this_ptr_conv = (LDKHolderCommitmentTransaction*)this_ptr;
8522 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
8523 *ret = HolderCommitmentTransaction_get_counterparty_sig(this_ptr_conv);
8527 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1set_1counterparty_1sig(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
8528 LDKHolderCommitmentTransaction* this_ptr_conv = (LDKHolderCommitmentTransaction*)this_ptr;
8529 LDKSignature val_conv = *(LDKSignature*)val;
8531 return HolderCommitmentTransaction_set_counterparty_sig(this_ptr_conv, val_conv);
8534 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1get_1feerate_1per_1kw(JNIEnv * _env, jclass _b, jlong this_ptr) {
8535 LDKHolderCommitmentTransaction* this_ptr_conv = (LDKHolderCommitmentTransaction*)this_ptr;
8536 return HolderCommitmentTransaction_get_feerate_per_kw(this_ptr_conv);
8539 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1set_1feerate_1per_1kw(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
8540 LDKHolderCommitmentTransaction* this_ptr_conv = (LDKHolderCommitmentTransaction*)this_ptr;
8541 return HolderCommitmentTransaction_set_feerate_per_kw(this_ptr_conv, val);
8544 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1set_1per_1htlc(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
8545 LDKHolderCommitmentTransaction* this_ptr_conv = (LDKHolderCommitmentTransaction*)this_ptr;
8546 LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ val_conv = *(LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ*)val;
8548 return HolderCommitmentTransaction_set_per_htlc(this_ptr_conv, val_conv);
8551 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) {
8552 LDKTransaction unsigned_tx_conv = *(LDKTransaction*)unsigned_tx;
8553 FREE((void*)unsigned_tx);
8554 LDKSignature counterparty_sig_conv = *(LDKSignature*)counterparty_sig;
8555 FREE((void*)counterparty_sig);
8556 LDKPublicKey holder_funding_key_conv = *(LDKPublicKey*)holder_funding_key;
8557 FREE((void*)holder_funding_key);
8558 LDKPublicKey counterparty_funding_key_conv = *(LDKPublicKey*)counterparty_funding_key;
8559 FREE((void*)counterparty_funding_key);
8560 LDKTxCreationKeys keys_conv = *(LDKTxCreationKeys*)keys;
8562 keys_conv.is_owned = true;
8563 LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ htlc_data_conv = *(LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ*)htlc_data;
8564 FREE((void*)htlc_data);
8565 LDKHolderCommitmentTransaction* ret = MALLOC(sizeof(LDKHolderCommitmentTransaction), "LDKHolderCommitmentTransaction");
8566 *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);
8567 DO_ASSERT(ret->is_owned);
8568 ret->is_owned = false;
8572 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1trust_1key_1derivation(JNIEnv * _env, jclass _b, jlong this_arg) {
8573 LDKHolderCommitmentTransaction* this_arg_conv = (LDKHolderCommitmentTransaction*)this_arg;
8574 LDKTxCreationKeys* ret = MALLOC(sizeof(LDKTxCreationKeys), "LDKTxCreationKeys");
8575 *ret = HolderCommitmentTransaction_trust_key_derivation(this_arg_conv);
8576 DO_ASSERT(ret->is_owned);
8577 ret->is_owned = false;
8581 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1txid(JNIEnv * _env, jclass _b, jlong this_arg) {
8582 LDKHolderCommitmentTransaction* this_arg_conv = (LDKHolderCommitmentTransaction*)this_arg;
8583 jbyteArray _arr = (*_env)->NewByteArray(_env, 32);
8584 (*_env)->SetByteArrayRegion(_env, _arr, 0, 32, HolderCommitmentTransaction_txid(this_arg_conv).data);
8588 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) {
8589 LDKHolderCommitmentTransaction* this_arg_conv = (LDKHolderCommitmentTransaction*)this_arg;
8590 unsigned char funding_key_arr[32];
8591 (*_env)->GetByteArrayRegion (_env, funding_key, 0, 32, funding_key_arr);
8592 unsigned char (*funding_key_ref)[32] = &funding_key_arr;
8593 LDKu8slice funding_redeemscript_conv = *(LDKu8slice*)funding_redeemscript;
8594 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
8595 *ret = HolderCommitmentTransaction_get_holder_sig(this_arg_conv, funding_key_ref, funding_redeemscript_conv, channel_value_satoshis);
8599 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) {
8600 LDKHolderCommitmentTransaction* this_arg_conv = (LDKHolderCommitmentTransaction*)this_arg;
8601 unsigned char htlc_base_key_arr[32];
8602 (*_env)->GetByteArrayRegion (_env, htlc_base_key, 0, 32, htlc_base_key_arr);
8603 unsigned char (*htlc_base_key_ref)[32] = &htlc_base_key_arr;
8604 LDKCResult_CVec_SignatureZNoneZ* ret = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
8605 *ret = HolderCommitmentTransaction_get_htlc_sigs(this_arg_conv, htlc_base_key_ref, counterparty_selected_contest_delay);
8609 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1write(JNIEnv * _env, jclass _b, jlong obj) {
8610 LDKHolderCommitmentTransaction* obj_conv = (LDKHolderCommitmentTransaction*)obj;
8611 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
8612 *ret = HolderCommitmentTransaction_write(obj_conv);
8616 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1read(JNIEnv * _env, jclass _b, jlong ser) {
8617 LDKu8slice ser_conv = *(LDKu8slice*)ser;
8618 LDKHolderCommitmentTransaction* ret = MALLOC(sizeof(LDKHolderCommitmentTransaction), "LDKHolderCommitmentTransaction");
8619 *ret = HolderCommitmentTransaction_read(ser_conv);
8620 DO_ASSERT(ret->is_owned);
8621 ret->is_owned = false;
8625 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
8626 LDKInitFeatures this_ptr_conv = *(LDKInitFeatures*)this_ptr;
8627 FREE((void*)this_ptr);
8628 this_ptr_conv.is_owned = true;
8629 return InitFeatures_free(this_ptr_conv);
8632 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
8633 LDKNodeFeatures this_ptr_conv = *(LDKNodeFeatures*)this_ptr;
8634 FREE((void*)this_ptr);
8635 this_ptr_conv.is_owned = true;
8636 return NodeFeatures_free(this_ptr_conv);
8639 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
8640 LDKChannelFeatures this_ptr_conv = *(LDKChannelFeatures*)this_ptr;
8641 FREE((void*)this_ptr);
8642 this_ptr_conv.is_owned = true;
8643 return ChannelFeatures_free(this_ptr_conv);
8646 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
8647 LDKRouteHop this_ptr_conv = *(LDKRouteHop*)this_ptr;
8648 FREE((void*)this_ptr);
8649 this_ptr_conv.is_owned = true;
8650 return RouteHop_free(this_ptr_conv);
8653 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr) {
8654 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
8655 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
8656 *ret = RouteHop_get_pubkey(this_ptr_conv);
8660 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
8661 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
8662 LDKPublicKey val_conv = *(LDKPublicKey*)val;
8664 return RouteHop_set_pubkey(this_ptr_conv, val_conv);
8667 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1node_1features(JNIEnv * _env, jclass _b, jlong this_ptr) {
8668 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
8669 LDKNodeFeatures* ret = MALLOC(sizeof(LDKNodeFeatures), "LDKNodeFeatures");
8670 *ret = RouteHop_get_node_features(this_ptr_conv);
8671 DO_ASSERT(ret->is_owned);
8672 ret->is_owned = false;
8676 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1node_1features(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
8677 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
8678 LDKNodeFeatures val_conv = *(LDKNodeFeatures*)val;
8680 val_conv.is_owned = true;
8681 return RouteHop_set_node_features(this_ptr_conv, val_conv);
8684 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
8685 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
8686 return RouteHop_get_short_channel_id(this_ptr_conv);
8689 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
8690 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
8691 return RouteHop_set_short_channel_id(this_ptr_conv, val);
8694 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1channel_1features(JNIEnv * _env, jclass _b, jlong this_ptr) {
8695 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
8696 LDKChannelFeatures* ret = MALLOC(sizeof(LDKChannelFeatures), "LDKChannelFeatures");
8697 *ret = RouteHop_get_channel_features(this_ptr_conv);
8698 DO_ASSERT(ret->is_owned);
8699 ret->is_owned = false;
8703 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1channel_1features(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
8704 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
8705 LDKChannelFeatures val_conv = *(LDKChannelFeatures*)val;
8707 val_conv.is_owned = true;
8708 return RouteHop_set_channel_features(this_ptr_conv, val_conv);
8711 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1fee_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
8712 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
8713 return RouteHop_get_fee_msat(this_ptr_conv);
8716 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1fee_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
8717 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
8718 return RouteHop_set_fee_msat(this_ptr_conv, val);
8721 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr) {
8722 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
8723 return RouteHop_get_cltv_expiry_delta(this_ptr_conv);
8726 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
8727 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
8728 return RouteHop_set_cltv_expiry_delta(this_ptr_conv, val);
8731 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) {
8732 LDKPublicKey pubkey_arg_conv = *(LDKPublicKey*)pubkey_arg;
8733 FREE((void*)pubkey_arg);
8734 LDKNodeFeatures node_features_arg_conv = *(LDKNodeFeatures*)node_features_arg;
8735 FREE((void*)node_features_arg);
8736 node_features_arg_conv.is_owned = true;
8737 LDKChannelFeatures channel_features_arg_conv = *(LDKChannelFeatures*)channel_features_arg;
8738 FREE((void*)channel_features_arg);
8739 channel_features_arg_conv.is_owned = true;
8740 LDKRouteHop* ret = MALLOC(sizeof(LDKRouteHop), "LDKRouteHop");
8741 *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);
8742 DO_ASSERT(ret->is_owned);
8743 ret->is_owned = false;
8747 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Route_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
8748 LDKRoute this_ptr_conv = *(LDKRoute*)this_ptr;
8749 FREE((void*)this_ptr);
8750 this_ptr_conv.is_owned = true;
8751 return Route_free(this_ptr_conv);
8754 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Route_1set_1paths(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
8755 LDKRoute* this_ptr_conv = (LDKRoute*)this_ptr;
8756 LDKCVec_CVec_RouteHopZZ val_conv = *(LDKCVec_CVec_RouteHopZZ*)val;
8758 return Route_set_paths(this_ptr_conv, val_conv);
8761 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Route_1new(JNIEnv * _env, jclass _b, jlong paths_arg) {
8762 LDKCVec_CVec_RouteHopZZ paths_arg_conv = *(LDKCVec_CVec_RouteHopZZ*)paths_arg;
8763 FREE((void*)paths_arg);
8764 LDKRoute* ret = MALLOC(sizeof(LDKRoute), "LDKRoute");
8765 *ret = Route_new(paths_arg_conv);
8766 DO_ASSERT(ret->is_owned);
8767 ret->is_owned = false;
8771 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Route_1write(JNIEnv * _env, jclass _b, jlong obj) {
8772 LDKRoute* obj_conv = (LDKRoute*)obj;
8773 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
8774 *ret = Route_write(obj_conv);
8778 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Route_1read(JNIEnv * _env, jclass _b, jlong ser) {
8779 LDKu8slice ser_conv = *(LDKu8slice*)ser;
8780 LDKRoute* ret = MALLOC(sizeof(LDKRoute), "LDKRoute");
8781 *ret = Route_read(ser_conv);
8782 DO_ASSERT(ret->is_owned);
8783 ret->is_owned = false;
8787 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
8788 LDKRouteHint this_ptr_conv = *(LDKRouteHint*)this_ptr;
8789 FREE((void*)this_ptr);
8790 this_ptr_conv.is_owned = true;
8791 return RouteHint_free(this_ptr_conv);
8794 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1src_1node_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
8795 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
8796 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
8797 *ret = RouteHint_get_src_node_id(this_ptr_conv);
8801 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1src_1node_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
8802 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
8803 LDKPublicKey val_conv = *(LDKPublicKey*)val;
8805 return RouteHint_set_src_node_id(this_ptr_conv, val_conv);
8808 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
8809 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
8810 return RouteHint_get_short_channel_id(this_ptr_conv);
8813 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
8814 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
8815 return RouteHint_set_short_channel_id(this_ptr_conv, val);
8818 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1fees(JNIEnv * _env, jclass _b, jlong this_ptr) {
8819 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
8820 LDKRoutingFees* ret = MALLOC(sizeof(LDKRoutingFees), "LDKRoutingFees");
8821 *ret = RouteHint_get_fees(this_ptr_conv);
8822 DO_ASSERT(ret->is_owned);
8823 ret->is_owned = false;
8827 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1fees(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
8828 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
8829 LDKRoutingFees val_conv = *(LDKRoutingFees*)val;
8831 val_conv.is_owned = true;
8832 return RouteHint_set_fees(this_ptr_conv, val_conv);
8835 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr) {
8836 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
8837 return RouteHint_get_cltv_expiry_delta(this_ptr_conv);
8840 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
8841 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
8842 return RouteHint_set_cltv_expiry_delta(this_ptr_conv, val);
8845 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
8846 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
8847 return RouteHint_get_htlc_minimum_msat(this_ptr_conv);
8850 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
8851 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
8852 return RouteHint_set_htlc_minimum_msat(this_ptr_conv, val);
8855 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) {
8856 LDKPublicKey src_node_id_arg_conv = *(LDKPublicKey*)src_node_id_arg;
8857 FREE((void*)src_node_id_arg);
8858 LDKRoutingFees fees_arg_conv = *(LDKRoutingFees*)fees_arg;
8859 FREE((void*)fees_arg);
8860 fees_arg_conv.is_owned = true;
8861 LDKRouteHint* ret = MALLOC(sizeof(LDKRouteHint), "LDKRouteHint");
8862 *ret = RouteHint_new(src_node_id_arg_conv, short_channel_id_arg, fees_arg_conv, cltv_expiry_delta_arg, htlc_minimum_msat_arg);
8863 DO_ASSERT(ret->is_owned);
8864 ret->is_owned = false;
8868 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) {
8869 LDKPublicKey our_node_id_conv = *(LDKPublicKey*)our_node_id;
8870 FREE((void*)our_node_id);
8871 LDKNetworkGraph* network_conv = (LDKNetworkGraph*)network;
8872 LDKPublicKey target_conv = *(LDKPublicKey*)target;
8873 FREE((void*)target);
8874 LDKCVec_ChannelDetailsZ* first_hops_conv = (LDKCVec_ChannelDetailsZ*)first_hops;
8875 LDKCVec_RouteHintZ last_hops_conv = *(LDKCVec_RouteHintZ*)last_hops;
8876 FREE((void*)last_hops);
8877 LDKLogger logger_conv = *(LDKLogger*)logger;
8878 if (logger_conv.free == LDKLogger_JCalls_free) {
8879 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
8880 LDKLogger_JCalls_clone(logger_conv.this_arg);
8882 LDKCResult_RouteLightningErrorZ* ret = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
8883 *ret = get_route(our_node_id_conv, network_conv, target_conv, first_hops_conv, last_hops_conv, final_value_msat, final_cltv, logger_conv);
8887 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
8888 LDKNetworkGraph this_ptr_conv = *(LDKNetworkGraph*)this_ptr;
8889 FREE((void*)this_ptr);
8890 this_ptr_conv.is_owned = true;
8891 return NetworkGraph_free(this_ptr_conv);
8894 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LockedNetworkGraph_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
8895 LDKLockedNetworkGraph this_ptr_conv = *(LDKLockedNetworkGraph*)this_ptr;
8896 FREE((void*)this_ptr);
8897 this_ptr_conv.is_owned = true;
8898 return LockedNetworkGraph_free(this_ptr_conv);
8901 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
8902 LDKNetGraphMsgHandler this_ptr_conv = *(LDKNetGraphMsgHandler*)this_ptr;
8903 FREE((void*)this_ptr);
8904 this_ptr_conv.is_owned = true;
8905 return NetGraphMsgHandler_free(this_ptr_conv);
8908 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1new(JNIEnv * _env, jclass _b, jlong chain_access, jlong logger) {
8909 LDKAccess* chain_access_conv = (LDKAccess*)chain_access;
8910 LDKLogger logger_conv = *(LDKLogger*)logger;
8911 if (logger_conv.free == LDKLogger_JCalls_free) {
8912 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
8913 LDKLogger_JCalls_clone(logger_conv.this_arg);
8915 LDKNetGraphMsgHandler* ret = MALLOC(sizeof(LDKNetGraphMsgHandler), "LDKNetGraphMsgHandler");
8916 *ret = NetGraphMsgHandler_new(chain_access_conv, logger_conv);
8917 DO_ASSERT(ret->is_owned);
8918 ret->is_owned = false;
8922 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1from_1net_1graph(JNIEnv * _env, jclass _b, jlong chain_access, jlong logger, jlong network_graph) {
8923 LDKAccess* chain_access_conv = (LDKAccess*)chain_access;
8924 LDKLogger logger_conv = *(LDKLogger*)logger;
8925 if (logger_conv.free == LDKLogger_JCalls_free) {
8926 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
8927 LDKLogger_JCalls_clone(logger_conv.this_arg);
8929 LDKNetworkGraph network_graph_conv = *(LDKNetworkGraph*)network_graph;
8930 FREE((void*)network_graph);
8931 network_graph_conv.is_owned = true;
8932 LDKNetGraphMsgHandler* ret = MALLOC(sizeof(LDKNetGraphMsgHandler), "LDKNetGraphMsgHandler");
8933 *ret = NetGraphMsgHandler_from_net_graph(chain_access_conv, logger_conv, network_graph_conv);
8934 DO_ASSERT(ret->is_owned);
8935 ret->is_owned = false;
8939 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1read_1locked_1graph(JNIEnv * _env, jclass _b, jlong this_arg) {
8940 LDKNetGraphMsgHandler* this_arg_conv = (LDKNetGraphMsgHandler*)this_arg;
8941 LDKLockedNetworkGraph* ret = MALLOC(sizeof(LDKLockedNetworkGraph), "LDKLockedNetworkGraph");
8942 *ret = NetGraphMsgHandler_read_locked_graph(this_arg_conv);
8943 DO_ASSERT(ret->is_owned);
8944 ret->is_owned = false;
8948 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LockedNetworkGraph_1graph(JNIEnv * _env, jclass _b, jlong this_arg) {
8949 LDKLockedNetworkGraph* this_arg_conv = (LDKLockedNetworkGraph*)this_arg;
8950 LDKNetworkGraph* ret = MALLOC(sizeof(LDKNetworkGraph), "LDKNetworkGraph");
8951 *ret = LockedNetworkGraph_graph(this_arg_conv);
8952 DO_ASSERT(ret->is_owned);
8953 ret->is_owned = false;
8957 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1as_1RoutingMessageHandler(JNIEnv * _env, jclass _b, jlong this_arg) {
8958 LDKNetGraphMsgHandler* this_arg_conv = (LDKNetGraphMsgHandler*)this_arg;
8959 LDKRoutingMessageHandler* ret = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler");
8960 *ret = NetGraphMsgHandler_as_RoutingMessageHandler(this_arg_conv);
8964 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
8965 LDKDirectionalChannelInfo this_ptr_conv = *(LDKDirectionalChannelInfo*)this_ptr;
8966 FREE((void*)this_ptr);
8967 this_ptr_conv.is_owned = true;
8968 return DirectionalChannelInfo_free(this_ptr_conv);
8971 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get_1last_1update(JNIEnv * _env, jclass _b, jlong this_ptr) {
8972 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
8973 return DirectionalChannelInfo_get_last_update(this_ptr_conv);
8976 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1last_1update(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
8977 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
8978 return DirectionalChannelInfo_set_last_update(this_ptr_conv, val);
8981 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get_1enabled(JNIEnv * _env, jclass _b, jlong this_ptr) {
8982 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
8983 return DirectionalChannelInfo_get_enabled(this_ptr_conv);
8986 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1enabled(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
8987 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
8988 return DirectionalChannelInfo_set_enabled(this_ptr_conv, val);
8991 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr) {
8992 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
8993 return DirectionalChannelInfo_get_cltv_expiry_delta(this_ptr_conv);
8996 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
8997 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
8998 return DirectionalChannelInfo_set_cltv_expiry_delta(this_ptr_conv, val);
9001 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
9002 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
9003 return DirectionalChannelInfo_get_htlc_minimum_msat(this_ptr_conv);
9006 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
9007 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
9008 return DirectionalChannelInfo_set_htlc_minimum_msat(this_ptr_conv, val);
9011 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get_1last_1update_1message(JNIEnv * _env, jclass _b, jlong this_ptr) {
9012 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
9013 LDKChannelUpdate* ret = MALLOC(sizeof(LDKChannelUpdate), "LDKChannelUpdate");
9014 *ret = DirectionalChannelInfo_get_last_update_message(this_ptr_conv);
9015 DO_ASSERT(ret->is_owned);
9016 ret->is_owned = false;
9020 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1last_1update_1message(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
9021 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
9022 LDKChannelUpdate val_conv = *(LDKChannelUpdate*)val;
9024 val_conv.is_owned = true;
9025 return DirectionalChannelInfo_set_last_update_message(this_ptr_conv, val_conv);
9028 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1write(JNIEnv * _env, jclass _b, jlong obj) {
9029 LDKDirectionalChannelInfo* obj_conv = (LDKDirectionalChannelInfo*)obj;
9030 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
9031 *ret = DirectionalChannelInfo_write(obj_conv);
9035 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1read(JNIEnv * _env, jclass _b, jlong ser) {
9036 LDKu8slice ser_conv = *(LDKu8slice*)ser;
9037 LDKDirectionalChannelInfo* ret = MALLOC(sizeof(LDKDirectionalChannelInfo), "LDKDirectionalChannelInfo");
9038 *ret = DirectionalChannelInfo_read(ser_conv);
9039 DO_ASSERT(ret->is_owned);
9040 ret->is_owned = false;
9044 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
9045 LDKChannelInfo this_ptr_conv = *(LDKChannelInfo*)this_ptr;
9046 FREE((void*)this_ptr);
9047 this_ptr_conv.is_owned = true;
9048 return ChannelInfo_free(this_ptr_conv);
9051 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1features(JNIEnv * _env, jclass _b, jlong this_ptr) {
9052 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
9053 LDKChannelFeatures* ret = MALLOC(sizeof(LDKChannelFeatures), "LDKChannelFeatures");
9054 *ret = ChannelInfo_get_features(this_ptr_conv);
9055 DO_ASSERT(ret->is_owned);
9056 ret->is_owned = false;
9060 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1features(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
9061 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
9062 LDKChannelFeatures val_conv = *(LDKChannelFeatures*)val;
9064 val_conv.is_owned = true;
9065 return ChannelInfo_set_features(this_ptr_conv, val_conv);
9068 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1node_1one(JNIEnv * _env, jclass _b, jlong this_ptr) {
9069 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
9070 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
9071 *ret = ChannelInfo_get_node_one(this_ptr_conv);
9075 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1node_1one(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
9076 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
9077 LDKPublicKey val_conv = *(LDKPublicKey*)val;
9079 return ChannelInfo_set_node_one(this_ptr_conv, val_conv);
9082 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1one_1to_1two(JNIEnv * _env, jclass _b, jlong this_ptr) {
9083 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
9084 LDKDirectionalChannelInfo* ret = MALLOC(sizeof(LDKDirectionalChannelInfo), "LDKDirectionalChannelInfo");
9085 *ret = ChannelInfo_get_one_to_two(this_ptr_conv);
9086 DO_ASSERT(ret->is_owned);
9087 ret->is_owned = false;
9091 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1one_1to_1two(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
9092 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
9093 LDKDirectionalChannelInfo val_conv = *(LDKDirectionalChannelInfo*)val;
9095 val_conv.is_owned = true;
9096 return ChannelInfo_set_one_to_two(this_ptr_conv, val_conv);
9099 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1node_1two(JNIEnv * _env, jclass _b, jlong this_ptr) {
9100 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
9101 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
9102 *ret = ChannelInfo_get_node_two(this_ptr_conv);
9106 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1node_1two(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
9107 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
9108 LDKPublicKey val_conv = *(LDKPublicKey*)val;
9110 return ChannelInfo_set_node_two(this_ptr_conv, val_conv);
9113 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1two_1to_1one(JNIEnv * _env, jclass _b, jlong this_ptr) {
9114 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
9115 LDKDirectionalChannelInfo* ret = MALLOC(sizeof(LDKDirectionalChannelInfo), "LDKDirectionalChannelInfo");
9116 *ret = ChannelInfo_get_two_to_one(this_ptr_conv);
9117 DO_ASSERT(ret->is_owned);
9118 ret->is_owned = false;
9122 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1two_1to_1one(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
9123 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
9124 LDKDirectionalChannelInfo val_conv = *(LDKDirectionalChannelInfo*)val;
9126 val_conv.is_owned = true;
9127 return ChannelInfo_set_two_to_one(this_ptr_conv, val_conv);
9130 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1announcement_1message(JNIEnv * _env, jclass _b, jlong this_ptr) {
9131 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
9132 LDKChannelAnnouncement* ret = MALLOC(sizeof(LDKChannelAnnouncement), "LDKChannelAnnouncement");
9133 *ret = ChannelInfo_get_announcement_message(this_ptr_conv);
9134 DO_ASSERT(ret->is_owned);
9135 ret->is_owned = false;
9139 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1announcement_1message(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
9140 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
9141 LDKChannelAnnouncement val_conv = *(LDKChannelAnnouncement*)val;
9143 val_conv.is_owned = true;
9144 return ChannelInfo_set_announcement_message(this_ptr_conv, val_conv);
9147 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1write(JNIEnv * _env, jclass _b, jlong obj) {
9148 LDKChannelInfo* obj_conv = (LDKChannelInfo*)obj;
9149 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
9150 *ret = ChannelInfo_write(obj_conv);
9154 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1read(JNIEnv * _env, jclass _b, jlong ser) {
9155 LDKu8slice ser_conv = *(LDKu8slice*)ser;
9156 LDKChannelInfo* ret = MALLOC(sizeof(LDKChannelInfo), "LDKChannelInfo");
9157 *ret = ChannelInfo_read(ser_conv);
9158 DO_ASSERT(ret->is_owned);
9159 ret->is_owned = false;
9163 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingFees_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
9164 LDKRoutingFees this_ptr_conv = *(LDKRoutingFees*)this_ptr;
9165 FREE((void*)this_ptr);
9166 this_ptr_conv.is_owned = true;
9167 return RoutingFees_free(this_ptr_conv);
9170 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_RoutingFees_1get_1base_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
9171 LDKRoutingFees* this_ptr_conv = (LDKRoutingFees*)this_ptr;
9172 return RoutingFees_get_base_msat(this_ptr_conv);
9175 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingFees_1set_1base_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
9176 LDKRoutingFees* this_ptr_conv = (LDKRoutingFees*)this_ptr;
9177 return RoutingFees_set_base_msat(this_ptr_conv, val);
9180 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_RoutingFees_1get_1proportional_1millionths(JNIEnv * _env, jclass _b, jlong this_ptr) {
9181 LDKRoutingFees* this_ptr_conv = (LDKRoutingFees*)this_ptr;
9182 return RoutingFees_get_proportional_millionths(this_ptr_conv);
9185 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingFees_1set_1proportional_1millionths(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
9186 LDKRoutingFees* this_ptr_conv = (LDKRoutingFees*)this_ptr;
9187 return RoutingFees_set_proportional_millionths(this_ptr_conv, val);
9190 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RoutingFees_1new(JNIEnv * _env, jclass _b, jint base_msat_arg, jint proportional_millionths_arg) {
9191 LDKRoutingFees* ret = MALLOC(sizeof(LDKRoutingFees), "LDKRoutingFees");
9192 *ret = RoutingFees_new(base_msat_arg, proportional_millionths_arg);
9193 DO_ASSERT(ret->is_owned);
9194 ret->is_owned = false;
9198 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RoutingFees_1read(JNIEnv * _env, jclass _b, jlong ser) {
9199 LDKu8slice ser_conv = *(LDKu8slice*)ser;
9200 LDKRoutingFees* ret = MALLOC(sizeof(LDKRoutingFees), "LDKRoutingFees");
9201 *ret = RoutingFees_read(ser_conv);
9202 DO_ASSERT(ret->is_owned);
9203 ret->is_owned = false;
9207 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RoutingFees_1write(JNIEnv * _env, jclass _b, jlong obj) {
9208 LDKRoutingFees* obj_conv = (LDKRoutingFees*)obj;
9209 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
9210 *ret = RoutingFees_write(obj_conv);
9214 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
9215 LDKNodeAnnouncementInfo this_ptr_conv = *(LDKNodeAnnouncementInfo*)this_ptr;
9216 FREE((void*)this_ptr);
9217 this_ptr_conv.is_owned = true;
9218 return NodeAnnouncementInfo_free(this_ptr_conv);
9221 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1features(JNIEnv * _env, jclass _b, jlong this_ptr) {
9222 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
9223 LDKNodeFeatures* ret = MALLOC(sizeof(LDKNodeFeatures), "LDKNodeFeatures");
9224 *ret = NodeAnnouncementInfo_get_features(this_ptr_conv);
9225 DO_ASSERT(ret->is_owned);
9226 ret->is_owned = false;
9230 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1features(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
9231 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
9232 LDKNodeFeatures val_conv = *(LDKNodeFeatures*)val;
9234 val_conv.is_owned = true;
9235 return NodeAnnouncementInfo_set_features(this_ptr_conv, val_conv);
9238 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1last_1update(JNIEnv * _env, jclass _b, jlong this_ptr) {
9239 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
9240 return NodeAnnouncementInfo_get_last_update(this_ptr_conv);
9243 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1last_1update(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
9244 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
9245 return NodeAnnouncementInfo_set_last_update(this_ptr_conv, val);
9248 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1rgb(JNIEnv * _env, jclass _b, jlong this_ptr) {
9249 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
9250 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 3);
9251 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 3, *NodeAnnouncementInfo_get_rgb(this_ptr_conv));
9255 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1rgb(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
9256 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
9257 LDKThreeBytes val_conv = *(LDKThreeBytes*)val;
9259 return NodeAnnouncementInfo_set_rgb(this_ptr_conv, val_conv);
9262 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1alias(JNIEnv * _env, jclass _b, jlong this_ptr) {
9263 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
9264 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
9265 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *NodeAnnouncementInfo_get_alias(this_ptr_conv));
9269 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1alias(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
9270 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
9271 LDKThirtyTwoBytes val_ref;
9272 (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
9273 return NodeAnnouncementInfo_set_alias(this_ptr_conv, val_ref);
9276 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1addresses(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
9277 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
9278 LDKCVec_NetAddressZ val_conv = *(LDKCVec_NetAddressZ*)val;
9280 return NodeAnnouncementInfo_set_addresses(this_ptr_conv, val_conv);
9283 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1announcement_1message(JNIEnv * _env, jclass _b, jlong this_ptr) {
9284 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
9285 LDKNodeAnnouncement* ret = MALLOC(sizeof(LDKNodeAnnouncement), "LDKNodeAnnouncement");
9286 *ret = NodeAnnouncementInfo_get_announcement_message(this_ptr_conv);
9287 DO_ASSERT(ret->is_owned);
9288 ret->is_owned = false;
9292 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1announcement_1message(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
9293 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
9294 LDKNodeAnnouncement val_conv = *(LDKNodeAnnouncement*)val;
9296 val_conv.is_owned = true;
9297 return NodeAnnouncementInfo_set_announcement_message(this_ptr_conv, val_conv);
9300 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1new(JNIEnv * _env, jclass _b, jlong features_arg, jint last_update_arg, jlong rgb_arg, jbyteArray alias_arg, jlong addresses_arg, jlong announcement_message_arg) {
9301 LDKNodeFeatures features_arg_conv = *(LDKNodeFeatures*)features_arg;
9302 FREE((void*)features_arg);
9303 features_arg_conv.is_owned = true;
9304 LDKThreeBytes rgb_arg_conv = *(LDKThreeBytes*)rgb_arg;
9305 FREE((void*)rgb_arg);
9306 LDKThirtyTwoBytes alias_arg_ref;
9307 (*_env)->GetByteArrayRegion (_env, alias_arg, 0, 32, alias_arg_ref.data);
9308 LDKCVec_NetAddressZ addresses_arg_conv = *(LDKCVec_NetAddressZ*)addresses_arg;
9309 FREE((void*)addresses_arg);
9310 LDKNodeAnnouncement announcement_message_arg_conv = *(LDKNodeAnnouncement*)announcement_message_arg;
9311 FREE((void*)announcement_message_arg);
9312 announcement_message_arg_conv.is_owned = true;
9313 LDKNodeAnnouncementInfo* ret = MALLOC(sizeof(LDKNodeAnnouncementInfo), "LDKNodeAnnouncementInfo");
9314 *ret = NodeAnnouncementInfo_new(features_arg_conv, last_update_arg, rgb_arg_conv, alias_arg_ref, addresses_arg_conv, announcement_message_arg_conv);
9315 DO_ASSERT(ret->is_owned);
9316 ret->is_owned = false;
9320 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1write(JNIEnv * _env, jclass _b, jlong obj) {
9321 LDKNodeAnnouncementInfo* obj_conv = (LDKNodeAnnouncementInfo*)obj;
9322 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
9323 *ret = NodeAnnouncementInfo_write(obj_conv);
9327 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1read(JNIEnv * _env, jclass _b, jlong ser) {
9328 LDKu8slice ser_conv = *(LDKu8slice*)ser;
9329 LDKNodeAnnouncementInfo* ret = MALLOC(sizeof(LDKNodeAnnouncementInfo), "LDKNodeAnnouncementInfo");
9330 *ret = NodeAnnouncementInfo_read(ser_conv);
9331 DO_ASSERT(ret->is_owned);
9332 ret->is_owned = false;
9336 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
9337 LDKNodeInfo this_ptr_conv = *(LDKNodeInfo*)this_ptr;
9338 FREE((void*)this_ptr);
9339 this_ptr_conv.is_owned = true;
9340 return NodeInfo_free(this_ptr_conv);
9343 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1set_1channels(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
9344 LDKNodeInfo* this_ptr_conv = (LDKNodeInfo*)this_ptr;
9345 LDKCVec_u64Z val_conv = *(LDKCVec_u64Z*)val;
9347 return NodeInfo_set_channels(this_ptr_conv, val_conv);
9350 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeInfo_1get_1lowest_1inbound_1channel_1fees(JNIEnv * _env, jclass _b, jlong this_ptr) {
9351 LDKNodeInfo* this_ptr_conv = (LDKNodeInfo*)this_ptr;
9352 LDKRoutingFees* ret = MALLOC(sizeof(LDKRoutingFees), "LDKRoutingFees");
9353 *ret = NodeInfo_get_lowest_inbound_channel_fees(this_ptr_conv);
9354 DO_ASSERT(ret->is_owned);
9355 ret->is_owned = false;
9359 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1set_1lowest_1inbound_1channel_1fees(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
9360 LDKNodeInfo* this_ptr_conv = (LDKNodeInfo*)this_ptr;
9361 LDKRoutingFees val_conv = *(LDKRoutingFees*)val;
9363 val_conv.is_owned = true;
9364 return NodeInfo_set_lowest_inbound_channel_fees(this_ptr_conv, val_conv);
9367 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeInfo_1get_1announcement_1info(JNIEnv * _env, jclass _b, jlong this_ptr) {
9368 LDKNodeInfo* this_ptr_conv = (LDKNodeInfo*)this_ptr;
9369 LDKNodeAnnouncementInfo* ret = MALLOC(sizeof(LDKNodeAnnouncementInfo), "LDKNodeAnnouncementInfo");
9370 *ret = NodeInfo_get_announcement_info(this_ptr_conv);
9371 DO_ASSERT(ret->is_owned);
9372 ret->is_owned = false;
9376 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1set_1announcement_1info(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
9377 LDKNodeInfo* this_ptr_conv = (LDKNodeInfo*)this_ptr;
9378 LDKNodeAnnouncementInfo val_conv = *(LDKNodeAnnouncementInfo*)val;
9380 val_conv.is_owned = true;
9381 return NodeInfo_set_announcement_info(this_ptr_conv, val_conv);
9384 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) {
9385 LDKCVec_u64Z channels_arg_conv = *(LDKCVec_u64Z*)channels_arg;
9386 FREE((void*)channels_arg);
9387 LDKRoutingFees lowest_inbound_channel_fees_arg_conv = *(LDKRoutingFees*)lowest_inbound_channel_fees_arg;
9388 FREE((void*)lowest_inbound_channel_fees_arg);
9389 lowest_inbound_channel_fees_arg_conv.is_owned = true;
9390 LDKNodeAnnouncementInfo announcement_info_arg_conv = *(LDKNodeAnnouncementInfo*)announcement_info_arg;
9391 FREE((void*)announcement_info_arg);
9392 announcement_info_arg_conv.is_owned = true;
9393 LDKNodeInfo* ret = MALLOC(sizeof(LDKNodeInfo), "LDKNodeInfo");
9394 *ret = NodeInfo_new(channels_arg_conv, lowest_inbound_channel_fees_arg_conv, announcement_info_arg_conv);
9395 DO_ASSERT(ret->is_owned);
9396 ret->is_owned = false;
9400 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeInfo_1write(JNIEnv * _env, jclass _b, jlong obj) {
9401 LDKNodeInfo* obj_conv = (LDKNodeInfo*)obj;
9402 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
9403 *ret = NodeInfo_write(obj_conv);
9407 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeInfo_1read(JNIEnv * _env, jclass _b, jlong ser) {
9408 LDKu8slice ser_conv = *(LDKu8slice*)ser;
9409 LDKNodeInfo* ret = MALLOC(sizeof(LDKNodeInfo), "LDKNodeInfo");
9410 *ret = NodeInfo_read(ser_conv);
9411 DO_ASSERT(ret->is_owned);
9412 ret->is_owned = false;
9416 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1write(JNIEnv * _env, jclass _b, jlong obj) {
9417 LDKNetworkGraph* obj_conv = (LDKNetworkGraph*)obj;
9418 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
9419 *ret = NetworkGraph_write(obj_conv);
9423 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1read(JNIEnv * _env, jclass _b, jlong ser) {
9424 LDKu8slice ser_conv = *(LDKu8slice*)ser;
9425 LDKNetworkGraph* ret = MALLOC(sizeof(LDKNetworkGraph), "LDKNetworkGraph");
9426 *ret = NetworkGraph_read(ser_conv);
9427 DO_ASSERT(ret->is_owned);
9428 ret->is_owned = false;
9432 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1new(JNIEnv * _env, jclass _b) {
9433 LDKNetworkGraph* ret = MALLOC(sizeof(LDKNetworkGraph), "LDKNetworkGraph");
9434 *ret = NetworkGraph_new();
9435 DO_ASSERT(ret->is_owned);
9436 ret->is_owned = false;
9440 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) {
9441 LDKNetworkGraph* this_arg_conv = (LDKNetworkGraph*)this_arg;
9442 return NetworkGraph_close_channel_from_update(this_arg_conv, short_channel_id, is_permanent);