public static native boolean LDKCResult_ChannelFeaturesDecodeErrorZ_result_ok(long arg);
public static native long LDKCResult_ChannelFeaturesDecodeErrorZ_get_ok(long arg);
public static native long LDKCResult_ChannelFeaturesDecodeErrorZ_get_err(long arg);
+ public static native boolean LDKCResult_InvoiceFeaturesDecodeErrorZ_result_ok(long arg);
+ public static native long LDKCResult_InvoiceFeaturesDecodeErrorZ_get_ok(long arg);
+ public static native long LDKCResult_InvoiceFeaturesDecodeErrorZ_get_err(long arg);
public static native boolean LDKCResult_ChannelConfigDecodeErrorZ_result_ok(long arg);
public static native long LDKCResult_ChannelConfigDecodeErrorZ_get_ok(long arg);
public static native long LDKCResult_ChannelConfigDecodeErrorZ_get_err(long arg);
public static native long CResult_ChannelFeaturesDecodeErrorZ_err(long e);
// void CResult_ChannelFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelFeaturesDecodeErrorZ _res);
public static native void CResult_ChannelFeaturesDecodeErrorZ_free(long _res);
+ // struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_ok(struct LDKInvoiceFeatures o);
+ public static native long CResult_InvoiceFeaturesDecodeErrorZ_ok(long o);
+ // struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
+ public static native long CResult_InvoiceFeaturesDecodeErrorZ_err(long e);
+ // void CResult_InvoiceFeaturesDecodeErrorZ_free(struct LDKCResult_InvoiceFeaturesDecodeErrorZ _res);
+ public static native void CResult_InvoiceFeaturesDecodeErrorZ_free(long _res);
// struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_ok(struct LDKChannelConfig o);
public static native long CResult_ChannelConfigDecodeErrorZ_ok(long o);
// struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_err(struct LDKDecodeError e);
public static native void PeerManager_socket_disconnected(long this_arg, long descriptor);
// void PeerManager_disconnect_by_node_id(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKPublicKey node_id, bool no_connection_possible);
public static native void PeerManager_disconnect_by_node_id(long this_arg, byte[] node_id, boolean no_connection_possible);
- // void PeerManager_timer_tick_occured(const struct LDKPeerManager *NONNULL_PTR this_arg);
- public static native void PeerManager_timer_tick_occured(long this_arg);
+ // void PeerManager_timer_tick_occurred(const struct LDKPeerManager *NONNULL_PTR this_arg);
+ public static native void PeerManager_timer_tick_occurred(long this_arg);
// struct LDKThirtyTwoBytes build_commitment_secret(const uint8_t (*commitment_seed)[32], uint64_t idx);
public static native byte[] build_commitment_secret(byte[] commitment_seed, long idx);
// struct LDKCResult_SecretKeyErrorZ derive_private_key(struct LDKPublicKey per_commitment_point, const uint8_t (*base_secret)[32]);
public static native long NodeFeatures_clone(long orig);
// struct LDKChannelFeatures ChannelFeatures_clone(const struct LDKChannelFeatures *NONNULL_PTR orig);
public static native long ChannelFeatures_clone(long orig);
+ // struct LDKInvoiceFeatures InvoiceFeatures_clone(const struct LDKInvoiceFeatures *NONNULL_PTR orig);
+ public static native long InvoiceFeatures_clone(long orig);
// void InitFeatures_free(struct LDKInitFeatures this_obj);
public static native void InitFeatures_free(long this_obj);
// void NodeFeatures_free(struct LDKNodeFeatures this_obj);
public static native void NodeFeatures_free(long this_obj);
// void ChannelFeatures_free(struct LDKChannelFeatures this_obj);
public static native void ChannelFeatures_free(long this_obj);
+ // void InvoiceFeatures_free(struct LDKInvoiceFeatures this_obj);
+ public static native void InvoiceFeatures_free(long this_obj);
// MUST_USE_RES struct LDKInitFeatures InitFeatures_empty(void);
public static native long InitFeatures_empty();
// MUST_USE_RES struct LDKInitFeatures InitFeatures_known(void);
public static native long ChannelFeatures_empty();
// MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_known(void);
public static native long ChannelFeatures_known();
+ // MUST_USE_RES struct LDKInvoiceFeatures InvoiceFeatures_empty(void);
+ public static native long InvoiceFeatures_empty();
+ // MUST_USE_RES struct LDKInvoiceFeatures InvoiceFeatures_known(void);
+ public static native long InvoiceFeatures_known();
// struct LDKCVec_u8Z InitFeatures_write(const struct LDKInitFeatures *NONNULL_PTR obj);
public static native byte[] InitFeatures_write(long obj);
// struct LDKCVec_u8Z NodeFeatures_write(const struct LDKNodeFeatures *NONNULL_PTR obj);
public static native byte[] NodeFeatures_write(long obj);
// struct LDKCVec_u8Z ChannelFeatures_write(const struct LDKChannelFeatures *NONNULL_PTR obj);
public static native byte[] ChannelFeatures_write(long obj);
+ // struct LDKCVec_u8Z InvoiceFeatures_write(const struct LDKInvoiceFeatures *NONNULL_PTR obj);
+ public static native byte[] InvoiceFeatures_write(long obj);
// struct LDKCResult_InitFeaturesDecodeErrorZ InitFeatures_read(struct LDKu8slice ser);
public static native long InitFeatures_read(byte[] ser);
// struct LDKCResult_NodeFeaturesDecodeErrorZ NodeFeatures_read(struct LDKu8slice ser);
public static native long NodeFeatures_read(byte[] ser);
// struct LDKCResult_ChannelFeaturesDecodeErrorZ ChannelFeatures_read(struct LDKu8slice ser);
public static native long ChannelFeatures_read(byte[] ser);
+ // struct LDKCResult_InvoiceFeaturesDecodeErrorZ InvoiceFeatures_read(struct LDKu8slice ser);
+ public static native long InvoiceFeatures_read(byte[] ser);
// void RouteHop_free(struct LDKRouteHop this_obj);
public static native void RouteHop_free(long this_obj);
// struct LDKPublicKey RouteHop_get_pubkey(const struct LDKRouteHop *NONNULL_PTR this_ptr);
public static native void RouteHint_set_cltv_expiry_delta(long this_ptr, short val);
// struct LDKRouteHint RouteHint_clone(const struct LDKRouteHint *NONNULL_PTR orig);
public static native long RouteHint_clone(long orig);
- // struct LDKCResult_RouteLightningErrorZ get_route(struct LDKPublicKey our_node_id, const struct LDKNetworkGraph *NONNULL_PTR network, struct LDKPublicKey payee, struct LDKCVec_ChannelDetailsZ *first_hops, struct LDKCVec_RouteHintZ last_hops, uint64_t final_value_msat, uint32_t final_cltv, struct LDKLogger logger);
- public static native long get_route(byte[] our_node_id, long network, byte[] payee, long[] first_hops, long[] last_hops, long final_value_msat, int final_cltv, long logger);
+ // struct LDKCResult_RouteLightningErrorZ get_route(struct LDKPublicKey our_node_id, const struct LDKNetworkGraph *NONNULL_PTR network, struct LDKPublicKey payee, struct LDKInvoiceFeatures payee_features, struct LDKCVec_ChannelDetailsZ *first_hops, struct LDKCVec_RouteHintZ last_hops, uint64_t final_value_msat, uint32_t final_cltv, struct LDKLogger logger);
+ public static native long get_route(byte[] our_node_id, long network, byte[] payee, long payee_features, long[] first_hops, long[] last_hops, long final_value_msat, int final_cltv, long logger);
// void NetworkGraph_free(struct LDKNetworkGraph this_obj);
public static native void NetworkGraph_free(long this_obj);
// struct LDKNetworkGraph NetworkGraph_clone(const struct LDKNetworkGraph *NONNULL_PTR orig);
}
/**
- * Creates a "default" ChannelConfig. See other documentaiton for details on what this implies.
+ * Creates a "default" ChannelConfig. See struct and individual field documentaiton for details on which values are used.
*/
public static ChannelConfig constructor_default() {
long ret = bindings.ChannelConfig_default();
}
/**
- * Creates a "default" ChannelHandshakeConfig. See other documentaiton for details on what this implies.
+ * Creates a "default" ChannelHandshakeConfig. See struct and individual field documentaiton for details on which values are used.
*/
public static ChannelHandshakeConfig constructor_default() {
long ret = bindings.ChannelHandshakeConfig_default();
* Not checking this value would be a security issue, as our peer would be able to set it to
* max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
*
- * Default value: MAX_LOCAL_BREAKDOWN_TIMEOUT (1008), which we also enforce as a maximum value
- * so you can tweak config to reduce the loss of having useless locked funds (if your peer accepts)
+ * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
+ * reduce the loss of having useless locked funds (if your peer accepts)
*/
public short get_their_to_self_delay() {
short ret = bindings.ChannelHandshakeLimits_get_their_to_self_delay(this.ptr);
* Not checking this value would be a security issue, as our peer would be able to set it to
* max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
*
- * Default value: MAX_LOCAL_BREAKDOWN_TIMEOUT (1008), which we also enforce as a maximum value
- * so you can tweak config to reduce the loss of having useless locked funds (if your peer accepts)
+ * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
+ * reduce the loss of having useless locked funds (if your peer accepts)
*/
public void set_their_to_self_delay(short val) {
bindings.ChannelHandshakeLimits_set_their_to_self_delay(this.ptr, val);
}
/**
- * Creates a "default" ChannelHandshakeLimits. See other documentaiton for details on what this implies.
+ * Creates a "default" ChannelHandshakeLimits. See struct and individual field documentaiton for details on which values are used.
*/
public static ChannelHandshakeLimits constructor_default() {
long ret = bindings.ChannelHandshakeLimits_default();
* It will send pings to each peer and disconnect those which did not respond to the last round of pings.
* Will most likely call send_data on all of the registered descriptors, thus, be very careful with reentrancy issues!
*/
- public void timer_tick_occured() {
- bindings.PeerManager_timer_tick_occured(this.ptr);
+ public void timer_tick_occurred() {
+ bindings.PeerManager_timer_tick_occurred(this.ptr);
}
}
}
/**
- * Creates a "default" UserConfig. See other documentaiton for details on what this implies.
+ * Creates a "default" UserConfig. See struct and individual field documentaiton for details on which values are used.
*/
public static UserConfig constructor_default() {
long ret = bindings.UserConfig_default();
FREE(err_buf);
return err_conv;
}
-static jclass arr_of_J_clz = NULL;
static jclass arr_of_B_clz = NULL;
+static jclass arr_of_J_clz = NULL;
JNIEXPORT void Java_org_ldk_impl_bindings_init_1class_1cache(JNIEnv * env, jclass clz) {
- arr_of_J_clz = (*env)->FindClass(env, "[J");
- CHECK(arr_of_J_clz != NULL);
- arr_of_J_clz = (*env)->NewGlobalRef(env, arr_of_J_clz);
arr_of_B_clz = (*env)->FindClass(env, "[B");
CHECK(arr_of_B_clz != NULL);
arr_of_B_clz = (*env)->NewGlobalRef(env, arr_of_B_clz);
+ arr_of_J_clz = (*env)->FindClass(env, "[J");
+ CHECK(arr_of_J_clz != NULL);
+ arr_of_J_clz = (*env)->NewGlobalRef(env, arr_of_J_clz);
}
static inline struct LDKThirtyTwoBytes ThirtyTwoBytes_clone(const struct LDKThirtyTwoBytes *orig) { struct LDKThirtyTwoBytes ret; memcpy(ret.data, orig->data, 32); return ret; }
static inline LDKAccessError LDKAccessError_from_java(JNIEnv *env, jclass clz) {
long err_ref = (long)err_var.inner & ~1;
return err_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceFeaturesDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
+ return ((LDKCResult_InvoiceFeaturesDecodeErrorZ*)arg)->result_ok;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCResult_InvoiceFeaturesDecodeErrorZ *val = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)(arg & ~1);
+ CHECK(val->result_ok);
+ LDKInvoiceFeatures res_var = (*val->contents.result);
+ CHECK((((long)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((long)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ long res_ref = (long)res_var.inner & ~1;
+ return res_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceFeaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCResult_InvoiceFeaturesDecodeErrorZ *val = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)(arg & ~1);
+ CHECK(!val->result_ok);
+ LDKDecodeError err_var = (*val->contents.err);
+ CHECK((((long)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((long)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ long err_ref = (long)err_var.inner & ~1;
+ return err_ref;
+}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelConfigDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
return ((LDKCResult_ChannelConfigDecodeErrorZ*)arg)->result_ok;
}
CResult_ChannelFeaturesDecodeErrorZ_free(_res_conv);
}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
+ LDKInvoiceFeatures o_conv;
+ o_conv.inner = (void*)(o & (~1));
+ o_conv.is_owned = (o & 1) || (o == 0);
+ o_conv = InvoiceFeatures_clone(&o_conv);
+ LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
+ *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_ok(o_conv);
+ return (long)ret_conv;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
+ LDKDecodeError e_conv;
+ e_conv.inner = (void*)(e & (~1));
+ e_conv.is_owned = (e & 1) || (e == 0);
+ e_conv = DecodeError_clone(&e_conv);
+ LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
+ *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_err(e_conv);
+ return (long)ret_conv;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
+ if ((_res & 1) != 0) return;
+ LDKCResult_InvoiceFeaturesDecodeErrorZ _res_conv = *(LDKCResult_InvoiceFeaturesDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ FREE((void*)_res);
+ CResult_InvoiceFeaturesDecodeErrorZ_free(_res_conv);
+}
+
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
LDKChannelConfig o_conv;
o_conv.inner = (void*)(o & (~1));
PeerManager_disconnect_by_node_id(&this_arg_conv, node_id_ref, no_connection_possible);
}
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1timer_1tick_1occured(JNIEnv *env, jclass clz, int64_t this_arg) {
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1timer_1tick_1occurred(JNIEnv *env, jclass clz, int64_t this_arg) {
LDKPeerManager this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- PeerManager_timer_tick_occured(&this_arg_conv);
+ PeerManager_timer_tick_occurred(&this_arg_conv);
}
JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_build_1commitment_1secret(JNIEnv *env, jclass clz, int8_tArray commitment_seed, int64_t idx) {
return ret_ref;
}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+ LDKInvoiceFeatures orig_conv;
+ orig_conv.inner = (void*)(orig & (~1));
+ orig_conv.is_owned = false;
+ LDKInvoiceFeatures ret_var = InvoiceFeatures_clone(&orig_conv);
+ CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ long ret_ref = (long)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKInitFeatures this_obj_conv;
this_obj_conv.inner = (void*)(this_obj & (~1));
ChannelFeatures_free(this_obj_conv);
}
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
+ LDKInvoiceFeatures this_obj_conv;
+ this_obj_conv.inner = (void*)(this_obj & (~1));
+ this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+ InvoiceFeatures_free(this_obj_conv);
+}
+
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1empty(JNIEnv *env, jclass clz) {
LDKInitFeatures ret_var = InitFeatures_empty();
CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
return ret_ref;
}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1empty(JNIEnv *env, jclass clz) {
+ LDKInvoiceFeatures ret_var = InvoiceFeatures_empty();
+ CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ long ret_ref = (long)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1known(JNIEnv *env, jclass clz) {
+ LDKInvoiceFeatures ret_var = InvoiceFeatures_known();
+ CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ long ret_ref = (long)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
+}
+
JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InitFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) {
LDKInitFeatures obj_conv;
obj_conv.inner = (void*)(obj & (~1));
return ret_arr;
}
+JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) {
+ LDKInvoiceFeatures obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z ret_var = InvoiceFeatures_write(&obj_conv);
+ int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
+}
+
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = (*env)->GetArrayLength(env, ser);
return (long)ret_conv;
}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.datalen = (*env)->GetArrayLength(env, ser);
+ ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
+ LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
+ *ret_conv = InvoiceFeatures_read(ser_ref);
+ (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
+ return (long)ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKRouteHop this_obj_conv;
this_obj_conv.inner = (void*)(this_obj & (~1));
return ret_ref;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_get_1route(JNIEnv *env, jclass clz, int8_tArray our_node_id, int64_t network, int8_tArray payee, int64_tArray first_hops, int64_tArray last_hops, int64_t final_value_msat, int32_t final_cltv, int64_t logger) {
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_get_1route(JNIEnv *env, jclass clz, int8_tArray our_node_id, int64_t network, int8_tArray payee, int64_t payee_features, int64_tArray first_hops, int64_tArray last_hops, int64_t final_value_msat, int32_t final_cltv, int64_t logger) {
LDKPublicKey our_node_id_ref;
CHECK((*env)->GetArrayLength(env, our_node_id) == 33);
(*env)->GetByteArrayRegion(env, our_node_id, 0, 33, our_node_id_ref.compressed_form);
LDKPublicKey payee_ref;
CHECK((*env)->GetArrayLength(env, payee) == 33);
(*env)->GetByteArrayRegion(env, payee, 0, 33, payee_ref.compressed_form);
+ LDKInvoiceFeatures payee_features_conv;
+ payee_features_conv.inner = (void*)(payee_features & (~1));
+ payee_features_conv.is_owned = (payee_features & 1) || (payee_features == 0);
+ payee_features_conv = InvoiceFeatures_clone(&payee_features_conv);
LDKCVec_ChannelDetailsZ first_hops_constr;
first_hops_constr.datalen = (*env)->GetArrayLength(env, first_hops);
if (first_hops_constr.datalen > 0)
LDKLogger_JCalls_clone(logger_conv.this_arg);
}
LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
- *ret_conv = get_route(our_node_id_ref, &network_conv, payee_ref, &first_hops_constr, last_hops_constr, final_value_msat, final_cltv, logger_conv);
+ *ret_conv = get_route(our_node_id_ref, &network_conv, payee_ref, payee_features_conv, &first_hops_constr, last_hops_constr, final_value_msat, final_cltv, logger_conv);
FREE(first_hops_constr.data);
return (long)ret_conv;
}
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelFeaturesDecodeErrorZ_1get_1err
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: LDKCResult_InvoiceFeaturesDecodeErrorZ_result_ok
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceFeaturesDecodeErrorZ_1result_1ok
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: LDKCResult_InvoiceFeaturesDecodeErrorZ_get_ok
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceFeaturesDecodeErrorZ_1get_1ok
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: LDKCResult_InvoiceFeaturesDecodeErrorZ_get_err
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceFeaturesDecodeErrorZ_1get_1err
+ (JNIEnv *, jclass, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: LDKCResult_ChannelConfigDecodeErrorZ_result_ok
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1free
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CResult_InvoiceFeaturesDecodeErrorZ_ok
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1ok
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CResult_InvoiceFeaturesDecodeErrorZ_err
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1err
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CResult_InvoiceFeaturesDecodeErrorZ_free
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1free
+ (JNIEnv *, jclass, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: CResult_ChannelConfigDecodeErrorZ_ok
/*
* Class: org_ldk_impl_bindings
- * Method: PeerManager_timer_tick_occured
+ * Method: PeerManager_timer_tick_occurred
* Signature: (J)V
*/
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1timer_1tick_1occured
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1timer_1tick_1occurred
(JNIEnv *, jclass, jlong);
/*
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1clone
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: InvoiceFeatures_clone
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1clone
+ (JNIEnv *, jclass, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: InitFeatures_free
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1free
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: InvoiceFeatures_free
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1free
+ (JNIEnv *, jclass, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: InitFeatures_empty
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1known
(JNIEnv *, jclass);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: InvoiceFeatures_empty
+ * Signature: ()J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1empty
+ (JNIEnv *, jclass);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: InvoiceFeatures_known
+ * Signature: ()J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1known
+ (JNIEnv *, jclass);
+
/*
* Class: org_ldk_impl_bindings
* Method: InitFeatures_write
JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1write
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: InvoiceFeatures_write
+ * Signature: (J)[B
+ */
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1write
+ (JNIEnv *, jclass, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: InitFeatures_read
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1read
(JNIEnv *, jclass, jbyteArray);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: InvoiceFeatures_read
+ * Signature: ([B)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1read
+ (JNIEnv *, jclass, jbyteArray);
+
/*
* Class: org_ldk_impl_bindings
* Method: RouteHop_free
/*
* Class: org_ldk_impl_bindings
* Method: get_route
- * Signature: ([BJ[B[J[JJIJ)J
+ * Signature: ([BJ[BJ[J[JJIJ)J
*/
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_get_1route
- (JNIEnv *, jclass, jbyteArray, jlong, jbyteArray, jlongArray, jlongArray, jlong, jint, jlong);
+ (JNIEnv *, jclass, jbyteArray, jlong, jbyteArray, jlong, jlongArray, jlongArray, jlong, jint, jlong);
/*
* Class: org_ldk_impl_bindings
long err_ref = (long)err_var.inner & ~1;
return err_ref;
}
+jboolean __attribute__((visibility("default"))) TS_LDKCResult_InvoiceFeaturesDecodeErrorZ_result_ok(uint32_t arg) {
+ return ((LDKCResult_InvoiceFeaturesDecodeErrorZ*)arg)->result_ok;
+}
+uint32_t __attribute__((visibility("default"))) TS_LDKCResult_InvoiceFeaturesDecodeErrorZ_get_ok(uint32_t arg) {
+ LDKCResult_InvoiceFeaturesDecodeErrorZ *val = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)(arg & ~1);
+ CHECK(val->result_ok);
+ LDKInvoiceFeatures res_var = (*val->contents.result);
+ CHECK((((long)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((long)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ long res_ref = (long)res_var.inner & ~1;
+ return res_ref;
+}
+uint32_t __attribute__((visibility("default"))) TS_LDKCResult_InvoiceFeaturesDecodeErrorZ_get_err(uint32_t arg) {
+ LDKCResult_InvoiceFeaturesDecodeErrorZ *val = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)(arg & ~1);
+ CHECK(!val->result_ok);
+ LDKDecodeError err_var = (*val->contents.err);
+ CHECK((((long)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((long)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ long err_ref = (long)err_var.inner & ~1;
+ return err_ref;
+}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_ChannelConfigDecodeErrorZ_result_ok(uint32_t arg) {
return ((LDKCResult_ChannelConfigDecodeErrorZ*)arg)->result_ok;
}
CResult_ChannelFeaturesDecodeErrorZ_free(_res_conv);
}
+uint32_t __attribute__((visibility("default"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_ok(uint32_t o) {
+ LDKInvoiceFeatures o_conv;
+ o_conv.inner = (void*)(o & (~1));
+ o_conv.is_owned = (o & 1) || (o == 0);
+ o_conv = InvoiceFeatures_clone(&o_conv);
+ LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
+ *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_ok(o_conv);
+ return (long)ret_conv;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_err(uint32_t e) {
+ LDKDecodeError e_conv;
+ e_conv.inner = (void*)(e & (~1));
+ e_conv.is_owned = (e & 1) || (e == 0);
+ e_conv = DecodeError_clone(&e_conv);
+ LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
+ *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_err(e_conv);
+ return (long)ret_conv;
+}
+
+void __attribute__((visibility("default"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_free(uint32_t _res) {
+ if ((_res & 1) != 0) return;
+ LDKCResult_InvoiceFeaturesDecodeErrorZ _res_conv = *(LDKCResult_InvoiceFeaturesDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ FREE((void*)_res);
+ CResult_InvoiceFeaturesDecodeErrorZ_free(_res_conv);
+}
+
uint32_t __attribute__((visibility("default"))) TS_CResult_ChannelConfigDecodeErrorZ_ok(uint32_t o) {
LDKChannelConfig o_conv;
o_conv.inner = (void*)(o & (~1));
PeerManager_disconnect_by_node_id(&this_arg_conv, node_id_ref, no_connection_possible);
}
-void __attribute__((visibility("default"))) TS_PeerManager_timer_tick_occured(uint32_t this_arg) {
+void __attribute__((visibility("default"))) TS_PeerManager_timer_tick_occurred(uint32_t this_arg) {
LDKPeerManager this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- PeerManager_timer_tick_occured(&this_arg_conv);
+ PeerManager_timer_tick_occurred(&this_arg_conv);
}
int8_tArray __attribute__((visibility("default"))) TS_build_commitment_secret(int8_tArray commitment_seed, int64_t idx) {
return ret_ref;
}
+uint32_t __attribute__((visibility("default"))) TS_InvoiceFeatures_clone(uint32_t orig) {
+ LDKInvoiceFeatures orig_conv;
+ orig_conv.inner = (void*)(orig & (~1));
+ orig_conv.is_owned = false;
+ LDKInvoiceFeatures ret_var = InvoiceFeatures_clone(&orig_conv);
+ CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ long ret_ref = (long)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
+}
+
void __attribute__((visibility("default"))) TS_InitFeatures_free(uint32_t this_obj) {
LDKInitFeatures this_obj_conv;
this_obj_conv.inner = (void*)(this_obj & (~1));
ChannelFeatures_free(this_obj_conv);
}
+void __attribute__((visibility("default"))) TS_InvoiceFeatures_free(uint32_t this_obj) {
+ LDKInvoiceFeatures this_obj_conv;
+ this_obj_conv.inner = (void*)(this_obj & (~1));
+ this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+ InvoiceFeatures_free(this_obj_conv);
+}
+
uint32_t __attribute__((visibility("default"))) TS_InitFeatures_empty() {
LDKInitFeatures ret_var = InitFeatures_empty();
CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
return ret_ref;
}
+uint32_t __attribute__((visibility("default"))) TS_InvoiceFeatures_empty() {
+ LDKInvoiceFeatures ret_var = InvoiceFeatures_empty();
+ CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ long ret_ref = (long)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_InvoiceFeatures_known() {
+ LDKInvoiceFeatures ret_var = InvoiceFeatures_known();
+ CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ long ret_ref = (long)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
+}
+
int8_tArray __attribute__((visibility("default"))) TS_InitFeatures_write(uint32_t obj) {
LDKInitFeatures obj_conv;
obj_conv.inner = (void*)(obj & (~1));
return ret_arr;
}
+int8_tArray __attribute__((visibility("default"))) TS_InvoiceFeatures_write(uint32_t obj) {
+ LDKInvoiceFeatures obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z ret_var = InvoiceFeatures_write(&obj_conv);
+ int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
+}
+
uint32_t __attribute__((visibility("default"))) TS_InitFeatures_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = *((uint32_t*)ser);
return (long)ret_conv;
}
+uint32_t __attribute__((visibility("default"))) TS_InvoiceFeatures_read(int8_tArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.datalen = *((uint32_t*)ser);
+ ser_ref.data = (int8_t*)(ser + 4);
+ LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
+ *ret_conv = InvoiceFeatures_read(ser_ref);
+ return (long)ret_conv;
+}
+
void __attribute__((visibility("default"))) TS_RouteHop_free(uint32_t this_obj) {
LDKRouteHop this_obj_conv;
this_obj_conv.inner = (void*)(this_obj & (~1));
return ret_ref;
}
-uint32_t __attribute__((visibility("default"))) TS_get_route(int8_tArray our_node_id, uint32_t network, int8_tArray payee, uint32_tArray first_hops, uint32_tArray last_hops, int64_t final_value_msat, int32_t final_cltv, uint32_t logger) {
+uint32_t __attribute__((visibility("default"))) TS_get_route(int8_tArray our_node_id, uint32_t network, int8_tArray payee, uint32_t payee_features, uint32_tArray first_hops, uint32_tArray last_hops, int64_t final_value_msat, int32_t final_cltv, uint32_t logger) {
LDKPublicKey our_node_id_ref;
CHECK(*((uint32_t*)our_node_id) == 33);
memcpy(our_node_id_ref.compressed_form, (uint8_t*)(our_node_id + 4), 33);
LDKPublicKey payee_ref;
CHECK(*((uint32_t*)payee) == 33);
memcpy(payee_ref.compressed_form, (uint8_t*)(payee + 4), 33);
+ LDKInvoiceFeatures payee_features_conv;
+ payee_features_conv.inner = (void*)(payee_features & (~1));
+ payee_features_conv.is_owned = (payee_features & 1) || (payee_features == 0);
+ payee_features_conv = InvoiceFeatures_clone(&payee_features_conv);
LDKCVec_ChannelDetailsZ first_hops_constr;
first_hops_constr.datalen = *((uint32_t*)first_hops);
if (first_hops_constr.datalen > 0)
}
LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
- *ret_conv = get_route(our_node_id_ref, &network_conv, payee_ref, &first_hops_constr, last_hops_constr, final_value_msat, final_cltv, logger_conv);
+ *ret_conv = get_route(our_node_id_ref, &network_conv, payee_ref, payee_features_conv, &first_hops_constr, last_hops_constr, final_value_msat, final_cltv, logger_conv);
FREE(first_hops_constr.data);
return (long)ret_conv;
}
public static native boolean LDKCResult_ChannelFeaturesDecodeErrorZ_result_ok(long arg);
public static native number LDKCResult_ChannelFeaturesDecodeErrorZ_get_ok(long arg);
public static native number LDKCResult_ChannelFeaturesDecodeErrorZ_get_err(long arg);
+ public static native boolean LDKCResult_InvoiceFeaturesDecodeErrorZ_result_ok(long arg);
+ public static native number LDKCResult_InvoiceFeaturesDecodeErrorZ_get_ok(long arg);
+ public static native number LDKCResult_InvoiceFeaturesDecodeErrorZ_get_err(long arg);
public static native boolean LDKCResult_ChannelConfigDecodeErrorZ_result_ok(long arg);
public static native number LDKCResult_ChannelConfigDecodeErrorZ_get_ok(long arg);
public static native number LDKCResult_ChannelConfigDecodeErrorZ_get_err(long arg);
const nativeResponseValue = wasm.CResult_ChannelFeaturesDecodeErrorZ_free(_res);
// debug statements here
}
+ // struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_ok(struct LDKInvoiceFeatures o);
+ export function CResult_InvoiceFeaturesDecodeErrorZ_ok(o: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.CResult_InvoiceFeaturesDecodeErrorZ_ok(o);
+ return nativeResponseValue;
+ }
+ // struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
+ export function CResult_InvoiceFeaturesDecodeErrorZ_err(e: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.CResult_InvoiceFeaturesDecodeErrorZ_err(e);
+ return nativeResponseValue;
+ }
+ // void CResult_InvoiceFeaturesDecodeErrorZ_free(struct LDKCResult_InvoiceFeaturesDecodeErrorZ _res);
+ export function CResult_InvoiceFeaturesDecodeErrorZ_free(_res: number): void {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.CResult_InvoiceFeaturesDecodeErrorZ_free(_res);
+ // debug statements here
+ }
// struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_ok(struct LDKChannelConfig o);
export function CResult_ChannelConfigDecodeErrorZ_ok(o: number): number {
if(!isWasmInitialized) {
const nativeResponseValue = wasm.PeerManager_disconnect_by_node_id(this_arg, encodeArray(node_id), no_connection_possible);
// debug statements here
}
- // void PeerManager_timer_tick_occured(const struct LDKPeerManager *NONNULL_PTR this_arg);
- export function PeerManager_timer_tick_occured(this_arg: number): void {
+ // void PeerManager_timer_tick_occurred(const struct LDKPeerManager *NONNULL_PTR this_arg);
+ export function PeerManager_timer_tick_occurred(this_arg: number): void {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.PeerManager_timer_tick_occured(this_arg);
+ const nativeResponseValue = wasm.PeerManager_timer_tick_occurred(this_arg);
// debug statements here
}
// struct LDKThirtyTwoBytes build_commitment_secret(const uint8_t (*commitment_seed)[32], uint64_t idx);
const nativeResponseValue = wasm.ChannelFeatures_clone(orig);
return nativeResponseValue;
}
+ // struct LDKInvoiceFeatures InvoiceFeatures_clone(const struct LDKInvoiceFeatures *NONNULL_PTR orig);
+ export function InvoiceFeatures_clone(orig: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.InvoiceFeatures_clone(orig);
+ return nativeResponseValue;
+ }
// void InitFeatures_free(struct LDKInitFeatures this_obj);
export function InitFeatures_free(this_obj: number): void {
if(!isWasmInitialized) {
const nativeResponseValue = wasm.ChannelFeatures_free(this_obj);
// debug statements here
}
+ // void InvoiceFeatures_free(struct LDKInvoiceFeatures this_obj);
+ export function InvoiceFeatures_free(this_obj: number): void {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.InvoiceFeatures_free(this_obj);
+ // debug statements here
+ }
// MUST_USE_RES struct LDKInitFeatures InitFeatures_empty(void);
export function InitFeatures_empty(): number {
if(!isWasmInitialized) {
const nativeResponseValue = wasm.ChannelFeatures_known();
return nativeResponseValue;
}
+ // MUST_USE_RES struct LDKInvoiceFeatures InvoiceFeatures_empty(void);
+ export function InvoiceFeatures_empty(): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.InvoiceFeatures_empty();
+ return nativeResponseValue;
+ }
+ // MUST_USE_RES struct LDKInvoiceFeatures InvoiceFeatures_known(void);
+ export function InvoiceFeatures_known(): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.InvoiceFeatures_known();
+ return nativeResponseValue;
+ }
// struct LDKCVec_u8Z InitFeatures_write(const struct LDKInitFeatures *NONNULL_PTR obj);
export function InitFeatures_write(obj: number): Uint8Array {
if(!isWasmInitialized) {
const nativeResponseValue = wasm.ChannelFeatures_write(obj);
return decodeArray(nativeResponseValue);
}
+ // struct LDKCVec_u8Z InvoiceFeatures_write(const struct LDKInvoiceFeatures *NONNULL_PTR obj);
+ export function InvoiceFeatures_write(obj: number): Uint8Array {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.InvoiceFeatures_write(obj);
+ return decodeArray(nativeResponseValue);
+ }
// struct LDKCResult_InitFeaturesDecodeErrorZ InitFeatures_read(struct LDKu8slice ser);
export function InitFeatures_read(ser: Uint8Array): number {
if(!isWasmInitialized) {
const nativeResponseValue = wasm.ChannelFeatures_read(encodeArray(ser));
return nativeResponseValue;
}
+ // struct LDKCResult_InvoiceFeaturesDecodeErrorZ InvoiceFeatures_read(struct LDKu8slice ser);
+ export function InvoiceFeatures_read(ser: Uint8Array): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.InvoiceFeatures_read(encodeArray(ser));
+ return nativeResponseValue;
+ }
// void RouteHop_free(struct LDKRouteHop this_obj);
export function RouteHop_free(this_obj: number): void {
if(!isWasmInitialized) {
const nativeResponseValue = wasm.RouteHint_clone(orig);
return nativeResponseValue;
}
- // struct LDKCResult_RouteLightningErrorZ get_route(struct LDKPublicKey our_node_id, const struct LDKNetworkGraph *NONNULL_PTR network, struct LDKPublicKey payee, struct LDKCVec_ChannelDetailsZ *first_hops, struct LDKCVec_RouteHintZ last_hops, uint64_t final_value_msat, uint32_t final_cltv, struct LDKLogger logger);
- export function get_route(our_node_id: Uint8Array, network: number, payee: Uint8Array, first_hops: number[], last_hops: number[], final_value_msat: number, final_cltv: number, logger: number): number {
+ // struct LDKCResult_RouteLightningErrorZ get_route(struct LDKPublicKey our_node_id, const struct LDKNetworkGraph *NONNULL_PTR network, struct LDKPublicKey payee, struct LDKInvoiceFeatures payee_features, struct LDKCVec_ChannelDetailsZ *first_hops, struct LDKCVec_RouteHintZ last_hops, uint64_t final_value_msat, uint32_t final_cltv, struct LDKLogger logger);
+ export function get_route(our_node_id: Uint8Array, network: number, payee: Uint8Array, payee_features: number, first_hops: number[], last_hops: number[], final_value_msat: number, final_cltv: number, logger: number): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.get_route(encodeArray(our_node_id), network, encodeArray(payee), first_hops, last_hops, final_value_msat, final_cltv, logger);
+ const nativeResponseValue = wasm.get_route(encodeArray(our_node_id), network, encodeArray(payee), payee_features, first_hops, last_hops, final_value_msat, final_cltv, logger);
return nativeResponseValue;
}
// void NetworkGraph_free(struct LDKNetworkGraph this_obj);
bindings.PeerManager_disconnect_by_node_id(this.ptr, node_id, no_connection_possible);
}
- public void timer_tick_occured() {
- bindings.PeerManager_timer_tick_occured(this.ptr);
+ public void timer_tick_occurred() {
+ bindings.PeerManager_timer_tick_occurred(this.ptr);
}
}