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();
--- /dev/null
+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;
+ }
+
+}
--- /dev/null
+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;
+ }
+
+}
}
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()));
}
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()));
--- /dev/null
+
+
+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;
+ }
+
+}
--- /dev/null
+
+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;
+ }
+
+}