]> git.bitcoin.ninja Git - ldk-java/commitdiff
Update auto-generated bindings with missed files and v0.0.98 tags
authorMatt Corallo <git-ldk-build@bluematt.me>
Fri, 11 Jun 2021 21:20:59 +0000 (21:20 +0000)
committerMatt Corallo <git-ldk-build@bluematt.me>
Fri, 11 Jun 2021 21:21:28 +0000 (21:21 +0000)
liblightningjni_debug.so
liblightningjni_release.so
src/main/java/org/ldk/impl/bindings.java
src/main/java/org/ldk/structs/PrivateRoute.java [new file with mode: 0644]
src/main/java/org/ldk/structs/Result_PrivateRouteCreationErrorZ.java [new file with mode: 0644]
src/main/jni/bindings.c
src/main/jni/bindings.c.body
ts/structs/PrivateRoute.ts [new file with mode: 0644]
ts/structs/Result_PrivateRouteCreationErrorZ.ts [new file with mode: 0644]

index 6ed01c09ed31a509e1b36db2d43c0186bc430db4..5807add4e12c10a7d80bc85867dec1b89a4e2e52 100755 (executable)
Binary files a/liblightningjni_debug.so and b/liblightningjni_debug.so differ
index 068013b1b28e30cf84f3ca03341299f9755d167a..437f17eb77b71c9a8e948d45e909473d053ce4bb 100755 (executable)
Binary files a/liblightningjni_release.so and b/liblightningjni_release.so differ
index f884049552d50f75eda1071a809ca95c19f3ba54..1eb28ec3c410b2fb6dc01f006ecc49c6597a5ef4 100644 (file)
@@ -25,7 +25,7 @@ public class bindings {
        static native String get_lib_version_string();
 
        public static String get_ldk_java_bindings_version() {
-               return "v0.0.13-26-gfb06c6a";
+               return "v0.0.98";
        }
        public static native String get_ldk_c_bindings_version();
        public static native String get_ldk_version();
diff --git a/src/main/java/org/ldk/structs/PrivateRoute.java b/src/main/java/org/ldk/structs/PrivateRoute.java
new file mode 100644 (file)
index 0000000..74c1bbb
--- /dev/null
@@ -0,0 +1,66 @@
+package org.ldk.structs;
+
+import org.ldk.impl.bindings;
+import org.ldk.enums.*;
+import org.ldk.util.*;
+import java.util.Arrays;
+
+
+/**
+ * Private routing information
+ * 
+ * # Invariants
+ * The encoded route has to be <1024 5bit characters long (<=639 bytes or <=12 hops)
+ */
+@SuppressWarnings("unchecked") // We correctly assign various generic arrays
+public class PrivateRoute extends CommonBase {
+       PrivateRoute(Object _dummy, long ptr) { super(ptr); }
+       @Override @SuppressWarnings("deprecation")
+       protected void finalize() throws Throwable {
+               super.finalize();
+               if (ptr != 0) { bindings.PrivateRoute_free(ptr); }
+       }
+
+       /**
+        * Checks if two PrivateRoutes contain equal inner contents.
+        * This ignores pointers and is_owned flags and looks at the values in fields.
+        * Two objects with NULL inner values will be considered "equal" here.
+        */
+       public boolean eq(PrivateRoute b) {
+               boolean ret = bindings.PrivateRoute_eq(this.ptr, b == null ? 0 : b.ptr & ~1);
+               this.ptrs_to.add(b);
+               return ret;
+       }
+
+       /**
+        * Creates a copy of the PrivateRoute
+        */
+       public PrivateRoute clone() {
+               long ret = bindings.PrivateRoute_clone(this.ptr);
+               PrivateRoute ret_hu_conv = new PrivateRoute(null, ret);
+               ret_hu_conv.ptrs_to.add(this);
+               return ret_hu_conv;
+       }
+
+       /**
+        * Creates a new (partial) route from a list of hops
+        */
+       public static Result_PrivateRouteCreationErrorZ of(RouteHint hops) {
+               long ret = bindings.PrivateRoute_new(hops == null ? 0 : hops.ptr & ~1);
+               Result_PrivateRouteCreationErrorZ ret_hu_conv = Result_PrivateRouteCreationErrorZ.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(hops);
+               return ret_hu_conv;
+       }
+
+       /**
+        * Returns the underlying list of hops
+        */
+       public RouteHint into_inner() {
+               long ret = bindings.PrivateRoute_into_inner(this.ptr);
+               RouteHint ret_hu_conv = new RouteHint(null, ret);
+               ret_hu_conv.ptrs_to.add(this);
+               this.ptrs_to.add(this);
+               return ret_hu_conv;
+       }
+
+}
diff --git a/src/main/java/org/ldk/structs/Result_PrivateRouteCreationErrorZ.java b/src/main/java/org/ldk/structs/Result_PrivateRouteCreationErrorZ.java
new file mode 100644 (file)
index 0000000..c6d50d9
--- /dev/null
@@ -0,0 +1,69 @@
+package org.ldk.structs;
+
+import org.ldk.impl.bindings;
+import org.ldk.enums.*;
+import org.ldk.util.*;
+import java.util.Arrays;
+
+public class Result_PrivateRouteCreationErrorZ extends CommonBase {
+       private Result_PrivateRouteCreationErrorZ(Object _dummy, long ptr) { super(ptr); }
+       protected void finalize() throws Throwable {
+               if (ptr != 0) { bindings.CResult_PrivateRouteCreationErrorZ_free(ptr); } super.finalize();
+       }
+
+       static Result_PrivateRouteCreationErrorZ constr_from_ptr(long ptr) {
+               if (bindings.LDKCResult_PrivateRouteCreationErrorZ_result_ok(ptr)) {
+                       return new Result_PrivateRouteCreationErrorZ_OK(null, ptr);
+               } else {
+                       return new Result_PrivateRouteCreationErrorZ_Err(null, ptr);
+               }
+       }
+       public static final class Result_PrivateRouteCreationErrorZ_OK extends Result_PrivateRouteCreationErrorZ {
+               public final PrivateRoute res;
+               private Result_PrivateRouteCreationErrorZ_OK(Object _dummy, long ptr) {
+                       super(_dummy, ptr);
+                       long res = bindings.LDKCResult_PrivateRouteCreationErrorZ_get_ok(ptr);
+                       PrivateRoute res_hu_conv = new PrivateRoute(null, res);
+                       res_hu_conv.ptrs_to.add(this);
+                       this.res = res_hu_conv;
+               }
+       }
+
+       public static final class Result_PrivateRouteCreationErrorZ_Err extends Result_PrivateRouteCreationErrorZ {
+               public final CreationError err;
+               private Result_PrivateRouteCreationErrorZ_Err(Object _dummy, long ptr) {
+                       super(_dummy, ptr);
+                       this.err = bindings.LDKCResult_PrivateRouteCreationErrorZ_get_err(ptr);
+               }
+       }
+
+       /**
+        * Creates a new CResult_PrivateRouteCreationErrorZ in the success state.
+        */
+       public static Result_PrivateRouteCreationErrorZ ok(PrivateRoute o) {
+               long ret = bindings.CResult_PrivateRouteCreationErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+               Result_PrivateRouteCreationErrorZ ret_hu_conv = Result_PrivateRouteCreationErrorZ.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(o);
+               return ret_hu_conv;
+       }
+
+       /**
+        * Creates a new CResult_PrivateRouteCreationErrorZ in the error state.
+        */
+       public static Result_PrivateRouteCreationErrorZ err(CreationError e) {
+               long ret = bindings.CResult_PrivateRouteCreationErrorZ_err(e);
+               Result_PrivateRouteCreationErrorZ ret_hu_conv = Result_PrivateRouteCreationErrorZ.constr_from_ptr(ret);
+               return ret_hu_conv;
+       }
+
+       /**
+        * Creates a new CResult_PrivateRouteCreationErrorZ which has the same data as `orig`
+        * but with all dynamically-allocated buffers duplicated in new buffers.
+        */
+       public Result_PrivateRouteCreationErrorZ clone() {
+               long ret = bindings.CResult_PrivateRouteCreationErrorZ_clone(this.ptr);
+               Result_PrivateRouteCreationErrorZ ret_hu_conv = Result_PrivateRouteCreationErrorZ.constr_from_ptr(ret);
+               return ret_hu_conv;
+       }
+
+}
index f6825d0f8b68fc487969372e65acb50b408e5969..3dc78c9ded6baefeb8198b8961c684c7b3037c7e 100644 (file)
@@ -130,7 +130,7 @@ static inline LDKStr java_to_owned_str(JNIEnv *env, jstring str) {
 }
 
 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_get_1lib_1version_1string(JNIEnv *env, jclass _c) {
-       return str_ref_to_java(env, "v0.0.13-26-gfb06c6a", strlen("v0.0.13-26-gfb06c6a"));
+       return str_ref_to_java(env, "v0.0.98", strlen("v0.0.98"));
 }
 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_get_1ldk_1c_1bindings_1version(JNIEnv *env, jclass _c) {
        return str_ref_to_java(env, check_get_ldk_bindings_version(), strlen(check_get_ldk_bindings_version()));
index 9811c87ae1f942759480b92e015a1408a4ec28c3..768139eeb59e457f20b0994d4ad103953af9dc23 100644 (file)
@@ -128,7 +128,7 @@ static inline LDKStr java_to_owned_str(JNIEnv *env, jstring str) {
 }
 
 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_get_1lib_1version_1string(JNIEnv *env, jclass _c) {
-       return str_ref_to_java(env, "v0.0.13-26-gfb06c6a", strlen("v0.0.13-26-gfb06c6a"));
+       return str_ref_to_java(env, "v0.0.98", strlen("v0.0.98"));
 }
 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_get_1ldk_1c_1bindings_1version(JNIEnv *env, jclass _c) {
        return str_ref_to_java(env, check_get_ldk_bindings_version(), strlen(check_get_ldk_bindings_version()));
diff --git a/ts/structs/PrivateRoute.ts b/ts/structs/PrivateRoute.ts
new file mode 100644 (file)
index 0000000..cead3cd
--- /dev/null
@@ -0,0 +1,48 @@
+
+            
+import CommonBase from './CommonBase';
+import * as bindings from '../bindings' // TODO: figure out location
+
+
+
+            export default class PrivateRoute extends CommonBase {
+                constructor(_dummy: object, ptr: number) {
+                    super(ptr);
+                }
+
+                
+                protected finalize() {
+                    super.finalize();
+
+                    if (this.ptr != 0) {
+                        bindings.PrivateRoute_free(this.ptr);
+                    }
+                }
+       public boolean eq(PrivateRoute b) {
+               boolean ret = bindings.PrivateRoute_eq(this.ptr, b == null ? 0 : b.ptr & ~1);
+               this.ptrs_to.add(b);
+               return ret;
+       }
+
+       public PrivateRoute clone() {
+               number ret = bindings.PrivateRoute_clone(this.ptr);
+               const ret_hu_conv: PrivateRoute = new PrivateRoute(null, ret);
+               ret_hu_conv.ptrs_to.add(this);
+               return ret_hu_conv;
+       }
+
+       public static Result_PrivateRouteCreationErrorZ constructor_new(RouteHint hops) {
+               number ret = bindings.PrivateRoute_new(hops == null ? 0 : hops.ptr & ~1);
+               Result_PrivateRouteCreationErrorZ ret_hu_conv = Result_PrivateRouteCreationErrorZ.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(hops);
+               return ret_hu_conv;
+       }
+
+       public RouteHint into_inner() {
+               number ret = bindings.PrivateRoute_into_inner(this.ptr);
+               const ret_hu_conv: RouteHint = new RouteHint(null, ret);
+               ret_hu_conv.ptrs_to.add(this);
+               return ret_hu_conv;
+       }
+
+}
diff --git a/ts/structs/Result_PrivateRouteCreationErrorZ.ts b/ts/structs/Result_PrivateRouteCreationErrorZ.ts
new file mode 100644 (file)
index 0000000..1ec6b28
--- /dev/null
@@ -0,0 +1,56 @@
+
+import CommonBase from './CommonBase';
+import * as bindings from '../bindings' // TODO: figure out location
+
+public class Result_PrivateRouteCreationErrorZ extends CommonBase {
+       private Result_PrivateRouteCreationErrorZ(Object _dummy, long ptr) { super(ptr); }
+       protected void finalize() throws Throwable {
+               if (ptr != 0) { bindings.CResult_PrivateRouteCreationErrorZ_free(ptr); } super.finalize();
+       }
+
+       static Result_PrivateRouteCreationErrorZ constr_from_ptr(long ptr) {
+               if (bindings.LDKCResult_PrivateRouteCreationErrorZ_result_ok(ptr)) {
+                       return new Result_PrivateRouteCreationErrorZ_OK(null, ptr);
+               } else {
+                       return new Result_PrivateRouteCreationErrorZ_Err(null, ptr);
+               }
+       }
+       public static final class Result_PrivateRouteCreationErrorZ_OK extends Result_PrivateRouteCreationErrorZ {
+               public final PrivateRoute res;
+               private Result_PrivateRouteCreationErrorZ_OK(Object _dummy, long ptr) {
+                       super(_dummy, ptr);
+                       number res = bindings.LDKCResult_PrivateRouteCreationErrorZ_get_ok(ptr);
+                       const res_hu_conv: PrivateRoute = new PrivateRoute(null, res);
+                       res_hu_conv.ptrs_to.add(this);
+                       this.res = res_hu_conv;
+               }
+       }
+
+       public static final class Result_PrivateRouteCreationErrorZ_Err extends Result_PrivateRouteCreationErrorZ {
+               public final CreationError err;
+               private Result_PrivateRouteCreationErrorZ_Err(Object _dummy, long ptr) {
+                       super(_dummy, ptr);
+                       this.err = bindings.LDKCResult_PrivateRouteCreationErrorZ_get_err(ptr);
+               }
+       }
+
+       public static Result_PrivateRouteCreationErrorZ constructor__ok(PrivateRoute o) {
+               number ret = bindings.CResult_PrivateRouteCreationErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+               Result_PrivateRouteCreationErrorZ ret_hu_conv = Result_PrivateRouteCreationErrorZ.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(o);
+               return ret_hu_conv;
+       }
+
+       public static Result_PrivateRouteCreationErrorZ constructor__err(CreationError e) {
+               number ret = bindings.CResult_PrivateRouteCreationErrorZ_err(e);
+               Result_PrivateRouteCreationErrorZ ret_hu_conv = Result_PrivateRouteCreationErrorZ.constr_from_ptr(ret);
+               return ret_hu_conv;
+       }
+
+       public Result_PrivateRouteCreationErrorZ _clone() {
+               number ret = bindings.CResult_PrivateRouteCreationErrorZ_clone(this.ptr);
+               Result_PrivateRouteCreationErrorZ ret_hu_conv = Result_PrivateRouteCreationErrorZ.constr_from_ptr(ret);
+               return ret_hu_conv;
+       }
+
+}