DECL_ARR_TYPE(int64_t, int64_t);
DECL_ARR_TYPE(uint64_t, uint64_t);
DECL_ARR_TYPE(int8_t, int8_t);
+DECL_ARR_TYPE(int16_t, int16_t);
DECL_ARR_TYPE(uint32_t, uint32_t);
DECL_ARR_TYPE(void*, ptr);
DECL_ARR_TYPE(char, char);
}
}
-static inline LDKAccessError LDKAccessError_from_js(int32_t ord) {
- switch (ord) {
- case 0: return LDKAccessError_UnknownChain;
- case 1: return LDKAccessError_UnknownTx;
- }
- abort();
-}
-static inline int32_t LDKAccessError_to_js(LDKAccessError val) {
- switch (val) {
- case LDKAccessError_UnknownChain: return 0;
- case LDKAccessError_UnknownTx: return 1;
- default: abort();
- }
-}
static inline LDKCOption_NoneZ LDKCOption_NoneZ_from_js(int32_t ord) {
switch (ord) {
case 0: return LDKCOption_NoneZ_Some;
default: abort();
}
}
-static inline LDKChannelMonitorUpdateErr LDKChannelMonitorUpdateErr_from_js(int32_t ord) {
+static inline LDKChannelMonitorUpdateStatus LDKChannelMonitorUpdateStatus_from_js(int32_t ord) {
switch (ord) {
- case 0: return LDKChannelMonitorUpdateErr_TemporaryFailure;
- case 1: return LDKChannelMonitorUpdateErr_PermanentFailure;
+ case 0: return LDKChannelMonitorUpdateStatus_Completed;
+ case 1: return LDKChannelMonitorUpdateStatus_InProgress;
+ case 2: return LDKChannelMonitorUpdateStatus_PermanentFailure;
}
abort();
}
-static inline int32_t LDKChannelMonitorUpdateErr_to_js(LDKChannelMonitorUpdateErr val) {
+static inline int32_t LDKChannelMonitorUpdateStatus_to_js(LDKChannelMonitorUpdateStatus val) {
switch (val) {
- case LDKChannelMonitorUpdateErr_TemporaryFailure: return 0;
- case LDKChannelMonitorUpdateErr_PermanentFailure: return 1;
+ case LDKChannelMonitorUpdateStatus_Completed: return 0;
+ case LDKChannelMonitorUpdateStatus_InProgress: return 1;
+ case LDKChannelMonitorUpdateStatus_PermanentFailure: return 2;
default: abort();
}
}
case 2: return LDKCreationError_TimestampOutOfBounds;
case 3: return LDKCreationError_InvalidAmount;
case 4: return LDKCreationError_MissingRouteHints;
+ case 5: return LDKCreationError_MinFinalCltvExpiryDeltaTooShort;
}
abort();
}
case LDKCreationError_TimestampOutOfBounds: return 2;
case LDKCreationError_InvalidAmount: return 3;
case LDKCreationError_MissingRouteHints: return 4;
+ case LDKCreationError_MinFinalCltvExpiryDeltaTooShort: return 5;
default: abort();
}
}
default: abort();
}
}
+static inline LDKFailureCode LDKFailureCode_from_js(int32_t ord) {
+ switch (ord) {
+ case 0: return LDKFailureCode_TemporaryNodeFailure;
+ case 1: return LDKFailureCode_RequiredNodeFeatureMissing;
+ case 2: return LDKFailureCode_IncorrectOrUnknownPaymentDetails;
+ }
+ abort();
+}
+static inline int32_t LDKFailureCode_to_js(LDKFailureCode val) {
+ switch (val) {
+ case LDKFailureCode_TemporaryNodeFailure: return 0;
+ case LDKFailureCode_RequiredNodeFeatureMissing: return 1;
+ case LDKFailureCode_IncorrectOrUnknownPaymentDetails: return 2;
+ default: abort();
+ }
+}
+static inline LDKHTLCClaim LDKHTLCClaim_from_js(int32_t ord) {
+ switch (ord) {
+ case 0: return LDKHTLCClaim_OfferedTimeout;
+ case 1: return LDKHTLCClaim_OfferedPreimage;
+ case 2: return LDKHTLCClaim_AcceptedTimeout;
+ case 3: return LDKHTLCClaim_AcceptedPreimage;
+ case 4: return LDKHTLCClaim_Revocation;
+ }
+ abort();
+}
+static inline int32_t LDKHTLCClaim_to_js(LDKHTLCClaim val) {
+ switch (val) {
+ case LDKHTLCClaim_OfferedTimeout: return 0;
+ case LDKHTLCClaim_OfferedPreimage: return 1;
+ case LDKHTLCClaim_AcceptedTimeout: return 2;
+ case LDKHTLCClaim_AcceptedPreimage: return 3;
+ case LDKHTLCClaim_Revocation: return 4;
+ default: abort();
+ }
+}
static inline LDKIOError LDKIOError_from_js(int32_t ord) {
switch (ord) {
case 0: return LDKIOError_NotFound;
default: abort();
}
}
+static inline LDKRetryableSendFailure LDKRetryableSendFailure_from_js(int32_t ord) {
+ switch (ord) {
+ case 0: return LDKRetryableSendFailure_PaymentExpired;
+ case 1: return LDKRetryableSendFailure_RouteNotFound;
+ case 2: return LDKRetryableSendFailure_DuplicatePayment;
+ }
+ abort();
+}
+static inline int32_t LDKRetryableSendFailure_to_js(LDKRetryableSendFailure val) {
+ switch (val) {
+ case LDKRetryableSendFailure_PaymentExpired: return 0;
+ case LDKRetryableSendFailure_RouteNotFound: return 1;
+ case LDKRetryableSendFailure_DuplicatePayment: return 2;
+ default: abort();
+ }
+}
static inline LDKSecp256k1Error LDKSecp256k1Error_from_js(int32_t ord) {
switch (ord) {
case 0: return LDKSecp256k1Error_IncorrectSignature;
default: abort();
}
}
+static inline LDKUtxoLookupError LDKUtxoLookupError_from_js(int32_t ord) {
+ switch (ord) {
+ case 0: return LDKUtxoLookupError_UnknownChain;
+ case 1: return LDKUtxoLookupError_UnknownTx;
+ }
+ abort();
+}
+static inline int32_t LDKUtxoLookupError_to_js(LDKUtxoLookupError val) {
+ switch (val) {
+ case LDKUtxoLookupError_UnknownChain: return 0;
+ case LDKUtxoLookupError_UnknownTx: return 1;
+ default: abort();
+ }
+}
+struct LDKThirtyTwoBytes BigEndianScalar_get_bytes (struct LDKBigEndianScalar* thing) {
+ LDKThirtyTwoBytes ret = { .data = *thing->big_endian_bytes };
+ return ret;
+}
+int8_tArray __attribute__((export_name("TS_BigEndianScalar_get_bytes"))) TS_BigEndianScalar_get_bytes(uint64_t thing) {
+ LDKBigEndianScalar* thing_conv = (LDKBigEndianScalar*)untag_ptr(thing);
+ int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
+ memcpy(ret_arr->elems, BigEndianScalar_get_bytes(thing_conv).data, 32);
+ return ret_arr;
+}
+
+static void BigEndianScalar_free (struct LDKBigEndianScalar thing) {}
+void __attribute__((export_name("TS_BigEndianScalar_free"))) TS_BigEndianScalar_free(uint64_t thing) {
+ if (!ptr_is_owned(thing)) return;
+ void* thing_ptr = untag_ptr(thing);
+ CHECK_ACCESS(thing_ptr);
+ LDKBigEndianScalar thing_conv = *(LDKBigEndianScalar*)(thing_ptr);
+ FREE(untag_ptr(thing));
+ BigEndianScalar_free(thing_conv);
+}
+
uint32_t __attribute__((export_name("TS_LDKBech32Error_ty_from_ptr"))) TS_LDKBech32Error_ty_from_ptr(uint64_t ptr) {
LDKBech32Error *obj = (LDKBech32Error*)untag_ptr(ptr);
switch(obj->tag) {
return ret_conv;
}
+uint32_t __attribute__((export_name("TS_LDKAPIError_ty_from_ptr"))) TS_LDKAPIError_ty_from_ptr(uint64_t ptr) {
+ LDKAPIError *obj = (LDKAPIError*)untag_ptr(ptr);
+ switch(obj->tag) {
+ case LDKAPIError_APIMisuseError: return 0;
+ case LDKAPIError_FeeRateTooHigh: return 1;
+ case LDKAPIError_InvalidRoute: return 2;
+ case LDKAPIError_ChannelUnavailable: return 3;
+ case LDKAPIError_MonitorUpdateInProgress: return 4;
+ case LDKAPIError_IncompatibleShutdownScript: return 5;
+ default: abort();
+ }
+}
+jstring __attribute__((export_name("TS_LDKAPIError_APIMisuseError_get_err"))) TS_LDKAPIError_APIMisuseError_get_err(uint64_t ptr) {
+ LDKAPIError *obj = (LDKAPIError*)untag_ptr(ptr);
+ assert(obj->tag == LDKAPIError_APIMisuseError);
+ LDKStr err_str = obj->api_misuse_error.err;
+ jstring err_conv = str_ref_to_ts(err_str.chars, err_str.len);
+ return err_conv;
+}
+jstring __attribute__((export_name("TS_LDKAPIError_FeeRateTooHigh_get_err"))) TS_LDKAPIError_FeeRateTooHigh_get_err(uint64_t ptr) {
+ LDKAPIError *obj = (LDKAPIError*)untag_ptr(ptr);
+ assert(obj->tag == LDKAPIError_FeeRateTooHigh);
+ LDKStr err_str = obj->fee_rate_too_high.err;
+ jstring err_conv = str_ref_to_ts(err_str.chars, err_str.len);
+ return err_conv;
+}
+int32_t __attribute__((export_name("TS_LDKAPIError_FeeRateTooHigh_get_feerate"))) TS_LDKAPIError_FeeRateTooHigh_get_feerate(uint64_t ptr) {
+ LDKAPIError *obj = (LDKAPIError*)untag_ptr(ptr);
+ assert(obj->tag == LDKAPIError_FeeRateTooHigh);
+ int32_t feerate_conv = obj->fee_rate_too_high.feerate;
+ return feerate_conv;
+}
+jstring __attribute__((export_name("TS_LDKAPIError_InvalidRoute_get_err"))) TS_LDKAPIError_InvalidRoute_get_err(uint64_t ptr) {
+ LDKAPIError *obj = (LDKAPIError*)untag_ptr(ptr);
+ assert(obj->tag == LDKAPIError_InvalidRoute);
+ LDKStr err_str = obj->invalid_route.err;
+ jstring err_conv = str_ref_to_ts(err_str.chars, err_str.len);
+ return err_conv;
+}
+jstring __attribute__((export_name("TS_LDKAPIError_ChannelUnavailable_get_err"))) TS_LDKAPIError_ChannelUnavailable_get_err(uint64_t ptr) {
+ LDKAPIError *obj = (LDKAPIError*)untag_ptr(ptr);
+ assert(obj->tag == LDKAPIError_ChannelUnavailable);
+ LDKStr err_str = obj->channel_unavailable.err;
+ jstring err_conv = str_ref_to_ts(err_str.chars, err_str.len);
+ return err_conv;
+}
+uint64_t __attribute__((export_name("TS_LDKAPIError_IncompatibleShutdownScript_get_script"))) TS_LDKAPIError_IncompatibleShutdownScript_get_script(uint64_t ptr) {
+ LDKAPIError *obj = (LDKAPIError*)untag_ptr(ptr);
+ assert(obj->tag == LDKAPIError_IncompatibleShutdownScript);
+ LDKShutdownScript script_var = obj->incompatible_shutdown_script.script;
+ uint64_t script_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(script_var);
+ script_ref = tag_ptr(script_var.inner, false);
+ return script_ref;
+}
+static inline void CResult_NoneAPIErrorZ_get_ok(LDKCResult_NoneAPIErrorZ *NONNULL_PTR owner){
+CHECK(owner->result_ok);
+ return *owner->contents.result;
+}
+void __attribute__((export_name("TS_CResult_NoneAPIErrorZ_get_ok"))) TS_CResult_NoneAPIErrorZ_get_ok(uint64_t owner) {
+ LDKCResult_NoneAPIErrorZ* owner_conv = (LDKCResult_NoneAPIErrorZ*)untag_ptr(owner);
+ CResult_NoneAPIErrorZ_get_ok(owner_conv);
+}
+
+static inline struct LDKAPIError CResult_NoneAPIErrorZ_get_err(LDKCResult_NoneAPIErrorZ *NONNULL_PTR owner){
+CHECK(!owner->result_ok);
+ return APIError_clone(&*owner->contents.err);
+}
+uint64_t __attribute__((export_name("TS_CResult_NoneAPIErrorZ_get_err"))) TS_CResult_NoneAPIErrorZ_get_err(uint64_t owner) {
+ LDKCResult_NoneAPIErrorZ* owner_conv = (LDKCResult_NoneAPIErrorZ*)untag_ptr(owner);
+ LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
+ *ret_copy = CResult_NoneAPIErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+static inline LDKCVec_CResult_NoneAPIErrorZZ CVec_CResult_NoneAPIErrorZZ_clone(const LDKCVec_CResult_NoneAPIErrorZZ *orig) {
+ LDKCVec_CResult_NoneAPIErrorZZ ret = { .data = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ) * orig->datalen, "LDKCVec_CResult_NoneAPIErrorZZ clone bytes"), .datalen = orig->datalen };
+ for (size_t i = 0; i < ret.datalen; i++) {
+ ret.data[i] = CResult_NoneAPIErrorZ_clone(&orig->data[i]);
+ }
+ return ret;
+}
+static inline LDKCVec_APIErrorZ CVec_APIErrorZ_clone(const LDKCVec_APIErrorZ *orig) {
+ LDKCVec_APIErrorZ ret = { .data = MALLOC(sizeof(LDKAPIError) * orig->datalen, "LDKCVec_APIErrorZ clone bytes"), .datalen = orig->datalen };
+ for (size_t i = 0; i < ret.datalen; i++) {
+ ret.data[i] = APIError_clone(&orig->data[i]);
+ }
+ return ret;
+}
+uint32_t __attribute__((export_name("TS_LDKCOption_HTLCClaimZ_ty_from_ptr"))) TS_LDKCOption_HTLCClaimZ_ty_from_ptr(uint64_t ptr) {
+ LDKCOption_HTLCClaimZ *obj = (LDKCOption_HTLCClaimZ*)untag_ptr(ptr);
+ switch(obj->tag) {
+ case LDKCOption_HTLCClaimZ_Some: return 0;
+ case LDKCOption_HTLCClaimZ_None: return 1;
+ default: abort();
+ }
+}
+uint32_t __attribute__((export_name("TS_LDKCOption_HTLCClaimZ_Some_get_some"))) TS_LDKCOption_HTLCClaimZ_Some_get_some(uint64_t ptr) {
+ LDKCOption_HTLCClaimZ *obj = (LDKCOption_HTLCClaimZ*)untag_ptr(ptr);
+ assert(obj->tag == LDKCOption_HTLCClaimZ_Some);
+ uint32_t some_conv = LDKHTLCClaim_to_js(obj->some);
+ return some_conv;
+}
static inline void CResult_NoneNoneZ_get_ok(LDKCResult_NoneNoneZ *NONNULL_PTR owner){
CHECK(owner->result_ok);
return *owner->contents.result;
CResult_NoneNoneZ_get_err(owner_conv);
}
+uint32_t __attribute__((export_name("TS_LDKDecodeError_ty_from_ptr"))) TS_LDKDecodeError_ty_from_ptr(uint64_t ptr) {
+ LDKDecodeError *obj = (LDKDecodeError*)untag_ptr(ptr);
+ switch(obj->tag) {
+ case LDKDecodeError_UnknownVersion: return 0;
+ case LDKDecodeError_UnknownRequiredFeature: return 1;
+ case LDKDecodeError_InvalidValue: return 2;
+ case LDKDecodeError_ShortRead: return 3;
+ case LDKDecodeError_BadLengthDescriptor: return 4;
+ case LDKDecodeError_Io: return 5;
+ case LDKDecodeError_UnsupportedCompression: return 6;
+ default: abort();
+ }
+}
+uint32_t __attribute__((export_name("TS_LDKDecodeError_Io_get_io"))) TS_LDKDecodeError_Io_get_io(uint64_t ptr) {
+ LDKDecodeError *obj = (LDKDecodeError*)untag_ptr(ptr);
+ assert(obj->tag == LDKDecodeError_Io);
+ uint32_t io_conv = LDKIOError_to_js(obj->io);
+ return io_conv;
+}
static inline struct LDKCounterpartyCommitmentSecrets CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_ok(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR owner){
LDKCounterpartyCommitmentSecrets ret = *owner->contents.result;
ret.is_owned = false;
}
static inline struct LDKDecodeError CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_err(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
uint64_t __attribute__((export_name("TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_err"))) TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_err(uint64_t owner) {
LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* owner_conv = (LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
-static inline struct LDKSecretKey CResult_SecretKeyErrorZ_get_ok(LDKCResult_SecretKeyErrorZ *NONNULL_PTR owner){
-CHECK(owner->result_ok);
- return *owner->contents.result;
-}
-int8_tArray __attribute__((export_name("TS_CResult_SecretKeyErrorZ_get_ok"))) TS_CResult_SecretKeyErrorZ_get_ok(uint64_t owner) {
- LDKCResult_SecretKeyErrorZ* owner_conv = (LDKCResult_SecretKeyErrorZ*)untag_ptr(owner);
- int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
- memcpy(ret_arr->elems, CResult_SecretKeyErrorZ_get_ok(owner_conv).bytes, 32);
- return ret_arr;
-}
-
-static inline enum LDKSecp256k1Error CResult_SecretKeyErrorZ_get_err(LDKCResult_SecretKeyErrorZ *NONNULL_PTR owner){
-CHECK(!owner->result_ok);
- return *owner->contents.err;
-}
-uint32_t __attribute__((export_name("TS_CResult_SecretKeyErrorZ_get_err"))) TS_CResult_SecretKeyErrorZ_get_err(uint64_t owner) {
- LDKCResult_SecretKeyErrorZ* owner_conv = (LDKCResult_SecretKeyErrorZ*)untag_ptr(owner);
- uint32_t ret_conv = LDKSecp256k1Error_to_js(CResult_SecretKeyErrorZ_get_err(owner_conv));
- return ret_conv;
-}
-
-static inline struct LDKPublicKey CResult_PublicKeyErrorZ_get_ok(LDKCResult_PublicKeyErrorZ *NONNULL_PTR owner){
-CHECK(owner->result_ok);
- return *owner->contents.result;
-}
-int8_tArray __attribute__((export_name("TS_CResult_PublicKeyErrorZ_get_ok"))) TS_CResult_PublicKeyErrorZ_get_ok(uint64_t owner) {
- LDKCResult_PublicKeyErrorZ* owner_conv = (LDKCResult_PublicKeyErrorZ*)untag_ptr(owner);
- int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
- memcpy(ret_arr->elems, CResult_PublicKeyErrorZ_get_ok(owner_conv).compressed_form, 33);
- return ret_arr;
-}
-
-static inline enum LDKSecp256k1Error CResult_PublicKeyErrorZ_get_err(LDKCResult_PublicKeyErrorZ *NONNULL_PTR owner){
-CHECK(!owner->result_ok);
- return *owner->contents.err;
-}
-uint32_t __attribute__((export_name("TS_CResult_PublicKeyErrorZ_get_err"))) TS_CResult_PublicKeyErrorZ_get_err(uint64_t owner) {
- LDKCResult_PublicKeyErrorZ* owner_conv = (LDKCResult_PublicKeyErrorZ*)untag_ptr(owner);
- uint32_t ret_conv = LDKSecp256k1Error_to_js(CResult_PublicKeyErrorZ_get_err(owner_conv));
- return ret_conv;
-}
-
static inline struct LDKTxCreationKeys CResult_TxCreationKeysDecodeErrorZ_get_ok(LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR owner){
LDKTxCreationKeys ret = *owner->contents.result;
ret.is_owned = false;
}
static inline struct LDKDecodeError CResult_TxCreationKeysDecodeErrorZ_get_err(LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
uint64_t __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_get_err"))) TS_CResult_TxCreationKeysDecodeErrorZ_get_err(uint64_t owner) {
LDKCResult_TxCreationKeysDecodeErrorZ* owner_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_TxCreationKeysDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_TxCreationKeysDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_ChannelPublicKeysDecodeErrorZ_get_err(LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
uint64_t __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_get_err"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_get_err(uint64_t owner) {
LDKCResult_ChannelPublicKeysDecodeErrorZ* owner_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_ChannelPublicKeysDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
- return ret_ref;
-}
-
-static inline struct LDKTxCreationKeys CResult_TxCreationKeysErrorZ_get_ok(LDKCResult_TxCreationKeysErrorZ *NONNULL_PTR owner){
- LDKTxCreationKeys ret = *owner->contents.result;
- ret.is_owned = false;
- return ret;
-}
-uint64_t __attribute__((export_name("TS_CResult_TxCreationKeysErrorZ_get_ok"))) TS_CResult_TxCreationKeysErrorZ_get_ok(uint64_t owner) {
- LDKCResult_TxCreationKeysErrorZ* owner_conv = (LDKCResult_TxCreationKeysErrorZ*)untag_ptr(owner);
- LDKTxCreationKeys ret_var = CResult_TxCreationKeysErrorZ_get_ok(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_ChannelPublicKeysDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
-static inline enum LDKSecp256k1Error CResult_TxCreationKeysErrorZ_get_err(LDKCResult_TxCreationKeysErrorZ *NONNULL_PTR owner){
-CHECK(!owner->result_ok);
- return *owner->contents.err;
-}
-uint32_t __attribute__((export_name("TS_CResult_TxCreationKeysErrorZ_get_err"))) TS_CResult_TxCreationKeysErrorZ_get_err(uint64_t owner) {
- LDKCResult_TxCreationKeysErrorZ* owner_conv = (LDKCResult_TxCreationKeysErrorZ*)untag_ptr(owner);
- uint32_t ret_conv = LDKSecp256k1Error_to_js(CResult_TxCreationKeysErrorZ_get_err(owner_conv));
- return ret_conv;
-}
-
uint32_t __attribute__((export_name("TS_LDKCOption_u32Z_ty_from_ptr"))) TS_LDKCOption_u32Z_ty_from_ptr(uint64_t ptr) {
LDKCOption_u32Z *obj = (LDKCOption_u32Z*)untag_ptr(ptr);
switch(obj->tag) {
}
static inline struct LDKDecodeError CResult_HTLCOutputInCommitmentDecodeErrorZ_get_err(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
uint64_t __attribute__((export_name("TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_get_err"))) TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_get_err(uint64_t owner) {
LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* owner_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_HTLCOutputInCommitmentDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_HTLCOutputInCommitmentDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_err(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
uint64_t __attribute__((export_name("TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_err"))) TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_err(uint64_t owner) {
LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* owner_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_ChannelTransactionParametersDecodeErrorZ_get_err(LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
uint64_t __attribute__((export_name("TS_CResult_ChannelTransactionParametersDecodeErrorZ_get_err"))) TS_CResult_ChannelTransactionParametersDecodeErrorZ_get_err(uint64_t owner) {
LDKCResult_ChannelTransactionParametersDecodeErrorZ* owner_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_ChannelTransactionParametersDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_ChannelTransactionParametersDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_HolderCommitmentTransactionDecodeErrorZ_get_err(LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
uint64_t __attribute__((export_name("TS_CResult_HolderCommitmentTransactionDecodeErrorZ_get_err"))) TS_CResult_HolderCommitmentTransactionDecodeErrorZ_get_err(uint64_t owner) {
LDKCResult_HolderCommitmentTransactionDecodeErrorZ* owner_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_HolderCommitmentTransactionDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_HolderCommitmentTransactionDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_BuiltCommitmentTransactionDecodeErrorZ_get_err(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
uint64_t __attribute__((export_name("TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_get_err"))) TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_get_err(uint64_t owner) {
LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* owner_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_BuiltCommitmentTransactionDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_BuiltCommitmentTransactionDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_CommitmentTransactionDecodeErrorZ_get_err(LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
uint64_t __attribute__((export_name("TS_CResult_CommitmentTransactionDecodeErrorZ_get_err"))) TS_CResult_CommitmentTransactionDecodeErrorZ_get_err(uint64_t owner) {
LDKCResult_CommitmentTransactionDecodeErrorZ* owner_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_CommitmentTransactionDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_CommitmentTransactionDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_ShutdownScriptDecodeErrorZ_get_err(LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
uint64_t __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_get_err"))) TS_CResult_ShutdownScriptDecodeErrorZ_get_err(uint64_t owner) {
LDKCResult_ShutdownScriptDecodeErrorZ* owner_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_ShutdownScriptDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_ShutdownScriptDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
return ret_ref;
}
-static inline struct LDKRouteHop CResult_RouteHopDecodeErrorZ_get_ok(LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR owner){
- LDKRouteHop ret = *owner->contents.result;
+static inline struct LDKBlindedPath CResult_BlindedPathNoneZ_get_ok(LDKCResult_BlindedPathNoneZ *NONNULL_PTR owner){
+ LDKBlindedPath ret = *owner->contents.result;
ret.is_owned = false;
return ret;
}
-uint64_t __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_get_ok"))) TS_CResult_RouteHopDecodeErrorZ_get_ok(uint64_t owner) {
- LDKCResult_RouteHopDecodeErrorZ* owner_conv = (LDKCResult_RouteHopDecodeErrorZ*)untag_ptr(owner);
- LDKRouteHop ret_var = CResult_RouteHopDecodeErrorZ_get_ok(owner_conv);
+uint64_t __attribute__((export_name("TS_CResult_BlindedPathNoneZ_get_ok"))) TS_CResult_BlindedPathNoneZ_get_ok(uint64_t owner) {
+ LDKCResult_BlindedPathNoneZ* owner_conv = (LDKCResult_BlindedPathNoneZ*)untag_ptr(owner);
+ LDKBlindedPath ret_var = CResult_BlindedPathNoneZ_get_ok(owner_conv);
uint64_t ret_ref = 0;
CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
return ret_ref;
}
-static inline struct LDKDecodeError CResult_RouteHopDecodeErrorZ_get_err(LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
+static inline void CResult_BlindedPathNoneZ_get_err(LDKCResult_BlindedPathNoneZ *NONNULL_PTR owner){
+CHECK(!owner->result_ok);
+ return *owner->contents.err;
+}
+void __attribute__((export_name("TS_CResult_BlindedPathNoneZ_get_err"))) TS_CResult_BlindedPathNoneZ_get_err(uint64_t owner) {
+ LDKCResult_BlindedPathNoneZ* owner_conv = (LDKCResult_BlindedPathNoneZ*)untag_ptr(owner);
+ CResult_BlindedPathNoneZ_get_err(owner_conv);
+}
+
+static inline struct LDKBlindedPath CResult_BlindedPathDecodeErrorZ_get_ok(LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR owner){
+ LDKBlindedPath ret = *owner->contents.result;
ret.is_owned = false;
return ret;
}
-uint64_t __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_get_err"))) TS_CResult_RouteHopDecodeErrorZ_get_err(uint64_t owner) {
- LDKCResult_RouteHopDecodeErrorZ* owner_conv = (LDKCResult_RouteHopDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_RouteHopDecodeErrorZ_get_err(owner_conv);
+uint64_t __attribute__((export_name("TS_CResult_BlindedPathDecodeErrorZ_get_ok"))) TS_CResult_BlindedPathDecodeErrorZ_get_ok(uint64_t owner) {
+ LDKCResult_BlindedPathDecodeErrorZ* owner_conv = (LDKCResult_BlindedPathDecodeErrorZ*)untag_ptr(owner);
+ LDKBlindedPath ret_var = CResult_BlindedPathDecodeErrorZ_get_ok(owner_conv);
+ uint64_t ret_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ return ret_ref;
+}
+
+static inline struct LDKDecodeError CResult_BlindedPathDecodeErrorZ_get_err(LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR owner){
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
+}
+uint64_t __attribute__((export_name("TS_CResult_BlindedPathDecodeErrorZ_get_err"))) TS_CResult_BlindedPathDecodeErrorZ_get_err(uint64_t owner) {
+ LDKCResult_BlindedPathDecodeErrorZ* owner_conv = (LDKCResult_BlindedPathDecodeErrorZ*)untag_ptr(owner);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_BlindedPathDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+static inline struct LDKBlindedHop CResult_BlindedHopDecodeErrorZ_get_ok(LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR owner){
+ LDKBlindedHop ret = *owner->contents.result;
+ ret.is_owned = false;
+ return ret;
+}
+uint64_t __attribute__((export_name("TS_CResult_BlindedHopDecodeErrorZ_get_ok"))) TS_CResult_BlindedHopDecodeErrorZ_get_ok(uint64_t owner) {
+ LDKCResult_BlindedHopDecodeErrorZ* owner_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(owner);
+ LDKBlindedHop ret_var = CResult_BlindedHopDecodeErrorZ_get_ok(owner_conv);
+ uint64_t ret_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ return ret_ref;
+}
+
+static inline struct LDKDecodeError CResult_BlindedHopDecodeErrorZ_get_err(LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR owner){
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
+}
+uint64_t __attribute__((export_name("TS_CResult_BlindedHopDecodeErrorZ_get_err"))) TS_CResult_BlindedHopDecodeErrorZ_get_err(uint64_t owner) {
+ LDKCResult_BlindedHopDecodeErrorZ* owner_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(owner);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_BlindedHopDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+static inline LDKCVec_ChannelDetailsZ CVec_ChannelDetailsZ_clone(const LDKCVec_ChannelDetailsZ *orig) {
+ LDKCVec_ChannelDetailsZ ret = { .data = MALLOC(sizeof(LDKChannelDetails) * orig->datalen, "LDKCVec_ChannelDetailsZ clone bytes"), .datalen = orig->datalen };
+ for (size_t i = 0; i < ret.datalen; i++) {
+ ret.data[i] = ChannelDetails_clone(&orig->data[i]);
+ }
+ return ret;
+}
+static inline struct LDKRoute CResult_RouteLightningErrorZ_get_ok(LDKCResult_RouteLightningErrorZ *NONNULL_PTR owner){
+ LDKRoute ret = *owner->contents.result;
+ ret.is_owned = false;
+ return ret;
+}
+uint64_t __attribute__((export_name("TS_CResult_RouteLightningErrorZ_get_ok"))) TS_CResult_RouteLightningErrorZ_get_ok(uint64_t owner) {
+ LDKCResult_RouteLightningErrorZ* owner_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(owner);
+ LDKRoute ret_var = CResult_RouteLightningErrorZ_get_ok(owner_conv);
+ uint64_t ret_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ return ret_ref;
+}
+
+static inline struct LDKLightningError CResult_RouteLightningErrorZ_get_err(LDKCResult_RouteLightningErrorZ *NONNULL_PTR owner){
+ LDKLightningError ret = *owner->contents.err;
+ ret.is_owned = false;
+ return ret;
+}
+uint64_t __attribute__((export_name("TS_CResult_RouteLightningErrorZ_get_err"))) TS_CResult_RouteLightningErrorZ_get_err(uint64_t owner) {
+ LDKCResult_RouteLightningErrorZ* owner_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(owner);
+ LDKLightningError ret_var = CResult_RouteLightningErrorZ_get_err(owner_conv);
uint64_t ret_ref = 0;
CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
}
return ret;
}
+uint32_t __attribute__((export_name("TS_LDKCOption_u64Z_ty_from_ptr"))) TS_LDKCOption_u64Z_ty_from_ptr(uint64_t ptr) {
+ LDKCOption_u64Z *obj = (LDKCOption_u64Z*)untag_ptr(ptr);
+ switch(obj->tag) {
+ case LDKCOption_u64Z_Some: return 0;
+ case LDKCOption_u64Z_None: return 1;
+ default: abort();
+ }
+}
+int64_t __attribute__((export_name("TS_LDKCOption_u64Z_Some_get_some"))) TS_LDKCOption_u64Z_Some_get_some(uint64_t ptr) {
+ LDKCOption_u64Z *obj = (LDKCOption_u64Z*)untag_ptr(ptr);
+ assert(obj->tag == LDKCOption_u64Z_Some);
+ int64_t some_conv = obj->some;
+ return some_conv;
+}
+static inline struct LDKInFlightHtlcs CResult_InFlightHtlcsDecodeErrorZ_get_ok(LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR owner){
+ LDKInFlightHtlcs ret = *owner->contents.result;
+ ret.is_owned = false;
+ return ret;
+}
+uint64_t __attribute__((export_name("TS_CResult_InFlightHtlcsDecodeErrorZ_get_ok"))) TS_CResult_InFlightHtlcsDecodeErrorZ_get_ok(uint64_t owner) {
+ LDKCResult_InFlightHtlcsDecodeErrorZ* owner_conv = (LDKCResult_InFlightHtlcsDecodeErrorZ*)untag_ptr(owner);
+ LDKInFlightHtlcs ret_var = CResult_InFlightHtlcsDecodeErrorZ_get_ok(owner_conv);
+ uint64_t ret_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ return ret_ref;
+}
+
+static inline struct LDKDecodeError CResult_InFlightHtlcsDecodeErrorZ_get_err(LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR owner){
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
+}
+uint64_t __attribute__((export_name("TS_CResult_InFlightHtlcsDecodeErrorZ_get_err"))) TS_CResult_InFlightHtlcsDecodeErrorZ_get_err(uint64_t owner) {
+ LDKCResult_InFlightHtlcsDecodeErrorZ* owner_conv = (LDKCResult_InFlightHtlcsDecodeErrorZ*)untag_ptr(owner);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_InFlightHtlcsDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+static inline struct LDKRouteHop CResult_RouteHopDecodeErrorZ_get_ok(LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR owner){
+ LDKRouteHop ret = *owner->contents.result;
+ ret.is_owned = false;
+ return ret;
+}
+uint64_t __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_get_ok"))) TS_CResult_RouteHopDecodeErrorZ_get_ok(uint64_t owner) {
+ LDKCResult_RouteHopDecodeErrorZ* owner_conv = (LDKCResult_RouteHopDecodeErrorZ*)untag_ptr(owner);
+ LDKRouteHop ret_var = CResult_RouteHopDecodeErrorZ_get_ok(owner_conv);
+ uint64_t ret_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ return ret_ref;
+}
+
+static inline struct LDKDecodeError CResult_RouteHopDecodeErrorZ_get_err(LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR owner){
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
+}
+uint64_t __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_get_err"))) TS_CResult_RouteHopDecodeErrorZ_get_err(uint64_t owner) {
+ LDKCResult_RouteHopDecodeErrorZ* owner_conv = (LDKCResult_RouteHopDecodeErrorZ*)untag_ptr(owner);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_RouteHopDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
static inline LDKCVec_CVec_RouteHopZZ CVec_CVec_RouteHopZZ_clone(const LDKCVec_CVec_RouteHopZZ *orig) {
LDKCVec_CVec_RouteHopZZ ret = { .data = MALLOC(sizeof(LDKCVec_RouteHopZ) * orig->datalen, "LDKCVec_CVec_RouteHopZZ clone bytes"), .datalen = orig->datalen };
for (size_t i = 0; i < ret.datalen; i++) {
}
static inline struct LDKDecodeError CResult_RouteDecodeErrorZ_get_err(LDKCResult_RouteDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
uint64_t __attribute__((export_name("TS_CResult_RouteDecodeErrorZ_get_err"))) TS_CResult_RouteDecodeErrorZ_get_err(uint64_t owner) {
LDKCResult_RouteDecodeErrorZ* owner_conv = (LDKCResult_RouteDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_RouteDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_RouteDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_RouteParametersDecodeErrorZ_get_err(LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
uint64_t __attribute__((export_name("TS_CResult_RouteParametersDecodeErrorZ_get_err"))) TS_CResult_RouteParametersDecodeErrorZ_get_err(uint64_t owner) {
LDKCResult_RouteParametersDecodeErrorZ* owner_conv = (LDKCResult_RouteParametersDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_RouteParametersDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_RouteParametersDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
return ret;
}
-uint32_t __attribute__((export_name("TS_LDKCOption_u64Z_ty_from_ptr"))) TS_LDKCOption_u64Z_ty_from_ptr(uint64_t ptr) {
- LDKCOption_u64Z *obj = (LDKCOption_u64Z*)untag_ptr(ptr);
- switch(obj->tag) {
- case LDKCOption_u64Z_Some: return 0;
- case LDKCOption_u64Z_None: return 1;
- default: abort();
- }
-}
-int64_t __attribute__((export_name("TS_LDKCOption_u64Z_Some_get_some"))) TS_LDKCOption_u64Z_Some_get_some(uint64_t ptr) {
- LDKCOption_u64Z *obj = (LDKCOption_u64Z*)untag_ptr(ptr);
- assert(obj->tag == LDKCOption_u64Z_Some);
- int64_t some_conv = obj->some;
- return some_conv;
-}
static inline LDKCVec_u64Z CVec_u64Z_clone(const LDKCVec_u64Z *orig) {
LDKCVec_u64Z ret = { .data = MALLOC(sizeof(int64_t) * orig->datalen, "LDKCVec_u64Z clone bytes"), .datalen = orig->datalen };
memcpy(ret.data, orig->data, sizeof(int64_t) * ret.datalen);
}
static inline struct LDKDecodeError CResult_PaymentParametersDecodeErrorZ_get_err(LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
uint64_t __attribute__((export_name("TS_CResult_PaymentParametersDecodeErrorZ_get_err"))) TS_CResult_PaymentParametersDecodeErrorZ_get_err(uint64_t owner) {
LDKCResult_PaymentParametersDecodeErrorZ* owner_conv = (LDKCResult_PaymentParametersDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_PaymentParametersDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_PaymentParametersDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_RouteHintDecodeErrorZ_get_err(LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
uint64_t __attribute__((export_name("TS_CResult_RouteHintDecodeErrorZ_get_err"))) TS_CResult_RouteHintDecodeErrorZ_get_err(uint64_t owner) {
LDKCResult_RouteHintDecodeErrorZ* owner_conv = (LDKCResult_RouteHintDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_RouteHintDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_RouteHintDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_RouteHintHopDecodeErrorZ_get_err(LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
uint64_t __attribute__((export_name("TS_CResult_RouteHintHopDecodeErrorZ_get_err"))) TS_CResult_RouteHintHopDecodeErrorZ_get_err(uint64_t owner) {
LDKCResult_RouteHintHopDecodeErrorZ* owner_conv = (LDKCResult_RouteHintHopDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_RouteHintHopDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
- return ret_ref;
-}
-
-static inline LDKCVec_ChannelDetailsZ CVec_ChannelDetailsZ_clone(const LDKCVec_ChannelDetailsZ *orig) {
- LDKCVec_ChannelDetailsZ ret = { .data = MALLOC(sizeof(LDKChannelDetails) * orig->datalen, "LDKCVec_ChannelDetailsZ clone bytes"), .datalen = orig->datalen };
- for (size_t i = 0; i < ret.datalen; i++) {
- ret.data[i] = ChannelDetails_clone(&orig->data[i]);
- }
- return ret;
-}
-static inline struct LDKRoute CResult_RouteLightningErrorZ_get_ok(LDKCResult_RouteLightningErrorZ *NONNULL_PTR owner){
- LDKRoute ret = *owner->contents.result;
- ret.is_owned = false;
- return ret;
-}
-uint64_t __attribute__((export_name("TS_CResult_RouteLightningErrorZ_get_ok"))) TS_CResult_RouteLightningErrorZ_get_ok(uint64_t owner) {
- LDKCResult_RouteLightningErrorZ* owner_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(owner);
- LDKRoute ret_var = CResult_RouteLightningErrorZ_get_ok(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
- return ret_ref;
-}
-
-static inline struct LDKLightningError CResult_RouteLightningErrorZ_get_err(LDKCResult_RouteLightningErrorZ *NONNULL_PTR owner){
- LDKLightningError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
-}
-uint64_t __attribute__((export_name("TS_CResult_RouteLightningErrorZ_get_err"))) TS_CResult_RouteLightningErrorZ_get_err(uint64_t owner) {
- LDKCResult_RouteLightningErrorZ* owner_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(owner);
- LDKLightningError ret_var = CResult_RouteLightningErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_RouteHintHopDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_PaymentPurposeDecodeErrorZ_get_err(LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
uint64_t __attribute__((export_name("TS_CResult_PaymentPurposeDecodeErrorZ_get_err"))) TS_CResult_PaymentPurposeDecodeErrorZ_get_err(uint64_t owner) {
LDKCResult_PaymentPurposeDecodeErrorZ* owner_conv = (LDKCResult_PaymentPurposeDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_PaymentPurposeDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_PaymentPurposeDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+uint32_t __attribute__((export_name("TS_LDKNetworkUpdate_ty_from_ptr"))) TS_LDKNetworkUpdate_ty_from_ptr(uint64_t ptr) {
+ LDKNetworkUpdate *obj = (LDKNetworkUpdate*)untag_ptr(ptr);
+ switch(obj->tag) {
+ case LDKNetworkUpdate_ChannelUpdateMessage: return 0;
+ case LDKNetworkUpdate_ChannelFailure: return 1;
+ case LDKNetworkUpdate_NodeFailure: return 2;
+ default: abort();
+ }
+}
+uint64_t __attribute__((export_name("TS_LDKNetworkUpdate_ChannelUpdateMessage_get_msg"))) TS_LDKNetworkUpdate_ChannelUpdateMessage_get_msg(uint64_t ptr) {
+ LDKNetworkUpdate *obj = (LDKNetworkUpdate*)untag_ptr(ptr);
+ assert(obj->tag == LDKNetworkUpdate_ChannelUpdateMessage);
+ LDKChannelUpdate msg_var = obj->channel_update_message.msg;
+ uint64_t msg_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
+ msg_ref = tag_ptr(msg_var.inner, false);
+ return msg_ref;
+}
+int64_t __attribute__((export_name("TS_LDKNetworkUpdate_ChannelFailure_get_short_channel_id"))) TS_LDKNetworkUpdate_ChannelFailure_get_short_channel_id(uint64_t ptr) {
+ LDKNetworkUpdate *obj = (LDKNetworkUpdate*)untag_ptr(ptr);
+ assert(obj->tag == LDKNetworkUpdate_ChannelFailure);
+ int64_t short_channel_id_conv = obj->channel_failure.short_channel_id;
+ return short_channel_id_conv;
+}
+jboolean __attribute__((export_name("TS_LDKNetworkUpdate_ChannelFailure_get_is_permanent"))) TS_LDKNetworkUpdate_ChannelFailure_get_is_permanent(uint64_t ptr) {
+ LDKNetworkUpdate *obj = (LDKNetworkUpdate*)untag_ptr(ptr);
+ assert(obj->tag == LDKNetworkUpdate_ChannelFailure);
+ jboolean is_permanent_conv = obj->channel_failure.is_permanent;
+ return is_permanent_conv;
+}
+int8_tArray __attribute__((export_name("TS_LDKNetworkUpdate_NodeFailure_get_node_id"))) TS_LDKNetworkUpdate_NodeFailure_get_node_id(uint64_t ptr) {
+ LDKNetworkUpdate *obj = (LDKNetworkUpdate*)untag_ptr(ptr);
+ assert(obj->tag == LDKNetworkUpdate_NodeFailure);
+ int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
+ memcpy(node_id_arr->elems, obj->node_failure.node_id.compressed_form, 33);
+ return node_id_arr;
+}
+jboolean __attribute__((export_name("TS_LDKNetworkUpdate_NodeFailure_get_is_permanent"))) TS_LDKNetworkUpdate_NodeFailure_get_is_permanent(uint64_t ptr) {
+ LDKNetworkUpdate *obj = (LDKNetworkUpdate*)untag_ptr(ptr);
+ assert(obj->tag == LDKNetworkUpdate_NodeFailure);
+ jboolean is_permanent_conv = obj->node_failure.is_permanent;
+ return is_permanent_conv;
+}
+uint32_t __attribute__((export_name("TS_LDKCOption_NetworkUpdateZ_ty_from_ptr"))) TS_LDKCOption_NetworkUpdateZ_ty_from_ptr(uint64_t ptr) {
+ LDKCOption_NetworkUpdateZ *obj = (LDKCOption_NetworkUpdateZ*)untag_ptr(ptr);
+ switch(obj->tag) {
+ case LDKCOption_NetworkUpdateZ_Some: return 0;
+ case LDKCOption_NetworkUpdateZ_None: return 1;
+ default: abort();
+ }
+}
+uint64_t __attribute__((export_name("TS_LDKCOption_NetworkUpdateZ_Some_get_some"))) TS_LDKCOption_NetworkUpdateZ_Some_get_some(uint64_t ptr) {
+ LDKCOption_NetworkUpdateZ *obj = (LDKCOption_NetworkUpdateZ*)untag_ptr(ptr);
+ assert(obj->tag == LDKCOption_NetworkUpdateZ_Some);
+ uint64_t some_ref = tag_ptr(&obj->some, false);
+ return some_ref;
+}
+uint32_t __attribute__((export_name("TS_LDKPathFailure_ty_from_ptr"))) TS_LDKPathFailure_ty_from_ptr(uint64_t ptr) {
+ LDKPathFailure *obj = (LDKPathFailure*)untag_ptr(ptr);
+ switch(obj->tag) {
+ case LDKPathFailure_InitialSend: return 0;
+ case LDKPathFailure_OnPath: return 1;
+ default: abort();
+ }
+}
+uint64_t __attribute__((export_name("TS_LDKPathFailure_InitialSend_get_err"))) TS_LDKPathFailure_InitialSend_get_err(uint64_t ptr) {
+ LDKPathFailure *obj = (LDKPathFailure*)untag_ptr(ptr);
+ assert(obj->tag == LDKPathFailure_InitialSend);
+ uint64_t err_ref = tag_ptr(&obj->initial_send.err, false);
+ return err_ref;
+}
+uint64_t __attribute__((export_name("TS_LDKPathFailure_OnPath_get_network_update"))) TS_LDKPathFailure_OnPath_get_network_update(uint64_t ptr) {
+ LDKPathFailure *obj = (LDKPathFailure*)untag_ptr(ptr);
+ assert(obj->tag == LDKPathFailure_OnPath);
+ uint64_t network_update_ref = tag_ptr(&obj->on_path.network_update, false);
+ return network_update_ref;
+}
+uint32_t __attribute__((export_name("TS_LDKCOption_PathFailureZ_ty_from_ptr"))) TS_LDKCOption_PathFailureZ_ty_from_ptr(uint64_t ptr) {
+ LDKCOption_PathFailureZ *obj = (LDKCOption_PathFailureZ*)untag_ptr(ptr);
+ switch(obj->tag) {
+ case LDKCOption_PathFailureZ_Some: return 0;
+ case LDKCOption_PathFailureZ_None: return 1;
+ default: abort();
+ }
+}
+uint64_t __attribute__((export_name("TS_LDKCOption_PathFailureZ_Some_get_some"))) TS_LDKCOption_PathFailureZ_Some_get_some(uint64_t ptr) {
+ LDKCOption_PathFailureZ *obj = (LDKCOption_PathFailureZ*)untag_ptr(ptr);
+ assert(obj->tag == LDKCOption_PathFailureZ_Some);
+ uint64_t some_ref = tag_ptr(&obj->some, false);
+ return some_ref;
+}
+static inline struct LDKCOption_PathFailureZ CResult_COption_PathFailureZDecodeErrorZ_get_ok(LDKCResult_COption_PathFailureZDecodeErrorZ *NONNULL_PTR owner){
+CHECK(owner->result_ok);
+ return COption_PathFailureZ_clone(&*owner->contents.result);
+}
+uint64_t __attribute__((export_name("TS_CResult_COption_PathFailureZDecodeErrorZ_get_ok"))) TS_CResult_COption_PathFailureZDecodeErrorZ_get_ok(uint64_t owner) {
+ LDKCResult_COption_PathFailureZDecodeErrorZ* owner_conv = (LDKCResult_COption_PathFailureZDecodeErrorZ*)untag_ptr(owner);
+ LDKCOption_PathFailureZ *ret_copy = MALLOC(sizeof(LDKCOption_PathFailureZ), "LDKCOption_PathFailureZ");
+ *ret_copy = CResult_COption_PathFailureZDecodeErrorZ_get_ok(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+static inline struct LDKDecodeError CResult_COption_PathFailureZDecodeErrorZ_get_err(LDKCResult_COption_PathFailureZDecodeErrorZ *NONNULL_PTR owner){
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
+}
+uint64_t __attribute__((export_name("TS_CResult_COption_PathFailureZDecodeErrorZ_get_err"))) TS_CResult_COption_PathFailureZDecodeErrorZ_get_err(uint64_t owner) {
+ LDKCResult_COption_PathFailureZDecodeErrorZ* owner_conv = (LDKCResult_COption_PathFailureZDecodeErrorZ*)untag_ptr(owner);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_COption_PathFailureZDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_COption_ClosureReasonZDecodeErrorZ_get_err(LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
uint64_t __attribute__((export_name("TS_CResult_COption_ClosureReasonZDecodeErrorZ_get_err"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_get_err(uint64_t owner) {
LDKCResult_COption_ClosureReasonZDecodeErrorZ* owner_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_COption_ClosureReasonZDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_COption_ClosureReasonZDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
switch(obj->tag) {
case LDKHTLCDestination_NextHopChannel: return 0;
case LDKHTLCDestination_UnknownNextHop: return 1;
- case LDKHTLCDestination_FailedPayment: return 2;
+ case LDKHTLCDestination_InvalidForward: return 2;
+ case LDKHTLCDestination_FailedPayment: return 3;
default: abort();
}
}
int64_t requested_forward_scid_conv = obj->unknown_next_hop.requested_forward_scid;
return requested_forward_scid_conv;
}
+int64_t __attribute__((export_name("TS_LDKHTLCDestination_InvalidForward_get_requested_forward_scid"))) TS_LDKHTLCDestination_InvalidForward_get_requested_forward_scid(uint64_t ptr) {
+ LDKHTLCDestination *obj = (LDKHTLCDestination*)untag_ptr(ptr);
+ assert(obj->tag == LDKHTLCDestination_InvalidForward);
+ int64_t requested_forward_scid_conv = obj->invalid_forward.requested_forward_scid;
+ return requested_forward_scid_conv;
+}
int8_tArray __attribute__((export_name("TS_LDKHTLCDestination_FailedPayment_get_payment_hash"))) TS_LDKHTLCDestination_FailedPayment_get_payment_hash(uint64_t ptr) {
LDKHTLCDestination *obj = (LDKHTLCDestination*)untag_ptr(ptr);
assert(obj->tag == LDKHTLCDestination_FailedPayment);
}
static inline struct LDKDecodeError CResult_COption_HTLCDestinationZDecodeErrorZ_get_err(LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
uint64_t __attribute__((export_name("TS_CResult_COption_HTLCDestinationZDecodeErrorZ_get_err"))) TS_CResult_COption_HTLCDestinationZDecodeErrorZ_get_err(uint64_t owner) {
LDKCResult_COption_HTLCDestinationZDecodeErrorZ* owner_conv = (LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_COption_HTLCDestinationZDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_COption_HTLCDestinationZDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
-uint32_t __attribute__((export_name("TS_LDKNetworkUpdate_ty_from_ptr"))) TS_LDKNetworkUpdate_ty_from_ptr(uint64_t ptr) {
- LDKNetworkUpdate *obj = (LDKNetworkUpdate*)untag_ptr(ptr);
- switch(obj->tag) {
- case LDKNetworkUpdate_ChannelUpdateMessage: return 0;
- case LDKNetworkUpdate_ChannelFailure: return 1;
- case LDKNetworkUpdate_NodeFailure: return 2;
- default: abort();
- }
-}
-uint64_t __attribute__((export_name("TS_LDKNetworkUpdate_ChannelUpdateMessage_get_msg"))) TS_LDKNetworkUpdate_ChannelUpdateMessage_get_msg(uint64_t ptr) {
- LDKNetworkUpdate *obj = (LDKNetworkUpdate*)untag_ptr(ptr);
- assert(obj->tag == LDKNetworkUpdate_ChannelUpdateMessage);
- LDKChannelUpdate msg_var = obj->channel_update_message.msg;
- uint64_t msg_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
- msg_ref = tag_ptr(msg_var.inner, false);
- return msg_ref;
-}
-int64_t __attribute__((export_name("TS_LDKNetworkUpdate_ChannelFailure_get_short_channel_id"))) TS_LDKNetworkUpdate_ChannelFailure_get_short_channel_id(uint64_t ptr) {
- LDKNetworkUpdate *obj = (LDKNetworkUpdate*)untag_ptr(ptr);
- assert(obj->tag == LDKNetworkUpdate_ChannelFailure);
- int64_t short_channel_id_conv = obj->channel_failure.short_channel_id;
- return short_channel_id_conv;
-}
-jboolean __attribute__((export_name("TS_LDKNetworkUpdate_ChannelFailure_get_is_permanent"))) TS_LDKNetworkUpdate_ChannelFailure_get_is_permanent(uint64_t ptr) {
- LDKNetworkUpdate *obj = (LDKNetworkUpdate*)untag_ptr(ptr);
- assert(obj->tag == LDKNetworkUpdate_ChannelFailure);
- jboolean is_permanent_conv = obj->channel_failure.is_permanent;
- return is_permanent_conv;
-}
-int8_tArray __attribute__((export_name("TS_LDKNetworkUpdate_NodeFailure_get_node_id"))) TS_LDKNetworkUpdate_NodeFailure_get_node_id(uint64_t ptr) {
- LDKNetworkUpdate *obj = (LDKNetworkUpdate*)untag_ptr(ptr);
- assert(obj->tag == LDKNetworkUpdate_NodeFailure);
- int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
- memcpy(node_id_arr->elems, obj->node_failure.node_id.compressed_form, 33);
- return node_id_arr;
-}
-jboolean __attribute__((export_name("TS_LDKNetworkUpdate_NodeFailure_get_is_permanent"))) TS_LDKNetworkUpdate_NodeFailure_get_is_permanent(uint64_t ptr) {
- LDKNetworkUpdate *obj = (LDKNetworkUpdate*)untag_ptr(ptr);
- assert(obj->tag == LDKNetworkUpdate_NodeFailure);
- jboolean is_permanent_conv = obj->node_failure.is_permanent;
- return is_permanent_conv;
-}
-uint32_t __attribute__((export_name("TS_LDKCOption_NetworkUpdateZ_ty_from_ptr"))) TS_LDKCOption_NetworkUpdateZ_ty_from_ptr(uint64_t ptr) {
- LDKCOption_NetworkUpdateZ *obj = (LDKCOption_NetworkUpdateZ*)untag_ptr(ptr);
+uint32_t __attribute__((export_name("TS_LDKCOption_u128Z_ty_from_ptr"))) TS_LDKCOption_u128Z_ty_from_ptr(uint64_t ptr) {
+ LDKCOption_u128Z *obj = (LDKCOption_u128Z*)untag_ptr(ptr);
switch(obj->tag) {
- case LDKCOption_NetworkUpdateZ_Some: return 0;
- case LDKCOption_NetworkUpdateZ_None: return 1;
+ case LDKCOption_u128Z_Some: return 0;
+ case LDKCOption_u128Z_None: return 1;
default: abort();
}
}
-uint64_t __attribute__((export_name("TS_LDKCOption_NetworkUpdateZ_Some_get_some"))) TS_LDKCOption_NetworkUpdateZ_Some_get_some(uint64_t ptr) {
- LDKCOption_NetworkUpdateZ *obj = (LDKCOption_NetworkUpdateZ*)untag_ptr(ptr);
- assert(obj->tag == LDKCOption_NetworkUpdateZ_Some);
- uint64_t some_ref = tag_ptr(&obj->some, false);
- return some_ref;
+int8_tArray __attribute__((export_name("TS_LDKCOption_u128Z_Some_get_some"))) TS_LDKCOption_u128Z_Some_get_some(uint64_t ptr) {
+ LDKCOption_u128Z *obj = (LDKCOption_u128Z*)untag_ptr(ptr);
+ assert(obj->tag == LDKCOption_u128Z_Some);
+ int8_tArray some_arr = init_int8_tArray(16, __LINE__);
+ memcpy(some_arr->elems, obj->some.le_bytes, 16);
+ return some_arr;
}
uint32_t __attribute__((export_name("TS_LDKSpendableOutputDescriptor_ty_from_ptr"))) TS_LDKSpendableOutputDescriptor_ty_from_ptr(uint64_t ptr) {
LDKSpendableOutputDescriptor *obj = (LDKSpendableOutputDescriptor*)untag_ptr(ptr);
LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
switch(obj->tag) {
case LDKEvent_FundingGenerationReady: return 0;
- case LDKEvent_PaymentReceived: return 1;
+ case LDKEvent_PaymentClaimable: return 1;
case LDKEvent_PaymentClaimed: return 2;
case LDKEvent_PaymentSent: return 3;
case LDKEvent_PaymentFailed: return 4;
case LDKEvent_ProbeSuccessful: return 7;
case LDKEvent_ProbeFailed: return 8;
case LDKEvent_PendingHTLCsForwardable: return 9;
- case LDKEvent_SpendableOutputs: return 10;
- case LDKEvent_PaymentForwarded: return 11;
- case LDKEvent_ChannelClosed: return 12;
- case LDKEvent_DiscardFunding: return 13;
- case LDKEvent_OpenChannelRequest: return 14;
- case LDKEvent_HTLCHandlingFailed: return 15;
+ case LDKEvent_HTLCIntercepted: return 10;
+ case LDKEvent_SpendableOutputs: return 11;
+ case LDKEvent_PaymentForwarded: return 12;
+ case LDKEvent_ChannelReady: return 13;
+ case LDKEvent_ChannelClosed: return 14;
+ case LDKEvent_DiscardFunding: return 15;
+ case LDKEvent_OpenChannelRequest: return 16;
+ case LDKEvent_HTLCHandlingFailed: return 17;
default: abort();
}
}
memcpy(output_script_arr->elems, output_script_var.data, output_script_var.datalen);
return output_script_arr;
}
-int64_t __attribute__((export_name("TS_LDKEvent_FundingGenerationReady_get_user_channel_id"))) TS_LDKEvent_FundingGenerationReady_get_user_channel_id(uint64_t ptr) {
+int8_tArray __attribute__((export_name("TS_LDKEvent_FundingGenerationReady_get_user_channel_id"))) TS_LDKEvent_FundingGenerationReady_get_user_channel_id(uint64_t ptr) {
LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
assert(obj->tag == LDKEvent_FundingGenerationReady);
- int64_t user_channel_id_conv = obj->funding_generation_ready.user_channel_id;
- return user_channel_id_conv;
+ int8_tArray user_channel_id_arr = init_int8_tArray(16, __LINE__);
+ memcpy(user_channel_id_arr->elems, obj->funding_generation_ready.user_channel_id.le_bytes, 16);
+ return user_channel_id_arr;
+}
+int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentClaimable_get_receiver_node_id"))) TS_LDKEvent_PaymentClaimable_get_receiver_node_id(uint64_t ptr) {
+ LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
+ assert(obj->tag == LDKEvent_PaymentClaimable);
+ int8_tArray receiver_node_id_arr = init_int8_tArray(33, __LINE__);
+ memcpy(receiver_node_id_arr->elems, obj->payment_claimable.receiver_node_id.compressed_form, 33);
+ return receiver_node_id_arr;
}
-int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentReceived_get_payment_hash"))) TS_LDKEvent_PaymentReceived_get_payment_hash(uint64_t ptr) {
+int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentClaimable_get_payment_hash"))) TS_LDKEvent_PaymentClaimable_get_payment_hash(uint64_t ptr) {
LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
- assert(obj->tag == LDKEvent_PaymentReceived);
+ assert(obj->tag == LDKEvent_PaymentClaimable);
int8_tArray payment_hash_arr = init_int8_tArray(32, __LINE__);
- memcpy(payment_hash_arr->elems, obj->payment_received.payment_hash.data, 32);
+ memcpy(payment_hash_arr->elems, obj->payment_claimable.payment_hash.data, 32);
return payment_hash_arr;
}
-int64_t __attribute__((export_name("TS_LDKEvent_PaymentReceived_get_amount_msat"))) TS_LDKEvent_PaymentReceived_get_amount_msat(uint64_t ptr) {
+int64_t __attribute__((export_name("TS_LDKEvent_PaymentClaimable_get_amount_msat"))) TS_LDKEvent_PaymentClaimable_get_amount_msat(uint64_t ptr) {
LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
- assert(obj->tag == LDKEvent_PaymentReceived);
- int64_t amount_msat_conv = obj->payment_received.amount_msat;
+ assert(obj->tag == LDKEvent_PaymentClaimable);
+ int64_t amount_msat_conv = obj->payment_claimable.amount_msat;
return amount_msat_conv;
}
-uint64_t __attribute__((export_name("TS_LDKEvent_PaymentReceived_get_purpose"))) TS_LDKEvent_PaymentReceived_get_purpose(uint64_t ptr) {
+uint64_t __attribute__((export_name("TS_LDKEvent_PaymentClaimable_get_purpose"))) TS_LDKEvent_PaymentClaimable_get_purpose(uint64_t ptr) {
LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
- assert(obj->tag == LDKEvent_PaymentReceived);
- uint64_t purpose_ref = tag_ptr(&obj->payment_received.purpose, false);
+ assert(obj->tag == LDKEvent_PaymentClaimable);
+ uint64_t purpose_ref = tag_ptr(&obj->payment_claimable.purpose, false);
return purpose_ref;
}
+int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentClaimable_get_via_channel_id"))) TS_LDKEvent_PaymentClaimable_get_via_channel_id(uint64_t ptr) {
+ LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
+ assert(obj->tag == LDKEvent_PaymentClaimable);
+ int8_tArray via_channel_id_arr = init_int8_tArray(32, __LINE__);
+ memcpy(via_channel_id_arr->elems, obj->payment_claimable.via_channel_id.data, 32);
+ return via_channel_id_arr;
+}
+uint64_t __attribute__((export_name("TS_LDKEvent_PaymentClaimable_get_via_user_channel_id"))) TS_LDKEvent_PaymentClaimable_get_via_user_channel_id(uint64_t ptr) {
+ LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
+ assert(obj->tag == LDKEvent_PaymentClaimable);
+ uint64_t via_user_channel_id_ref = tag_ptr(&obj->payment_claimable.via_user_channel_id, false);
+ return via_user_channel_id_ref;
+}
+int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentClaimed_get_receiver_node_id"))) TS_LDKEvent_PaymentClaimed_get_receiver_node_id(uint64_t ptr) {
+ LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
+ assert(obj->tag == LDKEvent_PaymentClaimed);
+ int8_tArray receiver_node_id_arr = init_int8_tArray(33, __LINE__);
+ memcpy(receiver_node_id_arr->elems, obj->payment_claimed.receiver_node_id.compressed_form, 33);
+ return receiver_node_id_arr;
+}
int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentClaimed_get_payment_hash"))) TS_LDKEvent_PaymentClaimed_get_payment_hash(uint64_t ptr) {
LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
assert(obj->tag == LDKEvent_PaymentClaimed);
memcpy(payment_hash_arr->elems, obj->payment_path_failed.payment_hash.data, 32);
return payment_hash_arr;
}
-jboolean __attribute__((export_name("TS_LDKEvent_PaymentPathFailed_get_rejected_by_dest"))) TS_LDKEvent_PaymentPathFailed_get_rejected_by_dest(uint64_t ptr) {
- LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
- assert(obj->tag == LDKEvent_PaymentPathFailed);
- jboolean rejected_by_dest_conv = obj->payment_path_failed.rejected_by_dest;
- return rejected_by_dest_conv;
-}
-uint64_t __attribute__((export_name("TS_LDKEvent_PaymentPathFailed_get_network_update"))) TS_LDKEvent_PaymentPathFailed_get_network_update(uint64_t ptr) {
+jboolean __attribute__((export_name("TS_LDKEvent_PaymentPathFailed_get_payment_failed_permanently"))) TS_LDKEvent_PaymentPathFailed_get_payment_failed_permanently(uint64_t ptr) {
LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
assert(obj->tag == LDKEvent_PaymentPathFailed);
- uint64_t network_update_ref = tag_ptr(&obj->payment_path_failed.network_update, false);
- return network_update_ref;
+ jboolean payment_failed_permanently_conv = obj->payment_path_failed.payment_failed_permanently;
+ return payment_failed_permanently_conv;
}
-jboolean __attribute__((export_name("TS_LDKEvent_PaymentPathFailed_get_all_paths_failed"))) TS_LDKEvent_PaymentPathFailed_get_all_paths_failed(uint64_t ptr) {
+uint64_t __attribute__((export_name("TS_LDKEvent_PaymentPathFailed_get_failure"))) TS_LDKEvent_PaymentPathFailed_get_failure(uint64_t ptr) {
LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
assert(obj->tag == LDKEvent_PaymentPathFailed);
- jboolean all_paths_failed_conv = obj->payment_path_failed.all_paths_failed;
- return all_paths_failed_conv;
+ uint64_t failure_ref = tag_ptr(&obj->payment_path_failed.failure, false);
+ return failure_ref;
}
uint64_tArray __attribute__((export_name("TS_LDKEvent_PaymentPathFailed_get_path"))) TS_LDKEvent_PaymentPathFailed_get_path(uint64_t ptr) {
LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
int64_t time_forwardable_conv = obj->pending_htl_cs_forwardable.time_forwardable;
return time_forwardable_conv;
}
+int8_tArray __attribute__((export_name("TS_LDKEvent_HTLCIntercepted_get_intercept_id"))) TS_LDKEvent_HTLCIntercepted_get_intercept_id(uint64_t ptr) {
+ LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
+ assert(obj->tag == LDKEvent_HTLCIntercepted);
+ int8_tArray intercept_id_arr = init_int8_tArray(32, __LINE__);
+ memcpy(intercept_id_arr->elems, obj->htlc_intercepted.intercept_id.data, 32);
+ return intercept_id_arr;
+}
+int64_t __attribute__((export_name("TS_LDKEvent_HTLCIntercepted_get_requested_next_hop_scid"))) TS_LDKEvent_HTLCIntercepted_get_requested_next_hop_scid(uint64_t ptr) {
+ LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
+ assert(obj->tag == LDKEvent_HTLCIntercepted);
+ int64_t requested_next_hop_scid_conv = obj->htlc_intercepted.requested_next_hop_scid;
+ return requested_next_hop_scid_conv;
+}
+int8_tArray __attribute__((export_name("TS_LDKEvent_HTLCIntercepted_get_payment_hash"))) TS_LDKEvent_HTLCIntercepted_get_payment_hash(uint64_t ptr) {
+ LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
+ assert(obj->tag == LDKEvent_HTLCIntercepted);
+ int8_tArray payment_hash_arr = init_int8_tArray(32, __LINE__);
+ memcpy(payment_hash_arr->elems, obj->htlc_intercepted.payment_hash.data, 32);
+ return payment_hash_arr;
+}
+int64_t __attribute__((export_name("TS_LDKEvent_HTLCIntercepted_get_inbound_amount_msat"))) TS_LDKEvent_HTLCIntercepted_get_inbound_amount_msat(uint64_t ptr) {
+ LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
+ assert(obj->tag == LDKEvent_HTLCIntercepted);
+ int64_t inbound_amount_msat_conv = obj->htlc_intercepted.inbound_amount_msat;
+ return inbound_amount_msat_conv;
+}
+int64_t __attribute__((export_name("TS_LDKEvent_HTLCIntercepted_get_expected_outbound_amount_msat"))) TS_LDKEvent_HTLCIntercepted_get_expected_outbound_amount_msat(uint64_t ptr) {
+ LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
+ assert(obj->tag == LDKEvent_HTLCIntercepted);
+ int64_t expected_outbound_amount_msat_conv = obj->htlc_intercepted.expected_outbound_amount_msat;
+ return expected_outbound_amount_msat_conv;
+}
uint64_tArray __attribute__((export_name("TS_LDKEvent_SpendableOutputs_get_outputs"))) TS_LDKEvent_SpendableOutputs_get_outputs(uint64_t ptr) {
LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
assert(obj->tag == LDKEvent_SpendableOutputs);
jboolean claim_from_onchain_tx_conv = obj->payment_forwarded.claim_from_onchain_tx;
return claim_from_onchain_tx_conv;
}
+int8_tArray __attribute__((export_name("TS_LDKEvent_ChannelReady_get_channel_id"))) TS_LDKEvent_ChannelReady_get_channel_id(uint64_t ptr) {
+ LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
+ assert(obj->tag == LDKEvent_ChannelReady);
+ int8_tArray channel_id_arr = init_int8_tArray(32, __LINE__);
+ memcpy(channel_id_arr->elems, obj->channel_ready.channel_id.data, 32);
+ return channel_id_arr;
+}
+int8_tArray __attribute__((export_name("TS_LDKEvent_ChannelReady_get_user_channel_id"))) TS_LDKEvent_ChannelReady_get_user_channel_id(uint64_t ptr) {
+ LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
+ assert(obj->tag == LDKEvent_ChannelReady);
+ int8_tArray user_channel_id_arr = init_int8_tArray(16, __LINE__);
+ memcpy(user_channel_id_arr->elems, obj->channel_ready.user_channel_id.le_bytes, 16);
+ return user_channel_id_arr;
+}
+int8_tArray __attribute__((export_name("TS_LDKEvent_ChannelReady_get_counterparty_node_id"))) TS_LDKEvent_ChannelReady_get_counterparty_node_id(uint64_t ptr) {
+ LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
+ assert(obj->tag == LDKEvent_ChannelReady);
+ int8_tArray counterparty_node_id_arr = init_int8_tArray(33, __LINE__);
+ memcpy(counterparty_node_id_arr->elems, obj->channel_ready.counterparty_node_id.compressed_form, 33);
+ return counterparty_node_id_arr;
+}
+uint64_t __attribute__((export_name("TS_LDKEvent_ChannelReady_get_channel_type"))) TS_LDKEvent_ChannelReady_get_channel_type(uint64_t ptr) {
+ LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
+ assert(obj->tag == LDKEvent_ChannelReady);
+ LDKChannelTypeFeatures channel_type_var = obj->channel_ready.channel_type;
+ uint64_t channel_type_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_var);
+ channel_type_ref = tag_ptr(channel_type_var.inner, false);
+ return channel_type_ref;
+}
int8_tArray __attribute__((export_name("TS_LDKEvent_ChannelClosed_get_channel_id"))) TS_LDKEvent_ChannelClosed_get_channel_id(uint64_t ptr) {
LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
assert(obj->tag == LDKEvent_ChannelClosed);
memcpy(channel_id_arr->elems, obj->channel_closed.channel_id.data, 32);
return channel_id_arr;
}
-int64_t __attribute__((export_name("TS_LDKEvent_ChannelClosed_get_user_channel_id"))) TS_LDKEvent_ChannelClosed_get_user_channel_id(uint64_t ptr) {
+int8_tArray __attribute__((export_name("TS_LDKEvent_ChannelClosed_get_user_channel_id"))) TS_LDKEvent_ChannelClosed_get_user_channel_id(uint64_t ptr) {
LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
assert(obj->tag == LDKEvent_ChannelClosed);
- int64_t user_channel_id_conv = obj->channel_closed.user_channel_id;
- return user_channel_id_conv;
+ int8_tArray user_channel_id_arr = init_int8_tArray(16, __LINE__);
+ memcpy(user_channel_id_arr->elems, obj->channel_closed.user_channel_id.le_bytes, 16);
+ return user_channel_id_arr;
}
uint64_t __attribute__((export_name("TS_LDKEvent_ChannelClosed_get_reason"))) TS_LDKEvent_ChannelClosed_get_reason(uint64_t ptr) {
LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
}
static inline struct LDKDecodeError CResult_COption_EventZDecodeErrorZ_get_err(LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
uint64_t __attribute__((export_name("TS_CResult_COption_EventZDecodeErrorZ_get_err"))) TS_CResult_COption_EventZDecodeErrorZ_get_err(uint64_t owner) {
LDKCResult_COption_EventZDecodeErrorZ* owner_conv = (LDKCResult_COption_EventZDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_COption_EventZDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_COption_EventZDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
case LDKMessageSendEvent_SendClosingSigned: return 8;
case LDKMessageSendEvent_SendShutdown: return 9;
case LDKMessageSendEvent_SendChannelReestablish: return 10;
- case LDKMessageSendEvent_BroadcastChannelAnnouncement: return 11;
- case LDKMessageSendEvent_BroadcastNodeAnnouncement: return 12;
+ case LDKMessageSendEvent_SendChannelAnnouncement: return 11;
+ case LDKMessageSendEvent_BroadcastChannelAnnouncement: return 12;
case LDKMessageSendEvent_BroadcastChannelUpdate: return 13;
- case LDKMessageSendEvent_SendChannelUpdate: return 14;
- case LDKMessageSendEvent_HandleError: return 15;
- case LDKMessageSendEvent_SendChannelRangeQuery: return 16;
- case LDKMessageSendEvent_SendShortIdsQuery: return 17;
- case LDKMessageSendEvent_SendReplyChannelRange: return 18;
- case LDKMessageSendEvent_SendGossipTimestampFilter: return 19;
+ case LDKMessageSendEvent_BroadcastNodeAnnouncement: return 14;
+ case LDKMessageSendEvent_SendChannelUpdate: return 15;
+ case LDKMessageSendEvent_HandleError: return 16;
+ case LDKMessageSendEvent_SendChannelRangeQuery: return 17;
+ case LDKMessageSendEvent_SendShortIdsQuery: return 18;
+ case LDKMessageSendEvent_SendReplyChannelRange: return 19;
+ case LDKMessageSendEvent_SendGossipTimestampFilter: return 20;
default: abort();
}
}
msg_ref = tag_ptr(msg_var.inner, false);
return msg_ref;
}
+int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendChannelAnnouncement_get_node_id"))) TS_LDKMessageSendEvent_SendChannelAnnouncement_get_node_id(uint64_t ptr) {
+ LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
+ assert(obj->tag == LDKMessageSendEvent_SendChannelAnnouncement);
+ int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
+ memcpy(node_id_arr->elems, obj->send_channel_announcement.node_id.compressed_form, 33);
+ return node_id_arr;
+}
+uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_SendChannelAnnouncement_get_msg"))) TS_LDKMessageSendEvent_SendChannelAnnouncement_get_msg(uint64_t ptr) {
+ LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
+ assert(obj->tag == LDKMessageSendEvent_SendChannelAnnouncement);
+ LDKChannelAnnouncement msg_var = obj->send_channel_announcement.msg;
+ uint64_t msg_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
+ msg_ref = tag_ptr(msg_var.inner, false);
+ return msg_ref;
+}
+uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_SendChannelAnnouncement_get_update_msg"))) TS_LDKMessageSendEvent_SendChannelAnnouncement_get_update_msg(uint64_t ptr) {
+ LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
+ assert(obj->tag == LDKMessageSendEvent_SendChannelAnnouncement);
+ LDKChannelUpdate update_msg_var = obj->send_channel_announcement.update_msg;
+ uint64_t update_msg_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(update_msg_var);
+ update_msg_ref = tag_ptr(update_msg_var.inner, false);
+ return update_msg_ref;
+}
uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_BroadcastChannelAnnouncement_get_msg"))) TS_LDKMessageSendEvent_BroadcastChannelAnnouncement_get_msg(uint64_t ptr) {
LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
assert(obj->tag == LDKMessageSendEvent_BroadcastChannelAnnouncement);
update_msg_ref = tag_ptr(update_msg_var.inner, false);
return update_msg_ref;
}
-uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_BroadcastNodeAnnouncement_get_msg"))) TS_LDKMessageSendEvent_BroadcastNodeAnnouncement_get_msg(uint64_t ptr) {
+uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_BroadcastChannelUpdate_get_msg"))) TS_LDKMessageSendEvent_BroadcastChannelUpdate_get_msg(uint64_t ptr) {
LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
- assert(obj->tag == LDKMessageSendEvent_BroadcastNodeAnnouncement);
- LDKNodeAnnouncement msg_var = obj->broadcast_node_announcement.msg;
+ assert(obj->tag == LDKMessageSendEvent_BroadcastChannelUpdate);
+ LDKChannelUpdate msg_var = obj->broadcast_channel_update.msg;
uint64_t msg_ref = 0;
CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
msg_ref = tag_ptr(msg_var.inner, false);
return msg_ref;
}
-uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_BroadcastChannelUpdate_get_msg"))) TS_LDKMessageSendEvent_BroadcastChannelUpdate_get_msg(uint64_t ptr) {
+uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_BroadcastNodeAnnouncement_get_msg"))) TS_LDKMessageSendEvent_BroadcastNodeAnnouncement_get_msg(uint64_t ptr) {
LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
- assert(obj->tag == LDKMessageSendEvent_BroadcastChannelUpdate);
- LDKChannelUpdate msg_var = obj->broadcast_channel_update.msg;
+ assert(obj->tag == LDKMessageSendEvent_BroadcastNodeAnnouncement);
+ LDKNodeAnnouncement msg_var = obj->broadcast_node_announcement.msg;
uint64_t msg_ref = 0;
CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
msg_ref = tag_ptr(msg_var.inner, false);
}
return ret;
}
-static inline struct LDKTxOut CResult_TxOutAccessErrorZ_get_ok(LDKCResult_TxOutAccessErrorZ *NONNULL_PTR owner){
-CHECK(owner->result_ok);
- return TxOut_clone(&*owner->contents.result);
-}
-uint64_t __attribute__((export_name("TS_CResult_TxOutAccessErrorZ_get_ok"))) TS_CResult_TxOutAccessErrorZ_get_ok(uint64_t owner) {
- LDKCResult_TxOutAccessErrorZ* owner_conv = (LDKCResult_TxOutAccessErrorZ*)untag_ptr(owner);
- LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut");
- *ret_ref = CResult_TxOutAccessErrorZ_get_ok(owner_conv);
- return tag_ptr(ret_ref, true);
-}
-
-static inline enum LDKAccessError CResult_TxOutAccessErrorZ_get_err(LDKCResult_TxOutAccessErrorZ *NONNULL_PTR owner){
-CHECK(!owner->result_ok);
- return AccessError_clone(&*owner->contents.err);
-}
-uint32_t __attribute__((export_name("TS_CResult_TxOutAccessErrorZ_get_err"))) TS_CResult_TxOutAccessErrorZ_get_err(uint64_t owner) {
- LDKCResult_TxOutAccessErrorZ* owner_conv = (LDKCResult_TxOutAccessErrorZ*)untag_ptr(owner);
- uint32_t ret_conv = LDKAccessError_to_js(CResult_TxOutAccessErrorZ_get_err(owner_conv));
- return ret_conv;
-}
-
static inline uintptr_t C2Tuple_usizeTransactionZ_get_a(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR owner){
return owner->a;
}
}
return ret;
}
-static inline LDKCVec_TxidZ CVec_TxidZ_clone(const LDKCVec_TxidZ *orig) {
- LDKCVec_TxidZ ret = { .data = MALLOC(sizeof(LDKThirtyTwoBytes) * orig->datalen, "LDKCVec_TxidZ clone bytes"), .datalen = orig->datalen };
- for (size_t i = 0; i < ret.datalen; i++) {
- ret.data[i] = ThirtyTwoBytes_clone(&orig->data[i]);
- }
- return ret;
-}
-static inline void CResult_NoneChannelMonitorUpdateErrZ_get_ok(LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR owner){
-CHECK(owner->result_ok);
- return *owner->contents.result;
+static inline struct LDKThirtyTwoBytes C2Tuple_TxidBlockHashZ_get_a(LDKC2Tuple_TxidBlockHashZ *NONNULL_PTR owner){
+ return ThirtyTwoBytes_clone(&owner->a);
}
-void __attribute__((export_name("TS_CResult_NoneChannelMonitorUpdateErrZ_get_ok"))) TS_CResult_NoneChannelMonitorUpdateErrZ_get_ok(uint64_t owner) {
- LDKCResult_NoneChannelMonitorUpdateErrZ* owner_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)untag_ptr(owner);
- CResult_NoneChannelMonitorUpdateErrZ_get_ok(owner_conv);
+int8_tArray __attribute__((export_name("TS_C2Tuple_TxidBlockHashZ_get_a"))) TS_C2Tuple_TxidBlockHashZ_get_a(uint64_t owner) {
+ LDKC2Tuple_TxidBlockHashZ* owner_conv = (LDKC2Tuple_TxidBlockHashZ*)untag_ptr(owner);
+ int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
+ memcpy(ret_arr->elems, C2Tuple_TxidBlockHashZ_get_a(owner_conv).data, 32);
+ return ret_arr;
}
-static inline enum LDKChannelMonitorUpdateErr CResult_NoneChannelMonitorUpdateErrZ_get_err(LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR owner){
-CHECK(!owner->result_ok);
- return ChannelMonitorUpdateErr_clone(&*owner->contents.err);
+static inline struct LDKThirtyTwoBytes C2Tuple_TxidBlockHashZ_get_b(LDKC2Tuple_TxidBlockHashZ *NONNULL_PTR owner){
+ return ThirtyTwoBytes_clone(&owner->b);
}
-uint32_t __attribute__((export_name("TS_CResult_NoneChannelMonitorUpdateErrZ_get_err"))) TS_CResult_NoneChannelMonitorUpdateErrZ_get_err(uint64_t owner) {
- LDKCResult_NoneChannelMonitorUpdateErrZ* owner_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)untag_ptr(owner);
- uint32_t ret_conv = LDKChannelMonitorUpdateErr_to_js(CResult_NoneChannelMonitorUpdateErrZ_get_err(owner_conv));
- return ret_conv;
+int8_tArray __attribute__((export_name("TS_C2Tuple_TxidBlockHashZ_get_b"))) TS_C2Tuple_TxidBlockHashZ_get_b(uint64_t owner) {
+ LDKC2Tuple_TxidBlockHashZ* owner_conv = (LDKC2Tuple_TxidBlockHashZ*)untag_ptr(owner);
+ int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
+ memcpy(ret_arr->elems, C2Tuple_TxidBlockHashZ_get_b(owner_conv).data, 32);
+ return ret_arr;
}
+static inline LDKCVec_C2Tuple_TxidBlockHashZZ CVec_C2Tuple_TxidBlockHashZZ_clone(const LDKCVec_C2Tuple_TxidBlockHashZZ *orig) {
+ LDKCVec_C2Tuple_TxidBlockHashZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_TxidBlockHashZ) * orig->datalen, "LDKCVec_C2Tuple_TxidBlockHashZZ clone bytes"), .datalen = orig->datalen };
+ for (size_t i = 0; i < ret.datalen; i++) {
+ ret.data[i] = C2Tuple_TxidBlockHashZ_clone(&orig->data[i]);
+ }
+ return ret;
+}
uint32_t __attribute__((export_name("TS_LDKMonitorEvent_ty_from_ptr"))) TS_LDKMonitorEvent_ty_from_ptr(uint64_t ptr) {
LDKMonitorEvent *obj = (LDKMonitorEvent*)untag_ptr(ptr);
switch(obj->tag) {
case LDKMonitorEvent_HTLCEvent: return 0;
case LDKMonitorEvent_CommitmentTxConfirmed: return 1;
- case LDKMonitorEvent_UpdateCompleted: return 2;
+ case LDKMonitorEvent_Completed: return 2;
case LDKMonitorEvent_UpdateFailed: return 3;
default: abort();
}
commitment_tx_confirmed_ref = tag_ptr(commitment_tx_confirmed_var.inner, false);
return commitment_tx_confirmed_ref;
}
-uint64_t __attribute__((export_name("TS_LDKMonitorEvent_UpdateCompleted_get_funding_txo"))) TS_LDKMonitorEvent_UpdateCompleted_get_funding_txo(uint64_t ptr) {
+uint64_t __attribute__((export_name("TS_LDKMonitorEvent_Completed_get_funding_txo"))) TS_LDKMonitorEvent_Completed_get_funding_txo(uint64_t ptr) {
LDKMonitorEvent *obj = (LDKMonitorEvent*)untag_ptr(ptr);
- assert(obj->tag == LDKMonitorEvent_UpdateCompleted);
- LDKOutPoint funding_txo_var = obj->update_completed.funding_txo;
+ assert(obj->tag == LDKMonitorEvent_Completed);
+ LDKOutPoint funding_txo_var = obj->completed.funding_txo;
uint64_t funding_txo_ref = 0;
CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_var);
funding_txo_ref = tag_ptr(funding_txo_var.inner, false);
return funding_txo_ref;
}
-int64_t __attribute__((export_name("TS_LDKMonitorEvent_UpdateCompleted_get_monitor_update_id"))) TS_LDKMonitorEvent_UpdateCompleted_get_monitor_update_id(uint64_t ptr) {
+int64_t __attribute__((export_name("TS_LDKMonitorEvent_Completed_get_monitor_update_id"))) TS_LDKMonitorEvent_Completed_get_monitor_update_id(uint64_t ptr) {
LDKMonitorEvent *obj = (LDKMonitorEvent*)untag_ptr(ptr);
- assert(obj->tag == LDKMonitorEvent_UpdateCompleted);
- int64_t monitor_update_id_conv = obj->update_completed.monitor_update_id;
+ assert(obj->tag == LDKMonitorEvent_Completed);
+ int64_t monitor_update_id_conv = obj->completed.monitor_update_id;
return monitor_update_id_conv;
}
uint64_t __attribute__((export_name("TS_LDKMonitorEvent_UpdateFailed_get_update_failed"))) TS_LDKMonitorEvent_UpdateFailed_get_update_failed(uint64_t ptr) {
}
return ret;
}
-uint32_t __attribute__((export_name("TS_LDKCOption_C2Tuple_usizeTransactionZZ_ty_from_ptr"))) TS_LDKCOption_C2Tuple_usizeTransactionZZ_ty_from_ptr(uint64_t ptr) {
- LDKCOption_C2Tuple_usizeTransactionZZ *obj = (LDKCOption_C2Tuple_usizeTransactionZZ*)untag_ptr(ptr);
- switch(obj->tag) {
- case LDKCOption_C2Tuple_usizeTransactionZZ_Some: return 0;
- case LDKCOption_C2Tuple_usizeTransactionZZ_None: return 1;
- default: abort();
- }
-}
-uint64_t __attribute__((export_name("TS_LDKCOption_C2Tuple_usizeTransactionZZ_Some_get_some"))) TS_LDKCOption_C2Tuple_usizeTransactionZZ_Some_get_some(uint64_t ptr) {
- LDKCOption_C2Tuple_usizeTransactionZZ *obj = (LDKCOption_C2Tuple_usizeTransactionZZ*)untag_ptr(ptr);
- assert(obj->tag == LDKCOption_C2Tuple_usizeTransactionZZ_Some);
- LDKC2Tuple_usizeTransactionZ* some_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ");
- *some_conv = obj->some;
- *some_conv = C2Tuple_usizeTransactionZ_clone(some_conv);
- return tag_ptr(some_conv, true);
-}
static inline struct LDKFixedPenaltyScorer CResult_FixedPenaltyScorerDecodeErrorZ_get_ok(LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR owner){
LDKFixedPenaltyScorer ret = *owner->contents.result;
ret.is_owned = false;
}
static inline struct LDKDecodeError CResult_FixedPenaltyScorerDecodeErrorZ_get_err(LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
uint64_t __attribute__((export_name("TS_CResult_FixedPenaltyScorerDecodeErrorZ_get_err"))) TS_CResult_FixedPenaltyScorerDecodeErrorZ_get_err(uint64_t owner) {
LDKCResult_FixedPenaltyScorerDecodeErrorZ* owner_conv = (LDKCResult_FixedPenaltyScorerDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_FixedPenaltyScorerDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_FixedPenaltyScorerDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
*some_conv = C2Tuple_u64u64Z_clone(some_conv);
return tag_ptr(some_conv, true);
}
+static inline struct LDKEightU16s C2Tuple_Z_get_a(LDKC2Tuple_Z *NONNULL_PTR owner){
+ return owner->a;
+}
+int16_tArray __attribute__((export_name("TS_C2Tuple_Z_get_a"))) TS_C2Tuple_Z_get_a(uint64_t owner) {
+ LDKC2Tuple_Z* owner_conv = (LDKC2Tuple_Z*)untag_ptr(owner);
+ int16_tArray ret_arr = init_int16_tArray(8, __LINE__);
+ memcpy(ret_arr->elems, C2Tuple_Z_get_a(owner_conv).data, 8 * 2);
+ return ret_arr;
+}
+
+static inline struct LDKEightU16s C2Tuple_Z_get_b(LDKC2Tuple_Z *NONNULL_PTR owner){
+ return owner->b;
+}
+int16_tArray __attribute__((export_name("TS_C2Tuple_Z_get_b"))) TS_C2Tuple_Z_get_b(uint64_t owner) {
+ LDKC2Tuple_Z* owner_conv = (LDKC2Tuple_Z*)untag_ptr(owner);
+ int16_tArray ret_arr = init_int16_tArray(8, __LINE__);
+ memcpy(ret_arr->elems, C2Tuple_Z_get_b(owner_conv).data, 8 * 2);
+ return ret_arr;
+}
+
+static inline struct LDKEightU16s C2Tuple__u168_u168Z_get_a(LDKC2Tuple__u168_u168Z *NONNULL_PTR owner){
+ return owner->a;
+}
+int16_tArray __attribute__((export_name("TS_C2Tuple__u168_u168Z_get_a"))) TS_C2Tuple__u168_u168Z_get_a(uint64_t owner) {
+ LDKC2Tuple__u168_u168Z* owner_conv = (LDKC2Tuple__u168_u168Z*)untag_ptr(owner);
+ int16_tArray ret_arr = init_int16_tArray(8, __LINE__);
+ memcpy(ret_arr->elems, C2Tuple__u168_u168Z_get_a(owner_conv).data, 8 * 2);
+ return ret_arr;
+}
+
+static inline struct LDKEightU16s C2Tuple__u168_u168Z_get_b(LDKC2Tuple__u168_u168Z *NONNULL_PTR owner){
+ return owner->b;
+}
+int16_tArray __attribute__((export_name("TS_C2Tuple__u168_u168Z_get_b"))) TS_C2Tuple__u168_u168Z_get_b(uint64_t owner) {
+ LDKC2Tuple__u168_u168Z* owner_conv = (LDKC2Tuple__u168_u168Z*)untag_ptr(owner);
+ int16_tArray ret_arr = init_int16_tArray(8, __LINE__);
+ memcpy(ret_arr->elems, C2Tuple__u168_u168Z_get_b(owner_conv).data, 8 * 2);
+ return ret_arr;
+}
+
+uint32_t __attribute__((export_name("TS_LDKCOption_C2Tuple_EightU16sEightU16sZZ_ty_from_ptr"))) TS_LDKCOption_C2Tuple_EightU16sEightU16sZZ_ty_from_ptr(uint64_t ptr) {
+ LDKCOption_C2Tuple_EightU16sEightU16sZZ *obj = (LDKCOption_C2Tuple_EightU16sEightU16sZZ*)untag_ptr(ptr);
+ switch(obj->tag) {
+ case LDKCOption_C2Tuple_EightU16sEightU16sZZ_Some: return 0;
+ case LDKCOption_C2Tuple_EightU16sEightU16sZZ_None: return 1;
+ default: abort();
+ }
+}
+uint64_t __attribute__((export_name("TS_LDKCOption_C2Tuple_EightU16sEightU16sZZ_Some_get_some"))) TS_LDKCOption_C2Tuple_EightU16sEightU16sZZ_Some_get_some(uint64_t ptr) {
+ LDKCOption_C2Tuple_EightU16sEightU16sZZ *obj = (LDKCOption_C2Tuple_EightU16sEightU16sZZ*)untag_ptr(ptr);
+ assert(obj->tag == LDKCOption_C2Tuple_EightU16sEightU16sZZ_Some);
+ LDKC2Tuple__u168_u168Z* some_conv = MALLOC(sizeof(LDKC2Tuple__u168_u168Z), "LDKC2Tuple__u168_u168Z");
+ *some_conv = obj->some;
+ *some_conv = C2Tuple__u168_u168Z_clone(some_conv);
+ return tag_ptr(some_conv, true);
+}
static inline LDKCVec_NodeIdZ CVec_NodeIdZ_clone(const LDKCVec_NodeIdZ *orig) {
LDKCVec_NodeIdZ ret = { .data = MALLOC(sizeof(LDKNodeId) * orig->datalen, "LDKCVec_NodeIdZ clone bytes"), .datalen = orig->datalen };
for (size_t i = 0; i < ret.datalen; i++) {
}
static inline struct LDKDecodeError CResult_ProbabilisticScorerDecodeErrorZ_get_err(LDKCResult_ProbabilisticScorerDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
uint64_t __attribute__((export_name("TS_CResult_ProbabilisticScorerDecodeErrorZ_get_err"))) TS_CResult_ProbabilisticScorerDecodeErrorZ_get_err(uint64_t owner) {
LDKCResult_ProbabilisticScorerDecodeErrorZ* owner_conv = (LDKCResult_ProbabilisticScorerDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_ProbabilisticScorerDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_ProbabilisticScorerDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_InitFeaturesDecodeErrorZ_get_err(LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
uint64_t __attribute__((export_name("TS_CResult_InitFeaturesDecodeErrorZ_get_err"))) TS_CResult_InitFeaturesDecodeErrorZ_get_err(uint64_t owner) {
LDKCResult_InitFeaturesDecodeErrorZ* owner_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_InitFeaturesDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_InitFeaturesDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_ChannelFeaturesDecodeErrorZ_get_err(LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
uint64_t __attribute__((export_name("TS_CResult_ChannelFeaturesDecodeErrorZ_get_err"))) TS_CResult_ChannelFeaturesDecodeErrorZ_get_err(uint64_t owner) {
LDKCResult_ChannelFeaturesDecodeErrorZ* owner_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_ChannelFeaturesDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_ChannelFeaturesDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_NodeFeaturesDecodeErrorZ_get_err(LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
uint64_t __attribute__((export_name("TS_CResult_NodeFeaturesDecodeErrorZ_get_err"))) TS_CResult_NodeFeaturesDecodeErrorZ_get_err(uint64_t owner) {
LDKCResult_NodeFeaturesDecodeErrorZ* owner_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_NodeFeaturesDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_NodeFeaturesDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_InvoiceFeaturesDecodeErrorZ_get_err(LDKCResult_InvoiceFeaturesDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
uint64_t __attribute__((export_name("TS_CResult_InvoiceFeaturesDecodeErrorZ_get_err"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_get_err(uint64_t owner) {
LDKCResult_InvoiceFeaturesDecodeErrorZ* owner_conv = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_InvoiceFeaturesDecodeErrorZ_get_err(owner_conv);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_InvoiceFeaturesDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+static inline struct LDKBlindedHopFeatures CResult_BlindedHopFeaturesDecodeErrorZ_get_ok(LDKCResult_BlindedHopFeaturesDecodeErrorZ *NONNULL_PTR owner){
+ LDKBlindedHopFeatures ret = *owner->contents.result;
+ ret.is_owned = false;
+ return ret;
+}
+uint64_t __attribute__((export_name("TS_CResult_BlindedHopFeaturesDecodeErrorZ_get_ok"))) TS_CResult_BlindedHopFeaturesDecodeErrorZ_get_ok(uint64_t owner) {
+ LDKCResult_BlindedHopFeaturesDecodeErrorZ* owner_conv = (LDKCResult_BlindedHopFeaturesDecodeErrorZ*)untag_ptr(owner);
+ LDKBlindedHopFeatures ret_var = CResult_BlindedHopFeaturesDecodeErrorZ_get_ok(owner_conv);
uint64_t ret_ref = 0;
CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
return ret_ref;
}
+static inline struct LDKDecodeError CResult_BlindedHopFeaturesDecodeErrorZ_get_err(LDKCResult_BlindedHopFeaturesDecodeErrorZ *NONNULL_PTR owner){
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
+}
+uint64_t __attribute__((export_name("TS_CResult_BlindedHopFeaturesDecodeErrorZ_get_err"))) TS_CResult_BlindedHopFeaturesDecodeErrorZ_get_err(uint64_t owner) {
+ LDKCResult_BlindedHopFeaturesDecodeErrorZ* owner_conv = (LDKCResult_BlindedHopFeaturesDecodeErrorZ*)untag_ptr(owner);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_BlindedHopFeaturesDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
static inline struct LDKChannelTypeFeatures CResult_ChannelTypeFeaturesDecodeErrorZ_get_ok(LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR owner){
LDKChannelTypeFeatures ret = *owner->contents.result;
ret.is_owned = false;
}
static inline struct LDKDecodeError CResult_ChannelTypeFeaturesDecodeErrorZ_get_err(LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
uint64_t __attribute__((export_name("TS_CResult_ChannelTypeFeaturesDecodeErrorZ_get_err"))) TS_CResult_ChannelTypeFeaturesDecodeErrorZ_get_err(uint64_t owner) {
LDKCResult_ChannelTypeFeaturesDecodeErrorZ* owner_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_ChannelTypeFeaturesDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_ChannelTypeFeaturesDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_NodeIdDecodeErrorZ_get_err(LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
uint64_t __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_get_err"))) TS_CResult_NodeIdDecodeErrorZ_get_err(uint64_t owner) {
LDKCResult_NodeIdDecodeErrorZ* owner_conv = (LDKCResult_NodeIdDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_NodeIdDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_NodeIdDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_COption_NetworkUpdateZDecodeErrorZ_get_err(LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
uint64_t __attribute__((export_name("TS_CResult_COption_NetworkUpdateZDecodeErrorZ_get_err"))) TS_CResult_COption_NetworkUpdateZDecodeErrorZ_get_err(uint64_t owner) {
LDKCResult_COption_NetworkUpdateZDecodeErrorZ* owner_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_COption_NetworkUpdateZDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_COption_NetworkUpdateZDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
-typedef struct LDKAccess_JCalls {
+static inline struct LDKTxOut CResult_TxOutUtxoLookupErrorZ_get_ok(LDKCResult_TxOutUtxoLookupErrorZ *NONNULL_PTR owner){
+CHECK(owner->result_ok);
+ return TxOut_clone(&*owner->contents.result);
+}
+uint64_t __attribute__((export_name("TS_CResult_TxOutUtxoLookupErrorZ_get_ok"))) TS_CResult_TxOutUtxoLookupErrorZ_get_ok(uint64_t owner) {
+ LDKCResult_TxOutUtxoLookupErrorZ* owner_conv = (LDKCResult_TxOutUtxoLookupErrorZ*)untag_ptr(owner);
+ LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut");
+ *ret_ref = CResult_TxOutUtxoLookupErrorZ_get_ok(owner_conv);
+ return tag_ptr(ret_ref, true);
+}
+
+static inline enum LDKUtxoLookupError CResult_TxOutUtxoLookupErrorZ_get_err(LDKCResult_TxOutUtxoLookupErrorZ *NONNULL_PTR owner){
+CHECK(!owner->result_ok);
+ return UtxoLookupError_clone(&*owner->contents.err);
+}
+uint32_t __attribute__((export_name("TS_CResult_TxOutUtxoLookupErrorZ_get_err"))) TS_CResult_TxOutUtxoLookupErrorZ_get_err(uint64_t owner) {
+ LDKCResult_TxOutUtxoLookupErrorZ* owner_conv = (LDKCResult_TxOutUtxoLookupErrorZ*)untag_ptr(owner);
+ uint32_t ret_conv = LDKUtxoLookupError_to_js(CResult_TxOutUtxoLookupErrorZ_get_err(owner_conv));
+ return ret_conv;
+}
+
+uint32_t __attribute__((export_name("TS_LDKUtxoResult_ty_from_ptr"))) TS_LDKUtxoResult_ty_from_ptr(uint64_t ptr) {
+ LDKUtxoResult *obj = (LDKUtxoResult*)untag_ptr(ptr);
+ switch(obj->tag) {
+ case LDKUtxoResult_Sync: return 0;
+ case LDKUtxoResult_Async: return 1;
+ default: abort();
+ }
+}
+uint64_t __attribute__((export_name("TS_LDKUtxoResult_Sync_get_sync"))) TS_LDKUtxoResult_Sync_get_sync(uint64_t ptr) {
+ LDKUtxoResult *obj = (LDKUtxoResult*)untag_ptr(ptr);
+ assert(obj->tag == LDKUtxoResult_Sync);
+ LDKCResult_TxOutUtxoLookupErrorZ* sync_conv = MALLOC(sizeof(LDKCResult_TxOutUtxoLookupErrorZ), "LDKCResult_TxOutUtxoLookupErrorZ");
+ *sync_conv = obj->sync;
+ *sync_conv = CResult_TxOutUtxoLookupErrorZ_clone(sync_conv);
+ return tag_ptr(sync_conv, true);
+}
+uint64_t __attribute__((export_name("TS_LDKUtxoResult_Async_get_async"))) TS_LDKUtxoResult_Async_get_async(uint64_t ptr) {
+ LDKUtxoResult *obj = (LDKUtxoResult*)untag_ptr(ptr);
+ assert(obj->tag == LDKUtxoResult_Async);
+ LDKUtxoFuture async_var = obj->async;
+ uint64_t async_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(async_var);
+ async_ref = tag_ptr(async_var.inner, false);
+ return async_ref;
+}
+typedef struct LDKUtxoLookup_JCalls {
atomic_size_t refcnt;
uint32_t instance_ptr;
-} LDKAccess_JCalls;
-static void LDKAccess_JCalls_free(void* this_arg) {
- LDKAccess_JCalls *j_calls = (LDKAccess_JCalls*) this_arg;
+} LDKUtxoLookup_JCalls;
+static void LDKUtxoLookup_JCalls_free(void* this_arg) {
+ LDKUtxoLookup_JCalls *j_calls = (LDKUtxoLookup_JCalls*) this_arg;
if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
FREE(j_calls);
}
}
-LDKCResult_TxOutAccessErrorZ get_utxo_LDKAccess_jcall(const void* this_arg, const uint8_t (* genesis_hash)[32], uint64_t short_channel_id) {
- LDKAccess_JCalls *j_calls = (LDKAccess_JCalls*) this_arg;
+LDKUtxoResult get_utxo_LDKUtxoLookup_jcall(const void* this_arg, const uint8_t (* genesis_hash)[32], uint64_t short_channel_id) {
+ LDKUtxoLookup_JCalls *j_calls = (LDKUtxoLookup_JCalls*) this_arg;
int8_tArray genesis_hash_arr = init_int8_tArray(32, __LINE__);
memcpy(genesis_hash_arr->elems, *genesis_hash, 32);
int64_t short_channel_id_conv = short_channel_id;
- uint32_t ret = js_invoke_function_ubuuuu(j_calls->instance_ptr, 1, (uint32_t)genesis_hash_arr, short_channel_id_conv, 0, 0, 0, 0);
+ uint64_t ret = js_invoke_function_ubuuuu(j_calls->instance_ptr, 1, (uint32_t)genesis_hash_arr, short_channel_id_conv, 0, 0, 0, 0);
void* ret_ptr = untag_ptr(ret);
CHECK_ACCESS(ret_ptr);
- LDKCResult_TxOutAccessErrorZ ret_conv = *(LDKCResult_TxOutAccessErrorZ*)(ret_ptr);
+ LDKUtxoResult ret_conv = *(LDKUtxoResult*)(ret_ptr);
FREE(untag_ptr(ret));
return ret_conv;
}
-static void LDKAccess_JCalls_cloned(LDKAccess* new_obj) {
- LDKAccess_JCalls *j_calls = (LDKAccess_JCalls*) new_obj->this_arg;
+static void LDKUtxoLookup_JCalls_cloned(LDKUtxoLookup* new_obj) {
+ LDKUtxoLookup_JCalls *j_calls = (LDKUtxoLookup_JCalls*) new_obj->this_arg;
atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
}
-static inline LDKAccess LDKAccess_init (JSValue o) {
- LDKAccess_JCalls *calls = MALLOC(sizeof(LDKAccess_JCalls), "LDKAccess_JCalls");
+static inline LDKUtxoLookup LDKUtxoLookup_init (JSValue o) {
+ LDKUtxoLookup_JCalls *calls = MALLOC(sizeof(LDKUtxoLookup_JCalls), "LDKUtxoLookup_JCalls");
atomic_init(&calls->refcnt, 1);
calls->instance_ptr = o;
- LDKAccess ret = {
+ LDKUtxoLookup ret = {
.this_arg = (void*) calls,
- .get_utxo = get_utxo_LDKAccess_jcall,
- .free = LDKAccess_JCalls_free,
+ .get_utxo = get_utxo_LDKUtxoLookup_jcall,
+ .free = LDKUtxoLookup_JCalls_free,
};
return ret;
}
-uint64_t __attribute__((export_name("TS_LDKAccess_new"))) TS_LDKAccess_new(JSValue o) {
- LDKAccess *res_ptr = MALLOC(sizeof(LDKAccess), "LDKAccess");
- *res_ptr = LDKAccess_init(o);
+uint64_t __attribute__((export_name("TS_LDKUtxoLookup_new"))) TS_LDKUtxoLookup_new(JSValue o) {
+ LDKUtxoLookup *res_ptr = MALLOC(sizeof(LDKUtxoLookup), "LDKUtxoLookup");
+ *res_ptr = LDKUtxoLookup_init(o);
return tag_ptr(res_ptr, true);
}
-uint64_t __attribute__((export_name("TS_Access_get_utxo"))) TS_Access_get_utxo(uint64_t this_arg, int8_tArray genesis_hash, int64_t short_channel_id) {
+uint64_t __attribute__((export_name("TS_UtxoLookup_get_utxo"))) TS_UtxoLookup_get_utxo(uint64_t this_arg, int8_tArray genesis_hash, int64_t short_channel_id) {
void* this_arg_ptr = untag_ptr(this_arg);
if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
- LDKAccess* this_arg_conv = (LDKAccess*)this_arg_ptr;
- unsigned char genesis_hash_arr[32];
+ LDKUtxoLookup* this_arg_conv = (LDKUtxoLookup*)this_arg_ptr;
+ uint8_t genesis_hash_arr[32];
CHECK(genesis_hash->arr_len == 32);
memcpy(genesis_hash_arr, genesis_hash->elems, 32); FREE(genesis_hash);
- unsigned char (*genesis_hash_ref)[32] = &genesis_hash_arr;
- LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ");
- *ret_conv = (this_arg_conv->get_utxo)(this_arg_conv->this_arg, genesis_hash_ref, short_channel_id);
- return tag_ptr(ret_conv, true);
+ uint8_t (*genesis_hash_ref)[32] = &genesis_hash_arr;
+ LDKUtxoResult *ret_copy = MALLOC(sizeof(LDKUtxoResult), "LDKUtxoResult");
+ *ret_copy = (this_arg_conv->get_utxo)(this_arg_conv->this_arg, genesis_hash_ref, short_channel_id);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
}
-uint32_t __attribute__((export_name("TS_LDKCOption_AccessZ_ty_from_ptr"))) TS_LDKCOption_AccessZ_ty_from_ptr(uint64_t ptr) {
- LDKCOption_AccessZ *obj = (LDKCOption_AccessZ*)untag_ptr(ptr);
+uint32_t __attribute__((export_name("TS_LDKCOption_UtxoLookupZ_ty_from_ptr"))) TS_LDKCOption_UtxoLookupZ_ty_from_ptr(uint64_t ptr) {
+ LDKCOption_UtxoLookupZ *obj = (LDKCOption_UtxoLookupZ*)untag_ptr(ptr);
switch(obj->tag) {
- case LDKCOption_AccessZ_Some: return 0;
- case LDKCOption_AccessZ_None: return 1;
+ case LDKCOption_UtxoLookupZ_Some: return 0;
+ case LDKCOption_UtxoLookupZ_None: return 1;
default: abort();
}
}
-uint64_t __attribute__((export_name("TS_LDKCOption_AccessZ_Some_get_some"))) TS_LDKCOption_AccessZ_Some_get_some(uint64_t ptr) {
- LDKCOption_AccessZ *obj = (LDKCOption_AccessZ*)untag_ptr(ptr);
- assert(obj->tag == LDKCOption_AccessZ_Some);
- LDKAccess* some_ret = MALLOC(sizeof(LDKAccess), "LDKAccess");
+uint64_t __attribute__((export_name("TS_LDKCOption_UtxoLookupZ_Some_get_some"))) TS_LDKCOption_UtxoLookupZ_Some_get_some(uint64_t ptr) {
+ LDKCOption_UtxoLookupZ *obj = (LDKCOption_UtxoLookupZ*)untag_ptr(ptr);
+ assert(obj->tag == LDKCOption_UtxoLookupZ_Some);
+ LDKUtxoLookup* some_ret = MALLOC(sizeof(LDKUtxoLookup), "LDKUtxoLookup");
*some_ret = obj->some;
// WARNING: We likely need to clone here, but no clone is available, so we just do it for Java instances
- if ((*some_ret).free == LDKAccess_JCalls_free) {
+ if ((*some_ret).free == LDKUtxoLookup_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
- LDKAccess_JCalls_cloned(&(*some_ret));
+ LDKUtxoLookup_JCalls_cloned(&(*some_ret));
}
return tag_ptr(some_ret, true);
}
return ret_ref;
}
-static inline LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_clone(const LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *orig) {
- LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ ret = { .data = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ) * orig->datalen, "LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ clone bytes"), .datalen = orig->datalen };
- for (size_t i = 0; i < ret.datalen; i++) {
- ret.data[i] = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(&orig->data[i]);
+uint32_t __attribute__((export_name("TS_LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_ty_from_ptr"))) TS_LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_ty_from_ptr(uint64_t ptr) {
+ LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *obj = (LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ*)untag_ptr(ptr);
+ switch(obj->tag) {
+ case LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Some: return 0;
+ case LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_None: return 1;
+ default: abort();
}
- return ret;
}
-static inline LDKCVec_NodeAnnouncementZ CVec_NodeAnnouncementZ_clone(const LDKCVec_NodeAnnouncementZ *orig) {
- LDKCVec_NodeAnnouncementZ ret = { .data = MALLOC(sizeof(LDKNodeAnnouncement) * orig->datalen, "LDKCVec_NodeAnnouncementZ clone bytes"), .datalen = orig->datalen };
- for (size_t i = 0; i < ret.datalen; i++) {
- ret.data[i] = NodeAnnouncement_clone(&orig->data[i]);
- }
- return ret;
+uint64_t __attribute__((export_name("TS_LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Some_get_some"))) TS_LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Some_get_some(uint64_t ptr) {
+ LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *obj = (LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ*)untag_ptr(ptr);
+ assert(obj->tag == LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Some);
+ LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* some_conv = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ");
+ *some_conv = obj->some;
+ *some_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(some_conv);
+ return tag_ptr(some_conv, true);
}
static inline void CResult_NoneLightningErrorZ_get_ok(LDKCResult_NoneLightningErrorZ *NONNULL_PTR owner){
CHECK(owner->result_ok);
}
static inline struct LDKDecodeError CResult_ChannelUpdateInfoDecodeErrorZ_get_err(LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
uint64_t __attribute__((export_name("TS_CResult_ChannelUpdateInfoDecodeErrorZ_get_err"))) TS_CResult_ChannelUpdateInfoDecodeErrorZ_get_err(uint64_t owner) {
LDKCResult_ChannelUpdateInfoDecodeErrorZ* owner_conv = (LDKCResult_ChannelUpdateInfoDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_ChannelUpdateInfoDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_ChannelUpdateInfoDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_ChannelInfoDecodeErrorZ_get_err(LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
uint64_t __attribute__((export_name("TS_CResult_ChannelInfoDecodeErrorZ_get_err"))) TS_CResult_ChannelInfoDecodeErrorZ_get_err(uint64_t owner) {
LDKCResult_ChannelInfoDecodeErrorZ* owner_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_ChannelInfoDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_ChannelInfoDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_RoutingFeesDecodeErrorZ_get_err(LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
uint64_t __attribute__((export_name("TS_CResult_RoutingFeesDecodeErrorZ_get_err"))) TS_CResult_RoutingFeesDecodeErrorZ_get_err(uint64_t owner) {
LDKCResult_RoutingFeesDecodeErrorZ* owner_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_RoutingFeesDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_RoutingFeesDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_NodeAnnouncementInfoDecodeErrorZ_get_err(LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
uint64_t __attribute__((export_name("TS_CResult_NodeAnnouncementInfoDecodeErrorZ_get_err"))) TS_CResult_NodeAnnouncementInfoDecodeErrorZ_get_err(uint64_t owner) {
LDKCResult_NodeAnnouncementInfoDecodeErrorZ* owner_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_NodeAnnouncementInfoDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_NodeAnnouncementInfoDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_NodeAliasDecodeErrorZ_get_err(LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
uint64_t __attribute__((export_name("TS_CResult_NodeAliasDecodeErrorZ_get_err"))) TS_CResult_NodeAliasDecodeErrorZ_get_err(uint64_t owner) {
LDKCResult_NodeAliasDecodeErrorZ* owner_conv = (LDKCResult_NodeAliasDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_NodeAliasDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_NodeAliasDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_NodeInfoDecodeErrorZ_get_err(LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
uint64_t __attribute__((export_name("TS_CResult_NodeInfoDecodeErrorZ_get_err"))) TS_CResult_NodeInfoDecodeErrorZ_get_err(uint64_t owner) {
LDKCResult_NodeInfoDecodeErrorZ* owner_conv = (LDKCResult_NodeInfoDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_NodeInfoDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_NodeInfoDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_NetworkGraphDecodeErrorZ_get_err(LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
uint64_t __attribute__((export_name("TS_CResult_NetworkGraphDecodeErrorZ_get_err"))) TS_CResult_NetworkGraphDecodeErrorZ_get_err(uint64_t owner) {
LDKCResult_NetworkGraphDecodeErrorZ* owner_conv = (LDKCResult_NetworkGraphDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_NetworkGraphDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_NetworkGraphDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_err(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
uint64_t __attribute__((export_name("TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_err"))) TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_err(uint64_t owner) {
LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_err(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
uint64_t __attribute__((export_name("TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_err"))) TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_err(uint64_t owner) {
LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_SpendableOutputDescriptorDecodeErrorZ_get_err(LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
uint64_t __attribute__((export_name("TS_CResult_SpendableOutputDescriptorDecodeErrorZ_get_err"))) TS_CResult_SpendableOutputDescriptorDecodeErrorZ_get_err(uint64_t owner) {
LDKCResult_SpendableOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_SpendableOutputDescriptorDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_SpendableOutputDescriptorDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
CResult_SignatureNoneZ_get_err(owner_conv);
}
-static inline struct LDKSignature C2Tuple_SignatureSignatureZ_get_a(LDKC2Tuple_SignatureSignatureZ *NONNULL_PTR owner){
- return owner->a;
+static inline struct LDKPublicKey CResult_PublicKeyNoneZ_get_ok(LDKCResult_PublicKeyNoneZ *NONNULL_PTR owner){
+CHECK(owner->result_ok);
+ return *owner->contents.result;
}
-int8_tArray __attribute__((export_name("TS_C2Tuple_SignatureSignatureZ_get_a"))) TS_C2Tuple_SignatureSignatureZ_get_a(uint64_t owner) {
- LDKC2Tuple_SignatureSignatureZ* owner_conv = (LDKC2Tuple_SignatureSignatureZ*)untag_ptr(owner);
- int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
- memcpy(ret_arr->elems, C2Tuple_SignatureSignatureZ_get_a(owner_conv).compact_form, 64);
+int8_tArray __attribute__((export_name("TS_CResult_PublicKeyNoneZ_get_ok"))) TS_CResult_PublicKeyNoneZ_get_ok(uint64_t owner) {
+ LDKCResult_PublicKeyNoneZ* owner_conv = (LDKCResult_PublicKeyNoneZ*)untag_ptr(owner);
+ int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
+ memcpy(ret_arr->elems, CResult_PublicKeyNoneZ_get_ok(owner_conv).compressed_form, 33);
return ret_arr;
}
-static inline struct LDKSignature C2Tuple_SignatureSignatureZ_get_b(LDKC2Tuple_SignatureSignatureZ *NONNULL_PTR owner){
- return owner->b;
+static inline void CResult_PublicKeyNoneZ_get_err(LDKCResult_PublicKeyNoneZ *NONNULL_PTR owner){
+CHECK(!owner->result_ok);
+ return *owner->contents.err;
}
-int8_tArray __attribute__((export_name("TS_C2Tuple_SignatureSignatureZ_get_b"))) TS_C2Tuple_SignatureSignatureZ_get_b(uint64_t owner) {
- LDKC2Tuple_SignatureSignatureZ* owner_conv = (LDKC2Tuple_SignatureSignatureZ*)untag_ptr(owner);
- int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
- memcpy(ret_arr->elems, C2Tuple_SignatureSignatureZ_get_b(owner_conv).compact_form, 64);
- return ret_arr;
+void __attribute__((export_name("TS_CResult_PublicKeyNoneZ_get_err"))) TS_CResult_PublicKeyNoneZ_get_err(uint64_t owner) {
+ LDKCResult_PublicKeyNoneZ* owner_conv = (LDKCResult_PublicKeyNoneZ*)untag_ptr(owner);
+ CResult_PublicKeyNoneZ_get_err(owner_conv);
}
-static inline struct LDKC2Tuple_SignatureSignatureZ CResult_C2Tuple_SignatureSignatureZNoneZ_get_ok(LDKCResult_C2Tuple_SignatureSignatureZNoneZ *NONNULL_PTR owner){
+uint32_t __attribute__((export_name("TS_LDKCOption_ScalarZ_ty_from_ptr"))) TS_LDKCOption_ScalarZ_ty_from_ptr(uint64_t ptr) {
+ LDKCOption_ScalarZ *obj = (LDKCOption_ScalarZ*)untag_ptr(ptr);
+ switch(obj->tag) {
+ case LDKCOption_ScalarZ_Some: return 0;
+ case LDKCOption_ScalarZ_None: return 1;
+ default: abort();
+ }
+}
+uint64_t __attribute__((export_name("TS_LDKCOption_ScalarZ_Some_get_some"))) TS_LDKCOption_ScalarZ_Some_get_some(uint64_t ptr) {
+ LDKCOption_ScalarZ *obj = (LDKCOption_ScalarZ*)untag_ptr(ptr);
+ assert(obj->tag == LDKCOption_ScalarZ_Some);
+ LDKBigEndianScalar* some_ref = &obj->some;
+ return tag_ptr(some_ref, false);
+}
+static inline struct LDKThirtyTwoBytes CResult_SharedSecretNoneZ_get_ok(LDKCResult_SharedSecretNoneZ *NONNULL_PTR owner){
CHECK(owner->result_ok);
- return C2Tuple_SignatureSignatureZ_clone(&*owner->contents.result);
+ return ThirtyTwoBytes_clone(&*owner->contents.result);
}
-uint64_t __attribute__((export_name("TS_CResult_C2Tuple_SignatureSignatureZNoneZ_get_ok"))) TS_CResult_C2Tuple_SignatureSignatureZNoneZ_get_ok(uint64_t owner) {
- LDKCResult_C2Tuple_SignatureSignatureZNoneZ* owner_conv = (LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)untag_ptr(owner);
- LDKC2Tuple_SignatureSignatureZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureSignatureZ), "LDKC2Tuple_SignatureSignatureZ");
- *ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_get_ok(owner_conv);
- return tag_ptr(ret_conv, true);
+int8_tArray __attribute__((export_name("TS_CResult_SharedSecretNoneZ_get_ok"))) TS_CResult_SharedSecretNoneZ_get_ok(uint64_t owner) {
+ LDKCResult_SharedSecretNoneZ* owner_conv = (LDKCResult_SharedSecretNoneZ*)untag_ptr(owner);
+ int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
+ memcpy(ret_arr->elems, CResult_SharedSecretNoneZ_get_ok(owner_conv).data, 32);
+ return ret_arr;
}
-static inline void CResult_C2Tuple_SignatureSignatureZNoneZ_get_err(LDKCResult_C2Tuple_SignatureSignatureZNoneZ *NONNULL_PTR owner){
+static inline void CResult_SharedSecretNoneZ_get_err(LDKCResult_SharedSecretNoneZ *NONNULL_PTR owner){
CHECK(!owner->result_ok);
return *owner->contents.err;
}
-void __attribute__((export_name("TS_CResult_C2Tuple_SignatureSignatureZNoneZ_get_err"))) TS_CResult_C2Tuple_SignatureSignatureZNoneZ_get_err(uint64_t owner) {
- LDKCResult_C2Tuple_SignatureSignatureZNoneZ* owner_conv = (LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)untag_ptr(owner);
- CResult_C2Tuple_SignatureSignatureZNoneZ_get_err(owner_conv);
+void __attribute__((export_name("TS_CResult_SharedSecretNoneZ_get_err"))) TS_CResult_SharedSecretNoneZ_get_err(uint64_t owner) {
+ LDKCResult_SharedSecretNoneZ* owner_conv = (LDKCResult_SharedSecretNoneZ*)untag_ptr(owner);
+ CResult_SharedSecretNoneZ_get_err(owner_conv);
}
-static inline struct LDKSecretKey CResult_SecretKeyNoneZ_get_ok(LDKCResult_SecretKeyNoneZ *NONNULL_PTR owner){
+static inline struct LDKRecoverableSignature CResult_RecoverableSignatureNoneZ_get_ok(LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR owner){
CHECK(owner->result_ok);
return *owner->contents.result;
}
-int8_tArray __attribute__((export_name("TS_CResult_SecretKeyNoneZ_get_ok"))) TS_CResult_SecretKeyNoneZ_get_ok(uint64_t owner) {
- LDKCResult_SecretKeyNoneZ* owner_conv = (LDKCResult_SecretKeyNoneZ*)untag_ptr(owner);
- int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
- memcpy(ret_arr->elems, CResult_SecretKeyNoneZ_get_ok(owner_conv).bytes, 32);
+int8_tArray __attribute__((export_name("TS_CResult_RecoverableSignatureNoneZ_get_ok"))) TS_CResult_RecoverableSignatureNoneZ_get_ok(uint64_t owner) {
+ LDKCResult_RecoverableSignatureNoneZ* owner_conv = (LDKCResult_RecoverableSignatureNoneZ*)untag_ptr(owner);
+ int8_tArray ret_arr = init_int8_tArray(68, __LINE__);
+ memcpy(ret_arr->elems, CResult_RecoverableSignatureNoneZ_get_ok(owner_conv).serialized_form, 68);
return ret_arr;
}
-static inline void CResult_SecretKeyNoneZ_get_err(LDKCResult_SecretKeyNoneZ *NONNULL_PTR owner){
+static inline void CResult_RecoverableSignatureNoneZ_get_err(LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR owner){
CHECK(!owner->result_ok);
return *owner->contents.err;
}
-void __attribute__((export_name("TS_CResult_SecretKeyNoneZ_get_err"))) TS_CResult_SecretKeyNoneZ_get_err(uint64_t owner) {
- LDKCResult_SecretKeyNoneZ* owner_conv = (LDKCResult_SecretKeyNoneZ*)untag_ptr(owner);
- CResult_SecretKeyNoneZ_get_err(owner_conv);
+void __attribute__((export_name("TS_CResult_RecoverableSignatureNoneZ_get_err"))) TS_CResult_RecoverableSignatureNoneZ_get_err(uint64_t owner) {
+ LDKCResult_RecoverableSignatureNoneZ* owner_conv = (LDKCResult_RecoverableSignatureNoneZ*)untag_ptr(owner);
+ CResult_RecoverableSignatureNoneZ_get_err(owner_conv);
}
-typedef struct LDKBaseSign_JCalls {
+typedef struct LDKChannelSigner_JCalls {
atomic_size_t refcnt;
uint32_t instance_ptr;
-} LDKBaseSign_JCalls;
-static void LDKBaseSign_JCalls_free(void* this_arg) {
- LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
+} LDKChannelSigner_JCalls;
+static void LDKChannelSigner_JCalls_free(void* this_arg) {
+ LDKChannelSigner_JCalls *j_calls = (LDKChannelSigner_JCalls*) this_arg;
if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
FREE(j_calls);
}
}
-LDKPublicKey get_per_commitment_point_LDKBaseSign_jcall(const void* this_arg, uint64_t idx) {
- LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
+LDKPublicKey get_per_commitment_point_LDKChannelSigner_jcall(const void* this_arg, uint64_t idx) {
+ LDKChannelSigner_JCalls *j_calls = (LDKChannelSigner_JCalls*) this_arg;
int64_t idx_conv = idx;
int8_tArray ret = (int8_tArray)js_invoke_function_buuuuu(j_calls->instance_ptr, 2, idx_conv, 0, 0, 0, 0, 0);
LDKPublicKey ret_ref;
memcpy(ret_ref.compressed_form, ret->elems, 33); FREE(ret);
return ret_ref;
}
-LDKThirtyTwoBytes release_commitment_secret_LDKBaseSign_jcall(const void* this_arg, uint64_t idx) {
- LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
+LDKThirtyTwoBytes release_commitment_secret_LDKChannelSigner_jcall(const void* this_arg, uint64_t idx) {
+ LDKChannelSigner_JCalls *j_calls = (LDKChannelSigner_JCalls*) this_arg;
int64_t idx_conv = idx;
int8_tArray ret = (int8_tArray)js_invoke_function_buuuuu(j_calls->instance_ptr, 3, idx_conv, 0, 0, 0, 0, 0);
LDKThirtyTwoBytes ret_ref;
memcpy(ret_ref.data, ret->elems, 32); FREE(ret);
return ret_ref;
}
-LDKCResult_NoneNoneZ validate_holder_commitment_LDKBaseSign_jcall(const void* this_arg, const LDKHolderCommitmentTransaction * holder_tx, LDKCVec_PaymentPreimageZ preimages) {
- LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
+LDKCResult_NoneNoneZ validate_holder_commitment_LDKChannelSigner_jcall(const void* this_arg, const LDKHolderCommitmentTransaction * holder_tx, LDKCVec_PaymentPreimageZ preimages) {
+ LDKChannelSigner_JCalls *j_calls = (LDKChannelSigner_JCalls*) this_arg;
LDKHolderCommitmentTransaction holder_tx_var = *holder_tx;
uint64_t holder_tx_ref = 0;
holder_tx_var = HolderCommitmentTransaction_clone(&holder_tx_var);
}
FREE(preimages_var.data);
- uint32_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 4, holder_tx_ref, (uint32_t)preimages_arr, 0, 0, 0, 0);
+ uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 4, holder_tx_ref, (uint32_t)preimages_arr, 0, 0, 0, 0);
void* ret_ptr = untag_ptr(ret);
CHECK_ACCESS(ret_ptr);
LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr);
FREE(untag_ptr(ret));
return ret_conv;
}
-LDKThirtyTwoBytes channel_keys_id_LDKBaseSign_jcall(const void* this_arg) {
- LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
+LDKThirtyTwoBytes channel_keys_id_LDKChannelSigner_jcall(const void* this_arg) {
+ LDKChannelSigner_JCalls *j_calls = (LDKChannelSigner_JCalls*) this_arg;
int8_tArray ret = (int8_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 5, 0, 0, 0, 0, 0, 0);
LDKThirtyTwoBytes ret_ref;
CHECK(ret->arr_len == 32);
memcpy(ret_ref.data, ret->elems, 32); FREE(ret);
return ret_ref;
}
-LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_counterparty_commitment_LDKBaseSign_jcall(const void* this_arg, const LDKCommitmentTransaction * commitment_tx, LDKCVec_PaymentPreimageZ preimages) {
- LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
+void provide_channel_parameters_LDKChannelSigner_jcall(void* this_arg, const LDKChannelTransactionParameters * channel_parameters) {
+ LDKChannelSigner_JCalls *j_calls = (LDKChannelSigner_JCalls*) this_arg;
+ LDKChannelTransactionParameters channel_parameters_var = *channel_parameters;
+ uint64_t channel_parameters_ref = 0;
+ channel_parameters_var = ChannelTransactionParameters_clone(&channel_parameters_var);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_parameters_var);
+ channel_parameters_ref = tag_ptr(channel_parameters_var.inner, channel_parameters_var.is_owned);
+ js_invoke_function_buuuuu(j_calls->instance_ptr, 6, channel_parameters_ref, 0, 0, 0, 0, 0);
+}
+static void LDKChannelSigner_JCalls_cloned(LDKChannelSigner* new_obj) {
+ LDKChannelSigner_JCalls *j_calls = (LDKChannelSigner_JCalls*) new_obj->this_arg;
+ atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
+}
+static inline LDKChannelSigner LDKChannelSigner_init (JSValue o, uint64_t pubkeys) {
+ LDKChannelSigner_JCalls *calls = MALLOC(sizeof(LDKChannelSigner_JCalls), "LDKChannelSigner_JCalls");
+ atomic_init(&calls->refcnt, 1);
+ calls->instance_ptr = o;
+
+ LDKChannelPublicKeys pubkeys_conv;
+ pubkeys_conv.inner = untag_ptr(pubkeys);
+ pubkeys_conv.is_owned = ptr_is_owned(pubkeys);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(pubkeys_conv);
+
+ LDKChannelSigner ret = {
+ .this_arg = (void*) calls,
+ .get_per_commitment_point = get_per_commitment_point_LDKChannelSigner_jcall,
+ .release_commitment_secret = release_commitment_secret_LDKChannelSigner_jcall,
+ .validate_holder_commitment = validate_holder_commitment_LDKChannelSigner_jcall,
+ .channel_keys_id = channel_keys_id_LDKChannelSigner_jcall,
+ .provide_channel_parameters = provide_channel_parameters_LDKChannelSigner_jcall,
+ .free = LDKChannelSigner_JCalls_free,
+ .pubkeys = pubkeys_conv,
+ .set_pubkeys = NULL,
+ };
+ return ret;
+}
+uint64_t __attribute__((export_name("TS_LDKChannelSigner_new"))) TS_LDKChannelSigner_new(JSValue o, uint64_t pubkeys) {
+ LDKChannelSigner *res_ptr = MALLOC(sizeof(LDKChannelSigner), "LDKChannelSigner");
+ *res_ptr = LDKChannelSigner_init(o, pubkeys);
+ return tag_ptr(res_ptr, true);
+}
+int8_tArray __attribute__((export_name("TS_ChannelSigner_get_per_commitment_point"))) TS_ChannelSigner_get_per_commitment_point(uint64_t this_arg, int64_t idx) {
+ void* this_arg_ptr = untag_ptr(this_arg);
+ if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelSigner* this_arg_conv = (LDKChannelSigner*)this_arg_ptr;
+ int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
+ memcpy(ret_arr->elems, (this_arg_conv->get_per_commitment_point)(this_arg_conv->this_arg, idx).compressed_form, 33);
+ return ret_arr;
+}
+
+int8_tArray __attribute__((export_name("TS_ChannelSigner_release_commitment_secret"))) TS_ChannelSigner_release_commitment_secret(uint64_t this_arg, int64_t idx) {
+ void* this_arg_ptr = untag_ptr(this_arg);
+ if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelSigner* this_arg_conv = (LDKChannelSigner*)this_arg_ptr;
+ int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
+ memcpy(ret_arr->elems, (this_arg_conv->release_commitment_secret)(this_arg_conv->this_arg, idx).data, 32);
+ return ret_arr;
+}
+
+uint64_t __attribute__((export_name("TS_ChannelSigner_validate_holder_commitment"))) TS_ChannelSigner_validate_holder_commitment(uint64_t this_arg, uint64_t holder_tx, ptrArray preimages) {
+ void* this_arg_ptr = untag_ptr(this_arg);
+ if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelSigner* this_arg_conv = (LDKChannelSigner*)this_arg_ptr;
+ LDKHolderCommitmentTransaction holder_tx_conv;
+ holder_tx_conv.inner = untag_ptr(holder_tx);
+ holder_tx_conv.is_owned = ptr_is_owned(holder_tx);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(holder_tx_conv);
+ holder_tx_conv.is_owned = false;
+ LDKCVec_PaymentPreimageZ preimages_constr;
+ preimages_constr.datalen = preimages->arr_len;
+ if (preimages_constr.datalen > 0)
+ preimages_constr.data = MALLOC(preimages_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_PaymentPreimageZ Elements");
+ else
+ preimages_constr.data = NULL;
+ int8_tArray* preimages_vals = (void*) preimages->elems;
+ for (size_t m = 0; m < preimages_constr.datalen; m++) {
+ int8_tArray preimages_conv_12 = preimages_vals[m];
+ LDKThirtyTwoBytes preimages_conv_12_ref;
+ CHECK(preimages_conv_12->arr_len == 32);
+ memcpy(preimages_conv_12_ref.data, preimages_conv_12->elems, 32); FREE(preimages_conv_12);
+ preimages_constr.data[m] = preimages_conv_12_ref;
+ }
+ FREE(preimages);
+ LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
+ *ret_conv = (this_arg_conv->validate_holder_commitment)(this_arg_conv->this_arg, &holder_tx_conv, preimages_constr);
+ return tag_ptr(ret_conv, true);
+}
+
+int8_tArray __attribute__((export_name("TS_ChannelSigner_channel_keys_id"))) TS_ChannelSigner_channel_keys_id(uint64_t this_arg) {
+ void* this_arg_ptr = untag_ptr(this_arg);
+ if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelSigner* this_arg_conv = (LDKChannelSigner*)this_arg_ptr;
+ int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
+ memcpy(ret_arr->elems, (this_arg_conv->channel_keys_id)(this_arg_conv->this_arg).data, 32);
+ return ret_arr;
+}
+
+void __attribute__((export_name("TS_ChannelSigner_provide_channel_parameters"))) TS_ChannelSigner_provide_channel_parameters(uint64_t this_arg, uint64_t channel_parameters) {
+ void* this_arg_ptr = untag_ptr(this_arg);
+ if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelSigner* this_arg_conv = (LDKChannelSigner*)this_arg_ptr;
+ LDKChannelTransactionParameters channel_parameters_conv;
+ channel_parameters_conv.inner = untag_ptr(channel_parameters);
+ channel_parameters_conv.is_owned = ptr_is_owned(channel_parameters);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_parameters_conv);
+ channel_parameters_conv.is_owned = false;
+ (this_arg_conv->provide_channel_parameters)(this_arg_conv->this_arg, &channel_parameters_conv);
+}
+
+LDKChannelPublicKeys LDKChannelSigner_set_get_pubkeys(LDKChannelSigner* this_arg) {
+ if (this_arg->set_pubkeys != NULL)
+ this_arg->set_pubkeys(this_arg);
+ return this_arg->pubkeys;
+}
+uint64_t __attribute__((export_name("TS_ChannelSigner_get_pubkeys"))) TS_ChannelSigner_get_pubkeys(uint64_t this_arg) {
+ void* this_arg_ptr = untag_ptr(this_arg);
+ if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelSigner* this_arg_conv = (LDKChannelSigner*)this_arg_ptr;
+ LDKChannelPublicKeys ret_var = LDKChannelSigner_set_get_pubkeys(this_arg_conv);
+ uint64_t ret_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ return ret_ref;
+}
+
+typedef struct LDKEcdsaChannelSigner_JCalls {
+ atomic_size_t refcnt;
+ uint32_t instance_ptr;
+ LDKChannelSigner_JCalls* ChannelSigner;
+} LDKEcdsaChannelSigner_JCalls;
+static void LDKEcdsaChannelSigner_JCalls_free(void* this_arg) {
+ LDKEcdsaChannelSigner_JCalls *j_calls = (LDKEcdsaChannelSigner_JCalls*) this_arg;
+ if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
+ FREE(j_calls);
+ }
+}
+LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_counterparty_commitment_LDKEcdsaChannelSigner_jcall(const void* this_arg, const LDKCommitmentTransaction * commitment_tx, LDKCVec_PaymentPreimageZ preimages) {
+ LDKEcdsaChannelSigner_JCalls *j_calls = (LDKEcdsaChannelSigner_JCalls*) this_arg;
LDKCommitmentTransaction commitment_tx_var = *commitment_tx;
uint64_t commitment_tx_ref = 0;
commitment_tx_var = CommitmentTransaction_clone(&commitment_tx_var);
}
FREE(preimages_var.data);
- uint32_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 6, commitment_tx_ref, (uint32_t)preimages_arr, 0, 0, 0, 0);
+ uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 7, commitment_tx_ref, (uint32_t)preimages_arr, 0, 0, 0, 0);
void* ret_ptr = untag_ptr(ret);
CHECK_ACCESS(ret_ptr);
LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(ret_ptr);
FREE(untag_ptr(ret));
return ret_conv;
}
-LDKCResult_NoneNoneZ validate_counterparty_revocation_LDKBaseSign_jcall(const void* this_arg, uint64_t idx, const uint8_t (* secret)[32]) {
- LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
+LDKCResult_NoneNoneZ validate_counterparty_revocation_LDKEcdsaChannelSigner_jcall(const void* this_arg, uint64_t idx, const uint8_t (* secret)[32]) {
+ LDKEcdsaChannelSigner_JCalls *j_calls = (LDKEcdsaChannelSigner_JCalls*) this_arg;
int64_t idx_conv = idx;
int8_tArray secret_arr = init_int8_tArray(32, __LINE__);
memcpy(secret_arr->elems, *secret, 32);
- uint32_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 7, idx_conv, (uint32_t)secret_arr, 0, 0, 0, 0);
+ uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 8, idx_conv, (uint32_t)secret_arr, 0, 0, 0, 0);
void* ret_ptr = untag_ptr(ret);
CHECK_ACCESS(ret_ptr);
LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr);
FREE(untag_ptr(ret));
return ret_conv;
}
-LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_holder_commitment_and_htlcs_LDKBaseSign_jcall(const void* this_arg, const LDKHolderCommitmentTransaction * commitment_tx) {
- LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
+LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_holder_commitment_and_htlcs_LDKEcdsaChannelSigner_jcall(const void* this_arg, const LDKHolderCommitmentTransaction * commitment_tx) {
+ LDKEcdsaChannelSigner_JCalls *j_calls = (LDKEcdsaChannelSigner_JCalls*) this_arg;
LDKHolderCommitmentTransaction commitment_tx_var = *commitment_tx;
uint64_t commitment_tx_ref = 0;
commitment_tx_var = HolderCommitmentTransaction_clone(&commitment_tx_var);
CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_var);
commitment_tx_ref = tag_ptr(commitment_tx_var.inner, commitment_tx_var.is_owned);
- uint32_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 8, commitment_tx_ref, 0, 0, 0, 0, 0);
+ uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 9, commitment_tx_ref, 0, 0, 0, 0, 0);
void* ret_ptr = untag_ptr(ret);
CHECK_ACCESS(ret_ptr);
LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(ret_ptr);
FREE(untag_ptr(ret));
return ret_conv;
}
-LDKCResult_SignatureNoneZ sign_justice_revoked_output_LDKBaseSign_jcall(const void* this_arg, LDKTransaction justice_tx, uintptr_t input, uint64_t amount, const uint8_t (* per_commitment_key)[32]) {
- LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
+LDKCResult_SignatureNoneZ sign_justice_revoked_output_LDKEcdsaChannelSigner_jcall(const void* this_arg, LDKTransaction justice_tx, uintptr_t input, uint64_t amount, const uint8_t (* per_commitment_key)[32]) {
+ LDKEcdsaChannelSigner_JCalls *j_calls = (LDKEcdsaChannelSigner_JCalls*) this_arg;
LDKTransaction justice_tx_var = justice_tx;
int8_tArray justice_tx_arr = init_int8_tArray(justice_tx_var.datalen, __LINE__);
memcpy(justice_tx_arr->elems, justice_tx_var.data, justice_tx_var.datalen);
int64_t amount_conv = amount;
int8_tArray per_commitment_key_arr = init_int8_tArray(32, __LINE__);
memcpy(per_commitment_key_arr->elems, *per_commitment_key, 32);
- uint32_t ret = js_invoke_function_uubuuu(j_calls->instance_ptr, 9, (uint32_t)justice_tx_arr, input_conv, amount_conv, (uint32_t)per_commitment_key_arr, 0, 0);
+ uint64_t ret = js_invoke_function_uubuuu(j_calls->instance_ptr, 10, (uint32_t)justice_tx_arr, input_conv, amount_conv, (uint32_t)per_commitment_key_arr, 0, 0);
void* ret_ptr = untag_ptr(ret);
CHECK_ACCESS(ret_ptr);
LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
FREE(untag_ptr(ret));
return ret_conv;
}
-LDKCResult_SignatureNoneZ sign_justice_revoked_htlc_LDKBaseSign_jcall(const void* this_arg, LDKTransaction justice_tx, uintptr_t input, uint64_t amount, const uint8_t (* per_commitment_key)[32], const LDKHTLCOutputInCommitment * htlc) {
- LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
+LDKCResult_SignatureNoneZ sign_justice_revoked_htlc_LDKEcdsaChannelSigner_jcall(const void* this_arg, LDKTransaction justice_tx, uintptr_t input, uint64_t amount, const uint8_t (* per_commitment_key)[32], const LDKHTLCOutputInCommitment * htlc) {
+ LDKEcdsaChannelSigner_JCalls *j_calls = (LDKEcdsaChannelSigner_JCalls*) this_arg;
LDKTransaction justice_tx_var = justice_tx;
int8_tArray justice_tx_arr = init_int8_tArray(justice_tx_var.datalen, __LINE__);
memcpy(justice_tx_arr->elems, justice_tx_var.data, justice_tx_var.datalen);
htlc_var = HTLCOutputInCommitment_clone(&htlc_var);
CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_var);
htlc_ref = tag_ptr(htlc_var.inner, htlc_var.is_owned);
- uint32_t ret = js_invoke_function_uububu(j_calls->instance_ptr, 10, (uint32_t)justice_tx_arr, input_conv, amount_conv, (uint32_t)per_commitment_key_arr, htlc_ref, 0);
+ uint64_t ret = js_invoke_function_uububu(j_calls->instance_ptr, 11, (uint32_t)justice_tx_arr, input_conv, amount_conv, (uint32_t)per_commitment_key_arr, htlc_ref, 0);
void* ret_ptr = untag_ptr(ret);
CHECK_ACCESS(ret_ptr);
LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
FREE(untag_ptr(ret));
return ret_conv;
}
-LDKCResult_SignatureNoneZ sign_counterparty_htlc_transaction_LDKBaseSign_jcall(const void* this_arg, LDKTransaction htlc_tx, uintptr_t input, uint64_t amount, LDKPublicKey per_commitment_point, const LDKHTLCOutputInCommitment * htlc) {
- LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
+LDKCResult_SignatureNoneZ sign_counterparty_htlc_transaction_LDKEcdsaChannelSigner_jcall(const void* this_arg, LDKTransaction htlc_tx, uintptr_t input, uint64_t amount, LDKPublicKey per_commitment_point, const LDKHTLCOutputInCommitment * htlc) {
+ LDKEcdsaChannelSigner_JCalls *j_calls = (LDKEcdsaChannelSigner_JCalls*) this_arg;
LDKTransaction htlc_tx_var = htlc_tx;
int8_tArray htlc_tx_arr = init_int8_tArray(htlc_tx_var.datalen, __LINE__);
memcpy(htlc_tx_arr->elems, htlc_tx_var.data, htlc_tx_var.datalen);
htlc_var = HTLCOutputInCommitment_clone(&htlc_var);
CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_var);
htlc_ref = tag_ptr(htlc_var.inner, htlc_var.is_owned);
- uint32_t ret = js_invoke_function_uububu(j_calls->instance_ptr, 11, (uint32_t)htlc_tx_arr, input_conv, amount_conv, (uint32_t)per_commitment_point_arr, htlc_ref, 0);
+ uint64_t ret = js_invoke_function_uububu(j_calls->instance_ptr, 12, (uint32_t)htlc_tx_arr, input_conv, amount_conv, (uint32_t)per_commitment_point_arr, htlc_ref, 0);
void* ret_ptr = untag_ptr(ret);
CHECK_ACCESS(ret_ptr);
LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
FREE(untag_ptr(ret));
return ret_conv;
}
-LDKCResult_SignatureNoneZ sign_closing_transaction_LDKBaseSign_jcall(const void* this_arg, const LDKClosingTransaction * closing_tx) {
- LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
+LDKCResult_SignatureNoneZ sign_closing_transaction_LDKEcdsaChannelSigner_jcall(const void* this_arg, const LDKClosingTransaction * closing_tx) {
+ LDKEcdsaChannelSigner_JCalls *j_calls = (LDKEcdsaChannelSigner_JCalls*) this_arg;
LDKClosingTransaction closing_tx_var = *closing_tx;
uint64_t closing_tx_ref = 0;
closing_tx_var = ClosingTransaction_clone(&closing_tx_var);
CHECK_INNER_FIELD_ACCESS_OR_NULL(closing_tx_var);
closing_tx_ref = tag_ptr(closing_tx_var.inner, closing_tx_var.is_owned);
- uint32_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 12, closing_tx_ref, 0, 0, 0, 0, 0);
+ uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 13, closing_tx_ref, 0, 0, 0, 0, 0);
+ void* ret_ptr = untag_ptr(ret);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
+ FREE(untag_ptr(ret));
+ return ret_conv;
+}
+LDKCResult_SignatureNoneZ sign_holder_anchor_input_LDKEcdsaChannelSigner_jcall(const void* this_arg, LDKTransaction anchor_tx, uintptr_t input) {
+ LDKEcdsaChannelSigner_JCalls *j_calls = (LDKEcdsaChannelSigner_JCalls*) this_arg;
+ LDKTransaction anchor_tx_var = anchor_tx;
+ int8_tArray anchor_tx_arr = init_int8_tArray(anchor_tx_var.datalen, __LINE__);
+ memcpy(anchor_tx_arr->elems, anchor_tx_var.data, anchor_tx_var.datalen);
+ Transaction_free(anchor_tx_var);
+ uint32_t input_conv = input;
+ uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 14, (uint32_t)anchor_tx_arr, input_conv, 0, 0, 0, 0);
void* ret_ptr = untag_ptr(ret);
CHECK_ACCESS(ret_ptr);
LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
FREE(untag_ptr(ret));
return ret_conv;
}
-LDKCResult_C2Tuple_SignatureSignatureZNoneZ sign_channel_announcement_LDKBaseSign_jcall(const void* this_arg, const LDKUnsignedChannelAnnouncement * msg) {
- LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
+LDKCResult_SignatureNoneZ sign_channel_announcement_with_funding_key_LDKEcdsaChannelSigner_jcall(const void* this_arg, const LDKUnsignedChannelAnnouncement * msg) {
+ LDKEcdsaChannelSigner_JCalls *j_calls = (LDKEcdsaChannelSigner_JCalls*) this_arg;
LDKUnsignedChannelAnnouncement msg_var = *msg;
uint64_t msg_ref = 0;
msg_var = UnsignedChannelAnnouncement_clone(&msg_var);
CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
- uint32_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 13, msg_ref, 0, 0, 0, 0, 0);
+ uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 15, msg_ref, 0, 0, 0, 0, 0);
void* ret_ptr = untag_ptr(ret);
CHECK_ACCESS(ret_ptr);
- LDKCResult_C2Tuple_SignatureSignatureZNoneZ ret_conv = *(LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)(ret_ptr);
+ LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
FREE(untag_ptr(ret));
return ret_conv;
}
-void ready_channel_LDKBaseSign_jcall(void* this_arg, const LDKChannelTransactionParameters * channel_parameters) {
- LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
- LDKChannelTransactionParameters channel_parameters_var = *channel_parameters;
- uint64_t channel_parameters_ref = 0;
- channel_parameters_var = ChannelTransactionParameters_clone(&channel_parameters_var);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_parameters_var);
- channel_parameters_ref = tag_ptr(channel_parameters_var.inner, channel_parameters_var.is_owned);
- js_invoke_function_buuuuu(j_calls->instance_ptr, 14, channel_parameters_ref, 0, 0, 0, 0, 0);
-}
-static void LDKBaseSign_JCalls_cloned(LDKBaseSign* new_obj) {
- LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) new_obj->this_arg;
+static void LDKEcdsaChannelSigner_JCalls_cloned(LDKEcdsaChannelSigner* new_obj) {
+ LDKEcdsaChannelSigner_JCalls *j_calls = (LDKEcdsaChannelSigner_JCalls*) new_obj->this_arg;
atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
+ atomic_fetch_add_explicit(&j_calls->ChannelSigner->refcnt, 1, memory_order_release);
}
-static inline LDKBaseSign LDKBaseSign_init (JSValue o, uint64_t pubkeys) {
- LDKBaseSign_JCalls *calls = MALLOC(sizeof(LDKBaseSign_JCalls), "LDKBaseSign_JCalls");
+static inline LDKEcdsaChannelSigner LDKEcdsaChannelSigner_init (JSValue o, JSValue ChannelSigner, uint64_t pubkeys) {
+ LDKEcdsaChannelSigner_JCalls *calls = MALLOC(sizeof(LDKEcdsaChannelSigner_JCalls), "LDKEcdsaChannelSigner_JCalls");
atomic_init(&calls->refcnt, 1);
calls->instance_ptr = o;
pubkeys_conv.is_owned = ptr_is_owned(pubkeys);
CHECK_INNER_FIELD_ACCESS_OR_NULL(pubkeys_conv);
- LDKBaseSign ret = {
+ LDKEcdsaChannelSigner ret = {
.this_arg = (void*) calls,
- .get_per_commitment_point = get_per_commitment_point_LDKBaseSign_jcall,
- .release_commitment_secret = release_commitment_secret_LDKBaseSign_jcall,
- .validate_holder_commitment = validate_holder_commitment_LDKBaseSign_jcall,
- .channel_keys_id = channel_keys_id_LDKBaseSign_jcall,
- .sign_counterparty_commitment = sign_counterparty_commitment_LDKBaseSign_jcall,
- .validate_counterparty_revocation = validate_counterparty_revocation_LDKBaseSign_jcall,
- .sign_holder_commitment_and_htlcs = sign_holder_commitment_and_htlcs_LDKBaseSign_jcall,
- .sign_justice_revoked_output = sign_justice_revoked_output_LDKBaseSign_jcall,
- .sign_justice_revoked_htlc = sign_justice_revoked_htlc_LDKBaseSign_jcall,
- .sign_counterparty_htlc_transaction = sign_counterparty_htlc_transaction_LDKBaseSign_jcall,
- .sign_closing_transaction = sign_closing_transaction_LDKBaseSign_jcall,
- .sign_channel_announcement = sign_channel_announcement_LDKBaseSign_jcall,
- .ready_channel = ready_channel_LDKBaseSign_jcall,
- .free = LDKBaseSign_JCalls_free,
- .pubkeys = pubkeys_conv,
- .set_pubkeys = NULL,
+ .sign_counterparty_commitment = sign_counterparty_commitment_LDKEcdsaChannelSigner_jcall,
+ .validate_counterparty_revocation = validate_counterparty_revocation_LDKEcdsaChannelSigner_jcall,
+ .sign_holder_commitment_and_htlcs = sign_holder_commitment_and_htlcs_LDKEcdsaChannelSigner_jcall,
+ .sign_justice_revoked_output = sign_justice_revoked_output_LDKEcdsaChannelSigner_jcall,
+ .sign_justice_revoked_htlc = sign_justice_revoked_htlc_LDKEcdsaChannelSigner_jcall,
+ .sign_counterparty_htlc_transaction = sign_counterparty_htlc_transaction_LDKEcdsaChannelSigner_jcall,
+ .sign_closing_transaction = sign_closing_transaction_LDKEcdsaChannelSigner_jcall,
+ .sign_holder_anchor_input = sign_holder_anchor_input_LDKEcdsaChannelSigner_jcall,
+ .sign_channel_announcement_with_funding_key = sign_channel_announcement_with_funding_key_LDKEcdsaChannelSigner_jcall,
+ .free = LDKEcdsaChannelSigner_JCalls_free,
+ .ChannelSigner = LDKChannelSigner_init(ChannelSigner, pubkeys),
};
+ calls->ChannelSigner = ret.ChannelSigner.this_arg;
return ret;
}
-uint64_t __attribute__((export_name("TS_LDKBaseSign_new"))) TS_LDKBaseSign_new(JSValue o, uint64_t pubkeys) {
- LDKBaseSign *res_ptr = MALLOC(sizeof(LDKBaseSign), "LDKBaseSign");
- *res_ptr = LDKBaseSign_init(o, pubkeys);
+uint64_t __attribute__((export_name("TS_LDKEcdsaChannelSigner_new"))) TS_LDKEcdsaChannelSigner_new(JSValue o, JSValue ChannelSigner, uint64_t pubkeys) {
+ LDKEcdsaChannelSigner *res_ptr = MALLOC(sizeof(LDKEcdsaChannelSigner), "LDKEcdsaChannelSigner");
+ *res_ptr = LDKEcdsaChannelSigner_init(o, ChannelSigner, pubkeys);
return tag_ptr(res_ptr, true);
}
-int8_tArray __attribute__((export_name("TS_BaseSign_get_per_commitment_point"))) TS_BaseSign_get_per_commitment_point(uint64_t this_arg, int64_t idx) {
- void* this_arg_ptr = untag_ptr(this_arg);
- if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
- LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
- int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
- memcpy(ret_arr->elems, (this_arg_conv->get_per_commitment_point)(this_arg_conv->this_arg, idx).compressed_form, 33);
- return ret_arr;
-}
-
-int8_tArray __attribute__((export_name("TS_BaseSign_release_commitment_secret"))) TS_BaseSign_release_commitment_secret(uint64_t this_arg, int64_t idx) {
- void* this_arg_ptr = untag_ptr(this_arg);
- if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
- LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
- int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
- memcpy(ret_arr->elems, (this_arg_conv->release_commitment_secret)(this_arg_conv->this_arg, idx).data, 32);
- return ret_arr;
-}
-
-uint64_t __attribute__((export_name("TS_BaseSign_validate_holder_commitment"))) TS_BaseSign_validate_holder_commitment(uint64_t this_arg, uint64_t holder_tx, ptrArray preimages) {
- void* this_arg_ptr = untag_ptr(this_arg);
- if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
- LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
- LDKHolderCommitmentTransaction holder_tx_conv;
- holder_tx_conv.inner = untag_ptr(holder_tx);
- holder_tx_conv.is_owned = ptr_is_owned(holder_tx);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(holder_tx_conv);
- holder_tx_conv.is_owned = false;
- LDKCVec_PaymentPreimageZ preimages_constr;
- preimages_constr.datalen = preimages->arr_len;
- if (preimages_constr.datalen > 0)
- preimages_constr.data = MALLOC(preimages_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_PaymentPreimageZ Elements");
- else
- preimages_constr.data = NULL;
- int8_tArray* preimages_vals = (void*) preimages->elems;
- for (size_t m = 0; m < preimages_constr.datalen; m++) {
- int8_tArray preimages_conv_12 = preimages_vals[m];
- LDKThirtyTwoBytes preimages_conv_12_ref;
- CHECK(preimages_conv_12->arr_len == 32);
- memcpy(preimages_conv_12_ref.data, preimages_conv_12->elems, 32); FREE(preimages_conv_12);
- preimages_constr.data[m] = preimages_conv_12_ref;
- }
- FREE(preimages);
- LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
- *ret_conv = (this_arg_conv->validate_holder_commitment)(this_arg_conv->this_arg, &holder_tx_conv, preimages_constr);
- return tag_ptr(ret_conv, true);
-}
-
-int8_tArray __attribute__((export_name("TS_BaseSign_channel_keys_id"))) TS_BaseSign_channel_keys_id(uint64_t this_arg) {
+uint64_t __attribute__((export_name("TS_EcdsaChannelSigner_sign_counterparty_commitment"))) TS_EcdsaChannelSigner_sign_counterparty_commitment(uint64_t this_arg, uint64_t commitment_tx, ptrArray preimages) {
void* this_arg_ptr = untag_ptr(this_arg);
if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
- LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
- int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
- memcpy(ret_arr->elems, (this_arg_conv->channel_keys_id)(this_arg_conv->this_arg).data, 32);
- return ret_arr;
-}
-
-uint64_t __attribute__((export_name("TS_BaseSign_sign_counterparty_commitment"))) TS_BaseSign_sign_counterparty_commitment(uint64_t this_arg, uint64_t commitment_tx, ptrArray preimages) {
- void* this_arg_ptr = untag_ptr(this_arg);
- if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
- LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
+ LDKEcdsaChannelSigner* this_arg_conv = (LDKEcdsaChannelSigner*)this_arg_ptr;
LDKCommitmentTransaction commitment_tx_conv;
commitment_tx_conv.inner = untag_ptr(commitment_tx);
commitment_tx_conv.is_owned = ptr_is_owned(commitment_tx);
return tag_ptr(ret_conv, true);
}
-uint64_t __attribute__((export_name("TS_BaseSign_validate_counterparty_revocation"))) TS_BaseSign_validate_counterparty_revocation(uint64_t this_arg, int64_t idx, int8_tArray secret) {
+uint64_t __attribute__((export_name("TS_EcdsaChannelSigner_validate_counterparty_revocation"))) TS_EcdsaChannelSigner_validate_counterparty_revocation(uint64_t this_arg, int64_t idx, int8_tArray secret) {
void* this_arg_ptr = untag_ptr(this_arg);
if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
- LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
- unsigned char secret_arr[32];
+ LDKEcdsaChannelSigner* this_arg_conv = (LDKEcdsaChannelSigner*)this_arg_ptr;
+ uint8_t secret_arr[32];
CHECK(secret->arr_len == 32);
memcpy(secret_arr, secret->elems, 32); FREE(secret);
- unsigned char (*secret_ref)[32] = &secret_arr;
+ uint8_t (*secret_ref)[32] = &secret_arr;
LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
*ret_conv = (this_arg_conv->validate_counterparty_revocation)(this_arg_conv->this_arg, idx, secret_ref);
return tag_ptr(ret_conv, true);
}
-uint64_t __attribute__((export_name("TS_BaseSign_sign_holder_commitment_and_htlcs"))) TS_BaseSign_sign_holder_commitment_and_htlcs(uint64_t this_arg, uint64_t commitment_tx) {
+uint64_t __attribute__((export_name("TS_EcdsaChannelSigner_sign_holder_commitment_and_htlcs"))) TS_EcdsaChannelSigner_sign_holder_commitment_and_htlcs(uint64_t this_arg, uint64_t commitment_tx) {
void* this_arg_ptr = untag_ptr(this_arg);
if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
- LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
+ LDKEcdsaChannelSigner* this_arg_conv = (LDKEcdsaChannelSigner*)this_arg_ptr;
LDKHolderCommitmentTransaction commitment_tx_conv;
commitment_tx_conv.inner = untag_ptr(commitment_tx);
commitment_tx_conv.is_owned = ptr_is_owned(commitment_tx);
return tag_ptr(ret_conv, true);
}
-uint64_t __attribute__((export_name("TS_BaseSign_sign_justice_revoked_output"))) TS_BaseSign_sign_justice_revoked_output(uint64_t this_arg, int8_tArray justice_tx, uint32_t input, int64_t amount, int8_tArray per_commitment_key) {
+uint64_t __attribute__((export_name("TS_EcdsaChannelSigner_sign_justice_revoked_output"))) TS_EcdsaChannelSigner_sign_justice_revoked_output(uint64_t this_arg, int8_tArray justice_tx, uint32_t input, int64_t amount, int8_tArray per_commitment_key) {
void* this_arg_ptr = untag_ptr(this_arg);
if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
- LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
+ LDKEcdsaChannelSigner* this_arg_conv = (LDKEcdsaChannelSigner*)this_arg_ptr;
LDKTransaction justice_tx_ref;
justice_tx_ref.datalen = justice_tx->arr_len;
justice_tx_ref.data = MALLOC(justice_tx_ref.datalen, "LDKTransaction Bytes");
memcpy(justice_tx_ref.data, justice_tx->elems, justice_tx_ref.datalen); FREE(justice_tx);
justice_tx_ref.data_is_owned = true;
- unsigned char per_commitment_key_arr[32];
+ uint8_t per_commitment_key_arr[32];
CHECK(per_commitment_key->arr_len == 32);
memcpy(per_commitment_key_arr, per_commitment_key->elems, 32); FREE(per_commitment_key);
- unsigned char (*per_commitment_key_ref)[32] = &per_commitment_key_arr;
+ uint8_t (*per_commitment_key_ref)[32] = &per_commitment_key_arr;
LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
*ret_conv = (this_arg_conv->sign_justice_revoked_output)(this_arg_conv->this_arg, justice_tx_ref, input, amount, per_commitment_key_ref);
return tag_ptr(ret_conv, true);
}
-uint64_t __attribute__((export_name("TS_BaseSign_sign_justice_revoked_htlc"))) TS_BaseSign_sign_justice_revoked_htlc(uint64_t this_arg, int8_tArray justice_tx, uint32_t input, int64_t amount, int8_tArray per_commitment_key, uint64_t htlc) {
+uint64_t __attribute__((export_name("TS_EcdsaChannelSigner_sign_justice_revoked_htlc"))) TS_EcdsaChannelSigner_sign_justice_revoked_htlc(uint64_t this_arg, int8_tArray justice_tx, uint32_t input, int64_t amount, int8_tArray per_commitment_key, uint64_t htlc) {
void* this_arg_ptr = untag_ptr(this_arg);
if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
- LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
+ LDKEcdsaChannelSigner* this_arg_conv = (LDKEcdsaChannelSigner*)this_arg_ptr;
LDKTransaction justice_tx_ref;
justice_tx_ref.datalen = justice_tx->arr_len;
justice_tx_ref.data = MALLOC(justice_tx_ref.datalen, "LDKTransaction Bytes");
memcpy(justice_tx_ref.data, justice_tx->elems, justice_tx_ref.datalen); FREE(justice_tx);
justice_tx_ref.data_is_owned = true;
- unsigned char per_commitment_key_arr[32];
+ uint8_t per_commitment_key_arr[32];
CHECK(per_commitment_key->arr_len == 32);
memcpy(per_commitment_key_arr, per_commitment_key->elems, 32); FREE(per_commitment_key);
- unsigned char (*per_commitment_key_ref)[32] = &per_commitment_key_arr;
+ uint8_t (*per_commitment_key_ref)[32] = &per_commitment_key_arr;
LDKHTLCOutputInCommitment htlc_conv;
htlc_conv.inner = untag_ptr(htlc);
htlc_conv.is_owned = ptr_is_owned(htlc);
return tag_ptr(ret_conv, true);
}
-uint64_t __attribute__((export_name("TS_BaseSign_sign_counterparty_htlc_transaction"))) TS_BaseSign_sign_counterparty_htlc_transaction(uint64_t this_arg, int8_tArray htlc_tx, uint32_t input, int64_t amount, int8_tArray per_commitment_point, uint64_t htlc) {
+uint64_t __attribute__((export_name("TS_EcdsaChannelSigner_sign_counterparty_htlc_transaction"))) TS_EcdsaChannelSigner_sign_counterparty_htlc_transaction(uint64_t this_arg, int8_tArray htlc_tx, uint32_t input, int64_t amount, int8_tArray per_commitment_point, uint64_t htlc) {
void* this_arg_ptr = untag_ptr(this_arg);
if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
- LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
+ LDKEcdsaChannelSigner* this_arg_conv = (LDKEcdsaChannelSigner*)this_arg_ptr;
LDKTransaction htlc_tx_ref;
htlc_tx_ref.datalen = htlc_tx->arr_len;
htlc_tx_ref.data = MALLOC(htlc_tx_ref.datalen, "LDKTransaction Bytes");
return tag_ptr(ret_conv, true);
}
-uint64_t __attribute__((export_name("TS_BaseSign_sign_closing_transaction"))) TS_BaseSign_sign_closing_transaction(uint64_t this_arg, uint64_t closing_tx) {
+uint64_t __attribute__((export_name("TS_EcdsaChannelSigner_sign_closing_transaction"))) TS_EcdsaChannelSigner_sign_closing_transaction(uint64_t this_arg, uint64_t closing_tx) {
void* this_arg_ptr = untag_ptr(this_arg);
if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
- LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
+ LDKEcdsaChannelSigner* this_arg_conv = (LDKEcdsaChannelSigner*)this_arg_ptr;
LDKClosingTransaction closing_tx_conv;
closing_tx_conv.inner = untag_ptr(closing_tx);
closing_tx_conv.is_owned = ptr_is_owned(closing_tx);
return tag_ptr(ret_conv, true);
}
-uint64_t __attribute__((export_name("TS_BaseSign_sign_channel_announcement"))) TS_BaseSign_sign_channel_announcement(uint64_t this_arg, uint64_t msg) {
+uint64_t __attribute__((export_name("TS_EcdsaChannelSigner_sign_holder_anchor_input"))) TS_EcdsaChannelSigner_sign_holder_anchor_input(uint64_t this_arg, int8_tArray anchor_tx, uint32_t input) {
+ void* this_arg_ptr = untag_ptr(this_arg);
+ if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKEcdsaChannelSigner* this_arg_conv = (LDKEcdsaChannelSigner*)this_arg_ptr;
+ LDKTransaction anchor_tx_ref;
+ anchor_tx_ref.datalen = anchor_tx->arr_len;
+ anchor_tx_ref.data = MALLOC(anchor_tx_ref.datalen, "LDKTransaction Bytes");
+ memcpy(anchor_tx_ref.data, anchor_tx->elems, anchor_tx_ref.datalen); FREE(anchor_tx);
+ anchor_tx_ref.data_is_owned = true;
+ LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
+ *ret_conv = (this_arg_conv->sign_holder_anchor_input)(this_arg_conv->this_arg, anchor_tx_ref, input);
+ return tag_ptr(ret_conv, true);
+}
+
+uint64_t __attribute__((export_name("TS_EcdsaChannelSigner_sign_channel_announcement_with_funding_key"))) TS_EcdsaChannelSigner_sign_channel_announcement_with_funding_key(uint64_t this_arg, uint64_t msg) {
void* this_arg_ptr = untag_ptr(this_arg);
if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
- LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
+ LDKEcdsaChannelSigner* this_arg_conv = (LDKEcdsaChannelSigner*)this_arg_ptr;
LDKUnsignedChannelAnnouncement msg_conv;
msg_conv.inner = untag_ptr(msg);
msg_conv.is_owned = ptr_is_owned(msg);
CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
msg_conv.is_owned = false;
- LDKCResult_C2Tuple_SignatureSignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureSignatureZNoneZ), "LDKCResult_C2Tuple_SignatureSignatureZNoneZ");
- *ret_conv = (this_arg_conv->sign_channel_announcement)(this_arg_conv->this_arg, &msg_conv);
+ LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
+ *ret_conv = (this_arg_conv->sign_channel_announcement_with_funding_key)(this_arg_conv->this_arg, &msg_conv);
return tag_ptr(ret_conv, true);
}
-void __attribute__((export_name("TS_BaseSign_ready_channel"))) TS_BaseSign_ready_channel(uint64_t this_arg, uint64_t channel_parameters) {
- void* this_arg_ptr = untag_ptr(this_arg);
- if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
- LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
- LDKChannelTransactionParameters channel_parameters_conv;
- channel_parameters_conv.inner = untag_ptr(channel_parameters);
- channel_parameters_conv.is_owned = ptr_is_owned(channel_parameters);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_parameters_conv);
- channel_parameters_conv.is_owned = false;
- (this_arg_conv->ready_channel)(this_arg_conv->this_arg, &channel_parameters_conv);
-}
-
-LDKChannelPublicKeys LDKBaseSign_set_get_pubkeys(LDKBaseSign* this_arg) {
- if (this_arg->set_pubkeys != NULL)
- this_arg->set_pubkeys(this_arg);
- return this_arg->pubkeys;
-}
-uint64_t __attribute__((export_name("TS_BaseSign_get_pubkeys"))) TS_BaseSign_get_pubkeys(uint64_t this_arg) {
- void* this_arg_ptr = untag_ptr(this_arg);
- if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
- LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
- LDKChannelPublicKeys ret_var = LDKBaseSign_set_get_pubkeys(this_arg_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
- return ret_ref;
-}
-
-typedef struct LDKSign_JCalls {
+typedef struct LDKWriteableEcdsaChannelSigner_JCalls {
atomic_size_t refcnt;
uint32_t instance_ptr;
- LDKBaseSign_JCalls* BaseSign;
-} LDKSign_JCalls;
-static void LDKSign_JCalls_free(void* this_arg) {
- LDKSign_JCalls *j_calls = (LDKSign_JCalls*) this_arg;
+ LDKEcdsaChannelSigner_JCalls* EcdsaChannelSigner;
+ LDKChannelSigner_JCalls* ChannelSigner;
+} LDKWriteableEcdsaChannelSigner_JCalls;
+static void LDKWriteableEcdsaChannelSigner_JCalls_free(void* this_arg) {
+ LDKWriteableEcdsaChannelSigner_JCalls *j_calls = (LDKWriteableEcdsaChannelSigner_JCalls*) this_arg;
if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
FREE(j_calls);
}
}
-LDKCVec_u8Z write_LDKSign_jcall(const void* this_arg) {
- LDKSign_JCalls *j_calls = (LDKSign_JCalls*) this_arg;
- int8_tArray ret = (int8_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 15, 0, 0, 0, 0, 0, 0);
+LDKCVec_u8Z write_LDKWriteableEcdsaChannelSigner_jcall(const void* this_arg) {
+ LDKWriteableEcdsaChannelSigner_JCalls *j_calls = (LDKWriteableEcdsaChannelSigner_JCalls*) this_arg;
+ int8_tArray ret = (int8_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 16, 0, 0, 0, 0, 0, 0);
LDKCVec_u8Z ret_ref;
ret_ref.datalen = ret->arr_len;
ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes");
memcpy(ret_ref.data, ret->elems, ret_ref.datalen); FREE(ret);
return ret_ref;
}
-static void LDKSign_JCalls_cloned(LDKSign* new_obj) {
- LDKSign_JCalls *j_calls = (LDKSign_JCalls*) new_obj->this_arg;
+static void LDKWriteableEcdsaChannelSigner_JCalls_cloned(LDKWriteableEcdsaChannelSigner* new_obj) {
+ LDKWriteableEcdsaChannelSigner_JCalls *j_calls = (LDKWriteableEcdsaChannelSigner_JCalls*) new_obj->this_arg;
atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
- atomic_fetch_add_explicit(&j_calls->BaseSign->refcnt, 1, memory_order_release);
+ atomic_fetch_add_explicit(&j_calls->EcdsaChannelSigner->refcnt, 1, memory_order_release);
+ atomic_fetch_add_explicit(&j_calls->EcdsaChannelSigner->ChannelSigner->refcnt, 1, memory_order_release);
}
-static inline LDKSign LDKSign_init (JSValue o, JSValue BaseSign, uint64_t pubkeys) {
- LDKSign_JCalls *calls = MALLOC(sizeof(LDKSign_JCalls), "LDKSign_JCalls");
+static inline LDKWriteableEcdsaChannelSigner LDKWriteableEcdsaChannelSigner_init (JSValue o, JSValue EcdsaChannelSigner, JSValue ChannelSigner, uint64_t pubkeys) {
+ LDKWriteableEcdsaChannelSigner_JCalls *calls = MALLOC(sizeof(LDKWriteableEcdsaChannelSigner_JCalls), "LDKWriteableEcdsaChannelSigner_JCalls");
atomic_init(&calls->refcnt, 1);
calls->instance_ptr = o;
pubkeys_conv.is_owned = ptr_is_owned(pubkeys);
CHECK_INNER_FIELD_ACCESS_OR_NULL(pubkeys_conv);
- LDKSign ret = {
+ LDKWriteableEcdsaChannelSigner ret = {
.this_arg = (void*) calls,
- .write = write_LDKSign_jcall,
- .cloned = LDKSign_JCalls_cloned,
- .free = LDKSign_JCalls_free,
- .BaseSign = LDKBaseSign_init(BaseSign, pubkeys),
+ .write = write_LDKWriteableEcdsaChannelSigner_jcall,
+ .cloned = LDKWriteableEcdsaChannelSigner_JCalls_cloned,
+ .free = LDKWriteableEcdsaChannelSigner_JCalls_free,
+ .EcdsaChannelSigner = LDKEcdsaChannelSigner_init(EcdsaChannelSigner, ChannelSigner, pubkeys),
};
- calls->BaseSign = ret.BaseSign.this_arg;
+ calls->EcdsaChannelSigner = ret.EcdsaChannelSigner.this_arg;
+ calls->ChannelSigner = ret.EcdsaChannelSigner.ChannelSigner.this_arg;
return ret;
}
-uint64_t __attribute__((export_name("TS_LDKSign_new"))) TS_LDKSign_new(JSValue o, JSValue BaseSign, uint64_t pubkeys) {
- LDKSign *res_ptr = MALLOC(sizeof(LDKSign), "LDKSign");
- *res_ptr = LDKSign_init(o, BaseSign, pubkeys);
+uint64_t __attribute__((export_name("TS_LDKWriteableEcdsaChannelSigner_new"))) TS_LDKWriteableEcdsaChannelSigner_new(JSValue o, JSValue EcdsaChannelSigner, JSValue ChannelSigner, uint64_t pubkeys) {
+ LDKWriteableEcdsaChannelSigner *res_ptr = MALLOC(sizeof(LDKWriteableEcdsaChannelSigner), "LDKWriteableEcdsaChannelSigner");
+ *res_ptr = LDKWriteableEcdsaChannelSigner_init(o, EcdsaChannelSigner, ChannelSigner, pubkeys);
return tag_ptr(res_ptr, true);
}
-int8_tArray __attribute__((export_name("TS_Sign_write"))) TS_Sign_write(uint64_t this_arg) {
+int8_tArray __attribute__((export_name("TS_WriteableEcdsaChannelSigner_write"))) TS_WriteableEcdsaChannelSigner_write(uint64_t this_arg) {
void* this_arg_ptr = untag_ptr(this_arg);
if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
- LDKSign* this_arg_conv = (LDKSign*)this_arg_ptr;
+ LDKWriteableEcdsaChannelSigner* this_arg_conv = (LDKWriteableEcdsaChannelSigner*)this_arg_ptr;
LDKCVec_u8Z ret_var = (this_arg_conv->write)(this_arg_conv->this_arg);
int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
return ret_arr;
}
-static inline struct LDKSign CResult_SignDecodeErrorZ_get_ok(LDKCResult_SignDecodeErrorZ *NONNULL_PTR owner){
+static inline struct LDKWriteableEcdsaChannelSigner CResult_WriteableEcdsaChannelSignerDecodeErrorZ_get_ok(LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ *NONNULL_PTR owner){
CHECK(owner->result_ok);
- return Sign_clone(&*owner->contents.result);
+ return WriteableEcdsaChannelSigner_clone(&*owner->contents.result);
}
-uint64_t __attribute__((export_name("TS_CResult_SignDecodeErrorZ_get_ok"))) TS_CResult_SignDecodeErrorZ_get_ok(uint64_t owner) {
- LDKCResult_SignDecodeErrorZ* owner_conv = (LDKCResult_SignDecodeErrorZ*)untag_ptr(owner);
- LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign");
- *ret_ret = CResult_SignDecodeErrorZ_get_ok(owner_conv);
+uint64_t __attribute__((export_name("TS_CResult_WriteableEcdsaChannelSignerDecodeErrorZ_get_ok"))) TS_CResult_WriteableEcdsaChannelSignerDecodeErrorZ_get_ok(uint64_t owner) {
+ LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ* owner_conv = (LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ*)untag_ptr(owner);
+ LDKWriteableEcdsaChannelSigner* ret_ret = MALLOC(sizeof(LDKWriteableEcdsaChannelSigner), "LDKWriteableEcdsaChannelSigner");
+ *ret_ret = CResult_WriteableEcdsaChannelSignerDecodeErrorZ_get_ok(owner_conv);
return tag_ptr(ret_ret, true);
}
-static inline struct LDKDecodeError CResult_SignDecodeErrorZ_get_err(LDKCResult_SignDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
-}
-uint64_t __attribute__((export_name("TS_CResult_SignDecodeErrorZ_get_err"))) TS_CResult_SignDecodeErrorZ_get_err(uint64_t owner) {
- LDKCResult_SignDecodeErrorZ* owner_conv = (LDKCResult_SignDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_SignDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
- return ret_ref;
-}
-
-static inline struct LDKRecoverableSignature CResult_RecoverableSignatureNoneZ_get_ok(LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR owner){
-CHECK(owner->result_ok);
- return *owner->contents.result;
-}
-int8_tArray __attribute__((export_name("TS_CResult_RecoverableSignatureNoneZ_get_ok"))) TS_CResult_RecoverableSignatureNoneZ_get_ok(uint64_t owner) {
- LDKCResult_RecoverableSignatureNoneZ* owner_conv = (LDKCResult_RecoverableSignatureNoneZ*)untag_ptr(owner);
- int8_tArray ret_arr = init_int8_tArray(68, __LINE__);
- memcpy(ret_arr->elems, CResult_RecoverableSignatureNoneZ_get_ok(owner_conv).serialized_form, 68);
- return ret_arr;
-}
-
-static inline void CResult_RecoverableSignatureNoneZ_get_err(LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR owner){
+static inline struct LDKDecodeError CResult_WriteableEcdsaChannelSignerDecodeErrorZ_get_err(LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ *NONNULL_PTR owner){
CHECK(!owner->result_ok);
- return *owner->contents.err;
+ return DecodeError_clone(&*owner->contents.err);
}
-void __attribute__((export_name("TS_CResult_RecoverableSignatureNoneZ_get_err"))) TS_CResult_RecoverableSignatureNoneZ_get_err(uint64_t owner) {
- LDKCResult_RecoverableSignatureNoneZ* owner_conv = (LDKCResult_RecoverableSignatureNoneZ*)untag_ptr(owner);
- CResult_RecoverableSignatureNoneZ_get_err(owner_conv);
+uint64_t __attribute__((export_name("TS_CResult_WriteableEcdsaChannelSignerDecodeErrorZ_get_err"))) TS_CResult_WriteableEcdsaChannelSignerDecodeErrorZ_get_err(uint64_t owner) {
+ LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ* owner_conv = (LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ*)untag_ptr(owner);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_WriteableEcdsaChannelSignerDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
}
static inline LDKCVec_CVec_u8ZZ CVec_CVec_u8ZZ_clone(const LDKCVec_CVec_u8ZZ *orig) {
}
static inline struct LDKDecodeError CResult_InMemorySignerDecodeErrorZ_get_err(LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
uint64_t __attribute__((export_name("TS_CResult_InMemorySignerDecodeErrorZ_get_err"))) TS_CResult_InMemorySignerDecodeErrorZ_get_err(uint64_t owner) {
LDKCResult_InMemorySignerDecodeErrorZ* owner_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_InMemorySignerDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_InMemorySignerDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
int16_t some_conv = obj->some;
return some_conv;
}
-uint32_t __attribute__((export_name("TS_LDKAPIError_ty_from_ptr"))) TS_LDKAPIError_ty_from_ptr(uint64_t ptr) {
- LDKAPIError *obj = (LDKAPIError*)untag_ptr(ptr);
- switch(obj->tag) {
- case LDKAPIError_APIMisuseError: return 0;
- case LDKAPIError_FeeRateTooHigh: return 1;
- case LDKAPIError_RouteError: return 2;
- case LDKAPIError_ChannelUnavailable: return 3;
- case LDKAPIError_MonitorUpdateFailed: return 4;
- case LDKAPIError_IncompatibleShutdownScript: return 5;
- default: abort();
- }
-}
-jstring __attribute__((export_name("TS_LDKAPIError_APIMisuseError_get_err"))) TS_LDKAPIError_APIMisuseError_get_err(uint64_t ptr) {
- LDKAPIError *obj = (LDKAPIError*)untag_ptr(ptr);
- assert(obj->tag == LDKAPIError_APIMisuseError);
- LDKStr err_str = obj->api_misuse_error.err;
- jstring err_conv = str_ref_to_ts(err_str.chars, err_str.len);
- return err_conv;
-}
-jstring __attribute__((export_name("TS_LDKAPIError_FeeRateTooHigh_get_err"))) TS_LDKAPIError_FeeRateTooHigh_get_err(uint64_t ptr) {
- LDKAPIError *obj = (LDKAPIError*)untag_ptr(ptr);
- assert(obj->tag == LDKAPIError_FeeRateTooHigh);
- LDKStr err_str = obj->fee_rate_too_high.err;
- jstring err_conv = str_ref_to_ts(err_str.chars, err_str.len);
- return err_conv;
-}
-int32_t __attribute__((export_name("TS_LDKAPIError_FeeRateTooHigh_get_feerate"))) TS_LDKAPIError_FeeRateTooHigh_get_feerate(uint64_t ptr) {
- LDKAPIError *obj = (LDKAPIError*)untag_ptr(ptr);
- assert(obj->tag == LDKAPIError_FeeRateTooHigh);
- int32_t feerate_conv = obj->fee_rate_too_high.feerate;
- return feerate_conv;
-}
-jstring __attribute__((export_name("TS_LDKAPIError_RouteError_get_err"))) TS_LDKAPIError_RouteError_get_err(uint64_t ptr) {
- LDKAPIError *obj = (LDKAPIError*)untag_ptr(ptr);
- assert(obj->tag == LDKAPIError_RouteError);
- LDKStr err_str = obj->route_error.err;
- jstring err_conv = str_ref_to_ts(err_str.chars, err_str.len);
- return err_conv;
-}
-jstring __attribute__((export_name("TS_LDKAPIError_ChannelUnavailable_get_err"))) TS_LDKAPIError_ChannelUnavailable_get_err(uint64_t ptr) {
- LDKAPIError *obj = (LDKAPIError*)untag_ptr(ptr);
- assert(obj->tag == LDKAPIError_ChannelUnavailable);
- LDKStr err_str = obj->channel_unavailable.err;
- jstring err_conv = str_ref_to_ts(err_str.chars, err_str.len);
- return err_conv;
-}
-uint64_t __attribute__((export_name("TS_LDKAPIError_IncompatibleShutdownScript_get_script"))) TS_LDKAPIError_IncompatibleShutdownScript_get_script(uint64_t ptr) {
- LDKAPIError *obj = (LDKAPIError*)untag_ptr(ptr);
- assert(obj->tag == LDKAPIError_IncompatibleShutdownScript);
- LDKShutdownScript script_var = obj->incompatible_shutdown_script.script;
- uint64_t script_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(script_var);
- script_ref = tag_ptr(script_var.inner, false);
- return script_ref;
-}
-static inline void CResult_NoneAPIErrorZ_get_ok(LDKCResult_NoneAPIErrorZ *NONNULL_PTR owner){
-CHECK(owner->result_ok);
- return *owner->contents.result;
-}
-void __attribute__((export_name("TS_CResult_NoneAPIErrorZ_get_ok"))) TS_CResult_NoneAPIErrorZ_get_ok(uint64_t owner) {
- LDKCResult_NoneAPIErrorZ* owner_conv = (LDKCResult_NoneAPIErrorZ*)untag_ptr(owner);
- CResult_NoneAPIErrorZ_get_ok(owner_conv);
-}
-
-static inline struct LDKAPIError CResult_NoneAPIErrorZ_get_err(LDKCResult_NoneAPIErrorZ *NONNULL_PTR owner){
-CHECK(!owner->result_ok);
- return APIError_clone(&*owner->contents.err);
-}
-uint64_t __attribute__((export_name("TS_CResult_NoneAPIErrorZ_get_err"))) TS_CResult_NoneAPIErrorZ_get_err(uint64_t owner) {
- LDKCResult_NoneAPIErrorZ* owner_conv = (LDKCResult_NoneAPIErrorZ*)untag_ptr(owner);
- LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
- *ret_copy = CResult_NoneAPIErrorZ_get_err(owner_conv);
- uint64_t ret_ref = tag_ptr(ret_copy, true);
- return ret_ref;
-}
-
-static inline LDKCVec_CResult_NoneAPIErrorZZ CVec_CResult_NoneAPIErrorZZ_clone(const LDKCVec_CResult_NoneAPIErrorZZ *orig) {
- LDKCVec_CResult_NoneAPIErrorZZ ret = { .data = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ) * orig->datalen, "LDKCVec_CResult_NoneAPIErrorZZ clone bytes"), .datalen = orig->datalen };
- for (size_t i = 0; i < ret.datalen; i++) {
- ret.data[i] = CResult_NoneAPIErrorZ_clone(&orig->data[i]);
- }
- return ret;
-}
-static inline LDKCVec_APIErrorZ CVec_APIErrorZ_clone(const LDKCVec_APIErrorZ *orig) {
- LDKCVec_APIErrorZ ret = { .data = MALLOC(sizeof(LDKAPIError) * orig->datalen, "LDKCVec_APIErrorZ clone bytes"), .datalen = orig->datalen };
- for (size_t i = 0; i < ret.datalen; i++) {
- ret.data[i] = APIError_clone(&orig->data[i]);
- }
- return ret;
-}
static inline struct LDKThirtyTwoBytes CResult__u832APIErrorZ_get_ok(LDKCResult__u832APIErrorZ *NONNULL_PTR owner){
CHECK(owner->result_ok);
return ThirtyTwoBytes_clone(&*owner->contents.result);
return ret_ref;
}
+uint32_t __attribute__((export_name("TS_LDKRecentPaymentDetails_ty_from_ptr"))) TS_LDKRecentPaymentDetails_ty_from_ptr(uint64_t ptr) {
+ LDKRecentPaymentDetails *obj = (LDKRecentPaymentDetails*)untag_ptr(ptr);
+ switch(obj->tag) {
+ case LDKRecentPaymentDetails_Pending: return 0;
+ case LDKRecentPaymentDetails_Fulfilled: return 1;
+ case LDKRecentPaymentDetails_Abandoned: return 2;
+ default: abort();
+ }
+}
+int8_tArray __attribute__((export_name("TS_LDKRecentPaymentDetails_Pending_get_payment_hash"))) TS_LDKRecentPaymentDetails_Pending_get_payment_hash(uint64_t ptr) {
+ LDKRecentPaymentDetails *obj = (LDKRecentPaymentDetails*)untag_ptr(ptr);
+ assert(obj->tag == LDKRecentPaymentDetails_Pending);
+ int8_tArray payment_hash_arr = init_int8_tArray(32, __LINE__);
+ memcpy(payment_hash_arr->elems, obj->pending.payment_hash.data, 32);
+ return payment_hash_arr;
+}
+int64_t __attribute__((export_name("TS_LDKRecentPaymentDetails_Pending_get_total_msat"))) TS_LDKRecentPaymentDetails_Pending_get_total_msat(uint64_t ptr) {
+ LDKRecentPaymentDetails *obj = (LDKRecentPaymentDetails*)untag_ptr(ptr);
+ assert(obj->tag == LDKRecentPaymentDetails_Pending);
+ int64_t total_msat_conv = obj->pending.total_msat;
+ return total_msat_conv;
+}
+int8_tArray __attribute__((export_name("TS_LDKRecentPaymentDetails_Fulfilled_get_payment_hash"))) TS_LDKRecentPaymentDetails_Fulfilled_get_payment_hash(uint64_t ptr) {
+ LDKRecentPaymentDetails *obj = (LDKRecentPaymentDetails*)untag_ptr(ptr);
+ assert(obj->tag == LDKRecentPaymentDetails_Fulfilled);
+ int8_tArray payment_hash_arr = init_int8_tArray(32, __LINE__);
+ memcpy(payment_hash_arr->elems, obj->fulfilled.payment_hash.data, 32);
+ return payment_hash_arr;
+}
+int8_tArray __attribute__((export_name("TS_LDKRecentPaymentDetails_Abandoned_get_payment_hash"))) TS_LDKRecentPaymentDetails_Abandoned_get_payment_hash(uint64_t ptr) {
+ LDKRecentPaymentDetails *obj = (LDKRecentPaymentDetails*)untag_ptr(ptr);
+ assert(obj->tag == LDKRecentPaymentDetails_Abandoned);
+ int8_tArray payment_hash_arr = init_int8_tArray(32, __LINE__);
+ memcpy(payment_hash_arr->elems, obj->abandoned.payment_hash.data, 32);
+ return payment_hash_arr;
+}
+static inline LDKCVec_RecentPaymentDetailsZ CVec_RecentPaymentDetailsZ_clone(const LDKCVec_RecentPaymentDetailsZ *orig) {
+ LDKCVec_RecentPaymentDetailsZ ret = { .data = MALLOC(sizeof(LDKRecentPaymentDetails) * orig->datalen, "LDKCVec_RecentPaymentDetailsZ clone bytes"), .datalen = orig->datalen };
+ for (size_t i = 0; i < ret.datalen; i++) {
+ ret.data[i] = RecentPaymentDetails_clone(&orig->data[i]);
+ }
+ return ret;
+}
uint32_t __attribute__((export_name("TS_LDKPaymentSendFailure_ty_from_ptr"))) TS_LDKPaymentSendFailure_ty_from_ptr(uint64_t ptr) {
LDKPaymentSendFailure *obj = (LDKPaymentSendFailure*)untag_ptr(ptr);
switch(obj->tag) {
case LDKPaymentSendFailure_ParameterError: return 0;
case LDKPaymentSendFailure_PathParameterError: return 1;
- case LDKPaymentSendFailure_AllFailedRetrySafe: return 2;
- case LDKPaymentSendFailure_PartialFailure: return 3;
+ case LDKPaymentSendFailure_AllFailedResendSafe: return 2;
+ case LDKPaymentSendFailure_DuplicatePayment: return 3;
+ case LDKPaymentSendFailure_PartialFailure: return 4;
default: abort();
}
}
return path_parameter_error_arr;
}
-uint64_tArray __attribute__((export_name("TS_LDKPaymentSendFailure_AllFailedRetrySafe_get_all_failed_retry_safe"))) TS_LDKPaymentSendFailure_AllFailedRetrySafe_get_all_failed_retry_safe(uint64_t ptr) {
+uint64_tArray __attribute__((export_name("TS_LDKPaymentSendFailure_AllFailedResendSafe_get_all_failed_resend_safe"))) TS_LDKPaymentSendFailure_AllFailedResendSafe_get_all_failed_resend_safe(uint64_t ptr) {
LDKPaymentSendFailure *obj = (LDKPaymentSendFailure*)untag_ptr(ptr);
- assert(obj->tag == LDKPaymentSendFailure_AllFailedRetrySafe);
- LDKCVec_APIErrorZ all_failed_retry_safe_var = obj->all_failed_retry_safe;
- uint64_tArray all_failed_retry_safe_arr = NULL;
- all_failed_retry_safe_arr = init_uint64_tArray(all_failed_retry_safe_var.datalen, __LINE__);
- uint64_t *all_failed_retry_safe_arr_ptr = (uint64_t*)(((uint8_t*)all_failed_retry_safe_arr) + 8);
- for (size_t k = 0; k < all_failed_retry_safe_var.datalen; k++) {
- uint64_t all_failed_retry_safe_conv_10_ref = tag_ptr(&all_failed_retry_safe_var.data[k], false);
- all_failed_retry_safe_arr_ptr[k] = all_failed_retry_safe_conv_10_ref;
+ assert(obj->tag == LDKPaymentSendFailure_AllFailedResendSafe);
+ LDKCVec_APIErrorZ all_failed_resend_safe_var = obj->all_failed_resend_safe;
+ uint64_tArray all_failed_resend_safe_arr = NULL;
+ all_failed_resend_safe_arr = init_uint64_tArray(all_failed_resend_safe_var.datalen, __LINE__);
+ uint64_t *all_failed_resend_safe_arr_ptr = (uint64_t*)(((uint8_t*)all_failed_resend_safe_arr) + 8);
+ for (size_t k = 0; k < all_failed_resend_safe_var.datalen; k++) {
+ uint64_t all_failed_resend_safe_conv_10_ref = tag_ptr(&all_failed_resend_safe_var.data[k], false);
+ all_failed_resend_safe_arr_ptr[k] = all_failed_resend_safe_conv_10_ref;
}
- return all_failed_retry_safe_arr;
+ return all_failed_resend_safe_arr;
}
uint64_tArray __attribute__((export_name("TS_LDKPaymentSendFailure_PartialFailure_get_results"))) TS_LDKPaymentSendFailure_PartialFailure_get_results(uint64_t ptr) {
LDKPaymentSendFailure *obj = (LDKPaymentSendFailure*)untag_ptr(ptr);
memcpy(payment_id_arr->elems, obj->partial_failure.payment_id.data, 32);
return payment_id_arr;
}
-static inline struct LDKThirtyTwoBytes CResult_PaymentIdPaymentSendFailureZ_get_ok(LDKCResult_PaymentIdPaymentSendFailureZ *NONNULL_PTR owner){
+static inline void CResult_NonePaymentSendFailureZ_get_ok(LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR owner){
CHECK(owner->result_ok);
- return ThirtyTwoBytes_clone(&*owner->contents.result);
+ return *owner->contents.result;
}
-int8_tArray __attribute__((export_name("TS_CResult_PaymentIdPaymentSendFailureZ_get_ok"))) TS_CResult_PaymentIdPaymentSendFailureZ_get_ok(uint64_t owner) {
- LDKCResult_PaymentIdPaymentSendFailureZ* owner_conv = (LDKCResult_PaymentIdPaymentSendFailureZ*)untag_ptr(owner);
- int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
- memcpy(ret_arr->elems, CResult_PaymentIdPaymentSendFailureZ_get_ok(owner_conv).data, 32);
- return ret_arr;
+void __attribute__((export_name("TS_CResult_NonePaymentSendFailureZ_get_ok"))) TS_CResult_NonePaymentSendFailureZ_get_ok(uint64_t owner) {
+ LDKCResult_NonePaymentSendFailureZ* owner_conv = (LDKCResult_NonePaymentSendFailureZ*)untag_ptr(owner);
+ CResult_NonePaymentSendFailureZ_get_ok(owner_conv);
}
-static inline struct LDKPaymentSendFailure CResult_PaymentIdPaymentSendFailureZ_get_err(LDKCResult_PaymentIdPaymentSendFailureZ *NONNULL_PTR owner){
+static inline struct LDKPaymentSendFailure CResult_NonePaymentSendFailureZ_get_err(LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR owner){
CHECK(!owner->result_ok);
return PaymentSendFailure_clone(&*owner->contents.err);
}
-uint64_t __attribute__((export_name("TS_CResult_PaymentIdPaymentSendFailureZ_get_err"))) TS_CResult_PaymentIdPaymentSendFailureZ_get_err(uint64_t owner) {
- LDKCResult_PaymentIdPaymentSendFailureZ* owner_conv = (LDKCResult_PaymentIdPaymentSendFailureZ*)untag_ptr(owner);
+uint64_t __attribute__((export_name("TS_CResult_NonePaymentSendFailureZ_get_err"))) TS_CResult_NonePaymentSendFailureZ_get_err(uint64_t owner) {
+ LDKCResult_NonePaymentSendFailureZ* owner_conv = (LDKCResult_NonePaymentSendFailureZ*)untag_ptr(owner);
LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
- *ret_copy = CResult_PaymentIdPaymentSendFailureZ_get_err(owner_conv);
+ *ret_copy = CResult_NonePaymentSendFailureZ_get_err(owner_conv);
uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
-static inline void CResult_NonePaymentSendFailureZ_get_ok(LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR owner){
+static inline void CResult_NoneRetryableSendFailureZ_get_ok(LDKCResult_NoneRetryableSendFailureZ *NONNULL_PTR owner){
CHECK(owner->result_ok);
return *owner->contents.result;
}
-void __attribute__((export_name("TS_CResult_NonePaymentSendFailureZ_get_ok"))) TS_CResult_NonePaymentSendFailureZ_get_ok(uint64_t owner) {
- LDKCResult_NonePaymentSendFailureZ* owner_conv = (LDKCResult_NonePaymentSendFailureZ*)untag_ptr(owner);
- CResult_NonePaymentSendFailureZ_get_ok(owner_conv);
+void __attribute__((export_name("TS_CResult_NoneRetryableSendFailureZ_get_ok"))) TS_CResult_NoneRetryableSendFailureZ_get_ok(uint64_t owner) {
+ LDKCResult_NoneRetryableSendFailureZ* owner_conv = (LDKCResult_NoneRetryableSendFailureZ*)untag_ptr(owner);
+ CResult_NoneRetryableSendFailureZ_get_ok(owner_conv);
}
-static inline struct LDKPaymentSendFailure CResult_NonePaymentSendFailureZ_get_err(LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR owner){
+static inline enum LDKRetryableSendFailure CResult_NoneRetryableSendFailureZ_get_err(LDKCResult_NoneRetryableSendFailureZ *NONNULL_PTR owner){
+CHECK(!owner->result_ok);
+ return RetryableSendFailure_clone(&*owner->contents.err);
+}
+uint32_t __attribute__((export_name("TS_CResult_NoneRetryableSendFailureZ_get_err"))) TS_CResult_NoneRetryableSendFailureZ_get_err(uint64_t owner) {
+ LDKCResult_NoneRetryableSendFailureZ* owner_conv = (LDKCResult_NoneRetryableSendFailureZ*)untag_ptr(owner);
+ uint32_t ret_conv = LDKRetryableSendFailure_to_js(CResult_NoneRetryableSendFailureZ_get_err(owner_conv));
+ return ret_conv;
+}
+
+static inline struct LDKThirtyTwoBytes CResult_PaymentHashPaymentSendFailureZ_get_ok(LDKCResult_PaymentHashPaymentSendFailureZ *NONNULL_PTR owner){
+CHECK(owner->result_ok);
+ return ThirtyTwoBytes_clone(&*owner->contents.result);
+}
+int8_tArray __attribute__((export_name("TS_CResult_PaymentHashPaymentSendFailureZ_get_ok"))) TS_CResult_PaymentHashPaymentSendFailureZ_get_ok(uint64_t owner) {
+ LDKCResult_PaymentHashPaymentSendFailureZ* owner_conv = (LDKCResult_PaymentHashPaymentSendFailureZ*)untag_ptr(owner);
+ int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
+ memcpy(ret_arr->elems, CResult_PaymentHashPaymentSendFailureZ_get_ok(owner_conv).data, 32);
+ return ret_arr;
+}
+
+static inline struct LDKPaymentSendFailure CResult_PaymentHashPaymentSendFailureZ_get_err(LDKCResult_PaymentHashPaymentSendFailureZ *NONNULL_PTR owner){
CHECK(!owner->result_ok);
return PaymentSendFailure_clone(&*owner->contents.err);
}
-uint64_t __attribute__((export_name("TS_CResult_NonePaymentSendFailureZ_get_err"))) TS_CResult_NonePaymentSendFailureZ_get_err(uint64_t owner) {
- LDKCResult_NonePaymentSendFailureZ* owner_conv = (LDKCResult_NonePaymentSendFailureZ*)untag_ptr(owner);
+uint64_t __attribute__((export_name("TS_CResult_PaymentHashPaymentSendFailureZ_get_err"))) TS_CResult_PaymentHashPaymentSendFailureZ_get_err(uint64_t owner) {
+ LDKCResult_PaymentHashPaymentSendFailureZ* owner_conv = (LDKCResult_PaymentHashPaymentSendFailureZ*)untag_ptr(owner);
LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
- *ret_copy = CResult_NonePaymentSendFailureZ_get_err(owner_conv);
+ *ret_copy = CResult_PaymentHashPaymentSendFailureZ_get_err(owner_conv);
uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
+static inline struct LDKThirtyTwoBytes CResult_PaymentHashRetryableSendFailureZ_get_ok(LDKCResult_PaymentHashRetryableSendFailureZ *NONNULL_PTR owner){
+CHECK(owner->result_ok);
+ return ThirtyTwoBytes_clone(&*owner->contents.result);
+}
+int8_tArray __attribute__((export_name("TS_CResult_PaymentHashRetryableSendFailureZ_get_ok"))) TS_CResult_PaymentHashRetryableSendFailureZ_get_ok(uint64_t owner) {
+ LDKCResult_PaymentHashRetryableSendFailureZ* owner_conv = (LDKCResult_PaymentHashRetryableSendFailureZ*)untag_ptr(owner);
+ int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
+ memcpy(ret_arr->elems, CResult_PaymentHashRetryableSendFailureZ_get_ok(owner_conv).data, 32);
+ return ret_arr;
+}
+
+static inline enum LDKRetryableSendFailure CResult_PaymentHashRetryableSendFailureZ_get_err(LDKCResult_PaymentHashRetryableSendFailureZ *NONNULL_PTR owner){
+CHECK(!owner->result_ok);
+ return RetryableSendFailure_clone(&*owner->contents.err);
+}
+uint32_t __attribute__((export_name("TS_CResult_PaymentHashRetryableSendFailureZ_get_err"))) TS_CResult_PaymentHashRetryableSendFailureZ_get_err(uint64_t owner) {
+ LDKCResult_PaymentHashRetryableSendFailureZ* owner_conv = (LDKCResult_PaymentHashRetryableSendFailureZ*)untag_ptr(owner);
+ uint32_t ret_conv = LDKRetryableSendFailure_to_js(CResult_PaymentHashRetryableSendFailureZ_get_err(owner_conv));
+ return ret_conv;
+}
+
static inline struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentIdZ_get_a(LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR owner){
return ThirtyTwoBytes_clone(&owner->a);
}
}
static inline struct LDKDecodeError CResult_CounterpartyForwardingInfoDecodeErrorZ_get_err(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
uint64_t __attribute__((export_name("TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_get_err"))) TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_get_err(uint64_t owner) {
LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* owner_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_CounterpartyForwardingInfoDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_CounterpartyForwardingInfoDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_ChannelCounterpartyDecodeErrorZ_get_err(LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
uint64_t __attribute__((export_name("TS_CResult_ChannelCounterpartyDecodeErrorZ_get_err"))) TS_CResult_ChannelCounterpartyDecodeErrorZ_get_err(uint64_t owner) {
LDKCResult_ChannelCounterpartyDecodeErrorZ* owner_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_ChannelCounterpartyDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_ChannelCounterpartyDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_ChannelDetailsDecodeErrorZ_get_err(LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
uint64_t __attribute__((export_name("TS_CResult_ChannelDetailsDecodeErrorZ_get_err"))) TS_CResult_ChannelDetailsDecodeErrorZ_get_err(uint64_t owner) {
LDKCResult_ChannelDetailsDecodeErrorZ* owner_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_ChannelDetailsDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_ChannelDetailsDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_PhantomRouteHintsDecodeErrorZ_get_err(LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
uint64_t __attribute__((export_name("TS_CResult_PhantomRouteHintsDecodeErrorZ_get_err"))) TS_CResult_PhantomRouteHintsDecodeErrorZ_get_err(uint64_t owner) {
LDKCResult_PhantomRouteHintsDecodeErrorZ* owner_conv = (LDKCResult_PhantomRouteHintsDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_PhantomRouteHintsDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_PhantomRouteHintsDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
FREE(j_calls);
}
}
-LDKCResult_NoneChannelMonitorUpdateErrZ watch_channel_LDKWatch_jcall(const void* this_arg, LDKOutPoint funding_txo, LDKChannelMonitor monitor) {
+LDKChannelMonitorUpdateStatus watch_channel_LDKWatch_jcall(const void* this_arg, LDKOutPoint funding_txo, LDKChannelMonitor monitor) {
LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
LDKOutPoint funding_txo_var = funding_txo;
uint64_t funding_txo_ref = 0;
uint64_t monitor_ref = 0;
CHECK_INNER_FIELD_ACCESS_OR_NULL(monitor_var);
monitor_ref = tag_ptr(monitor_var.inner, monitor_var.is_owned);
- uint32_t ret = js_invoke_function_bbuuuu(j_calls->instance_ptr, 16, funding_txo_ref, monitor_ref, 0, 0, 0, 0);
- void* ret_ptr = untag_ptr(ret);
- CHECK_ACCESS(ret_ptr);
- LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr);
- FREE(untag_ptr(ret));
+ uint64_t ret = js_invoke_function_bbuuuu(j_calls->instance_ptr, 17, funding_txo_ref, monitor_ref, 0, 0, 0, 0);
+ LDKChannelMonitorUpdateStatus ret_conv = LDKChannelMonitorUpdateStatus_from_js(ret);
return ret_conv;
}
-LDKCResult_NoneChannelMonitorUpdateErrZ update_channel_LDKWatch_jcall(const void* this_arg, LDKOutPoint funding_txo, LDKChannelMonitorUpdate update) {
+LDKChannelMonitorUpdateStatus update_channel_LDKWatch_jcall(const void* this_arg, LDKOutPoint funding_txo, const LDKChannelMonitorUpdate * update) {
LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
LDKOutPoint funding_txo_var = funding_txo;
uint64_t funding_txo_ref = 0;
CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_var);
funding_txo_ref = tag_ptr(funding_txo_var.inner, funding_txo_var.is_owned);
- LDKChannelMonitorUpdate update_var = update;
+ LDKChannelMonitorUpdate update_var = *update;
uint64_t update_ref = 0;
+ update_var = ChannelMonitorUpdate_clone(&update_var);
CHECK_INNER_FIELD_ACCESS_OR_NULL(update_var);
update_ref = tag_ptr(update_var.inner, update_var.is_owned);
- uint32_t ret = js_invoke_function_bbuuuu(j_calls->instance_ptr, 17, funding_txo_ref, update_ref, 0, 0, 0, 0);
- void* ret_ptr = untag_ptr(ret);
- CHECK_ACCESS(ret_ptr);
- LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr);
- FREE(untag_ptr(ret));
+ uint64_t ret = js_invoke_function_bbuuuu(j_calls->instance_ptr, 18, funding_txo_ref, update_ref, 0, 0, 0, 0);
+ LDKChannelMonitorUpdateStatus ret_conv = LDKChannelMonitorUpdateStatus_from_js(ret);
return ret_conv;
}
LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ release_pending_monitor_events_LDKWatch_jcall(const void* this_arg) {
LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
- uint64_tArray ret = (uint64_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 18, 0, 0, 0, 0, 0, 0);
+ uint64_tArray ret = (uint64_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 19, 0, 0, 0, 0, 0, 0);
LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ ret_constr;
ret_constr.datalen = ret->arr_len;
if (ret_constr.datalen > 0)
*res_ptr = LDKWatch_init(o);
return tag_ptr(res_ptr, true);
}
-uint64_t __attribute__((export_name("TS_Watch_watch_channel"))) TS_Watch_watch_channel(uint64_t this_arg, uint64_t funding_txo, uint64_t monitor) {
+uint32_t __attribute__((export_name("TS_Watch_watch_channel"))) TS_Watch_watch_channel(uint64_t this_arg, uint64_t funding_txo, uint64_t monitor) {
void* this_arg_ptr = untag_ptr(this_arg);
if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
LDKWatch* this_arg_conv = (LDKWatch*)this_arg_ptr;
monitor_conv.is_owned = ptr_is_owned(monitor);
CHECK_INNER_FIELD_ACCESS_OR_NULL(monitor_conv);
monitor_conv = ChannelMonitor_clone(&monitor_conv);
- LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
- *ret_conv = (this_arg_conv->watch_channel)(this_arg_conv->this_arg, funding_txo_conv, monitor_conv);
- return tag_ptr(ret_conv, true);
+ uint32_t ret_conv = LDKChannelMonitorUpdateStatus_to_js((this_arg_conv->watch_channel)(this_arg_conv->this_arg, funding_txo_conv, monitor_conv));
+ return ret_conv;
}
-uint64_t __attribute__((export_name("TS_Watch_update_channel"))) TS_Watch_update_channel(uint64_t this_arg, uint64_t funding_txo, uint64_t update) {
+uint32_t __attribute__((export_name("TS_Watch_update_channel"))) TS_Watch_update_channel(uint64_t this_arg, uint64_t funding_txo, uint64_t update) {
void* this_arg_ptr = untag_ptr(this_arg);
if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
LDKWatch* this_arg_conv = (LDKWatch*)this_arg_ptr;
update_conv.inner = untag_ptr(update);
update_conv.is_owned = ptr_is_owned(update);
CHECK_INNER_FIELD_ACCESS_OR_NULL(update_conv);
- update_conv = ChannelMonitorUpdate_clone(&update_conv);
- LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
- *ret_conv = (this_arg_conv->update_channel)(this_arg_conv->this_arg, funding_txo_conv, update_conv);
- return tag_ptr(ret_conv, true);
+ update_conv.is_owned = false;
+ uint32_t ret_conv = LDKChannelMonitorUpdateStatus_to_js((this_arg_conv->update_channel)(this_arg_conv->this_arg, funding_txo_conv, &update_conv));
+ return ret_conv;
}
uint64_tArray __attribute__((export_name("TS_Watch_release_pending_monitor_events"))) TS_Watch_release_pending_monitor_events(uint64_t this_arg) {
int8_tArray tx_arr = init_int8_tArray(tx_var.datalen, __LINE__);
memcpy(tx_arr->elems, tx_var.data, tx_var.datalen);
Transaction_free(tx_var);
- js_invoke_function_uuuuuu(j_calls->instance_ptr, 19, (uint32_t)tx_arr, 0, 0, 0, 0, 0);
+ js_invoke_function_uuuuuu(j_calls->instance_ptr, 20, (uint32_t)tx_arr, 0, 0, 0, 0, 0);
}
static void LDKBroadcasterInterface_JCalls_cloned(LDKBroadcasterInterface* new_obj) {
LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_JCalls*) new_obj->this_arg;
(this_arg_conv->broadcast_transaction)(this_arg_conv->this_arg, tx_ref);
}
-typedef struct LDKKeysInterface_JCalls {
+typedef struct LDKEntropySource_JCalls {
atomic_size_t refcnt;
uint32_t instance_ptr;
-} LDKKeysInterface_JCalls;
-static void LDKKeysInterface_JCalls_free(void* this_arg) {
- LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
+} LDKEntropySource_JCalls;
+static void LDKEntropySource_JCalls_free(void* this_arg) {
+ LDKEntropySource_JCalls *j_calls = (LDKEntropySource_JCalls*) this_arg;
if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
FREE(j_calls);
}
}
-LDKCResult_SecretKeyNoneZ get_node_secret_LDKKeysInterface_jcall(const void* this_arg, LDKRecipient recipient) {
- LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
- uint32_t recipient_conv = LDKRecipient_to_js(recipient);
- uint32_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 20, recipient_conv, 0, 0, 0, 0, 0);
- void* ret_ptr = untag_ptr(ret);
- CHECK_ACCESS(ret_ptr);
- LDKCResult_SecretKeyNoneZ ret_conv = *(LDKCResult_SecretKeyNoneZ*)(ret_ptr);
- FREE(untag_ptr(ret));
- return ret_conv;
-}
-LDKCVec_u8Z get_destination_script_LDKKeysInterface_jcall(const void* this_arg) {
- LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
+LDKThirtyTwoBytes get_secure_random_bytes_LDKEntropySource_jcall(const void* this_arg) {
+ LDKEntropySource_JCalls *j_calls = (LDKEntropySource_JCalls*) this_arg;
int8_tArray ret = (int8_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 21, 0, 0, 0, 0, 0, 0);
- LDKCVec_u8Z ret_ref;
- ret_ref.datalen = ret->arr_len;
- ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes");
- memcpy(ret_ref.data, ret->elems, ret_ref.datalen); FREE(ret);
+ LDKThirtyTwoBytes ret_ref;
+ CHECK(ret->arr_len == 32);
+ memcpy(ret_ref.data, ret->elems, 32); FREE(ret);
return ret_ref;
}
-LDKShutdownScript get_shutdown_scriptpubkey_LDKKeysInterface_jcall(const void* this_arg) {
- LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
- uint32_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 22, 0, 0, 0, 0, 0, 0);
- LDKShutdownScript ret_conv;
- ret_conv.inner = untag_ptr(ret);
- ret_conv.is_owned = ptr_is_owned(ret);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv);
- return ret_conv;
+static void LDKEntropySource_JCalls_cloned(LDKEntropySource* new_obj) {
+ LDKEntropySource_JCalls *j_calls = (LDKEntropySource_JCalls*) new_obj->this_arg;
+ atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
}
-LDKSign get_channel_signer_LDKKeysInterface_jcall(const void* this_arg, bool inbound, uint64_t channel_value_satoshis) {
- LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
- jboolean inbound_conv = inbound;
- int64_t channel_value_satoshis_conv = channel_value_satoshis;
- uint32_t ret = js_invoke_function_ubuuuu(j_calls->instance_ptr, 23, inbound_conv, channel_value_satoshis_conv, 0, 0, 0, 0);
- void* ret_ptr = untag_ptr(ret);
- CHECK_ACCESS(ret_ptr);
- LDKSign ret_conv = *(LDKSign*)(ret_ptr);
- FREE(untag_ptr(ret));
- return ret_conv;
+static inline LDKEntropySource LDKEntropySource_init (JSValue o) {
+ LDKEntropySource_JCalls *calls = MALLOC(sizeof(LDKEntropySource_JCalls), "LDKEntropySource_JCalls");
+ atomic_init(&calls->refcnt, 1);
+ calls->instance_ptr = o;
+
+ LDKEntropySource ret = {
+ .this_arg = (void*) calls,
+ .get_secure_random_bytes = get_secure_random_bytes_LDKEntropySource_jcall,
+ .free = LDKEntropySource_JCalls_free,
+ };
+ return ret;
+}
+uint64_t __attribute__((export_name("TS_LDKEntropySource_new"))) TS_LDKEntropySource_new(JSValue o) {
+ LDKEntropySource *res_ptr = MALLOC(sizeof(LDKEntropySource), "LDKEntropySource");
+ *res_ptr = LDKEntropySource_init(o);
+ return tag_ptr(res_ptr, true);
+}
+int8_tArray __attribute__((export_name("TS_EntropySource_get_secure_random_bytes"))) TS_EntropySource_get_secure_random_bytes(uint64_t this_arg) {
+ void* this_arg_ptr = untag_ptr(this_arg);
+ if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKEntropySource* this_arg_conv = (LDKEntropySource*)this_arg_ptr;
+ int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
+ memcpy(ret_arr->elems, (this_arg_conv->get_secure_random_bytes)(this_arg_conv->this_arg).data, 32);
+ return ret_arr;
}
-LDKThirtyTwoBytes get_secure_random_bytes_LDKKeysInterface_jcall(const void* this_arg) {
- LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
- int8_tArray ret = (int8_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 24, 0, 0, 0, 0, 0, 0);
+
+uint32_t __attribute__((export_name("TS_LDKUnsignedGossipMessage_ty_from_ptr"))) TS_LDKUnsignedGossipMessage_ty_from_ptr(uint64_t ptr) {
+ LDKUnsignedGossipMessage *obj = (LDKUnsignedGossipMessage*)untag_ptr(ptr);
+ switch(obj->tag) {
+ case LDKUnsignedGossipMessage_ChannelAnnouncement: return 0;
+ case LDKUnsignedGossipMessage_ChannelUpdate: return 1;
+ case LDKUnsignedGossipMessage_NodeAnnouncement: return 2;
+ default: abort();
+ }
+}
+uint64_t __attribute__((export_name("TS_LDKUnsignedGossipMessage_ChannelAnnouncement_get_channel_announcement"))) TS_LDKUnsignedGossipMessage_ChannelAnnouncement_get_channel_announcement(uint64_t ptr) {
+ LDKUnsignedGossipMessage *obj = (LDKUnsignedGossipMessage*)untag_ptr(ptr);
+ assert(obj->tag == LDKUnsignedGossipMessage_ChannelAnnouncement);
+ LDKUnsignedChannelAnnouncement channel_announcement_var = obj->channel_announcement;
+ uint64_t channel_announcement_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_announcement_var);
+ channel_announcement_ref = tag_ptr(channel_announcement_var.inner, false);
+ return channel_announcement_ref;
+}
+uint64_t __attribute__((export_name("TS_LDKUnsignedGossipMessage_ChannelUpdate_get_channel_update"))) TS_LDKUnsignedGossipMessage_ChannelUpdate_get_channel_update(uint64_t ptr) {
+ LDKUnsignedGossipMessage *obj = (LDKUnsignedGossipMessage*)untag_ptr(ptr);
+ assert(obj->tag == LDKUnsignedGossipMessage_ChannelUpdate);
+ LDKUnsignedChannelUpdate channel_update_var = obj->channel_update;
+ uint64_t channel_update_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_update_var);
+ channel_update_ref = tag_ptr(channel_update_var.inner, false);
+ return channel_update_ref;
+}
+uint64_t __attribute__((export_name("TS_LDKUnsignedGossipMessage_NodeAnnouncement_get_node_announcement"))) TS_LDKUnsignedGossipMessage_NodeAnnouncement_get_node_announcement(uint64_t ptr) {
+ LDKUnsignedGossipMessage *obj = (LDKUnsignedGossipMessage*)untag_ptr(ptr);
+ assert(obj->tag == LDKUnsignedGossipMessage_NodeAnnouncement);
+ LDKUnsignedNodeAnnouncement node_announcement_var = obj->node_announcement;
+ uint64_t node_announcement_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(node_announcement_var);
+ node_announcement_ref = tag_ptr(node_announcement_var.inner, false);
+ return node_announcement_ref;
+}
+typedef struct LDKNodeSigner_JCalls {
+ atomic_size_t refcnt;
+ uint32_t instance_ptr;
+} LDKNodeSigner_JCalls;
+static void LDKNodeSigner_JCalls_free(void* this_arg) {
+ LDKNodeSigner_JCalls *j_calls = (LDKNodeSigner_JCalls*) this_arg;
+ if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
+ FREE(j_calls);
+ }
+}
+LDKThirtyTwoBytes get_inbound_payment_key_material_LDKNodeSigner_jcall(const void* this_arg) {
+ LDKNodeSigner_JCalls *j_calls = (LDKNodeSigner_JCalls*) this_arg;
+ int8_tArray ret = (int8_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 22, 0, 0, 0, 0, 0, 0);
LDKThirtyTwoBytes ret_ref;
CHECK(ret->arr_len == 32);
memcpy(ret_ref.data, ret->elems, 32); FREE(ret);
return ret_ref;
}
-LDKCResult_SignDecodeErrorZ read_chan_signer_LDKKeysInterface_jcall(const void* this_arg, LDKu8slice reader) {
- LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
- LDKu8slice reader_var = reader;
- int8_tArray reader_arr = init_int8_tArray(reader_var.datalen, __LINE__);
- memcpy(reader_arr->elems, reader_var.data, reader_var.datalen);
- uint32_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 25, (uint32_t)reader_arr, 0, 0, 0, 0, 0);
+LDKCResult_PublicKeyNoneZ get_node_id_LDKNodeSigner_jcall(const void* this_arg, LDKRecipient recipient) {
+ LDKNodeSigner_JCalls *j_calls = (LDKNodeSigner_JCalls*) this_arg;
+ uint32_t recipient_conv = LDKRecipient_to_js(recipient);
+ uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 23, recipient_conv, 0, 0, 0, 0, 0);
+ void* ret_ptr = untag_ptr(ret);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_PublicKeyNoneZ ret_conv = *(LDKCResult_PublicKeyNoneZ*)(ret_ptr);
+ FREE(untag_ptr(ret));
+ return ret_conv;
+}
+LDKCResult_SharedSecretNoneZ ecdh_LDKNodeSigner_jcall(const void* this_arg, LDKRecipient recipient, LDKPublicKey other_key, LDKCOption_ScalarZ tweak) {
+ LDKNodeSigner_JCalls *j_calls = (LDKNodeSigner_JCalls*) this_arg;
+ uint32_t recipient_conv = LDKRecipient_to_js(recipient);
+ int8_tArray other_key_arr = init_int8_tArray(33, __LINE__);
+ memcpy(other_key_arr->elems, other_key.compressed_form, 33);
+ LDKCOption_ScalarZ *tweak_copy = MALLOC(sizeof(LDKCOption_ScalarZ), "LDKCOption_ScalarZ");
+ *tweak_copy = tweak;
+ uint64_t tweak_ref = tag_ptr(tweak_copy, true);
+ uint64_t ret = js_invoke_function_uubuuu(j_calls->instance_ptr, 24, recipient_conv, (uint32_t)other_key_arr, tweak_ref, 0, 0, 0);
void* ret_ptr = untag_ptr(ret);
CHECK_ACCESS(ret_ptr);
- LDKCResult_SignDecodeErrorZ ret_conv = *(LDKCResult_SignDecodeErrorZ*)(ret_ptr);
+ LDKCResult_SharedSecretNoneZ ret_conv = *(LDKCResult_SharedSecretNoneZ*)(ret_ptr);
FREE(untag_ptr(ret));
return ret_conv;
}
-LDKCResult_RecoverableSignatureNoneZ sign_invoice_LDKKeysInterface_jcall(const void* this_arg, LDKu8slice hrp_bytes, LDKCVec_u5Z invoice_data, LDKRecipient receipient) {
- LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
+LDKCResult_RecoverableSignatureNoneZ sign_invoice_LDKNodeSigner_jcall(const void* this_arg, LDKu8slice hrp_bytes, LDKCVec_U5Z invoice_data, LDKRecipient recipient) {
+ LDKNodeSigner_JCalls *j_calls = (LDKNodeSigner_JCalls*) this_arg;
LDKu8slice hrp_bytes_var = hrp_bytes;
int8_tArray hrp_bytes_arr = init_int8_tArray(hrp_bytes_var.datalen, __LINE__);
memcpy(hrp_bytes_arr->elems, hrp_bytes_var.data, hrp_bytes_var.datalen);
- LDKCVec_u5Z invoice_data_var = invoice_data;
+ LDKCVec_U5Z invoice_data_var = invoice_data;
ptrArray invoice_data_arr = NULL;
invoice_data_arr = init_ptrArray(invoice_data_var.datalen, __LINE__);
int8_t *invoice_data_arr_ptr = (int8_t*)(((uint8_t*)invoice_data_arr) + 8);
}
FREE(invoice_data_var.data);
- uint32_t receipient_conv = LDKRecipient_to_js(receipient);
- uint32_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 26, (uint32_t)hrp_bytes_arr, (uint32_t)invoice_data_arr, receipient_conv, 0, 0, 0);
+ uint32_t recipient_conv = LDKRecipient_to_js(recipient);
+ uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 25, (uint32_t)hrp_bytes_arr, (uint32_t)invoice_data_arr, recipient_conv, 0, 0, 0);
void* ret_ptr = untag_ptr(ret);
CHECK_ACCESS(ret_ptr);
LDKCResult_RecoverableSignatureNoneZ ret_conv = *(LDKCResult_RecoverableSignatureNoneZ*)(ret_ptr);
FREE(untag_ptr(ret));
return ret_conv;
}
-LDKThirtyTwoBytes get_inbound_payment_key_material_LDKKeysInterface_jcall(const void* this_arg) {
- LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
- int8_tArray ret = (int8_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 27, 0, 0, 0, 0, 0, 0);
+LDKCResult_SignatureNoneZ sign_gossip_message_LDKNodeSigner_jcall(const void* this_arg, LDKUnsignedGossipMessage msg) {
+ LDKNodeSigner_JCalls *j_calls = (LDKNodeSigner_JCalls*) this_arg;
+ LDKUnsignedGossipMessage *msg_copy = MALLOC(sizeof(LDKUnsignedGossipMessage), "LDKUnsignedGossipMessage");
+ *msg_copy = msg;
+ uint64_t msg_ref = tag_ptr(msg_copy, true);
+ uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 26, msg_ref, 0, 0, 0, 0, 0);
+ void* ret_ptr = untag_ptr(ret);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
+ FREE(untag_ptr(ret));
+ return ret_conv;
+}
+static void LDKNodeSigner_JCalls_cloned(LDKNodeSigner* new_obj) {
+ LDKNodeSigner_JCalls *j_calls = (LDKNodeSigner_JCalls*) new_obj->this_arg;
+ atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
+}
+static inline LDKNodeSigner LDKNodeSigner_init (JSValue o) {
+ LDKNodeSigner_JCalls *calls = MALLOC(sizeof(LDKNodeSigner_JCalls), "LDKNodeSigner_JCalls");
+ atomic_init(&calls->refcnt, 1);
+ calls->instance_ptr = o;
+
+ LDKNodeSigner ret = {
+ .this_arg = (void*) calls,
+ .get_inbound_payment_key_material = get_inbound_payment_key_material_LDKNodeSigner_jcall,
+ .get_node_id = get_node_id_LDKNodeSigner_jcall,
+ .ecdh = ecdh_LDKNodeSigner_jcall,
+ .sign_invoice = sign_invoice_LDKNodeSigner_jcall,
+ .sign_gossip_message = sign_gossip_message_LDKNodeSigner_jcall,
+ .free = LDKNodeSigner_JCalls_free,
+ };
+ return ret;
+}
+uint64_t __attribute__((export_name("TS_LDKNodeSigner_new"))) TS_LDKNodeSigner_new(JSValue o) {
+ LDKNodeSigner *res_ptr = MALLOC(sizeof(LDKNodeSigner), "LDKNodeSigner");
+ *res_ptr = LDKNodeSigner_init(o);
+ return tag_ptr(res_ptr, true);
+}
+int8_tArray __attribute__((export_name("TS_NodeSigner_get_inbound_payment_key_material"))) TS_NodeSigner_get_inbound_payment_key_material(uint64_t this_arg) {
+ void* this_arg_ptr = untag_ptr(this_arg);
+ if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKNodeSigner* this_arg_conv = (LDKNodeSigner*)this_arg_ptr;
+ int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
+ memcpy(ret_arr->elems, (this_arg_conv->get_inbound_payment_key_material)(this_arg_conv->this_arg).data, 32);
+ return ret_arr;
+}
+
+uint64_t __attribute__((export_name("TS_NodeSigner_get_node_id"))) TS_NodeSigner_get_node_id(uint64_t this_arg, uint32_t recipient) {
+ void* this_arg_ptr = untag_ptr(this_arg);
+ if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKNodeSigner* this_arg_conv = (LDKNodeSigner*)this_arg_ptr;
+ LDKRecipient recipient_conv = LDKRecipient_from_js(recipient);
+ LDKCResult_PublicKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyNoneZ), "LDKCResult_PublicKeyNoneZ");
+ *ret_conv = (this_arg_conv->get_node_id)(this_arg_conv->this_arg, recipient_conv);
+ return tag_ptr(ret_conv, true);
+}
+
+uint64_t __attribute__((export_name("TS_NodeSigner_ecdh"))) TS_NodeSigner_ecdh(uint64_t this_arg, uint32_t recipient, int8_tArray other_key, uint64_t tweak) {
+ void* this_arg_ptr = untag_ptr(this_arg);
+ if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKNodeSigner* this_arg_conv = (LDKNodeSigner*)this_arg_ptr;
+ LDKRecipient recipient_conv = LDKRecipient_from_js(recipient);
+ LDKPublicKey other_key_ref;
+ CHECK(other_key->arr_len == 33);
+ memcpy(other_key_ref.compressed_form, other_key->elems, 33); FREE(other_key);
+ void* tweak_ptr = untag_ptr(tweak);
+ CHECK_ACCESS(tweak_ptr);
+ LDKCOption_ScalarZ tweak_conv = *(LDKCOption_ScalarZ*)(tweak_ptr);
+ // WARNING: we may need a move here but no clone is available for LDKCOption_ScalarZ
+ LDKCResult_SharedSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SharedSecretNoneZ), "LDKCResult_SharedSecretNoneZ");
+ *ret_conv = (this_arg_conv->ecdh)(this_arg_conv->this_arg, recipient_conv, other_key_ref, tweak_conv);
+ return tag_ptr(ret_conv, true);
+}
+
+uint64_t __attribute__((export_name("TS_NodeSigner_sign_invoice"))) TS_NodeSigner_sign_invoice(uint64_t this_arg, int8_tArray hrp_bytes, ptrArray invoice_data, uint32_t recipient) {
+ void* this_arg_ptr = untag_ptr(this_arg);
+ if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKNodeSigner* this_arg_conv = (LDKNodeSigner*)this_arg_ptr;
+ LDKu8slice hrp_bytes_ref;
+ hrp_bytes_ref.datalen = hrp_bytes->arr_len;
+ hrp_bytes_ref.data = hrp_bytes->elems;
+ LDKCVec_U5Z invoice_data_constr;
+ invoice_data_constr.datalen = invoice_data->arr_len;
+ if (invoice_data_constr.datalen > 0)
+ invoice_data_constr.data = MALLOC(invoice_data_constr.datalen * sizeof(LDKU5), "LDKCVec_U5Z Elements");
+ else
+ invoice_data_constr.data = NULL;
+ int8_t* invoice_data_vals = (void*) invoice_data->elems;
+ for (size_t h = 0; h < invoice_data_constr.datalen; h++) {
+ int8_t invoice_data_conv_7 = invoice_data_vals[h];
+
+ invoice_data_constr.data[h] = (LDKU5){ ._0 = invoice_data_conv_7 };
+ }
+ FREE(invoice_data);
+ LDKRecipient recipient_conv = LDKRecipient_from_js(recipient);
+ LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ");
+ *ret_conv = (this_arg_conv->sign_invoice)(this_arg_conv->this_arg, hrp_bytes_ref, invoice_data_constr, recipient_conv);
+ FREE(hrp_bytes);
+ return tag_ptr(ret_conv, true);
+}
+
+uint64_t __attribute__((export_name("TS_NodeSigner_sign_gossip_message"))) TS_NodeSigner_sign_gossip_message(uint64_t this_arg, uint64_t msg) {
+ void* this_arg_ptr = untag_ptr(this_arg);
+ if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKNodeSigner* this_arg_conv = (LDKNodeSigner*)this_arg_ptr;
+ void* msg_ptr = untag_ptr(msg);
+ CHECK_ACCESS(msg_ptr);
+ LDKUnsignedGossipMessage msg_conv = *(LDKUnsignedGossipMessage*)(msg_ptr);
+ msg_conv = UnsignedGossipMessage_clone((LDKUnsignedGossipMessage*)untag_ptr(msg));
+ LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
+ *ret_conv = (this_arg_conv->sign_gossip_message)(this_arg_conv->this_arg, msg_conv);
+ return tag_ptr(ret_conv, true);
+}
+
+typedef struct LDKSignerProvider_JCalls {
+ atomic_size_t refcnt;
+ uint32_t instance_ptr;
+} LDKSignerProvider_JCalls;
+static void LDKSignerProvider_JCalls_free(void* this_arg) {
+ LDKSignerProvider_JCalls *j_calls = (LDKSignerProvider_JCalls*) this_arg;
+ if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
+ FREE(j_calls);
+ }
+}
+LDKThirtyTwoBytes generate_channel_keys_id_LDKSignerProvider_jcall(const void* this_arg, bool inbound, uint64_t channel_value_satoshis, LDKU128 user_channel_id) {
+ LDKSignerProvider_JCalls *j_calls = (LDKSignerProvider_JCalls*) this_arg;
+ jboolean inbound_conv = inbound;
+ int64_t channel_value_satoshis_conv = channel_value_satoshis;
+ int8_tArray user_channel_id_arr = init_int8_tArray(16, __LINE__);
+ memcpy(user_channel_id_arr->elems, user_channel_id.le_bytes, 16);
+ int8_tArray ret = (int8_tArray)js_invoke_function_ubuuuu(j_calls->instance_ptr, 27, inbound_conv, channel_value_satoshis_conv, (uint32_t)user_channel_id_arr, 0, 0, 0);
LDKThirtyTwoBytes ret_ref;
CHECK(ret->arr_len == 32);
memcpy(ret_ref.data, ret->elems, 32); FREE(ret);
return ret_ref;
}
-static void LDKKeysInterface_JCalls_cloned(LDKKeysInterface* new_obj) {
- LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) new_obj->this_arg;
+LDKWriteableEcdsaChannelSigner derive_channel_signer_LDKSignerProvider_jcall(const void* this_arg, uint64_t channel_value_satoshis, LDKThirtyTwoBytes channel_keys_id) {
+ LDKSignerProvider_JCalls *j_calls = (LDKSignerProvider_JCalls*) this_arg;
+ int64_t channel_value_satoshis_conv = channel_value_satoshis;
+ int8_tArray channel_keys_id_arr = init_int8_tArray(32, __LINE__);
+ memcpy(channel_keys_id_arr->elems, channel_keys_id.data, 32);
+ uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 28, channel_value_satoshis_conv, (uint32_t)channel_keys_id_arr, 0, 0, 0, 0);
+ void* ret_ptr = untag_ptr(ret);
+ CHECK_ACCESS(ret_ptr);
+ LDKWriteableEcdsaChannelSigner ret_conv = *(LDKWriteableEcdsaChannelSigner*)(ret_ptr);
+ FREE(untag_ptr(ret));
+ return ret_conv;
+}
+LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ read_chan_signer_LDKSignerProvider_jcall(const void* this_arg, LDKu8slice reader) {
+ LDKSignerProvider_JCalls *j_calls = (LDKSignerProvider_JCalls*) this_arg;
+ LDKu8slice reader_var = reader;
+ int8_tArray reader_arr = init_int8_tArray(reader_var.datalen, __LINE__);
+ memcpy(reader_arr->elems, reader_var.data, reader_var.datalen);
+ uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 29, (uint32_t)reader_arr, 0, 0, 0, 0, 0);
+ void* ret_ptr = untag_ptr(ret);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ ret_conv = *(LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ*)(ret_ptr);
+ FREE(untag_ptr(ret));
+ return ret_conv;
+}
+LDKCVec_u8Z get_destination_script_LDKSignerProvider_jcall(const void* this_arg) {
+ LDKSignerProvider_JCalls *j_calls = (LDKSignerProvider_JCalls*) this_arg;
+ int8_tArray ret = (int8_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 30, 0, 0, 0, 0, 0, 0);
+ LDKCVec_u8Z ret_ref;
+ ret_ref.datalen = ret->arr_len;
+ ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes");
+ memcpy(ret_ref.data, ret->elems, ret_ref.datalen); FREE(ret);
+ return ret_ref;
+}
+LDKShutdownScript get_shutdown_scriptpubkey_LDKSignerProvider_jcall(const void* this_arg) {
+ LDKSignerProvider_JCalls *j_calls = (LDKSignerProvider_JCalls*) this_arg;
+ uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 31, 0, 0, 0, 0, 0, 0);
+ LDKShutdownScript ret_conv;
+ ret_conv.inner = untag_ptr(ret);
+ ret_conv.is_owned = ptr_is_owned(ret);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv);
+ return ret_conv;
+}
+static void LDKSignerProvider_JCalls_cloned(LDKSignerProvider* new_obj) {
+ LDKSignerProvider_JCalls *j_calls = (LDKSignerProvider_JCalls*) new_obj->this_arg;
atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
}
-static inline LDKKeysInterface LDKKeysInterface_init (JSValue o) {
- LDKKeysInterface_JCalls *calls = MALLOC(sizeof(LDKKeysInterface_JCalls), "LDKKeysInterface_JCalls");
+static inline LDKSignerProvider LDKSignerProvider_init (JSValue o) {
+ LDKSignerProvider_JCalls *calls = MALLOC(sizeof(LDKSignerProvider_JCalls), "LDKSignerProvider_JCalls");
atomic_init(&calls->refcnt, 1);
calls->instance_ptr = o;
- LDKKeysInterface ret = {
+ LDKSignerProvider ret = {
.this_arg = (void*) calls,
- .get_node_secret = get_node_secret_LDKKeysInterface_jcall,
- .get_destination_script = get_destination_script_LDKKeysInterface_jcall,
- .get_shutdown_scriptpubkey = get_shutdown_scriptpubkey_LDKKeysInterface_jcall,
- .get_channel_signer = get_channel_signer_LDKKeysInterface_jcall,
- .get_secure_random_bytes = get_secure_random_bytes_LDKKeysInterface_jcall,
- .read_chan_signer = read_chan_signer_LDKKeysInterface_jcall,
- .sign_invoice = sign_invoice_LDKKeysInterface_jcall,
- .get_inbound_payment_key_material = get_inbound_payment_key_material_LDKKeysInterface_jcall,
- .free = LDKKeysInterface_JCalls_free,
+ .generate_channel_keys_id = generate_channel_keys_id_LDKSignerProvider_jcall,
+ .derive_channel_signer = derive_channel_signer_LDKSignerProvider_jcall,
+ .read_chan_signer = read_chan_signer_LDKSignerProvider_jcall,
+ .get_destination_script = get_destination_script_LDKSignerProvider_jcall,
+ .get_shutdown_scriptpubkey = get_shutdown_scriptpubkey_LDKSignerProvider_jcall,
+ .free = LDKSignerProvider_JCalls_free,
};
return ret;
}
-uint64_t __attribute__((export_name("TS_LDKKeysInterface_new"))) TS_LDKKeysInterface_new(JSValue o) {
- LDKKeysInterface *res_ptr = MALLOC(sizeof(LDKKeysInterface), "LDKKeysInterface");
- *res_ptr = LDKKeysInterface_init(o);
+uint64_t __attribute__((export_name("TS_LDKSignerProvider_new"))) TS_LDKSignerProvider_new(JSValue o) {
+ LDKSignerProvider *res_ptr = MALLOC(sizeof(LDKSignerProvider), "LDKSignerProvider");
+ *res_ptr = LDKSignerProvider_init(o);
return tag_ptr(res_ptr, true);
}
-uint64_t __attribute__((export_name("TS_KeysInterface_get_node_secret"))) TS_KeysInterface_get_node_secret(uint64_t this_arg, uint32_t recipient) {
+int8_tArray __attribute__((export_name("TS_SignerProvider_generate_channel_keys_id"))) TS_SignerProvider_generate_channel_keys_id(uint64_t this_arg, jboolean inbound, int64_t channel_value_satoshis, int8_tArray user_channel_id) {
void* this_arg_ptr = untag_ptr(this_arg);
if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
- LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
- LDKRecipient recipient_conv = LDKRecipient_from_js(recipient);
- LDKCResult_SecretKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyNoneZ), "LDKCResult_SecretKeyNoneZ");
- *ret_conv = (this_arg_conv->get_node_secret)(this_arg_conv->this_arg, recipient_conv);
+ LDKSignerProvider* this_arg_conv = (LDKSignerProvider*)this_arg_ptr;
+ LDKU128 user_channel_id_ref;
+ CHECK(user_channel_id->arr_len == 16);
+ memcpy(user_channel_id_ref.le_bytes, user_channel_id->elems, 16); FREE(user_channel_id);
+ int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
+ memcpy(ret_arr->elems, (this_arg_conv->generate_channel_keys_id)(this_arg_conv->this_arg, inbound, channel_value_satoshis, user_channel_id_ref).data, 32);
+ return ret_arr;
+}
+
+uint64_t __attribute__((export_name("TS_SignerProvider_derive_channel_signer"))) TS_SignerProvider_derive_channel_signer(uint64_t this_arg, int64_t channel_value_satoshis, int8_tArray channel_keys_id) {
+ void* this_arg_ptr = untag_ptr(this_arg);
+ if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKSignerProvider* this_arg_conv = (LDKSignerProvider*)this_arg_ptr;
+ LDKThirtyTwoBytes channel_keys_id_ref;
+ CHECK(channel_keys_id->arr_len == 32);
+ memcpy(channel_keys_id_ref.data, channel_keys_id->elems, 32); FREE(channel_keys_id);
+ LDKWriteableEcdsaChannelSigner* ret_ret = MALLOC(sizeof(LDKWriteableEcdsaChannelSigner), "LDKWriteableEcdsaChannelSigner");
+ *ret_ret = (this_arg_conv->derive_channel_signer)(this_arg_conv->this_arg, channel_value_satoshis, channel_keys_id_ref);
+ return tag_ptr(ret_ret, true);
+}
+
+uint64_t __attribute__((export_name("TS_SignerProvider_read_chan_signer"))) TS_SignerProvider_read_chan_signer(uint64_t this_arg, int8_tArray reader) {
+ void* this_arg_ptr = untag_ptr(this_arg);
+ if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKSignerProvider* this_arg_conv = (LDKSignerProvider*)this_arg_ptr;
+ LDKu8slice reader_ref;
+ reader_ref.datalen = reader->arr_len;
+ reader_ref.data = reader->elems;
+ LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ), "LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ");
+ *ret_conv = (this_arg_conv->read_chan_signer)(this_arg_conv->this_arg, reader_ref);
+ FREE(reader);
return tag_ptr(ret_conv, true);
}
-int8_tArray __attribute__((export_name("TS_KeysInterface_get_destination_script"))) TS_KeysInterface_get_destination_script(uint64_t this_arg) {
+int8_tArray __attribute__((export_name("TS_SignerProvider_get_destination_script"))) TS_SignerProvider_get_destination_script(uint64_t this_arg) {
void* this_arg_ptr = untag_ptr(this_arg);
if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
- LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
+ LDKSignerProvider* this_arg_conv = (LDKSignerProvider*)this_arg_ptr;
LDKCVec_u8Z ret_var = (this_arg_conv->get_destination_script)(this_arg_conv->this_arg);
int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
return ret_arr;
}
-uint64_t __attribute__((export_name("TS_KeysInterface_get_shutdown_scriptpubkey"))) TS_KeysInterface_get_shutdown_scriptpubkey(uint64_t this_arg) {
+uint64_t __attribute__((export_name("TS_SignerProvider_get_shutdown_scriptpubkey"))) TS_SignerProvider_get_shutdown_scriptpubkey(uint64_t this_arg) {
void* this_arg_ptr = untag_ptr(this_arg);
if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
- LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
+ LDKSignerProvider* this_arg_conv = (LDKSignerProvider*)this_arg_ptr;
LDKShutdownScript ret_var = (this_arg_conv->get_shutdown_scriptpubkey)(this_arg_conv->this_arg);
uint64_t ret_ref = 0;
CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
return ret_ref;
}
-uint64_t __attribute__((export_name("TS_KeysInterface_get_channel_signer"))) TS_KeysInterface_get_channel_signer(uint64_t this_arg, jboolean inbound, int64_t channel_value_satoshis) {
- void* this_arg_ptr = untag_ptr(this_arg);
- if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
- LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
- LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign");
- *ret_ret = (this_arg_conv->get_channel_signer)(this_arg_conv->this_arg, inbound, channel_value_satoshis);
- return tag_ptr(ret_ret, true);
-}
-
-int8_tArray __attribute__((export_name("TS_KeysInterface_get_secure_random_bytes"))) TS_KeysInterface_get_secure_random_bytes(uint64_t this_arg) {
- void* this_arg_ptr = untag_ptr(this_arg);
- if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
- LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
- int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
- memcpy(ret_arr->elems, (this_arg_conv->get_secure_random_bytes)(this_arg_conv->this_arg).data, 32);
- return ret_arr;
-}
-
-uint64_t __attribute__((export_name("TS_KeysInterface_read_chan_signer"))) TS_KeysInterface_read_chan_signer(uint64_t this_arg, int8_tArray reader) {
- void* this_arg_ptr = untag_ptr(this_arg);
- if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
- LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
- LDKu8slice reader_ref;
- reader_ref.datalen = reader->arr_len;
- reader_ref.data = reader->elems;
- LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ");
- *ret_conv = (this_arg_conv->read_chan_signer)(this_arg_conv->this_arg, reader_ref);
- FREE(reader);
- return tag_ptr(ret_conv, true);
-}
-
-uint64_t __attribute__((export_name("TS_KeysInterface_sign_invoice"))) TS_KeysInterface_sign_invoice(uint64_t this_arg, int8_tArray hrp_bytes, ptrArray invoice_data, uint32_t receipient) {
- void* this_arg_ptr = untag_ptr(this_arg);
- if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
- LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
- LDKu8slice hrp_bytes_ref;
- hrp_bytes_ref.datalen = hrp_bytes->arr_len;
- hrp_bytes_ref.data = hrp_bytes->elems;
- LDKCVec_u5Z invoice_data_constr;
- invoice_data_constr.datalen = invoice_data->arr_len;
- if (invoice_data_constr.datalen > 0)
- invoice_data_constr.data = MALLOC(invoice_data_constr.datalen * sizeof(LDKu5), "LDKCVec_u5Z Elements");
- else
- invoice_data_constr.data = NULL;
- int8_t* invoice_data_vals = (void*) invoice_data->elems;
- for (size_t h = 0; h < invoice_data_constr.datalen; h++) {
- int8_t invoice_data_conv_7 = invoice_data_vals[h];
-
- invoice_data_constr.data[h] = (LDKu5){ ._0 = invoice_data_conv_7 };
- }
- FREE(invoice_data);
- LDKRecipient receipient_conv = LDKRecipient_from_js(receipient);
- LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ");
- *ret_conv = (this_arg_conv->sign_invoice)(this_arg_conv->this_arg, hrp_bytes_ref, invoice_data_constr, receipient_conv);
- FREE(hrp_bytes);
- return tag_ptr(ret_conv, true);
-}
-
-int8_tArray __attribute__((export_name("TS_KeysInterface_get_inbound_payment_key_material"))) TS_KeysInterface_get_inbound_payment_key_material(uint64_t this_arg) {
- void* this_arg_ptr = untag_ptr(this_arg);
- if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
- LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
- int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
- memcpy(ret_arr->elems, (this_arg_conv->get_inbound_payment_key_material)(this_arg_conv->this_arg).data, 32);
- return ret_arr;
-}
-
typedef struct LDKFeeEstimator_JCalls {
atomic_size_t refcnt;
uint32_t instance_ptr;
uint32_t get_est_sat_per_1000_weight_LDKFeeEstimator_jcall(const void* this_arg, LDKConfirmationTarget confirmation_target) {
LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) this_arg;
uint32_t confirmation_target_conv = LDKConfirmationTarget_to_js(confirmation_target);
- return js_invoke_function_uuuuuu(j_calls->instance_ptr, 28, confirmation_target_conv, 0, 0, 0, 0, 0);
+ return js_invoke_function_uuuuuu(j_calls->instance_ptr, 32, confirmation_target_conv, 0, 0, 0, 0, 0);
}
static void LDKFeeEstimator_JCalls_cloned(LDKFeeEstimator* new_obj) {
LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) new_obj->this_arg;
return ret_conv;
}
+typedef struct LDKRouter_JCalls {
+ atomic_size_t refcnt;
+ uint32_t instance_ptr;
+} LDKRouter_JCalls;
+static void LDKRouter_JCalls_free(void* this_arg) {
+ LDKRouter_JCalls *j_calls = (LDKRouter_JCalls*) this_arg;
+ if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
+ FREE(j_calls);
+ }
+}
+LDKCResult_RouteLightningErrorZ find_route_LDKRouter_jcall(const void* this_arg, LDKPublicKey payer, const LDKRouteParameters * route_params, LDKCVec_ChannelDetailsZ * first_hops, const LDKInFlightHtlcs * inflight_htlcs) {
+ LDKRouter_JCalls *j_calls = (LDKRouter_JCalls*) this_arg;
+ int8_tArray payer_arr = init_int8_tArray(33, __LINE__);
+ memcpy(payer_arr->elems, payer.compressed_form, 33);
+ LDKRouteParameters route_params_var = *route_params;
+ uint64_t route_params_ref = 0;
+ route_params_var = RouteParameters_clone(&route_params_var);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_var);
+ route_params_ref = tag_ptr(route_params_var.inner, route_params_var.is_owned);
+ LDKCVec_ChannelDetailsZ *first_hops_var_ptr = first_hops;
+ uint64_tArray first_hops_arr = NULL;
+ if (first_hops != NULL) {
+ LDKCVec_ChannelDetailsZ first_hops_var = *first_hops_var_ptr;
+ first_hops_arr = init_uint64_tArray(first_hops_var.datalen, __LINE__);
+ uint64_t *first_hops_arr_ptr = (uint64_t*)(((uint8_t*)first_hops_arr) + 8);
+ for (size_t q = 0; q < first_hops_var.datalen; q++) {
+ LDKChannelDetails first_hops_conv_16_var = first_hops_var.data[q];
+ uint64_t first_hops_conv_16_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_var);
+ first_hops_conv_16_ref = tag_ptr(first_hops_conv_16_var.inner, first_hops_conv_16_var.is_owned);
+ first_hops_arr_ptr[q] = first_hops_conv_16_ref;
+ }
+
+ }
+ LDKInFlightHtlcs inflight_htlcs_var = *inflight_htlcs;
+ uint64_t inflight_htlcs_ref = 0;
+ inflight_htlcs_var = InFlightHtlcs_clone(&inflight_htlcs_var);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(inflight_htlcs_var);
+ inflight_htlcs_ref = tag_ptr(inflight_htlcs_var.inner, inflight_htlcs_var.is_owned);
+ uint64_t ret = js_invoke_function_ububuu(j_calls->instance_ptr, 33, (uint32_t)payer_arr, route_params_ref, (uint32_t)first_hops_arr, inflight_htlcs_ref, 0, 0);
+ void* ret_ptr = untag_ptr(ret);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_RouteLightningErrorZ ret_conv = *(LDKCResult_RouteLightningErrorZ*)(ret_ptr);
+ FREE(untag_ptr(ret));
+ return ret_conv;
+}
+LDKCResult_RouteLightningErrorZ find_route_with_id_LDKRouter_jcall(const void* this_arg, LDKPublicKey payer, const LDKRouteParameters * route_params, LDKCVec_ChannelDetailsZ * first_hops, const LDKInFlightHtlcs * inflight_htlcs, LDKThirtyTwoBytes _payment_hash, LDKThirtyTwoBytes _payment_id) {
+ LDKRouter_JCalls *j_calls = (LDKRouter_JCalls*) this_arg;
+ int8_tArray payer_arr = init_int8_tArray(33, __LINE__);
+ memcpy(payer_arr->elems, payer.compressed_form, 33);
+ LDKRouteParameters route_params_var = *route_params;
+ uint64_t route_params_ref = 0;
+ route_params_var = RouteParameters_clone(&route_params_var);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_var);
+ route_params_ref = tag_ptr(route_params_var.inner, route_params_var.is_owned);
+ LDKCVec_ChannelDetailsZ *first_hops_var_ptr = first_hops;
+ uint64_tArray first_hops_arr = NULL;
+ if (first_hops != NULL) {
+ LDKCVec_ChannelDetailsZ first_hops_var = *first_hops_var_ptr;
+ first_hops_arr = init_uint64_tArray(first_hops_var.datalen, __LINE__);
+ uint64_t *first_hops_arr_ptr = (uint64_t*)(((uint8_t*)first_hops_arr) + 8);
+ for (size_t q = 0; q < first_hops_var.datalen; q++) {
+ LDKChannelDetails first_hops_conv_16_var = first_hops_var.data[q];
+ uint64_t first_hops_conv_16_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_var);
+ first_hops_conv_16_ref = tag_ptr(first_hops_conv_16_var.inner, first_hops_conv_16_var.is_owned);
+ first_hops_arr_ptr[q] = first_hops_conv_16_ref;
+ }
+
+ }
+ LDKInFlightHtlcs inflight_htlcs_var = *inflight_htlcs;
+ uint64_t inflight_htlcs_ref = 0;
+ inflight_htlcs_var = InFlightHtlcs_clone(&inflight_htlcs_var);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(inflight_htlcs_var);
+ inflight_htlcs_ref = tag_ptr(inflight_htlcs_var.inner, inflight_htlcs_var.is_owned);
+ int8_tArray _payment_hash_arr = init_int8_tArray(32, __LINE__);
+ memcpy(_payment_hash_arr->elems, _payment_hash.data, 32);
+ int8_tArray _payment_id_arr = init_int8_tArray(32, __LINE__);
+ memcpy(_payment_id_arr->elems, _payment_id.data, 32);
+ uint64_t ret = js_invoke_function_ububuu(j_calls->instance_ptr, 34, (uint32_t)payer_arr, route_params_ref, (uint32_t)first_hops_arr, inflight_htlcs_ref, (uint32_t)_payment_hash_arr, (uint32_t)_payment_id_arr);
+ void* ret_ptr = untag_ptr(ret);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_RouteLightningErrorZ ret_conv = *(LDKCResult_RouteLightningErrorZ*)(ret_ptr);
+ FREE(untag_ptr(ret));
+ return ret_conv;
+}
+static void LDKRouter_JCalls_cloned(LDKRouter* new_obj) {
+ LDKRouter_JCalls *j_calls = (LDKRouter_JCalls*) new_obj->this_arg;
+ atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
+}
+static inline LDKRouter LDKRouter_init (JSValue o) {
+ LDKRouter_JCalls *calls = MALLOC(sizeof(LDKRouter_JCalls), "LDKRouter_JCalls");
+ atomic_init(&calls->refcnt, 1);
+ calls->instance_ptr = o;
+
+ LDKRouter ret = {
+ .this_arg = (void*) calls,
+ .find_route = find_route_LDKRouter_jcall,
+ .find_route_with_id = find_route_with_id_LDKRouter_jcall,
+ .free = LDKRouter_JCalls_free,
+ };
+ return ret;
+}
+uint64_t __attribute__((export_name("TS_LDKRouter_new"))) TS_LDKRouter_new(JSValue o) {
+ LDKRouter *res_ptr = MALLOC(sizeof(LDKRouter), "LDKRouter");
+ *res_ptr = LDKRouter_init(o);
+ return tag_ptr(res_ptr, true);
+}
+uint64_t __attribute__((export_name("TS_Router_find_route"))) TS_Router_find_route(uint64_t this_arg, int8_tArray payer, uint64_t route_params, uint64_tArray first_hops, uint64_t inflight_htlcs) {
+ void* this_arg_ptr = untag_ptr(this_arg);
+ if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKRouter* this_arg_conv = (LDKRouter*)this_arg_ptr;
+ LDKPublicKey payer_ref;
+ CHECK(payer->arr_len == 33);
+ memcpy(payer_ref.compressed_form, payer->elems, 33); FREE(payer);
+ LDKRouteParameters route_params_conv;
+ route_params_conv.inner = untag_ptr(route_params);
+ route_params_conv.is_owned = ptr_is_owned(route_params);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_conv);
+ route_params_conv.is_owned = false;
+ LDKCVec_ChannelDetailsZ first_hops_constr;
+ LDKCVec_ChannelDetailsZ *first_hops_ptr = NULL;
+ if (first_hops != 0) {
+ first_hops_constr.datalen = first_hops->arr_len;
+ if (first_hops_constr.datalen > 0)
+ first_hops_constr.data = MALLOC(first_hops_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
+ else
+ first_hops_constr.data = NULL;
+ uint64_t* first_hops_vals = first_hops->elems;
+ for (size_t q = 0; q < first_hops_constr.datalen; q++) {
+ uint64_t first_hops_conv_16 = first_hops_vals[q];
+ LDKChannelDetails first_hops_conv_16_conv;
+ first_hops_conv_16_conv.inner = untag_ptr(first_hops_conv_16);
+ first_hops_conv_16_conv.is_owned = ptr_is_owned(first_hops_conv_16);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_conv);
+ first_hops_conv_16_conv.is_owned = false;
+ first_hops_constr.data[q] = first_hops_conv_16_conv;
+ }
+ FREE(first_hops);
+ first_hops_ptr = &first_hops_constr;
+ }
+ LDKInFlightHtlcs inflight_htlcs_conv;
+ inflight_htlcs_conv.inner = untag_ptr(inflight_htlcs);
+ inflight_htlcs_conv.is_owned = ptr_is_owned(inflight_htlcs);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(inflight_htlcs_conv);
+ inflight_htlcs_conv.is_owned = false;
+ LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
+ *ret_conv = (this_arg_conv->find_route)(this_arg_conv->this_arg, payer_ref, &route_params_conv, first_hops_ptr, &inflight_htlcs_conv);
+ if (first_hops_ptr != NULL) { FREE(first_hops_constr.data); }
+ return tag_ptr(ret_conv, true);
+}
+
+uint64_t __attribute__((export_name("TS_Router_find_route_with_id"))) TS_Router_find_route_with_id(uint64_t this_arg, int8_tArray payer, uint64_t route_params, uint64_tArray first_hops, uint64_t inflight_htlcs, int8_tArray _payment_hash, int8_tArray _payment_id) {
+ void* this_arg_ptr = untag_ptr(this_arg);
+ if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKRouter* this_arg_conv = (LDKRouter*)this_arg_ptr;
+ LDKPublicKey payer_ref;
+ CHECK(payer->arr_len == 33);
+ memcpy(payer_ref.compressed_form, payer->elems, 33); FREE(payer);
+ LDKRouteParameters route_params_conv;
+ route_params_conv.inner = untag_ptr(route_params);
+ route_params_conv.is_owned = ptr_is_owned(route_params);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_conv);
+ route_params_conv.is_owned = false;
+ LDKCVec_ChannelDetailsZ first_hops_constr;
+ LDKCVec_ChannelDetailsZ *first_hops_ptr = NULL;
+ if (first_hops != 0) {
+ first_hops_constr.datalen = first_hops->arr_len;
+ if (first_hops_constr.datalen > 0)
+ first_hops_constr.data = MALLOC(first_hops_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
+ else
+ first_hops_constr.data = NULL;
+ uint64_t* first_hops_vals = first_hops->elems;
+ for (size_t q = 0; q < first_hops_constr.datalen; q++) {
+ uint64_t first_hops_conv_16 = first_hops_vals[q];
+ LDKChannelDetails first_hops_conv_16_conv;
+ first_hops_conv_16_conv.inner = untag_ptr(first_hops_conv_16);
+ first_hops_conv_16_conv.is_owned = ptr_is_owned(first_hops_conv_16);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_conv);
+ first_hops_conv_16_conv.is_owned = false;
+ first_hops_constr.data[q] = first_hops_conv_16_conv;
+ }
+ FREE(first_hops);
+ first_hops_ptr = &first_hops_constr;
+ }
+ LDKInFlightHtlcs inflight_htlcs_conv;
+ inflight_htlcs_conv.inner = untag_ptr(inflight_htlcs);
+ inflight_htlcs_conv.is_owned = ptr_is_owned(inflight_htlcs);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(inflight_htlcs_conv);
+ inflight_htlcs_conv.is_owned = false;
+ LDKThirtyTwoBytes _payment_hash_ref;
+ CHECK(_payment_hash->arr_len == 32);
+ memcpy(_payment_hash_ref.data, _payment_hash->elems, 32); FREE(_payment_hash);
+ LDKThirtyTwoBytes _payment_id_ref;
+ CHECK(_payment_id->arr_len == 32);
+ memcpy(_payment_id_ref.data, _payment_id->elems, 32); FREE(_payment_id);
+ LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
+ *ret_conv = (this_arg_conv->find_route_with_id)(this_arg_conv->this_arg, payer_ref, &route_params_conv, first_hops_ptr, &inflight_htlcs_conv, _payment_hash_ref, _payment_id_ref);
+ if (first_hops_ptr != NULL) { FREE(first_hops_constr.data); }
+ return tag_ptr(ret_conv, true);
+}
+
static inline struct LDKThirtyTwoBytes C2Tuple_BlockHashChannelManagerZ_get_a(LDKC2Tuple_BlockHashChannelManagerZ *NONNULL_PTR owner){
return ThirtyTwoBytes_clone(&owner->a);
}
}
static inline struct LDKDecodeError CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_err(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
uint64_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_err"))) TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_err(uint64_t owner) {
LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* owner_conv = (LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_ChannelConfigDecodeErrorZ_get_err(LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
uint64_t __attribute__((export_name("TS_CResult_ChannelConfigDecodeErrorZ_get_err"))) TS_CResult_ChannelConfigDecodeErrorZ_get_err(uint64_t owner) {
LDKCResult_ChannelConfigDecodeErrorZ* owner_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_ChannelConfigDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_ChannelConfigDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+uint32_t __attribute__((export_name("TS_LDKCOption_APIErrorZ_ty_from_ptr"))) TS_LDKCOption_APIErrorZ_ty_from_ptr(uint64_t ptr) {
+ LDKCOption_APIErrorZ *obj = (LDKCOption_APIErrorZ*)untag_ptr(ptr);
+ switch(obj->tag) {
+ case LDKCOption_APIErrorZ_Some: return 0;
+ case LDKCOption_APIErrorZ_None: return 1;
+ default: abort();
+ }
+}
+uint64_t __attribute__((export_name("TS_LDKCOption_APIErrorZ_Some_get_some"))) TS_LDKCOption_APIErrorZ_Some_get_some(uint64_t ptr) {
+ LDKCOption_APIErrorZ *obj = (LDKCOption_APIErrorZ*)untag_ptr(ptr);
+ assert(obj->tag == LDKCOption_APIErrorZ_Some);
+ uint64_t some_ref = tag_ptr(&obj->some, false);
+ return some_ref;
+}
+static inline struct LDKCOption_APIErrorZ CResult_COption_APIErrorZDecodeErrorZ_get_ok(LDKCResult_COption_APIErrorZDecodeErrorZ *NONNULL_PTR owner){
+CHECK(owner->result_ok);
+ return COption_APIErrorZ_clone(&*owner->contents.result);
+}
+uint64_t __attribute__((export_name("TS_CResult_COption_APIErrorZDecodeErrorZ_get_ok"))) TS_CResult_COption_APIErrorZDecodeErrorZ_get_ok(uint64_t owner) {
+ LDKCResult_COption_APIErrorZDecodeErrorZ* owner_conv = (LDKCResult_COption_APIErrorZDecodeErrorZ*)untag_ptr(owner);
+ LDKCOption_APIErrorZ *ret_copy = MALLOC(sizeof(LDKCOption_APIErrorZ), "LDKCOption_APIErrorZ");
+ *ret_copy = CResult_COption_APIErrorZDecodeErrorZ_get_ok(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+static inline struct LDKDecodeError CResult_COption_APIErrorZDecodeErrorZ_get_err(LDKCResult_COption_APIErrorZDecodeErrorZ *NONNULL_PTR owner){
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
+}
+uint64_t __attribute__((export_name("TS_CResult_COption_APIErrorZDecodeErrorZ_get_err"))) TS_CResult_COption_APIErrorZDecodeErrorZ_get_err(uint64_t owner) {
+ LDKCResult_COption_APIErrorZDecodeErrorZ* owner_conv = (LDKCResult_COption_APIErrorZDecodeErrorZ*)untag_ptr(owner);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_COption_APIErrorZDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_OutPointDecodeErrorZ_get_err(LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
uint64_t __attribute__((export_name("TS_CResult_OutPointDecodeErrorZ_get_err"))) TS_CResult_OutPointDecodeErrorZ_get_err(uint64_t owner) {
LDKCResult_OutPointDecodeErrorZ* owner_conv = (LDKCResult_OutPointDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_OutPointDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_OutPointDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
uint16_t type_id_LDKType_jcall(const void* this_arg) {
LDKType_JCalls *j_calls = (LDKType_JCalls*) this_arg;
- return js_invoke_function_uuuuuu(j_calls->instance_ptr, 29, 0, 0, 0, 0, 0, 0);
+ return js_invoke_function_uuuuuu(j_calls->instance_ptr, 35, 0, 0, 0, 0, 0, 0);
}
LDKStr debug_str_LDKType_jcall(const void* this_arg) {
LDKType_JCalls *j_calls = (LDKType_JCalls*) this_arg;
- jstring ret = (jstring)js_invoke_function_uuuuuu(j_calls->instance_ptr, 30, 0, 0, 0, 0, 0, 0);
+ jstring ret = (jstring)js_invoke_function_uuuuuu(j_calls->instance_ptr, 36, 0, 0, 0, 0, 0, 0);
LDKStr ret_conv = str_ref_to_owned_c(ret);
return ret_conv;
}
LDKCVec_u8Z write_LDKType_jcall(const void* this_arg) {
LDKType_JCalls *j_calls = (LDKType_JCalls*) this_arg;
- int8_tArray ret = (int8_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 31, 0, 0, 0, 0, 0, 0);
+ int8_tArray ret = (int8_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 37, 0, 0, 0, 0, 0, 0);
LDKCVec_u8Z ret_ref;
ret_ref.datalen = ret->arr_len;
ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes");
}
static inline struct LDKDecodeError CResult_COption_TypeZDecodeErrorZ_get_err(LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
uint64_t __attribute__((export_name("TS_CResult_COption_TypeZDecodeErrorZ_get_err"))) TS_CResult_COption_TypeZDecodeErrorZ_get_err(uint64_t owner) {
LDKCResult_COption_TypeZDecodeErrorZ* owner_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_COption_TypeZDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_COption_TypeZDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
LDKPaymentError *obj = (LDKPaymentError*)untag_ptr(ptr);
switch(obj->tag) {
case LDKPaymentError_Invoice: return 0;
- case LDKPaymentError_Routing: return 1;
- case LDKPaymentError_Sending: return 2;
+ case LDKPaymentError_Sending: return 1;
default: abort();
}
}
jstring invoice_conv = str_ref_to_ts(invoice_str.chars, invoice_str.len);
return invoice_conv;
}
-uint64_t __attribute__((export_name("TS_LDKPaymentError_Routing_get_routing"))) TS_LDKPaymentError_Routing_get_routing(uint64_t ptr) {
- LDKPaymentError *obj = (LDKPaymentError*)untag_ptr(ptr);
- assert(obj->tag == LDKPaymentError_Routing);
- LDKLightningError routing_var = obj->routing;
- uint64_t routing_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(routing_var);
- routing_ref = tag_ptr(routing_var.inner, false);
- return routing_ref;
-}
-uint64_t __attribute__((export_name("TS_LDKPaymentError_Sending_get_sending"))) TS_LDKPaymentError_Sending_get_sending(uint64_t ptr) {
+uint32_t __attribute__((export_name("TS_LDKPaymentError_Sending_get_sending"))) TS_LDKPaymentError_Sending_get_sending(uint64_t ptr) {
LDKPaymentError *obj = (LDKPaymentError*)untag_ptr(ptr);
assert(obj->tag == LDKPaymentError_Sending);
- uint64_t sending_ref = tag_ptr(&obj->sending, false);
- return sending_ref;
+ uint32_t sending_conv = LDKRetryableSendFailure_to_js(obj->sending);
+ return sending_conv;
}
static inline struct LDKThirtyTwoBytes CResult_PaymentIdPaymentErrorZ_get_ok(LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR owner){
CHECK(owner->result_ok);
return ret_ref;
}
-uint32_t __attribute__((export_name("TS_LDKParseError_ty_from_ptr"))) TS_LDKParseError_ty_from_ptr(uint64_t ptr) {
- LDKParseError *obj = (LDKParseError*)untag_ptr(ptr);
- switch(obj->tag) {
- case LDKParseError_Bech32Error: return 0;
- case LDKParseError_ParseAmountError: return 1;
- case LDKParseError_MalformedSignature: return 2;
- case LDKParseError_BadPrefix: return 3;
- case LDKParseError_UnknownCurrency: return 4;
- case LDKParseError_UnknownSiPrefix: return 5;
- case LDKParseError_MalformedHRP: return 6;
- case LDKParseError_TooShortDataPart: return 7;
- case LDKParseError_UnexpectedEndOfTaggedFields: return 8;
- case LDKParseError_DescriptionDecodeError: return 9;
- case LDKParseError_PaddingError: return 10;
- case LDKParseError_IntegerOverflowError: return 11;
- case LDKParseError_InvalidSegWitProgramLength: return 12;
- case LDKParseError_InvalidPubKeyHashLength: return 13;
- case LDKParseError_InvalidScriptHashLength: return 14;
- case LDKParseError_InvalidRecoveryId: return 15;
- case LDKParseError_InvalidSliceLength: return 16;
- case LDKParseError_Skip: return 17;
- default: abort();
- }
-}
-uint64_t __attribute__((export_name("TS_LDKParseError_Bech32Error_get_bech32_error"))) TS_LDKParseError_Bech32Error_get_bech32_error(uint64_t ptr) {
- LDKParseError *obj = (LDKParseError*)untag_ptr(ptr);
- assert(obj->tag == LDKParseError_Bech32Error);
- uint64_t bech32_error_ref = tag_ptr(&obj->bech32_error, false);
- return bech32_error_ref;
-}
-int32_t __attribute__((export_name("TS_LDKParseError_ParseAmountError_get_parse_amount_error"))) TS_LDKParseError_ParseAmountError_get_parse_amount_error(uint64_t ptr) {
- LDKParseError *obj = (LDKParseError*)untag_ptr(ptr);
- assert(obj->tag == LDKParseError_ParseAmountError);
- /*obj->parse_amount_error*/
- return 0;
+static inline void CResult_NonePaymentErrorZ_get_ok(LDKCResult_NonePaymentErrorZ *NONNULL_PTR owner){
+CHECK(owner->result_ok);
+ return *owner->contents.result;
}
-uint32_t __attribute__((export_name("TS_LDKParseError_MalformedSignature_get_malformed_signature"))) TS_LDKParseError_MalformedSignature_get_malformed_signature(uint64_t ptr) {
- LDKParseError *obj = (LDKParseError*)untag_ptr(ptr);
- assert(obj->tag == LDKParseError_MalformedSignature);
- uint32_t malformed_signature_conv = LDKSecp256k1Error_to_js(obj->malformed_signature);
- return malformed_signature_conv;
+void __attribute__((export_name("TS_CResult_NonePaymentErrorZ_get_ok"))) TS_CResult_NonePaymentErrorZ_get_ok(uint64_t owner) {
+ LDKCResult_NonePaymentErrorZ* owner_conv = (LDKCResult_NonePaymentErrorZ*)untag_ptr(owner);
+ CResult_NonePaymentErrorZ_get_ok(owner_conv);
}
-int32_t __attribute__((export_name("TS_LDKParseError_DescriptionDecodeError_get_description_decode_error"))) TS_LDKParseError_DescriptionDecodeError_get_description_decode_error(uint64_t ptr) {
- LDKParseError *obj = (LDKParseError*)untag_ptr(ptr);
- assert(obj->tag == LDKParseError_DescriptionDecodeError);
- /*obj->description_decode_error*/
- return 0;
+
+static inline struct LDKPaymentError CResult_NonePaymentErrorZ_get_err(LDKCResult_NonePaymentErrorZ *NONNULL_PTR owner){
+CHECK(!owner->result_ok);
+ return PaymentError_clone(&*owner->contents.err);
}
-jstring __attribute__((export_name("TS_LDKParseError_InvalidSliceLength_get_invalid_slice_length"))) TS_LDKParseError_InvalidSliceLength_get_invalid_slice_length(uint64_t ptr) {
- LDKParseError *obj = (LDKParseError*)untag_ptr(ptr);
- assert(obj->tag == LDKParseError_InvalidSliceLength);
- LDKStr invalid_slice_length_str = obj->invalid_slice_length;
- jstring invalid_slice_length_conv = str_ref_to_ts(invalid_slice_length_str.chars, invalid_slice_length_str.len);
- return invalid_slice_length_conv;
+uint64_t __attribute__((export_name("TS_CResult_NonePaymentErrorZ_get_err"))) TS_CResult_NonePaymentErrorZ_get_err(uint64_t owner) {
+ LDKCResult_NonePaymentErrorZ* owner_conv = (LDKCResult_NonePaymentErrorZ*)untag_ptr(owner);
+ LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError");
+ *ret_copy = CResult_NonePaymentErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
}
-static inline enum LDKSiPrefix CResult_SiPrefixParseErrorZ_get_ok(LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR owner){
+
+static inline struct LDKStr CResult_StringErrorZ_get_ok(LDKCResult_StringErrorZ *NONNULL_PTR owner){
CHECK(owner->result_ok);
- return SiPrefix_clone(&*owner->contents.result);
+ return *owner->contents.result;
}
-uint32_t __attribute__((export_name("TS_CResult_SiPrefixParseErrorZ_get_ok"))) TS_CResult_SiPrefixParseErrorZ_get_ok(uint64_t owner) {
- LDKCResult_SiPrefixParseErrorZ* owner_conv = (LDKCResult_SiPrefixParseErrorZ*)untag_ptr(owner);
- uint32_t ret_conv = LDKSiPrefix_to_js(CResult_SiPrefixParseErrorZ_get_ok(owner_conv));
+jstring __attribute__((export_name("TS_CResult_StringErrorZ_get_ok"))) TS_CResult_StringErrorZ_get_ok(uint64_t owner) {
+ LDKCResult_StringErrorZ* owner_conv = (LDKCResult_StringErrorZ*)untag_ptr(owner);
+ LDKStr ret_str = CResult_StringErrorZ_get_ok(owner_conv);
+ jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
return ret_conv;
}
-static inline struct LDKParseError CResult_SiPrefixParseErrorZ_get_err(LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR owner){
+static inline enum LDKSecp256k1Error CResult_StringErrorZ_get_err(LDKCResult_StringErrorZ *NONNULL_PTR owner){
CHECK(!owner->result_ok);
- return ParseError_clone(&*owner->contents.err);
+ return *owner->contents.err;
}
-uint64_t __attribute__((export_name("TS_CResult_SiPrefixParseErrorZ_get_err"))) TS_CResult_SiPrefixParseErrorZ_get_err(uint64_t owner) {
- LDKCResult_SiPrefixParseErrorZ* owner_conv = (LDKCResult_SiPrefixParseErrorZ*)untag_ptr(owner);
- LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
- *ret_copy = CResult_SiPrefixParseErrorZ_get_err(owner_conv);
- uint64_t ret_ref = tag_ptr(ret_copy, true);
- return ret_ref;
+uint32_t __attribute__((export_name("TS_CResult_StringErrorZ_get_err"))) TS_CResult_StringErrorZ_get_err(uint64_t owner) {
+ LDKCResult_StringErrorZ* owner_conv = (LDKCResult_StringErrorZ*)untag_ptr(owner);
+ uint32_t ret_conv = LDKSecp256k1Error_to_js(CResult_StringErrorZ_get_err(owner_conv));
+ return ret_conv;
}
-uint32_t __attribute__((export_name("TS_LDKParseOrSemanticError_ty_from_ptr"))) TS_LDKParseOrSemanticError_ty_from_ptr(uint64_t ptr) {
- LDKParseOrSemanticError *obj = (LDKParseOrSemanticError*)untag_ptr(ptr);
- switch(obj->tag) {
- case LDKParseOrSemanticError_ParseError: return 0;
- case LDKParseOrSemanticError_SemanticError: return 1;
- default: abort();
- }
+static inline struct LDKPublicKey CResult_PublicKeyErrorZ_get_ok(LDKCResult_PublicKeyErrorZ *NONNULL_PTR owner){
+CHECK(owner->result_ok);
+ return *owner->contents.result;
}
-uint64_t __attribute__((export_name("TS_LDKParseOrSemanticError_ParseError_get_parse_error"))) TS_LDKParseOrSemanticError_ParseError_get_parse_error(uint64_t ptr) {
- LDKParseOrSemanticError *obj = (LDKParseOrSemanticError*)untag_ptr(ptr);
- assert(obj->tag == LDKParseOrSemanticError_ParseError);
- uint64_t parse_error_ref = tag_ptr(&obj->parse_error, false);
- return parse_error_ref;
+int8_tArray __attribute__((export_name("TS_CResult_PublicKeyErrorZ_get_ok"))) TS_CResult_PublicKeyErrorZ_get_ok(uint64_t owner) {
+ LDKCResult_PublicKeyErrorZ* owner_conv = (LDKCResult_PublicKeyErrorZ*)untag_ptr(owner);
+ int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
+ memcpy(ret_arr->elems, CResult_PublicKeyErrorZ_get_ok(owner_conv).compressed_form, 33);
+ return ret_arr;
}
-uint32_t __attribute__((export_name("TS_LDKParseOrSemanticError_SemanticError_get_semantic_error"))) TS_LDKParseOrSemanticError_SemanticError_get_semantic_error(uint64_t ptr) {
- LDKParseOrSemanticError *obj = (LDKParseOrSemanticError*)untag_ptr(ptr);
- assert(obj->tag == LDKParseOrSemanticError_SemanticError);
- uint32_t semantic_error_conv = LDKSemanticError_to_js(obj->semantic_error);
- return semantic_error_conv;
+
+static inline enum LDKSecp256k1Error CResult_PublicKeyErrorZ_get_err(LDKCResult_PublicKeyErrorZ *NONNULL_PTR owner){
+CHECK(!owner->result_ok);
+ return *owner->contents.err;
}
-static inline struct LDKInvoice CResult_InvoiceParseOrSemanticErrorZ_get_ok(LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR owner){
- LDKInvoice ret = *owner->contents.result;
+uint32_t __attribute__((export_name("TS_CResult_PublicKeyErrorZ_get_err"))) TS_CResult_PublicKeyErrorZ_get_err(uint64_t owner) {
+ LDKCResult_PublicKeyErrorZ* owner_conv = (LDKCResult_PublicKeyErrorZ*)untag_ptr(owner);
+ uint32_t ret_conv = LDKSecp256k1Error_to_js(CResult_PublicKeyErrorZ_get_err(owner_conv));
+ return ret_conv;
+}
+
+static inline struct LDKChannelMonitorUpdate CResult_ChannelMonitorUpdateDecodeErrorZ_get_ok(LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR owner){
+ LDKChannelMonitorUpdate ret = *owner->contents.result;
ret.is_owned = false;
return ret;
}
-uint64_t __attribute__((export_name("TS_CResult_InvoiceParseOrSemanticErrorZ_get_ok"))) TS_CResult_InvoiceParseOrSemanticErrorZ_get_ok(uint64_t owner) {
- LDKCResult_InvoiceParseOrSemanticErrorZ* owner_conv = (LDKCResult_InvoiceParseOrSemanticErrorZ*)untag_ptr(owner);
- LDKInvoice ret_var = CResult_InvoiceParseOrSemanticErrorZ_get_ok(owner_conv);
+uint64_t __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeErrorZ_get_ok"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_get_ok(uint64_t owner) {
+ LDKCResult_ChannelMonitorUpdateDecodeErrorZ* owner_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)untag_ptr(owner);
+ LDKChannelMonitorUpdate ret_var = CResult_ChannelMonitorUpdateDecodeErrorZ_get_ok(owner_conv);
uint64_t ret_ref = 0;
CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
return ret_ref;
}
-static inline struct LDKParseOrSemanticError CResult_InvoiceParseOrSemanticErrorZ_get_err(LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR owner){
+static inline struct LDKDecodeError CResult_ChannelMonitorUpdateDecodeErrorZ_get_err(LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR owner){
CHECK(!owner->result_ok);
- return ParseOrSemanticError_clone(&*owner->contents.err);
+ return DecodeError_clone(&*owner->contents.err);
}
-uint64_t __attribute__((export_name("TS_CResult_InvoiceParseOrSemanticErrorZ_get_err"))) TS_CResult_InvoiceParseOrSemanticErrorZ_get_err(uint64_t owner) {
- LDKCResult_InvoiceParseOrSemanticErrorZ* owner_conv = (LDKCResult_InvoiceParseOrSemanticErrorZ*)untag_ptr(owner);
- LDKParseOrSemanticError *ret_copy = MALLOC(sizeof(LDKParseOrSemanticError), "LDKParseOrSemanticError");
- *ret_copy = CResult_InvoiceParseOrSemanticErrorZ_get_err(owner_conv);
+uint64_t __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeErrorZ_get_err"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_get_err(uint64_t owner) {
+ LDKCResult_ChannelMonitorUpdateDecodeErrorZ* owner_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)untag_ptr(owner);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_ChannelMonitorUpdateDecodeErrorZ_get_err(owner_conv);
uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
-static inline struct LDKSignedRawInvoice CResult_SignedRawInvoiceParseErrorZ_get_ok(LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR owner){
- LDKSignedRawInvoice ret = *owner->contents.result;
- ret.is_owned = false;
- return ret;
+uint32_t __attribute__((export_name("TS_LDKCOption_MonitorEventZ_ty_from_ptr"))) TS_LDKCOption_MonitorEventZ_ty_from_ptr(uint64_t ptr) {
+ LDKCOption_MonitorEventZ *obj = (LDKCOption_MonitorEventZ*)untag_ptr(ptr);
+ switch(obj->tag) {
+ case LDKCOption_MonitorEventZ_Some: return 0;
+ case LDKCOption_MonitorEventZ_None: return 1;
+ default: abort();
+ }
}
-uint64_t __attribute__((export_name("TS_CResult_SignedRawInvoiceParseErrorZ_get_ok"))) TS_CResult_SignedRawInvoiceParseErrorZ_get_ok(uint64_t owner) {
- LDKCResult_SignedRawInvoiceParseErrorZ* owner_conv = (LDKCResult_SignedRawInvoiceParseErrorZ*)untag_ptr(owner);
- LDKSignedRawInvoice ret_var = CResult_SignedRawInvoiceParseErrorZ_get_ok(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+uint64_t __attribute__((export_name("TS_LDKCOption_MonitorEventZ_Some_get_some"))) TS_LDKCOption_MonitorEventZ_Some_get_some(uint64_t ptr) {
+ LDKCOption_MonitorEventZ *obj = (LDKCOption_MonitorEventZ*)untag_ptr(ptr);
+ assert(obj->tag == LDKCOption_MonitorEventZ_Some);
+ uint64_t some_ref = tag_ptr(&obj->some, false);
+ return some_ref;
+}
+static inline struct LDKCOption_MonitorEventZ CResult_COption_MonitorEventZDecodeErrorZ_get_ok(LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR owner){
+CHECK(owner->result_ok);
+ return COption_MonitorEventZ_clone(&*owner->contents.result);
+}
+uint64_t __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErrorZ_get_ok"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_get_ok(uint64_t owner) {
+ LDKCResult_COption_MonitorEventZDecodeErrorZ* owner_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)untag_ptr(owner);
+ LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ");
+ *ret_copy = CResult_COption_MonitorEventZDecodeErrorZ_get_ok(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
-static inline struct LDKParseError CResult_SignedRawInvoiceParseErrorZ_get_err(LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR owner){
+static inline struct LDKDecodeError CResult_COption_MonitorEventZDecodeErrorZ_get_err(LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR owner){
CHECK(!owner->result_ok);
- return ParseError_clone(&*owner->contents.err);
+ return DecodeError_clone(&*owner->contents.err);
}
-uint64_t __attribute__((export_name("TS_CResult_SignedRawInvoiceParseErrorZ_get_err"))) TS_CResult_SignedRawInvoiceParseErrorZ_get_err(uint64_t owner) {
- LDKCResult_SignedRawInvoiceParseErrorZ* owner_conv = (LDKCResult_SignedRawInvoiceParseErrorZ*)untag_ptr(owner);
- LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
- *ret_copy = CResult_SignedRawInvoiceParseErrorZ_get_err(owner_conv);
+uint64_t __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErrorZ_get_err"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_get_err(uint64_t owner) {
+ LDKCResult_COption_MonitorEventZDecodeErrorZ* owner_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)untag_ptr(owner);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_COption_MonitorEventZDecodeErrorZ_get_err(owner_conv);
uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
-static inline struct LDKRawInvoice C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_a(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR owner){
- LDKRawInvoice ret = owner->a;
+static inline struct LDKHTLCUpdate CResult_HTLCUpdateDecodeErrorZ_get_ok(LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR owner){
+ LDKHTLCUpdate ret = *owner->contents.result;
ret.is_owned = false;
return ret;
}
-uint64_t __attribute__((export_name("TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_a"))) TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_a(uint64_t owner) {
- LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* owner_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)untag_ptr(owner);
- LDKRawInvoice ret_var = C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_a(owner_conv);
+uint64_t __attribute__((export_name("TS_CResult_HTLCUpdateDecodeErrorZ_get_ok"))) TS_CResult_HTLCUpdateDecodeErrorZ_get_ok(uint64_t owner) {
+ LDKCResult_HTLCUpdateDecodeErrorZ* owner_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)untag_ptr(owner);
+ LDKHTLCUpdate ret_var = CResult_HTLCUpdateDecodeErrorZ_get_ok(owner_conv);
uint64_t ret_ref = 0;
CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
return ret_ref;
}
-static inline struct LDKThirtyTwoBytes C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_b(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR owner){
- return ThirtyTwoBytes_clone(&owner->b);
+static inline struct LDKDecodeError CResult_HTLCUpdateDecodeErrorZ_get_err(LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR owner){
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
-int8_tArray __attribute__((export_name("TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_b"))) TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_b(uint64_t owner) {
- LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* owner_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)untag_ptr(owner);
- int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
- memcpy(ret_arr->elems, C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_b(owner_conv).data, 32);
- return ret_arr;
+uint64_t __attribute__((export_name("TS_CResult_HTLCUpdateDecodeErrorZ_get_err"))) TS_CResult_HTLCUpdateDecodeErrorZ_get_err(uint64_t owner) {
+ LDKCResult_HTLCUpdateDecodeErrorZ* owner_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)untag_ptr(owner);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_HTLCUpdateDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
}
-static inline struct LDKInvoiceSignature C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_c(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR owner){
- LDKInvoiceSignature ret = owner->c;
+static inline struct LDKOutPoint C2Tuple_OutPointScriptZ_get_a(LDKC2Tuple_OutPointScriptZ *NONNULL_PTR owner){
+ LDKOutPoint ret = owner->a;
ret.is_owned = false;
return ret;
}
-uint64_t __attribute__((export_name("TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_c"))) TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_c(uint64_t owner) {
- LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* owner_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)untag_ptr(owner);
- LDKInvoiceSignature ret_var = C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_c(owner_conv);
+uint64_t __attribute__((export_name("TS_C2Tuple_OutPointScriptZ_get_a"))) TS_C2Tuple_OutPointScriptZ_get_a(uint64_t owner) {
+ LDKC2Tuple_OutPointScriptZ* owner_conv = (LDKC2Tuple_OutPointScriptZ*)untag_ptr(owner);
+ LDKOutPoint ret_var = C2Tuple_OutPointScriptZ_get_a(owner_conv);
uint64_t ret_ref = 0;
CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
return ret_ref;
}
-static inline struct LDKPayeePubKey CResult_PayeePubKeyErrorZ_get_ok(LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR owner){
- LDKPayeePubKey ret = *owner->contents.result;
- ret.is_owned = false;
- return ret;
+static inline struct LDKCVec_u8Z C2Tuple_OutPointScriptZ_get_b(LDKC2Tuple_OutPointScriptZ *NONNULL_PTR owner){
+ return CVec_u8Z_clone(&owner->b);
}
-uint64_t __attribute__((export_name("TS_CResult_PayeePubKeyErrorZ_get_ok"))) TS_CResult_PayeePubKeyErrorZ_get_ok(uint64_t owner) {
- LDKCResult_PayeePubKeyErrorZ* owner_conv = (LDKCResult_PayeePubKeyErrorZ*)untag_ptr(owner);
- LDKPayeePubKey ret_var = CResult_PayeePubKeyErrorZ_get_ok(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
- return ret_ref;
+int8_tArray __attribute__((export_name("TS_C2Tuple_OutPointScriptZ_get_b"))) TS_C2Tuple_OutPointScriptZ_get_b(uint64_t owner) {
+ LDKC2Tuple_OutPointScriptZ* owner_conv = (LDKC2Tuple_OutPointScriptZ*)untag_ptr(owner);
+ LDKCVec_u8Z ret_var = C2Tuple_OutPointScriptZ_get_b(owner_conv);
+ int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
+ memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
-static inline enum LDKSecp256k1Error CResult_PayeePubKeyErrorZ_get_err(LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR owner){
-CHECK(!owner->result_ok);
- return *owner->contents.err;
+static inline uint32_t C2Tuple_u32ScriptZ_get_a(LDKC2Tuple_u32ScriptZ *NONNULL_PTR owner){
+ return owner->a;
}
-uint32_t __attribute__((export_name("TS_CResult_PayeePubKeyErrorZ_get_err"))) TS_CResult_PayeePubKeyErrorZ_get_err(uint64_t owner) {
- LDKCResult_PayeePubKeyErrorZ* owner_conv = (LDKCResult_PayeePubKeyErrorZ*)untag_ptr(owner);
- uint32_t ret_conv = LDKSecp256k1Error_to_js(CResult_PayeePubKeyErrorZ_get_err(owner_conv));
+int32_t __attribute__((export_name("TS_C2Tuple_u32ScriptZ_get_a"))) TS_C2Tuple_u32ScriptZ_get_a(uint64_t owner) {
+ LDKC2Tuple_u32ScriptZ* owner_conv = (LDKC2Tuple_u32ScriptZ*)untag_ptr(owner);
+ int32_t ret_conv = C2Tuple_u32ScriptZ_get_a(owner_conv);
return ret_conv;
}
-static inline LDKCVec_PrivateRouteZ CVec_PrivateRouteZ_clone(const LDKCVec_PrivateRouteZ *orig) {
- LDKCVec_PrivateRouteZ ret = { .data = MALLOC(sizeof(LDKPrivateRoute) * orig->datalen, "LDKCVec_PrivateRouteZ clone bytes"), .datalen = orig->datalen };
- for (size_t i = 0; i < ret.datalen; i++) {
- ret.data[i] = PrivateRoute_clone(&orig->data[i]);
- }
- return ret;
-}
-static inline struct LDKPositiveTimestamp CResult_PositiveTimestampCreationErrorZ_get_ok(LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR owner){
- LDKPositiveTimestamp ret = *owner->contents.result;
- ret.is_owned = false;
- return ret;
-}
-uint64_t __attribute__((export_name("TS_CResult_PositiveTimestampCreationErrorZ_get_ok"))) TS_CResult_PositiveTimestampCreationErrorZ_get_ok(uint64_t owner) {
- LDKCResult_PositiveTimestampCreationErrorZ* owner_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)untag_ptr(owner);
- LDKPositiveTimestamp ret_var = CResult_PositiveTimestampCreationErrorZ_get_ok(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
- return ret_ref;
-}
-
-static inline enum LDKCreationError CResult_PositiveTimestampCreationErrorZ_get_err(LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR owner){
-CHECK(!owner->result_ok);
- return CreationError_clone(&*owner->contents.err);
-}
-uint32_t __attribute__((export_name("TS_CResult_PositiveTimestampCreationErrorZ_get_err"))) TS_CResult_PositiveTimestampCreationErrorZ_get_err(uint64_t owner) {
- LDKCResult_PositiveTimestampCreationErrorZ* owner_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)untag_ptr(owner);
- uint32_t ret_conv = LDKCreationError_to_js(CResult_PositiveTimestampCreationErrorZ_get_err(owner_conv));
- return ret_conv;
-}
-
-static inline void CResult_NoneSemanticErrorZ_get_ok(LDKCResult_NoneSemanticErrorZ *NONNULL_PTR owner){
-CHECK(owner->result_ok);
- return *owner->contents.result;
-}
-void __attribute__((export_name("TS_CResult_NoneSemanticErrorZ_get_ok"))) TS_CResult_NoneSemanticErrorZ_get_ok(uint64_t owner) {
- LDKCResult_NoneSemanticErrorZ* owner_conv = (LDKCResult_NoneSemanticErrorZ*)untag_ptr(owner);
- CResult_NoneSemanticErrorZ_get_ok(owner_conv);
-}
-
-static inline enum LDKSemanticError CResult_NoneSemanticErrorZ_get_err(LDKCResult_NoneSemanticErrorZ *NONNULL_PTR owner){
-CHECK(!owner->result_ok);
- return SemanticError_clone(&*owner->contents.err);
-}
-uint32_t __attribute__((export_name("TS_CResult_NoneSemanticErrorZ_get_err"))) TS_CResult_NoneSemanticErrorZ_get_err(uint64_t owner) {
- LDKCResult_NoneSemanticErrorZ* owner_conv = (LDKCResult_NoneSemanticErrorZ*)untag_ptr(owner);
- uint32_t ret_conv = LDKSemanticError_to_js(CResult_NoneSemanticErrorZ_get_err(owner_conv));
- return ret_conv;
-}
-
-static inline struct LDKInvoice CResult_InvoiceSemanticErrorZ_get_ok(LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR owner){
- LDKInvoice ret = *owner->contents.result;
- ret.is_owned = false;
- return ret;
-}
-uint64_t __attribute__((export_name("TS_CResult_InvoiceSemanticErrorZ_get_ok"))) TS_CResult_InvoiceSemanticErrorZ_get_ok(uint64_t owner) {
- LDKCResult_InvoiceSemanticErrorZ* owner_conv = (LDKCResult_InvoiceSemanticErrorZ*)untag_ptr(owner);
- LDKInvoice ret_var = CResult_InvoiceSemanticErrorZ_get_ok(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
- return ret_ref;
-}
-
-static inline enum LDKSemanticError CResult_InvoiceSemanticErrorZ_get_err(LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR owner){
-CHECK(!owner->result_ok);
- return SemanticError_clone(&*owner->contents.err);
-}
-uint32_t __attribute__((export_name("TS_CResult_InvoiceSemanticErrorZ_get_err"))) TS_CResult_InvoiceSemanticErrorZ_get_err(uint64_t owner) {
- LDKCResult_InvoiceSemanticErrorZ* owner_conv = (LDKCResult_InvoiceSemanticErrorZ*)untag_ptr(owner);
- uint32_t ret_conv = LDKSemanticError_to_js(CResult_InvoiceSemanticErrorZ_get_err(owner_conv));
- return ret_conv;
-}
-
-static inline struct LDKDescription CResult_DescriptionCreationErrorZ_get_ok(LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR owner){
- LDKDescription ret = *owner->contents.result;
- ret.is_owned = false;
- return ret;
-}
-uint64_t __attribute__((export_name("TS_CResult_DescriptionCreationErrorZ_get_ok"))) TS_CResult_DescriptionCreationErrorZ_get_ok(uint64_t owner) {
- LDKCResult_DescriptionCreationErrorZ* owner_conv = (LDKCResult_DescriptionCreationErrorZ*)untag_ptr(owner);
- LDKDescription ret_var = CResult_DescriptionCreationErrorZ_get_ok(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
- return ret_ref;
-}
-
-static inline enum LDKCreationError CResult_DescriptionCreationErrorZ_get_err(LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR owner){
-CHECK(!owner->result_ok);
- return CreationError_clone(&*owner->contents.err);
-}
-uint32_t __attribute__((export_name("TS_CResult_DescriptionCreationErrorZ_get_err"))) TS_CResult_DescriptionCreationErrorZ_get_err(uint64_t owner) {
- LDKCResult_DescriptionCreationErrorZ* owner_conv = (LDKCResult_DescriptionCreationErrorZ*)untag_ptr(owner);
- uint32_t ret_conv = LDKCreationError_to_js(CResult_DescriptionCreationErrorZ_get_err(owner_conv));
- return ret_conv;
-}
-
-static inline struct LDKPrivateRoute CResult_PrivateRouteCreationErrorZ_get_ok(LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR owner){
- LDKPrivateRoute ret = *owner->contents.result;
- ret.is_owned = false;
- return ret;
-}
-uint64_t __attribute__((export_name("TS_CResult_PrivateRouteCreationErrorZ_get_ok"))) TS_CResult_PrivateRouteCreationErrorZ_get_ok(uint64_t owner) {
- LDKCResult_PrivateRouteCreationErrorZ* owner_conv = (LDKCResult_PrivateRouteCreationErrorZ*)untag_ptr(owner);
- LDKPrivateRoute ret_var = CResult_PrivateRouteCreationErrorZ_get_ok(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
- return ret_ref;
-}
-
-static inline enum LDKCreationError CResult_PrivateRouteCreationErrorZ_get_err(LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR owner){
-CHECK(!owner->result_ok);
- return CreationError_clone(&*owner->contents.err);
-}
-uint32_t __attribute__((export_name("TS_CResult_PrivateRouteCreationErrorZ_get_err"))) TS_CResult_PrivateRouteCreationErrorZ_get_err(uint64_t owner) {
- LDKCResult_PrivateRouteCreationErrorZ* owner_conv = (LDKCResult_PrivateRouteCreationErrorZ*)untag_ptr(owner);
- uint32_t ret_conv = LDKCreationError_to_js(CResult_PrivateRouteCreationErrorZ_get_err(owner_conv));
- return ret_conv;
-}
-
-static inline struct LDKStr CResult_StringErrorZ_get_ok(LDKCResult_StringErrorZ *NONNULL_PTR owner){
-CHECK(owner->result_ok);
- return *owner->contents.result;
-}
-jstring __attribute__((export_name("TS_CResult_StringErrorZ_get_ok"))) TS_CResult_StringErrorZ_get_ok(uint64_t owner) {
- LDKCResult_StringErrorZ* owner_conv = (LDKCResult_StringErrorZ*)untag_ptr(owner);
- LDKStr ret_str = CResult_StringErrorZ_get_ok(owner_conv);
- jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
- return ret_conv;
-}
-
-static inline enum LDKSecp256k1Error CResult_StringErrorZ_get_err(LDKCResult_StringErrorZ *NONNULL_PTR owner){
-CHECK(!owner->result_ok);
- return *owner->contents.err;
-}
-uint32_t __attribute__((export_name("TS_CResult_StringErrorZ_get_err"))) TS_CResult_StringErrorZ_get_err(uint64_t owner) {
- LDKCResult_StringErrorZ* owner_conv = (LDKCResult_StringErrorZ*)untag_ptr(owner);
- uint32_t ret_conv = LDKSecp256k1Error_to_js(CResult_StringErrorZ_get_err(owner_conv));
- return ret_conv;
-}
-
-static inline struct LDKChannelMonitorUpdate CResult_ChannelMonitorUpdateDecodeErrorZ_get_ok(LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR owner){
- LDKChannelMonitorUpdate ret = *owner->contents.result;
- ret.is_owned = false;
- return ret;
-}
-uint64_t __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeErrorZ_get_ok"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_get_ok(uint64_t owner) {
- LDKCResult_ChannelMonitorUpdateDecodeErrorZ* owner_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)untag_ptr(owner);
- LDKChannelMonitorUpdate ret_var = CResult_ChannelMonitorUpdateDecodeErrorZ_get_ok(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
- return ret_ref;
-}
-
-static inline struct LDKDecodeError CResult_ChannelMonitorUpdateDecodeErrorZ_get_err(LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
-}
-uint64_t __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeErrorZ_get_err"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_get_err(uint64_t owner) {
- LDKCResult_ChannelMonitorUpdateDecodeErrorZ* owner_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_ChannelMonitorUpdateDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
- return ret_ref;
-}
-
-uint32_t __attribute__((export_name("TS_LDKCOption_MonitorEventZ_ty_from_ptr"))) TS_LDKCOption_MonitorEventZ_ty_from_ptr(uint64_t ptr) {
- LDKCOption_MonitorEventZ *obj = (LDKCOption_MonitorEventZ*)untag_ptr(ptr);
- switch(obj->tag) {
- case LDKCOption_MonitorEventZ_Some: return 0;
- case LDKCOption_MonitorEventZ_None: return 1;
- default: abort();
- }
-}
-uint64_t __attribute__((export_name("TS_LDKCOption_MonitorEventZ_Some_get_some"))) TS_LDKCOption_MonitorEventZ_Some_get_some(uint64_t ptr) {
- LDKCOption_MonitorEventZ *obj = (LDKCOption_MonitorEventZ*)untag_ptr(ptr);
- assert(obj->tag == LDKCOption_MonitorEventZ_Some);
- uint64_t some_ref = tag_ptr(&obj->some, false);
- return some_ref;
-}
-static inline struct LDKCOption_MonitorEventZ CResult_COption_MonitorEventZDecodeErrorZ_get_ok(LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR owner){
-CHECK(owner->result_ok);
- return COption_MonitorEventZ_clone(&*owner->contents.result);
-}
-uint64_t __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErrorZ_get_ok"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_get_ok(uint64_t owner) {
- LDKCResult_COption_MonitorEventZDecodeErrorZ* owner_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)untag_ptr(owner);
- LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ");
- *ret_copy = CResult_COption_MonitorEventZDecodeErrorZ_get_ok(owner_conv);
- uint64_t ret_ref = tag_ptr(ret_copy, true);
- return ret_ref;
-}
-
-static inline struct LDKDecodeError CResult_COption_MonitorEventZDecodeErrorZ_get_err(LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
-}
-uint64_t __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErrorZ_get_err"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_get_err(uint64_t owner) {
- LDKCResult_COption_MonitorEventZDecodeErrorZ* owner_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_COption_MonitorEventZDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
- return ret_ref;
-}
-
-static inline struct LDKHTLCUpdate CResult_HTLCUpdateDecodeErrorZ_get_ok(LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR owner){
- LDKHTLCUpdate ret = *owner->contents.result;
- ret.is_owned = false;
- return ret;
-}
-uint64_t __attribute__((export_name("TS_CResult_HTLCUpdateDecodeErrorZ_get_ok"))) TS_CResult_HTLCUpdateDecodeErrorZ_get_ok(uint64_t owner) {
- LDKCResult_HTLCUpdateDecodeErrorZ* owner_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)untag_ptr(owner);
- LDKHTLCUpdate ret_var = CResult_HTLCUpdateDecodeErrorZ_get_ok(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
- return ret_ref;
-}
-
-static inline struct LDKDecodeError CResult_HTLCUpdateDecodeErrorZ_get_err(LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
-}
-uint64_t __attribute__((export_name("TS_CResult_HTLCUpdateDecodeErrorZ_get_err"))) TS_CResult_HTLCUpdateDecodeErrorZ_get_err(uint64_t owner) {
- LDKCResult_HTLCUpdateDecodeErrorZ* owner_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_HTLCUpdateDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
- return ret_ref;
-}
-
-static inline struct LDKOutPoint C2Tuple_OutPointScriptZ_get_a(LDKC2Tuple_OutPointScriptZ *NONNULL_PTR owner){
- LDKOutPoint ret = owner->a;
- ret.is_owned = false;
- return ret;
-}
-uint64_t __attribute__((export_name("TS_C2Tuple_OutPointScriptZ_get_a"))) TS_C2Tuple_OutPointScriptZ_get_a(uint64_t owner) {
- LDKC2Tuple_OutPointScriptZ* owner_conv = (LDKC2Tuple_OutPointScriptZ*)untag_ptr(owner);
- LDKOutPoint ret_var = C2Tuple_OutPointScriptZ_get_a(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
- return ret_ref;
-}
-
-static inline struct LDKCVec_u8Z C2Tuple_OutPointScriptZ_get_b(LDKC2Tuple_OutPointScriptZ *NONNULL_PTR owner){
- return CVec_u8Z_clone(&owner->b);
-}
-int8_tArray __attribute__((export_name("TS_C2Tuple_OutPointScriptZ_get_b"))) TS_C2Tuple_OutPointScriptZ_get_b(uint64_t owner) {
- LDKC2Tuple_OutPointScriptZ* owner_conv = (LDKC2Tuple_OutPointScriptZ*)untag_ptr(owner);
- LDKCVec_u8Z ret_var = C2Tuple_OutPointScriptZ_get_b(owner_conv);
- int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
- memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
- CVec_u8Z_free(ret_var);
- return ret_arr;
-}
-
-static inline uint32_t C2Tuple_u32ScriptZ_get_a(LDKC2Tuple_u32ScriptZ *NONNULL_PTR owner){
- return owner->a;
-}
-int32_t __attribute__((export_name("TS_C2Tuple_u32ScriptZ_get_a"))) TS_C2Tuple_u32ScriptZ_get_a(uint64_t owner) {
- LDKC2Tuple_u32ScriptZ* owner_conv = (LDKC2Tuple_u32ScriptZ*)untag_ptr(owner);
- int32_t ret_conv = C2Tuple_u32ScriptZ_get_a(owner_conv);
- return ret_conv;
-}
-
-static inline struct LDKCVec_u8Z C2Tuple_u32ScriptZ_get_b(LDKC2Tuple_u32ScriptZ *NONNULL_PTR owner){
- return CVec_u8Z_clone(&owner->b);
+static inline struct LDKCVec_u8Z C2Tuple_u32ScriptZ_get_b(LDKC2Tuple_u32ScriptZ *NONNULL_PTR owner){
+ return CVec_u8Z_clone(&owner->b);
}
int8_tArray __attribute__((export_name("TS_C2Tuple_u32ScriptZ_get_b"))) TS_C2Tuple_u32ScriptZ_get_b(uint64_t owner) {
LDKC2Tuple_u32ScriptZ* owner_conv = (LDKC2Tuple_u32ScriptZ*)untag_ptr(owner);
case LDKBalance_ClaimableOnChannelClose: return 0;
case LDKBalance_ClaimableAwaitingConfirmations: return 1;
case LDKBalance_ContentiousClaimable: return 2;
- case LDKBalance_MaybeClaimableHTLCAwaitingTimeout: return 3;
+ case LDKBalance_MaybeTimeoutClaimableHTLC: return 3;
+ case LDKBalance_MaybePreimageClaimableHTLC: return 4;
+ case LDKBalance_CounterpartyRevokedOutputClaimable: return 5;
default: abort();
}
}
int32_t timeout_height_conv = obj->contentious_claimable.timeout_height;
return timeout_height_conv;
}
-int64_t __attribute__((export_name("TS_LDKBalance_MaybeClaimableHTLCAwaitingTimeout_get_claimable_amount_satoshis"))) TS_LDKBalance_MaybeClaimableHTLCAwaitingTimeout_get_claimable_amount_satoshis(uint64_t ptr) {
+int64_t __attribute__((export_name("TS_LDKBalance_MaybeTimeoutClaimableHTLC_get_claimable_amount_satoshis"))) TS_LDKBalance_MaybeTimeoutClaimableHTLC_get_claimable_amount_satoshis(uint64_t ptr) {
LDKBalance *obj = (LDKBalance*)untag_ptr(ptr);
- assert(obj->tag == LDKBalance_MaybeClaimableHTLCAwaitingTimeout);
- int64_t claimable_amount_satoshis_conv = obj->maybe_claimable_htlc_awaiting_timeout.claimable_amount_satoshis;
+ assert(obj->tag == LDKBalance_MaybeTimeoutClaimableHTLC);
+ int64_t claimable_amount_satoshis_conv = obj->maybe_timeout_claimable_htlc.claimable_amount_satoshis;
return claimable_amount_satoshis_conv;
}
-int32_t __attribute__((export_name("TS_LDKBalance_MaybeClaimableHTLCAwaitingTimeout_get_claimable_height"))) TS_LDKBalance_MaybeClaimableHTLCAwaitingTimeout_get_claimable_height(uint64_t ptr) {
+int32_t __attribute__((export_name("TS_LDKBalance_MaybeTimeoutClaimableHTLC_get_claimable_height"))) TS_LDKBalance_MaybeTimeoutClaimableHTLC_get_claimable_height(uint64_t ptr) {
LDKBalance *obj = (LDKBalance*)untag_ptr(ptr);
- assert(obj->tag == LDKBalance_MaybeClaimableHTLCAwaitingTimeout);
- int32_t claimable_height_conv = obj->maybe_claimable_htlc_awaiting_timeout.claimable_height;
+ assert(obj->tag == LDKBalance_MaybeTimeoutClaimableHTLC);
+ int32_t claimable_height_conv = obj->maybe_timeout_claimable_htlc.claimable_height;
return claimable_height_conv;
}
+int64_t __attribute__((export_name("TS_LDKBalance_MaybePreimageClaimableHTLC_get_claimable_amount_satoshis"))) TS_LDKBalance_MaybePreimageClaimableHTLC_get_claimable_amount_satoshis(uint64_t ptr) {
+ LDKBalance *obj = (LDKBalance*)untag_ptr(ptr);
+ assert(obj->tag == LDKBalance_MaybePreimageClaimableHTLC);
+ int64_t claimable_amount_satoshis_conv = obj->maybe_preimage_claimable_htlc.claimable_amount_satoshis;
+ return claimable_amount_satoshis_conv;
+}
+int32_t __attribute__((export_name("TS_LDKBalance_MaybePreimageClaimableHTLC_get_expiry_height"))) TS_LDKBalance_MaybePreimageClaimableHTLC_get_expiry_height(uint64_t ptr) {
+ LDKBalance *obj = (LDKBalance*)untag_ptr(ptr);
+ assert(obj->tag == LDKBalance_MaybePreimageClaimableHTLC);
+ int32_t expiry_height_conv = obj->maybe_preimage_claimable_htlc.expiry_height;
+ return expiry_height_conv;
+}
+int64_t __attribute__((export_name("TS_LDKBalance_CounterpartyRevokedOutputClaimable_get_claimable_amount_satoshis"))) TS_LDKBalance_CounterpartyRevokedOutputClaimable_get_claimable_amount_satoshis(uint64_t ptr) {
+ LDKBalance *obj = (LDKBalance*)untag_ptr(ptr);
+ assert(obj->tag == LDKBalance_CounterpartyRevokedOutputClaimable);
+ int64_t claimable_amount_satoshis_conv = obj->counterparty_revoked_output_claimable.claimable_amount_satoshis;
+ return claimable_amount_satoshis_conv;
+}
static inline LDKCVec_BalanceZ CVec_BalanceZ_clone(const LDKCVec_BalanceZ *orig) {
LDKCVec_BalanceZ ret = { .data = MALLOC(sizeof(LDKBalance) * orig->datalen, "LDKCVec_BalanceZ clone bytes"), .datalen = orig->datalen };
for (size_t i = 0; i < ret.datalen; i++) {
}
static inline struct LDKDecodeError CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_err(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
uint64_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_err"))) TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_err(uint64_t owner) {
LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* owner_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
return ret;
}
+typedef struct LDKCustomOnionMessageContents_JCalls {
+ atomic_size_t refcnt;
+ uint32_t instance_ptr;
+} LDKCustomOnionMessageContents_JCalls;
+static void LDKCustomOnionMessageContents_JCalls_free(void* this_arg) {
+ LDKCustomOnionMessageContents_JCalls *j_calls = (LDKCustomOnionMessageContents_JCalls*) this_arg;
+ if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
+ FREE(j_calls);
+ }
+}
+uint64_t tlv_type_LDKCustomOnionMessageContents_jcall(const void* this_arg) {
+ LDKCustomOnionMessageContents_JCalls *j_calls = (LDKCustomOnionMessageContents_JCalls*) this_arg;
+ return js_invoke_function_uuuuuu(j_calls->instance_ptr, 38, 0, 0, 0, 0, 0, 0);
+}
+LDKCVec_u8Z write_LDKCustomOnionMessageContents_jcall(const void* this_arg) {
+ LDKCustomOnionMessageContents_JCalls *j_calls = (LDKCustomOnionMessageContents_JCalls*) this_arg;
+ int8_tArray ret = (int8_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 39, 0, 0, 0, 0, 0, 0);
+ LDKCVec_u8Z ret_ref;
+ ret_ref.datalen = ret->arr_len;
+ ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes");
+ memcpy(ret_ref.data, ret->elems, ret_ref.datalen); FREE(ret);
+ return ret_ref;
+}
+static void LDKCustomOnionMessageContents_JCalls_cloned(LDKCustomOnionMessageContents* new_obj) {
+ LDKCustomOnionMessageContents_JCalls *j_calls = (LDKCustomOnionMessageContents_JCalls*) new_obj->this_arg;
+ atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
+}
+static inline LDKCustomOnionMessageContents LDKCustomOnionMessageContents_init (JSValue o) {
+ LDKCustomOnionMessageContents_JCalls *calls = MALLOC(sizeof(LDKCustomOnionMessageContents_JCalls), "LDKCustomOnionMessageContents_JCalls");
+ atomic_init(&calls->refcnt, 1);
+ calls->instance_ptr = o;
+
+ LDKCustomOnionMessageContents ret = {
+ .this_arg = (void*) calls,
+ .tlv_type = tlv_type_LDKCustomOnionMessageContents_jcall,
+ .write = write_LDKCustomOnionMessageContents_jcall,
+ .cloned = LDKCustomOnionMessageContents_JCalls_cloned,
+ .free = LDKCustomOnionMessageContents_JCalls_free,
+ };
+ return ret;
+}
+uint64_t __attribute__((export_name("TS_LDKCustomOnionMessageContents_new"))) TS_LDKCustomOnionMessageContents_new(JSValue o) {
+ LDKCustomOnionMessageContents *res_ptr = MALLOC(sizeof(LDKCustomOnionMessageContents), "LDKCustomOnionMessageContents");
+ *res_ptr = LDKCustomOnionMessageContents_init(o);
+ return tag_ptr(res_ptr, true);
+}
+int64_t __attribute__((export_name("TS_CustomOnionMessageContents_tlv_type"))) TS_CustomOnionMessageContents_tlv_type(uint64_t this_arg) {
+ void* this_arg_ptr = untag_ptr(this_arg);
+ if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKCustomOnionMessageContents* this_arg_conv = (LDKCustomOnionMessageContents*)this_arg_ptr;
+ int64_t ret_conv = (this_arg_conv->tlv_type)(this_arg_conv->this_arg);
+ return ret_conv;
+}
+
+int8_tArray __attribute__((export_name("TS_CustomOnionMessageContents_write"))) TS_CustomOnionMessageContents_write(uint64_t this_arg) {
+ void* this_arg_ptr = untag_ptr(this_arg);
+ if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKCustomOnionMessageContents* this_arg_conv = (LDKCustomOnionMessageContents*)this_arg_ptr;
+ LDKCVec_u8Z ret_var = (this_arg_conv->write)(this_arg_conv->this_arg);
+ int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
+ memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
+}
+
+uint32_t __attribute__((export_name("TS_LDKCOption_CustomOnionMessageContentsZ_ty_from_ptr"))) TS_LDKCOption_CustomOnionMessageContentsZ_ty_from_ptr(uint64_t ptr) {
+ LDKCOption_CustomOnionMessageContentsZ *obj = (LDKCOption_CustomOnionMessageContentsZ*)untag_ptr(ptr);
+ switch(obj->tag) {
+ case LDKCOption_CustomOnionMessageContentsZ_Some: return 0;
+ case LDKCOption_CustomOnionMessageContentsZ_None: return 1;
+ default: abort();
+ }
+}
+uint64_t __attribute__((export_name("TS_LDKCOption_CustomOnionMessageContentsZ_Some_get_some"))) TS_LDKCOption_CustomOnionMessageContentsZ_Some_get_some(uint64_t ptr) {
+ LDKCOption_CustomOnionMessageContentsZ *obj = (LDKCOption_CustomOnionMessageContentsZ*)untag_ptr(ptr);
+ assert(obj->tag == LDKCOption_CustomOnionMessageContentsZ_Some);
+ LDKCustomOnionMessageContents* some_ret = MALLOC(sizeof(LDKCustomOnionMessageContents), "LDKCustomOnionMessageContents");
+ *some_ret = CustomOnionMessageContents_clone(&obj->some);
+ return tag_ptr(some_ret, true);
+}
+static inline struct LDKCOption_CustomOnionMessageContentsZ CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_get_ok(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ *NONNULL_PTR owner){
+CHECK(owner->result_ok);
+ return COption_CustomOnionMessageContentsZ_clone(&*owner->contents.result);
+}
+uint64_t __attribute__((export_name("TS_CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_get_ok"))) TS_CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_get_ok(uint64_t owner) {
+ LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* owner_conv = (LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ*)untag_ptr(owner);
+ LDKCOption_CustomOnionMessageContentsZ *ret_copy = MALLOC(sizeof(LDKCOption_CustomOnionMessageContentsZ), "LDKCOption_CustomOnionMessageContentsZ");
+ *ret_copy = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_get_ok(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+static inline struct LDKDecodeError CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_get_err(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ *NONNULL_PTR owner){
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
+}
+uint64_t __attribute__((export_name("TS_CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_get_err"))) TS_CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_get_err(uint64_t owner) {
+ LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* owner_conv = (LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ*)untag_ptr(owner);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
uint32_t __attribute__((export_name("TS_LDKCOption_NetAddressZ_ty_from_ptr"))) TS_LDKCOption_NetAddressZ_ty_from_ptr(uint64_t ptr) {
LDKCOption_NetAddressZ *obj = (LDKCOption_NetAddressZ*)untag_ptr(ptr);
switch(obj->tag) {
uint64_t some_ref = tag_ptr(&obj->some, false);
return some_ref;
}
+static inline struct LDKPublicKey C2Tuple_PublicKeyCOption_NetAddressZZ_get_a(LDKC2Tuple_PublicKeyCOption_NetAddressZZ *NONNULL_PTR owner){
+ return owner->a;
+}
+int8_tArray __attribute__((export_name("TS_C2Tuple_PublicKeyCOption_NetAddressZZ_get_a"))) TS_C2Tuple_PublicKeyCOption_NetAddressZZ_get_a(uint64_t owner) {
+ LDKC2Tuple_PublicKeyCOption_NetAddressZZ* owner_conv = (LDKC2Tuple_PublicKeyCOption_NetAddressZZ*)untag_ptr(owner);
+ int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
+ memcpy(ret_arr->elems, C2Tuple_PublicKeyCOption_NetAddressZZ_get_a(owner_conv).compressed_form, 33);
+ return ret_arr;
+}
+
+static inline struct LDKCOption_NetAddressZ C2Tuple_PublicKeyCOption_NetAddressZZ_get_b(LDKC2Tuple_PublicKeyCOption_NetAddressZZ *NONNULL_PTR owner){
+ return COption_NetAddressZ_clone(&owner->b);
+}
+uint64_t __attribute__((export_name("TS_C2Tuple_PublicKeyCOption_NetAddressZZ_get_b"))) TS_C2Tuple_PublicKeyCOption_NetAddressZZ_get_b(uint64_t owner) {
+ LDKC2Tuple_PublicKeyCOption_NetAddressZZ* owner_conv = (LDKC2Tuple_PublicKeyCOption_NetAddressZZ*)untag_ptr(owner);
+ LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ");
+ *ret_copy = C2Tuple_PublicKeyCOption_NetAddressZZ_get_b(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+static inline LDKCVec_C2Tuple_PublicKeyCOption_NetAddressZZZ CVec_C2Tuple_PublicKeyCOption_NetAddressZZZ_clone(const LDKCVec_C2Tuple_PublicKeyCOption_NetAddressZZZ *orig) {
+ LDKCVec_C2Tuple_PublicKeyCOption_NetAddressZZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_PublicKeyCOption_NetAddressZZ) * orig->datalen, "LDKCVec_C2Tuple_PublicKeyCOption_NetAddressZZZ clone bytes"), .datalen = orig->datalen };
+ for (size_t i = 0; i < ret.datalen; i++) {
+ ret.data[i] = C2Tuple_PublicKeyCOption_NetAddressZZ_clone(&orig->data[i]);
+ }
+ return ret;
+}
static inline struct LDKCVec_u8Z CResult_CVec_u8ZPeerHandleErrorZ_get_ok(LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR owner){
CHECK(owner->result_ok);
return CVec_u8Z_clone(&*owner->contents.result);
return ret_ref;
}
-static inline void CResult_NoneErrorZ_get_ok(LDKCResult_NoneErrorZ *NONNULL_PTR owner){
+uint32_t __attribute__((export_name("TS_LDKSendError_ty_from_ptr"))) TS_LDKSendError_ty_from_ptr(uint64_t ptr) {
+ LDKSendError *obj = (LDKSendError*)untag_ptr(ptr);
+ switch(obj->tag) {
+ case LDKSendError_Secp256k1: return 0;
+ case LDKSendError_TooBigPacket: return 1;
+ case LDKSendError_TooFewBlindedHops: return 2;
+ case LDKSendError_InvalidFirstHop: return 3;
+ case LDKSendError_InvalidMessage: return 4;
+ case LDKSendError_BufferFull: return 5;
+ case LDKSendError_GetNodeIdFailed: return 6;
+ case LDKSendError_BlindedPathAdvanceFailed: return 7;
+ default: abort();
+ }
+}
+uint32_t __attribute__((export_name("TS_LDKSendError_Secp256k1_get_secp256k1"))) TS_LDKSendError_Secp256k1_get_secp256k1(uint64_t ptr) {
+ LDKSendError *obj = (LDKSendError*)untag_ptr(ptr);
+ assert(obj->tag == LDKSendError_Secp256k1);
+ uint32_t secp256k1_conv = LDKSecp256k1Error_to_js(obj->secp256k1);
+ return secp256k1_conv;
+}
+static inline void CResult_NoneSendErrorZ_get_ok(LDKCResult_NoneSendErrorZ *NONNULL_PTR owner){
CHECK(owner->result_ok);
return *owner->contents.result;
}
-void __attribute__((export_name("TS_CResult_NoneErrorZ_get_ok"))) TS_CResult_NoneErrorZ_get_ok(uint64_t owner) {
- LDKCResult_NoneErrorZ* owner_conv = (LDKCResult_NoneErrorZ*)untag_ptr(owner);
- CResult_NoneErrorZ_get_ok(owner_conv);
+void __attribute__((export_name("TS_CResult_NoneSendErrorZ_get_ok"))) TS_CResult_NoneSendErrorZ_get_ok(uint64_t owner) {
+ LDKCResult_NoneSendErrorZ* owner_conv = (LDKCResult_NoneSendErrorZ*)untag_ptr(owner);
+ CResult_NoneSendErrorZ_get_ok(owner_conv);
}
-static inline enum LDKIOError CResult_NoneErrorZ_get_err(LDKCResult_NoneErrorZ *NONNULL_PTR owner){
+static inline struct LDKSendError CResult_NoneSendErrorZ_get_err(LDKCResult_NoneSendErrorZ *NONNULL_PTR owner){
CHECK(!owner->result_ok);
- return *owner->contents.err;
+ return SendError_clone(&*owner->contents.err);
}
-uint32_t __attribute__((export_name("TS_CResult_NoneErrorZ_get_err"))) TS_CResult_NoneErrorZ_get_err(uint64_t owner) {
- LDKCResult_NoneErrorZ* owner_conv = (LDKCResult_NoneErrorZ*)untag_ptr(owner);
- uint32_t ret_conv = LDKIOError_to_js(CResult_NoneErrorZ_get_err(owner_conv));
- return ret_conv;
+uint64_t __attribute__((export_name("TS_CResult_NoneSendErrorZ_get_err"))) TS_CResult_NoneSendErrorZ_get_err(uint64_t owner) {
+ LDKCResult_NoneSendErrorZ* owner_conv = (LDKCResult_NoneSendErrorZ*)untag_ptr(owner);
+ LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError");
+ *ret_copy = CResult_NoneSendErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
}
-static inline struct LDKNetAddress CResult_NetAddressDecodeErrorZ_get_ok(LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR owner){
+uint32_t __attribute__((export_name("TS_LDKGraphSyncError_ty_from_ptr"))) TS_LDKGraphSyncError_ty_from_ptr(uint64_t ptr) {
+ LDKGraphSyncError *obj = (LDKGraphSyncError*)untag_ptr(ptr);
+ switch(obj->tag) {
+ case LDKGraphSyncError_DecodeError: return 0;
+ case LDKGraphSyncError_LightningError: return 1;
+ default: abort();
+ }
+}
+uint64_t __attribute__((export_name("TS_LDKGraphSyncError_DecodeError_get_decode_error"))) TS_LDKGraphSyncError_DecodeError_get_decode_error(uint64_t ptr) {
+ LDKGraphSyncError *obj = (LDKGraphSyncError*)untag_ptr(ptr);
+ assert(obj->tag == LDKGraphSyncError_DecodeError);
+ uint64_t decode_error_ref = tag_ptr(&obj->decode_error, false);
+ return decode_error_ref;
+}
+uint64_t __attribute__((export_name("TS_LDKGraphSyncError_LightningError_get_lightning_error"))) TS_LDKGraphSyncError_LightningError_get_lightning_error(uint64_t ptr) {
+ LDKGraphSyncError *obj = (LDKGraphSyncError*)untag_ptr(ptr);
+ assert(obj->tag == LDKGraphSyncError_LightningError);
+ LDKLightningError lightning_error_var = obj->lightning_error;
+ uint64_t lightning_error_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(lightning_error_var);
+ lightning_error_ref = tag_ptr(lightning_error_var.inner, false);
+ return lightning_error_ref;
+}
+static inline uint32_t CResult_u32GraphSyncErrorZ_get_ok(LDKCResult_u32GraphSyncErrorZ *NONNULL_PTR owner){
CHECK(owner->result_ok);
- return NetAddress_clone(&*owner->contents.result);
+ return *owner->contents.result;
}
-uint64_t __attribute__((export_name("TS_CResult_NetAddressDecodeErrorZ_get_ok"))) TS_CResult_NetAddressDecodeErrorZ_get_ok(uint64_t owner) {
- LDKCResult_NetAddressDecodeErrorZ* owner_conv = (LDKCResult_NetAddressDecodeErrorZ*)untag_ptr(owner);
- LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
- *ret_copy = CResult_NetAddressDecodeErrorZ_get_ok(owner_conv);
- uint64_t ret_ref = tag_ptr(ret_copy, true);
- return ret_ref;
+int32_t __attribute__((export_name("TS_CResult_u32GraphSyncErrorZ_get_ok"))) TS_CResult_u32GraphSyncErrorZ_get_ok(uint64_t owner) {
+ LDKCResult_u32GraphSyncErrorZ* owner_conv = (LDKCResult_u32GraphSyncErrorZ*)untag_ptr(owner);
+ int32_t ret_conv = CResult_u32GraphSyncErrorZ_get_ok(owner_conv);
+ return ret_conv;
}
-static inline struct LDKDecodeError CResult_NetAddressDecodeErrorZ_get_err(LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+static inline struct LDKGraphSyncError CResult_u32GraphSyncErrorZ_get_err(LDKCResult_u32GraphSyncErrorZ *NONNULL_PTR owner){
+CHECK(!owner->result_ok);
+ return GraphSyncError_clone(&*owner->contents.err);
}
-uint64_t __attribute__((export_name("TS_CResult_NetAddressDecodeErrorZ_get_err"))) TS_CResult_NetAddressDecodeErrorZ_get_err(uint64_t owner) {
- LDKCResult_NetAddressDecodeErrorZ* owner_conv = (LDKCResult_NetAddressDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_NetAddressDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+uint64_t __attribute__((export_name("TS_CResult_u32GraphSyncErrorZ_get_err"))) TS_CResult_u32GraphSyncErrorZ_get_err(uint64_t owner) {
+ LDKCResult_u32GraphSyncErrorZ* owner_conv = (LDKCResult_u32GraphSyncErrorZ*)untag_ptr(owner);
+ LDKGraphSyncError *ret_copy = MALLOC(sizeof(LDKGraphSyncError), "LDKGraphSyncError");
+ *ret_copy = CResult_u32GraphSyncErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
-static inline LDKCVec_UpdateAddHTLCZ CVec_UpdateAddHTLCZ_clone(const LDKCVec_UpdateAddHTLCZ *orig) {
- LDKCVec_UpdateAddHTLCZ ret = { .data = MALLOC(sizeof(LDKUpdateAddHTLC) * orig->datalen, "LDKCVec_UpdateAddHTLCZ clone bytes"), .datalen = orig->datalen };
- for (size_t i = 0; i < ret.datalen; i++) {
- ret.data[i] = UpdateAddHTLC_clone(&orig->data[i]);
+uint32_t __attribute__((export_name("TS_LDKParseError_ty_from_ptr"))) TS_LDKParseError_ty_from_ptr(uint64_t ptr) {
+ LDKParseError *obj = (LDKParseError*)untag_ptr(ptr);
+ switch(obj->tag) {
+ case LDKParseError_Bech32Error: return 0;
+ case LDKParseError_ParseAmountError: return 1;
+ case LDKParseError_MalformedSignature: return 2;
+ case LDKParseError_BadPrefix: return 3;
+ case LDKParseError_UnknownCurrency: return 4;
+ case LDKParseError_UnknownSiPrefix: return 5;
+ case LDKParseError_MalformedHRP: return 6;
+ case LDKParseError_TooShortDataPart: return 7;
+ case LDKParseError_UnexpectedEndOfTaggedFields: return 8;
+ case LDKParseError_DescriptionDecodeError: return 9;
+ case LDKParseError_PaddingError: return 10;
+ case LDKParseError_IntegerOverflowError: return 11;
+ case LDKParseError_InvalidSegWitProgramLength: return 12;
+ case LDKParseError_InvalidPubKeyHashLength: return 13;
+ case LDKParseError_InvalidScriptHashLength: return 14;
+ case LDKParseError_InvalidRecoveryId: return 15;
+ case LDKParseError_InvalidSliceLength: return 16;
+ case LDKParseError_Skip: return 17;
+ default: abort();
}
- return ret;
}
-static inline LDKCVec_UpdateFulfillHTLCZ CVec_UpdateFulfillHTLCZ_clone(const LDKCVec_UpdateFulfillHTLCZ *orig) {
- LDKCVec_UpdateFulfillHTLCZ ret = { .data = MALLOC(sizeof(LDKUpdateFulfillHTLC) * orig->datalen, "LDKCVec_UpdateFulfillHTLCZ clone bytes"), .datalen = orig->datalen };
- for (size_t i = 0; i < ret.datalen; i++) {
- ret.data[i] = UpdateFulfillHTLC_clone(&orig->data[i]);
- }
- return ret;
+uint64_t __attribute__((export_name("TS_LDKParseError_Bech32Error_get_bech32_error"))) TS_LDKParseError_Bech32Error_get_bech32_error(uint64_t ptr) {
+ LDKParseError *obj = (LDKParseError*)untag_ptr(ptr);
+ assert(obj->tag == LDKParseError_Bech32Error);
+ uint64_t bech32_error_ref = tag_ptr(&obj->bech32_error, false);
+ return bech32_error_ref;
}
-static inline LDKCVec_UpdateFailHTLCZ CVec_UpdateFailHTLCZ_clone(const LDKCVec_UpdateFailHTLCZ *orig) {
- LDKCVec_UpdateFailHTLCZ ret = { .data = MALLOC(sizeof(LDKUpdateFailHTLC) * orig->datalen, "LDKCVec_UpdateFailHTLCZ clone bytes"), .datalen = orig->datalen };
- for (size_t i = 0; i < ret.datalen; i++) {
- ret.data[i] = UpdateFailHTLC_clone(&orig->data[i]);
- }
- return ret;
+int32_t __attribute__((export_name("TS_LDKParseError_ParseAmountError_get_parse_amount_error"))) TS_LDKParseError_ParseAmountError_get_parse_amount_error(uint64_t ptr) {
+ LDKParseError *obj = (LDKParseError*)untag_ptr(ptr);
+ assert(obj->tag == LDKParseError_ParseAmountError);
+ /*obj->parse_amount_error*/
+ return 0;
}
-static inline LDKCVec_UpdateFailMalformedHTLCZ CVec_UpdateFailMalformedHTLCZ_clone(const LDKCVec_UpdateFailMalformedHTLCZ *orig) {
- LDKCVec_UpdateFailMalformedHTLCZ ret = { .data = MALLOC(sizeof(LDKUpdateFailMalformedHTLC) * orig->datalen, "LDKCVec_UpdateFailMalformedHTLCZ clone bytes"), .datalen = orig->datalen };
- for (size_t i = 0; i < ret.datalen; i++) {
- ret.data[i] = UpdateFailMalformedHTLC_clone(&orig->data[i]);
- }
- return ret;
+uint32_t __attribute__((export_name("TS_LDKParseError_MalformedSignature_get_malformed_signature"))) TS_LDKParseError_MalformedSignature_get_malformed_signature(uint64_t ptr) {
+ LDKParseError *obj = (LDKParseError*)untag_ptr(ptr);
+ assert(obj->tag == LDKParseError_MalformedSignature);
+ uint32_t malformed_signature_conv = LDKSecp256k1Error_to_js(obj->malformed_signature);
+ return malformed_signature_conv;
}
-static inline struct LDKAcceptChannel CResult_AcceptChannelDecodeErrorZ_get_ok(LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR owner){
- LDKAcceptChannel ret = *owner->contents.result;
- ret.is_owned = false;
- return ret;
+int32_t __attribute__((export_name("TS_LDKParseError_DescriptionDecodeError_get_description_decode_error"))) TS_LDKParseError_DescriptionDecodeError_get_description_decode_error(uint64_t ptr) {
+ LDKParseError *obj = (LDKParseError*)untag_ptr(ptr);
+ assert(obj->tag == LDKParseError_DescriptionDecodeError);
+ /*obj->description_decode_error*/
+ return 0;
}
-uint64_t __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_get_ok"))) TS_CResult_AcceptChannelDecodeErrorZ_get_ok(uint64_t owner) {
- LDKCResult_AcceptChannelDecodeErrorZ* owner_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)untag_ptr(owner);
- LDKAcceptChannel ret_var = CResult_AcceptChannelDecodeErrorZ_get_ok(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
- return ret_ref;
+jstring __attribute__((export_name("TS_LDKParseError_InvalidSliceLength_get_invalid_slice_length"))) TS_LDKParseError_InvalidSliceLength_get_invalid_slice_length(uint64_t ptr) {
+ LDKParseError *obj = (LDKParseError*)untag_ptr(ptr);
+ assert(obj->tag == LDKParseError_InvalidSliceLength);
+ LDKStr invalid_slice_length_str = obj->invalid_slice_length;
+ jstring invalid_slice_length_conv = str_ref_to_ts(invalid_slice_length_str.chars, invalid_slice_length_str.len);
+ return invalid_slice_length_conv;
}
-
-static inline struct LDKDecodeError CResult_AcceptChannelDecodeErrorZ_get_err(LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+static inline enum LDKSiPrefix CResult_SiPrefixParseErrorZ_get_ok(LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR owner){
+CHECK(owner->result_ok);
+ return SiPrefix_clone(&*owner->contents.result);
}
-uint64_t __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_get_err"))) TS_CResult_AcceptChannelDecodeErrorZ_get_err(uint64_t owner) {
- LDKCResult_AcceptChannelDecodeErrorZ* owner_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_AcceptChannelDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
- return ret_ref;
+uint32_t __attribute__((export_name("TS_CResult_SiPrefixParseErrorZ_get_ok"))) TS_CResult_SiPrefixParseErrorZ_get_ok(uint64_t owner) {
+ LDKCResult_SiPrefixParseErrorZ* owner_conv = (LDKCResult_SiPrefixParseErrorZ*)untag_ptr(owner);
+ uint32_t ret_conv = LDKSiPrefix_to_js(CResult_SiPrefixParseErrorZ_get_ok(owner_conv));
+ return ret_conv;
}
-static inline struct LDKAnnouncementSignatures CResult_AnnouncementSignaturesDecodeErrorZ_get_ok(LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR owner){
- LDKAnnouncementSignatures ret = *owner->contents.result;
- ret.is_owned = false;
- return ret;
+static inline struct LDKParseError CResult_SiPrefixParseErrorZ_get_err(LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR owner){
+CHECK(!owner->result_ok);
+ return ParseError_clone(&*owner->contents.err);
}
-uint64_t __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErrorZ_get_ok"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_get_ok(uint64_t owner) {
- LDKCResult_AnnouncementSignaturesDecodeErrorZ* owner_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)untag_ptr(owner);
- LDKAnnouncementSignatures ret_var = CResult_AnnouncementSignaturesDecodeErrorZ_get_ok(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+uint64_t __attribute__((export_name("TS_CResult_SiPrefixParseErrorZ_get_err"))) TS_CResult_SiPrefixParseErrorZ_get_err(uint64_t owner) {
+ LDKCResult_SiPrefixParseErrorZ* owner_conv = (LDKCResult_SiPrefixParseErrorZ*)untag_ptr(owner);
+ LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
+ *ret_copy = CResult_SiPrefixParseErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
-static inline struct LDKDecodeError CResult_AnnouncementSignaturesDecodeErrorZ_get_err(LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
+uint32_t __attribute__((export_name("TS_LDKParseOrSemanticError_ty_from_ptr"))) TS_LDKParseOrSemanticError_ty_from_ptr(uint64_t ptr) {
+ LDKParseOrSemanticError *obj = (LDKParseOrSemanticError*)untag_ptr(ptr);
+ switch(obj->tag) {
+ case LDKParseOrSemanticError_ParseError: return 0;
+ case LDKParseOrSemanticError_SemanticError: return 1;
+ default: abort();
+ }
+}
+uint64_t __attribute__((export_name("TS_LDKParseOrSemanticError_ParseError_get_parse_error"))) TS_LDKParseOrSemanticError_ParseError_get_parse_error(uint64_t ptr) {
+ LDKParseOrSemanticError *obj = (LDKParseOrSemanticError*)untag_ptr(ptr);
+ assert(obj->tag == LDKParseOrSemanticError_ParseError);
+ uint64_t parse_error_ref = tag_ptr(&obj->parse_error, false);
+ return parse_error_ref;
+}
+uint32_t __attribute__((export_name("TS_LDKParseOrSemanticError_SemanticError_get_semantic_error"))) TS_LDKParseOrSemanticError_SemanticError_get_semantic_error(uint64_t ptr) {
+ LDKParseOrSemanticError *obj = (LDKParseOrSemanticError*)untag_ptr(ptr);
+ assert(obj->tag == LDKParseOrSemanticError_SemanticError);
+ uint32_t semantic_error_conv = LDKSemanticError_to_js(obj->semantic_error);
+ return semantic_error_conv;
+}
+static inline struct LDKInvoice CResult_InvoiceParseOrSemanticErrorZ_get_ok(LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR owner){
+ LDKInvoice ret = *owner->contents.result;
ret.is_owned = false;
return ret;
}
-uint64_t __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErrorZ_get_err"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_get_err(uint64_t owner) {
+uint64_t __attribute__((export_name("TS_CResult_InvoiceParseOrSemanticErrorZ_get_ok"))) TS_CResult_InvoiceParseOrSemanticErrorZ_get_ok(uint64_t owner) {
+ LDKCResult_InvoiceParseOrSemanticErrorZ* owner_conv = (LDKCResult_InvoiceParseOrSemanticErrorZ*)untag_ptr(owner);
+ LDKInvoice ret_var = CResult_InvoiceParseOrSemanticErrorZ_get_ok(owner_conv);
+ uint64_t ret_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ return ret_ref;
+}
+
+static inline struct LDKParseOrSemanticError CResult_InvoiceParseOrSemanticErrorZ_get_err(LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR owner){
+CHECK(!owner->result_ok);
+ return ParseOrSemanticError_clone(&*owner->contents.err);
+}
+uint64_t __attribute__((export_name("TS_CResult_InvoiceParseOrSemanticErrorZ_get_err"))) TS_CResult_InvoiceParseOrSemanticErrorZ_get_err(uint64_t owner) {
+ LDKCResult_InvoiceParseOrSemanticErrorZ* owner_conv = (LDKCResult_InvoiceParseOrSemanticErrorZ*)untag_ptr(owner);
+ LDKParseOrSemanticError *ret_copy = MALLOC(sizeof(LDKParseOrSemanticError), "LDKParseOrSemanticError");
+ *ret_copy = CResult_InvoiceParseOrSemanticErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+static inline struct LDKSignedRawInvoice CResult_SignedRawInvoiceParseErrorZ_get_ok(LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR owner){
+ LDKSignedRawInvoice ret = *owner->contents.result;
+ ret.is_owned = false;
+ return ret;
+}
+uint64_t __attribute__((export_name("TS_CResult_SignedRawInvoiceParseErrorZ_get_ok"))) TS_CResult_SignedRawInvoiceParseErrorZ_get_ok(uint64_t owner) {
+ LDKCResult_SignedRawInvoiceParseErrorZ* owner_conv = (LDKCResult_SignedRawInvoiceParseErrorZ*)untag_ptr(owner);
+ LDKSignedRawInvoice ret_var = CResult_SignedRawInvoiceParseErrorZ_get_ok(owner_conv);
+ uint64_t ret_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ return ret_ref;
+}
+
+static inline struct LDKParseError CResult_SignedRawInvoiceParseErrorZ_get_err(LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR owner){
+CHECK(!owner->result_ok);
+ return ParseError_clone(&*owner->contents.err);
+}
+uint64_t __attribute__((export_name("TS_CResult_SignedRawInvoiceParseErrorZ_get_err"))) TS_CResult_SignedRawInvoiceParseErrorZ_get_err(uint64_t owner) {
+ LDKCResult_SignedRawInvoiceParseErrorZ* owner_conv = (LDKCResult_SignedRawInvoiceParseErrorZ*)untag_ptr(owner);
+ LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
+ *ret_copy = CResult_SignedRawInvoiceParseErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+static inline struct LDKRawInvoice C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_a(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR owner){
+ LDKRawInvoice ret = owner->a;
+ ret.is_owned = false;
+ return ret;
+}
+uint64_t __attribute__((export_name("TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_a"))) TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_a(uint64_t owner) {
+ LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* owner_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)untag_ptr(owner);
+ LDKRawInvoice ret_var = C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_a(owner_conv);
+ uint64_t ret_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ return ret_ref;
+}
+
+static inline struct LDKThirtyTwoBytes C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_b(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR owner){
+ return ThirtyTwoBytes_clone(&owner->b);
+}
+int8_tArray __attribute__((export_name("TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_b"))) TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_b(uint64_t owner) {
+ LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* owner_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)untag_ptr(owner);
+ int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
+ memcpy(ret_arr->elems, C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_b(owner_conv).data, 32);
+ return ret_arr;
+}
+
+static inline struct LDKInvoiceSignature C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_c(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR owner){
+ LDKInvoiceSignature ret = owner->c;
+ ret.is_owned = false;
+ return ret;
+}
+uint64_t __attribute__((export_name("TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_c"))) TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_c(uint64_t owner) {
+ LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* owner_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)untag_ptr(owner);
+ LDKInvoiceSignature ret_var = C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_c(owner_conv);
+ uint64_t ret_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ return ret_ref;
+}
+
+static inline struct LDKPayeePubKey CResult_PayeePubKeyErrorZ_get_ok(LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR owner){
+ LDKPayeePubKey ret = *owner->contents.result;
+ ret.is_owned = false;
+ return ret;
+}
+uint64_t __attribute__((export_name("TS_CResult_PayeePubKeyErrorZ_get_ok"))) TS_CResult_PayeePubKeyErrorZ_get_ok(uint64_t owner) {
+ LDKCResult_PayeePubKeyErrorZ* owner_conv = (LDKCResult_PayeePubKeyErrorZ*)untag_ptr(owner);
+ LDKPayeePubKey ret_var = CResult_PayeePubKeyErrorZ_get_ok(owner_conv);
+ uint64_t ret_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ return ret_ref;
+}
+
+static inline enum LDKSecp256k1Error CResult_PayeePubKeyErrorZ_get_err(LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR owner){
+CHECK(!owner->result_ok);
+ return *owner->contents.err;
+}
+uint32_t __attribute__((export_name("TS_CResult_PayeePubKeyErrorZ_get_err"))) TS_CResult_PayeePubKeyErrorZ_get_err(uint64_t owner) {
+ LDKCResult_PayeePubKeyErrorZ* owner_conv = (LDKCResult_PayeePubKeyErrorZ*)untag_ptr(owner);
+ uint32_t ret_conv = LDKSecp256k1Error_to_js(CResult_PayeePubKeyErrorZ_get_err(owner_conv));
+ return ret_conv;
+}
+
+static inline LDKCVec_PrivateRouteZ CVec_PrivateRouteZ_clone(const LDKCVec_PrivateRouteZ *orig) {
+ LDKCVec_PrivateRouteZ ret = { .data = MALLOC(sizeof(LDKPrivateRoute) * orig->datalen, "LDKCVec_PrivateRouteZ clone bytes"), .datalen = orig->datalen };
+ for (size_t i = 0; i < ret.datalen; i++) {
+ ret.data[i] = PrivateRoute_clone(&orig->data[i]);
+ }
+ return ret;
+}
+static inline struct LDKPositiveTimestamp CResult_PositiveTimestampCreationErrorZ_get_ok(LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR owner){
+ LDKPositiveTimestamp ret = *owner->contents.result;
+ ret.is_owned = false;
+ return ret;
+}
+uint64_t __attribute__((export_name("TS_CResult_PositiveTimestampCreationErrorZ_get_ok"))) TS_CResult_PositiveTimestampCreationErrorZ_get_ok(uint64_t owner) {
+ LDKCResult_PositiveTimestampCreationErrorZ* owner_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)untag_ptr(owner);
+ LDKPositiveTimestamp ret_var = CResult_PositiveTimestampCreationErrorZ_get_ok(owner_conv);
+ uint64_t ret_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ return ret_ref;
+}
+
+static inline enum LDKCreationError CResult_PositiveTimestampCreationErrorZ_get_err(LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR owner){
+CHECK(!owner->result_ok);
+ return CreationError_clone(&*owner->contents.err);
+}
+uint32_t __attribute__((export_name("TS_CResult_PositiveTimestampCreationErrorZ_get_err"))) TS_CResult_PositiveTimestampCreationErrorZ_get_err(uint64_t owner) {
+ LDKCResult_PositiveTimestampCreationErrorZ* owner_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)untag_ptr(owner);
+ uint32_t ret_conv = LDKCreationError_to_js(CResult_PositiveTimestampCreationErrorZ_get_err(owner_conv));
+ return ret_conv;
+}
+
+static inline void CResult_NoneSemanticErrorZ_get_ok(LDKCResult_NoneSemanticErrorZ *NONNULL_PTR owner){
+CHECK(owner->result_ok);
+ return *owner->contents.result;
+}
+void __attribute__((export_name("TS_CResult_NoneSemanticErrorZ_get_ok"))) TS_CResult_NoneSemanticErrorZ_get_ok(uint64_t owner) {
+ LDKCResult_NoneSemanticErrorZ* owner_conv = (LDKCResult_NoneSemanticErrorZ*)untag_ptr(owner);
+ CResult_NoneSemanticErrorZ_get_ok(owner_conv);
+}
+
+static inline enum LDKSemanticError CResult_NoneSemanticErrorZ_get_err(LDKCResult_NoneSemanticErrorZ *NONNULL_PTR owner){
+CHECK(!owner->result_ok);
+ return SemanticError_clone(&*owner->contents.err);
+}
+uint32_t __attribute__((export_name("TS_CResult_NoneSemanticErrorZ_get_err"))) TS_CResult_NoneSemanticErrorZ_get_err(uint64_t owner) {
+ LDKCResult_NoneSemanticErrorZ* owner_conv = (LDKCResult_NoneSemanticErrorZ*)untag_ptr(owner);
+ uint32_t ret_conv = LDKSemanticError_to_js(CResult_NoneSemanticErrorZ_get_err(owner_conv));
+ return ret_conv;
+}
+
+static inline struct LDKInvoice CResult_InvoiceSemanticErrorZ_get_ok(LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR owner){
+ LDKInvoice ret = *owner->contents.result;
+ ret.is_owned = false;
+ return ret;
+}
+uint64_t __attribute__((export_name("TS_CResult_InvoiceSemanticErrorZ_get_ok"))) TS_CResult_InvoiceSemanticErrorZ_get_ok(uint64_t owner) {
+ LDKCResult_InvoiceSemanticErrorZ* owner_conv = (LDKCResult_InvoiceSemanticErrorZ*)untag_ptr(owner);
+ LDKInvoice ret_var = CResult_InvoiceSemanticErrorZ_get_ok(owner_conv);
+ uint64_t ret_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ return ret_ref;
+}
+
+static inline enum LDKSemanticError CResult_InvoiceSemanticErrorZ_get_err(LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR owner){
+CHECK(!owner->result_ok);
+ return SemanticError_clone(&*owner->contents.err);
+}
+uint32_t __attribute__((export_name("TS_CResult_InvoiceSemanticErrorZ_get_err"))) TS_CResult_InvoiceSemanticErrorZ_get_err(uint64_t owner) {
+ LDKCResult_InvoiceSemanticErrorZ* owner_conv = (LDKCResult_InvoiceSemanticErrorZ*)untag_ptr(owner);
+ uint32_t ret_conv = LDKSemanticError_to_js(CResult_InvoiceSemanticErrorZ_get_err(owner_conv));
+ return ret_conv;
+}
+
+static inline struct LDKDescription CResult_DescriptionCreationErrorZ_get_ok(LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR owner){
+ LDKDescription ret = *owner->contents.result;
+ ret.is_owned = false;
+ return ret;
+}
+uint64_t __attribute__((export_name("TS_CResult_DescriptionCreationErrorZ_get_ok"))) TS_CResult_DescriptionCreationErrorZ_get_ok(uint64_t owner) {
+ LDKCResult_DescriptionCreationErrorZ* owner_conv = (LDKCResult_DescriptionCreationErrorZ*)untag_ptr(owner);
+ LDKDescription ret_var = CResult_DescriptionCreationErrorZ_get_ok(owner_conv);
+ uint64_t ret_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ return ret_ref;
+}
+
+static inline enum LDKCreationError CResult_DescriptionCreationErrorZ_get_err(LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR owner){
+CHECK(!owner->result_ok);
+ return CreationError_clone(&*owner->contents.err);
+}
+uint32_t __attribute__((export_name("TS_CResult_DescriptionCreationErrorZ_get_err"))) TS_CResult_DescriptionCreationErrorZ_get_err(uint64_t owner) {
+ LDKCResult_DescriptionCreationErrorZ* owner_conv = (LDKCResult_DescriptionCreationErrorZ*)untag_ptr(owner);
+ uint32_t ret_conv = LDKCreationError_to_js(CResult_DescriptionCreationErrorZ_get_err(owner_conv));
+ return ret_conv;
+}
+
+static inline struct LDKPrivateRoute CResult_PrivateRouteCreationErrorZ_get_ok(LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR owner){
+ LDKPrivateRoute ret = *owner->contents.result;
+ ret.is_owned = false;
+ return ret;
+}
+uint64_t __attribute__((export_name("TS_CResult_PrivateRouteCreationErrorZ_get_ok"))) TS_CResult_PrivateRouteCreationErrorZ_get_ok(uint64_t owner) {
+ LDKCResult_PrivateRouteCreationErrorZ* owner_conv = (LDKCResult_PrivateRouteCreationErrorZ*)untag_ptr(owner);
+ LDKPrivateRoute ret_var = CResult_PrivateRouteCreationErrorZ_get_ok(owner_conv);
+ uint64_t ret_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ return ret_ref;
+}
+
+static inline enum LDKCreationError CResult_PrivateRouteCreationErrorZ_get_err(LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR owner){
+CHECK(!owner->result_ok);
+ return CreationError_clone(&*owner->contents.err);
+}
+uint32_t __attribute__((export_name("TS_CResult_PrivateRouteCreationErrorZ_get_err"))) TS_CResult_PrivateRouteCreationErrorZ_get_err(uint64_t owner) {
+ LDKCResult_PrivateRouteCreationErrorZ* owner_conv = (LDKCResult_PrivateRouteCreationErrorZ*)untag_ptr(owner);
+ uint32_t ret_conv = LDKCreationError_to_js(CResult_PrivateRouteCreationErrorZ_get_err(owner_conv));
+ return ret_conv;
+}
+
+static inline void CResult_NoneErrorZ_get_ok(LDKCResult_NoneErrorZ *NONNULL_PTR owner){
+CHECK(owner->result_ok);
+ return *owner->contents.result;
+}
+void __attribute__((export_name("TS_CResult_NoneErrorZ_get_ok"))) TS_CResult_NoneErrorZ_get_ok(uint64_t owner) {
+ LDKCResult_NoneErrorZ* owner_conv = (LDKCResult_NoneErrorZ*)untag_ptr(owner);
+ CResult_NoneErrorZ_get_ok(owner_conv);
+}
+
+static inline enum LDKIOError CResult_NoneErrorZ_get_err(LDKCResult_NoneErrorZ *NONNULL_PTR owner){
+CHECK(!owner->result_ok);
+ return *owner->contents.err;
+}
+uint32_t __attribute__((export_name("TS_CResult_NoneErrorZ_get_err"))) TS_CResult_NoneErrorZ_get_err(uint64_t owner) {
+ LDKCResult_NoneErrorZ* owner_conv = (LDKCResult_NoneErrorZ*)untag_ptr(owner);
+ uint32_t ret_conv = LDKIOError_to_js(CResult_NoneErrorZ_get_err(owner_conv));
+ return ret_conv;
+}
+
+static inline struct LDKNetAddress CResult_NetAddressDecodeErrorZ_get_ok(LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR owner){
+CHECK(owner->result_ok);
+ return NetAddress_clone(&*owner->contents.result);
+}
+uint64_t __attribute__((export_name("TS_CResult_NetAddressDecodeErrorZ_get_ok"))) TS_CResult_NetAddressDecodeErrorZ_get_ok(uint64_t owner) {
+ LDKCResult_NetAddressDecodeErrorZ* owner_conv = (LDKCResult_NetAddressDecodeErrorZ*)untag_ptr(owner);
+ LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
+ *ret_copy = CResult_NetAddressDecodeErrorZ_get_ok(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+static inline struct LDKDecodeError CResult_NetAddressDecodeErrorZ_get_err(LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR owner){
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
+}
+uint64_t __attribute__((export_name("TS_CResult_NetAddressDecodeErrorZ_get_err"))) TS_CResult_NetAddressDecodeErrorZ_get_err(uint64_t owner) {
+ LDKCResult_NetAddressDecodeErrorZ* owner_conv = (LDKCResult_NetAddressDecodeErrorZ*)untag_ptr(owner);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_NetAddressDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+static inline LDKCVec_UpdateAddHTLCZ CVec_UpdateAddHTLCZ_clone(const LDKCVec_UpdateAddHTLCZ *orig) {
+ LDKCVec_UpdateAddHTLCZ ret = { .data = MALLOC(sizeof(LDKUpdateAddHTLC) * orig->datalen, "LDKCVec_UpdateAddHTLCZ clone bytes"), .datalen = orig->datalen };
+ for (size_t i = 0; i < ret.datalen; i++) {
+ ret.data[i] = UpdateAddHTLC_clone(&orig->data[i]);
+ }
+ return ret;
+}
+static inline LDKCVec_UpdateFulfillHTLCZ CVec_UpdateFulfillHTLCZ_clone(const LDKCVec_UpdateFulfillHTLCZ *orig) {
+ LDKCVec_UpdateFulfillHTLCZ ret = { .data = MALLOC(sizeof(LDKUpdateFulfillHTLC) * orig->datalen, "LDKCVec_UpdateFulfillHTLCZ clone bytes"), .datalen = orig->datalen };
+ for (size_t i = 0; i < ret.datalen; i++) {
+ ret.data[i] = UpdateFulfillHTLC_clone(&orig->data[i]);
+ }
+ return ret;
+}
+static inline LDKCVec_UpdateFailHTLCZ CVec_UpdateFailHTLCZ_clone(const LDKCVec_UpdateFailHTLCZ *orig) {
+ LDKCVec_UpdateFailHTLCZ ret = { .data = MALLOC(sizeof(LDKUpdateFailHTLC) * orig->datalen, "LDKCVec_UpdateFailHTLCZ clone bytes"), .datalen = orig->datalen };
+ for (size_t i = 0; i < ret.datalen; i++) {
+ ret.data[i] = UpdateFailHTLC_clone(&orig->data[i]);
+ }
+ return ret;
+}
+static inline LDKCVec_UpdateFailMalformedHTLCZ CVec_UpdateFailMalformedHTLCZ_clone(const LDKCVec_UpdateFailMalformedHTLCZ *orig) {
+ LDKCVec_UpdateFailMalformedHTLCZ ret = { .data = MALLOC(sizeof(LDKUpdateFailMalformedHTLC) * orig->datalen, "LDKCVec_UpdateFailMalformedHTLCZ clone bytes"), .datalen = orig->datalen };
+ for (size_t i = 0; i < ret.datalen; i++) {
+ ret.data[i] = UpdateFailMalformedHTLC_clone(&orig->data[i]);
+ }
+ return ret;
+}
+static inline struct LDKAcceptChannel CResult_AcceptChannelDecodeErrorZ_get_ok(LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR owner){
+ LDKAcceptChannel ret = *owner->contents.result;
+ ret.is_owned = false;
+ return ret;
+}
+uint64_t __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_get_ok"))) TS_CResult_AcceptChannelDecodeErrorZ_get_ok(uint64_t owner) {
+ LDKCResult_AcceptChannelDecodeErrorZ* owner_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)untag_ptr(owner);
+ LDKAcceptChannel ret_var = CResult_AcceptChannelDecodeErrorZ_get_ok(owner_conv);
+ uint64_t ret_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ return ret_ref;
+}
+
+static inline struct LDKDecodeError CResult_AcceptChannelDecodeErrorZ_get_err(LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR owner){
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
+}
+uint64_t __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_get_err"))) TS_CResult_AcceptChannelDecodeErrorZ_get_err(uint64_t owner) {
+ LDKCResult_AcceptChannelDecodeErrorZ* owner_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)untag_ptr(owner);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_AcceptChannelDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+static inline struct LDKAnnouncementSignatures CResult_AnnouncementSignaturesDecodeErrorZ_get_ok(LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR owner){
+ LDKAnnouncementSignatures ret = *owner->contents.result;
+ ret.is_owned = false;
+ return ret;
+}
+uint64_t __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErrorZ_get_ok"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_get_ok(uint64_t owner) {
LDKCResult_AnnouncementSignaturesDecodeErrorZ* owner_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_AnnouncementSignaturesDecodeErrorZ_get_err(owner_conv);
+ LDKAnnouncementSignatures ret_var = CResult_AnnouncementSignaturesDecodeErrorZ_get_ok(owner_conv);
uint64_t ret_ref = 0;
CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
return ret_ref;
}
+static inline struct LDKDecodeError CResult_AnnouncementSignaturesDecodeErrorZ_get_err(LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR owner){
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
+}
+uint64_t __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErrorZ_get_err"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_get_err(uint64_t owner) {
+ LDKCResult_AnnouncementSignaturesDecodeErrorZ* owner_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)untag_ptr(owner);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_AnnouncementSignaturesDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
static inline struct LDKChannelReestablish CResult_ChannelReestablishDecodeErrorZ_get_ok(LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR owner){
LDKChannelReestablish ret = *owner->contents.result;
ret.is_owned = false;
}
static inline struct LDKDecodeError CResult_ChannelReestablishDecodeErrorZ_get_err(LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
uint64_t __attribute__((export_name("TS_CResult_ChannelReestablishDecodeErrorZ_get_err"))) TS_CResult_ChannelReestablishDecodeErrorZ_get_err(uint64_t owner) {
LDKCResult_ChannelReestablishDecodeErrorZ* owner_conv = (LDKCResult_ChannelReestablishDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_ChannelReestablishDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_ChannelReestablishDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_ClosingSignedDecodeErrorZ_get_err(LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
uint64_t __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_get_err"))) TS_CResult_ClosingSignedDecodeErrorZ_get_err(uint64_t owner) {
LDKCResult_ClosingSignedDecodeErrorZ* owner_conv = (LDKCResult_ClosingSignedDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_ClosingSignedDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_ClosingSignedDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_ClosingSignedFeeRangeDecodeErrorZ_get_err(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
uint64_t __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_get_err"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_get_err(uint64_t owner) {
LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* owner_conv = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_ClosingSignedFeeRangeDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_ClosingSignedFeeRangeDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_CommitmentSignedDecodeErrorZ_get_err(LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
uint64_t __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_get_err"))) TS_CResult_CommitmentSignedDecodeErrorZ_get_err(uint64_t owner) {
LDKCResult_CommitmentSignedDecodeErrorZ* owner_conv = (LDKCResult_CommitmentSignedDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_CommitmentSignedDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_CommitmentSignedDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_FundingCreatedDecodeErrorZ_get_err(LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
uint64_t __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_get_err"))) TS_CResult_FundingCreatedDecodeErrorZ_get_err(uint64_t owner) {
LDKCResult_FundingCreatedDecodeErrorZ* owner_conv = (LDKCResult_FundingCreatedDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_FundingCreatedDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_FundingCreatedDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_FundingSignedDecodeErrorZ_get_err(LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
uint64_t __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_get_err"))) TS_CResult_FundingSignedDecodeErrorZ_get_err(uint64_t owner) {
LDKCResult_FundingSignedDecodeErrorZ* owner_conv = (LDKCResult_FundingSignedDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_FundingSignedDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_FundingSignedDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_ChannelReadyDecodeErrorZ_get_err(LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
uint64_t __attribute__((export_name("TS_CResult_ChannelReadyDecodeErrorZ_get_err"))) TS_CResult_ChannelReadyDecodeErrorZ_get_err(uint64_t owner) {
LDKCResult_ChannelReadyDecodeErrorZ* owner_conv = (LDKCResult_ChannelReadyDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_ChannelReadyDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_ChannelReadyDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_InitDecodeErrorZ_get_err(LDKCResult_InitDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
uint64_t __attribute__((export_name("TS_CResult_InitDecodeErrorZ_get_err"))) TS_CResult_InitDecodeErrorZ_get_err(uint64_t owner) {
LDKCResult_InitDecodeErrorZ* owner_conv = (LDKCResult_InitDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_InitDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_InitDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_OpenChannelDecodeErrorZ_get_err(LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
uint64_t __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_get_err"))) TS_CResult_OpenChannelDecodeErrorZ_get_err(uint64_t owner) {
LDKCResult_OpenChannelDecodeErrorZ* owner_conv = (LDKCResult_OpenChannelDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_OpenChannelDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_OpenChannelDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_RevokeAndACKDecodeErrorZ_get_err(LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
uint64_t __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_get_err"))) TS_CResult_RevokeAndACKDecodeErrorZ_get_err(uint64_t owner) {
LDKCResult_RevokeAndACKDecodeErrorZ* owner_conv = (LDKCResult_RevokeAndACKDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_RevokeAndACKDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_RevokeAndACKDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_ShutdownDecodeErrorZ_get_err(LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
uint64_t __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_get_err"))) TS_CResult_ShutdownDecodeErrorZ_get_err(uint64_t owner) {
LDKCResult_ShutdownDecodeErrorZ* owner_conv = (LDKCResult_ShutdownDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_ShutdownDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_ShutdownDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_UpdateFailHTLCDecodeErrorZ_get_err(LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
uint64_t __attribute__((export_name("TS_CResult_UpdateFailHTLCDecodeErrorZ_get_err"))) TS_CResult_UpdateFailHTLCDecodeErrorZ_get_err(uint64_t owner) {
LDKCResult_UpdateFailHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_UpdateFailHTLCDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_UpdateFailHTLCDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_err(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
uint64_t __attribute__((export_name("TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_err"))) TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_err(uint64_t owner) {
LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_UpdateFeeDecodeErrorZ_get_err(LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
uint64_t __attribute__((export_name("TS_CResult_UpdateFeeDecodeErrorZ_get_err"))) TS_CResult_UpdateFeeDecodeErrorZ_get_err(uint64_t owner) {
LDKCResult_UpdateFeeDecodeErrorZ* owner_conv = (LDKCResult_UpdateFeeDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_UpdateFeeDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_UpdateFeeDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_UpdateFulfillHTLCDecodeErrorZ_get_err(LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
uint64_t __attribute__((export_name("TS_CResult_UpdateFulfillHTLCDecodeErrorZ_get_err"))) TS_CResult_UpdateFulfillHTLCDecodeErrorZ_get_err(uint64_t owner) {
LDKCResult_UpdateFulfillHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_UpdateFulfillHTLCDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_UpdateFulfillHTLCDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_UpdateAddHTLCDecodeErrorZ_get_err(LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
uint64_t __attribute__((export_name("TS_CResult_UpdateAddHTLCDecodeErrorZ_get_err"))) TS_CResult_UpdateAddHTLCDecodeErrorZ_get_err(uint64_t owner) {
LDKCResult_UpdateAddHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_UpdateAddHTLCDecodeErrorZ_get_err(owner_conv);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_UpdateAddHTLCDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+static inline struct LDKOnionMessage CResult_OnionMessageDecodeErrorZ_get_ok(LDKCResult_OnionMessageDecodeErrorZ *NONNULL_PTR owner){
+ LDKOnionMessage ret = *owner->contents.result;
+ ret.is_owned = false;
+ return ret;
+}
+uint64_t __attribute__((export_name("TS_CResult_OnionMessageDecodeErrorZ_get_ok"))) TS_CResult_OnionMessageDecodeErrorZ_get_ok(uint64_t owner) {
+ LDKCResult_OnionMessageDecodeErrorZ* owner_conv = (LDKCResult_OnionMessageDecodeErrorZ*)untag_ptr(owner);
+ LDKOnionMessage ret_var = CResult_OnionMessageDecodeErrorZ_get_ok(owner_conv);
uint64_t ret_ref = 0;
CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
return ret_ref;
}
+static inline struct LDKDecodeError CResult_OnionMessageDecodeErrorZ_get_err(LDKCResult_OnionMessageDecodeErrorZ *NONNULL_PTR owner){
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
+}
+uint64_t __attribute__((export_name("TS_CResult_OnionMessageDecodeErrorZ_get_err"))) TS_CResult_OnionMessageDecodeErrorZ_get_err(uint64_t owner) {
+ LDKCResult_OnionMessageDecodeErrorZ* owner_conv = (LDKCResult_OnionMessageDecodeErrorZ*)untag_ptr(owner);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_OnionMessageDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
static inline struct LDKPing CResult_PingDecodeErrorZ_get_ok(LDKCResult_PingDecodeErrorZ *NONNULL_PTR owner){
LDKPing ret = *owner->contents.result;
ret.is_owned = false;
}
static inline struct LDKDecodeError CResult_PingDecodeErrorZ_get_err(LDKCResult_PingDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
uint64_t __attribute__((export_name("TS_CResult_PingDecodeErrorZ_get_err"))) TS_CResult_PingDecodeErrorZ_get_err(uint64_t owner) {
LDKCResult_PingDecodeErrorZ* owner_conv = (LDKCResult_PingDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_PingDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_PingDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_PongDecodeErrorZ_get_err(LDKCResult_PongDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
uint64_t __attribute__((export_name("TS_CResult_PongDecodeErrorZ_get_err"))) TS_CResult_PongDecodeErrorZ_get_err(uint64_t owner) {
LDKCResult_PongDecodeErrorZ* owner_conv = (LDKCResult_PongDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_PongDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_PongDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_err(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
uint64_t __attribute__((export_name("TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_err"))) TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_err(uint64_t owner) {
LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_ChannelAnnouncementDecodeErrorZ_get_err(LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
uint64_t __attribute__((export_name("TS_CResult_ChannelAnnouncementDecodeErrorZ_get_err"))) TS_CResult_ChannelAnnouncementDecodeErrorZ_get_err(uint64_t owner) {
LDKCResult_ChannelAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_ChannelAnnouncementDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_ChannelAnnouncementDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_UnsignedChannelUpdateDecodeErrorZ_get_err(LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
uint64_t __attribute__((export_name("TS_CResult_UnsignedChannelUpdateDecodeErrorZ_get_err"))) TS_CResult_UnsignedChannelUpdateDecodeErrorZ_get_err(uint64_t owner) {
LDKCResult_UnsignedChannelUpdateDecodeErrorZ* owner_conv = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_UnsignedChannelUpdateDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_UnsignedChannelUpdateDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_ChannelUpdateDecodeErrorZ_get_err(LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
uint64_t __attribute__((export_name("TS_CResult_ChannelUpdateDecodeErrorZ_get_err"))) TS_CResult_ChannelUpdateDecodeErrorZ_get_err(uint64_t owner) {
LDKCResult_ChannelUpdateDecodeErrorZ* owner_conv = (LDKCResult_ChannelUpdateDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_ChannelUpdateDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_ChannelUpdateDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_ErrorMessageDecodeErrorZ_get_err(LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
uint64_t __attribute__((export_name("TS_CResult_ErrorMessageDecodeErrorZ_get_err"))) TS_CResult_ErrorMessageDecodeErrorZ_get_err(uint64_t owner) {
LDKCResult_ErrorMessageDecodeErrorZ* owner_conv = (LDKCResult_ErrorMessageDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_ErrorMessageDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_ErrorMessageDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_WarningMessageDecodeErrorZ_get_err(LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
uint64_t __attribute__((export_name("TS_CResult_WarningMessageDecodeErrorZ_get_err"))) TS_CResult_WarningMessageDecodeErrorZ_get_err(uint64_t owner) {
LDKCResult_WarningMessageDecodeErrorZ* owner_conv = (LDKCResult_WarningMessageDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_WarningMessageDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_WarningMessageDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_err(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
uint64_t __attribute__((export_name("TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_err"))) TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_err(uint64_t owner) {
LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_NodeAnnouncementDecodeErrorZ_get_err(LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
uint64_t __attribute__((export_name("TS_CResult_NodeAnnouncementDecodeErrorZ_get_err"))) TS_CResult_NodeAnnouncementDecodeErrorZ_get_err(uint64_t owner) {
LDKCResult_NodeAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_NodeAnnouncementDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_NodeAnnouncementDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_NodeAnnouncementDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_QueryShortChannelIdsDecodeErrorZ_get_err(LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
uint64_t __attribute__((export_name("TS_CResult_QueryShortChannelIdsDecodeErrorZ_get_err"))) TS_CResult_QueryShortChannelIdsDecodeErrorZ_get_err(uint64_t owner) {
LDKCResult_QueryShortChannelIdsDecodeErrorZ* owner_conv = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_QueryShortChannelIdsDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_QueryShortChannelIdsDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_err(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
uint64_t __attribute__((export_name("TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_err"))) TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_err(uint64_t owner) {
LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* owner_conv = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_QueryChannelRangeDecodeErrorZ_get_err(LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
uint64_t __attribute__((export_name("TS_CResult_QueryChannelRangeDecodeErrorZ_get_err"))) TS_CResult_QueryChannelRangeDecodeErrorZ_get_err(uint64_t owner) {
LDKCResult_QueryChannelRangeDecodeErrorZ* owner_conv = (LDKCResult_QueryChannelRangeDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_QueryChannelRangeDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_QueryChannelRangeDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_ReplyChannelRangeDecodeErrorZ_get_err(LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
uint64_t __attribute__((export_name("TS_CResult_ReplyChannelRangeDecodeErrorZ_get_err"))) TS_CResult_ReplyChannelRangeDecodeErrorZ_get_err(uint64_t owner) {
LDKCResult_ReplyChannelRangeDecodeErrorZ* owner_conv = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_ReplyChannelRangeDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_ReplyChannelRangeDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_GossipTimestampFilterDecodeErrorZ_get_err(LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
uint64_t __attribute__((export_name("TS_CResult_GossipTimestampFilterDecodeErrorZ_get_err"))) TS_CResult_GossipTimestampFilterDecodeErrorZ_get_err(uint64_t owner) {
LDKCResult_GossipTimestampFilterDecodeErrorZ* owner_conv = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_GossipTimestampFilterDecodeErrorZ_get_err(owner_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_GossipTimestampFilterDecodeErrorZ_get_err(owner_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
+static inline LDKCVec_PhantomRouteHintsZ CVec_PhantomRouteHintsZ_clone(const LDKCVec_PhantomRouteHintsZ *orig) {
+ LDKCVec_PhantomRouteHintsZ ret = { .data = MALLOC(sizeof(LDKPhantomRouteHints) * orig->datalen, "LDKCVec_PhantomRouteHintsZ clone bytes"), .datalen = orig->datalen };
+ for (size_t i = 0; i < ret.datalen; i++) {
+ ret.data[i] = PhantomRouteHints_clone(&orig->data[i]);
+ }
+ return ret;
+}
uint32_t __attribute__((export_name("TS_LDKSignOrCreationError_ty_from_ptr"))) TS_LDKSignOrCreationError_ty_from_ptr(uint64_t ptr) {
LDKSignOrCreationError *obj = (LDKSignOrCreationError*)untag_ptr(ptr);
switch(obj->tag) {
LDKu8slice script_pubkey_var = script_pubkey;
int8_tArray script_pubkey_arr = init_int8_tArray(script_pubkey_var.datalen, __LINE__);
memcpy(script_pubkey_arr->elems, script_pubkey_var.data, script_pubkey_var.datalen);
- js_invoke_function_uuuuuu(j_calls->instance_ptr, 32, (uint32_t)txid_arr, (uint32_t)script_pubkey_arr, 0, 0, 0, 0);
+ js_invoke_function_uuuuuu(j_calls->instance_ptr, 40, (uint32_t)txid_arr, (uint32_t)script_pubkey_arr, 0, 0, 0, 0);
}
-LDKCOption_C2Tuple_usizeTransactionZZ register_output_LDKFilter_jcall(const void* this_arg, LDKWatchedOutput output) {
+void register_output_LDKFilter_jcall(const void* this_arg, LDKWatchedOutput output) {
LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg;
LDKWatchedOutput output_var = output;
uint64_t output_ref = 0;
CHECK_INNER_FIELD_ACCESS_OR_NULL(output_var);
output_ref = tag_ptr(output_var.inner, output_var.is_owned);
- uint32_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 33, output_ref, 0, 0, 0, 0, 0);
- void* ret_ptr = untag_ptr(ret);
- CHECK_ACCESS(ret_ptr);
- LDKCOption_C2Tuple_usizeTransactionZZ ret_conv = *(LDKCOption_C2Tuple_usizeTransactionZZ*)(ret_ptr);
- FREE(untag_ptr(ret));
- return ret_conv;
+ js_invoke_function_buuuuu(j_calls->instance_ptr, 41, output_ref, 0, 0, 0, 0, 0);
}
static void LDKFilter_JCalls_cloned(LDKFilter* new_obj) {
LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) new_obj->this_arg;
void* this_arg_ptr = untag_ptr(this_arg);
if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
LDKFilter* this_arg_conv = (LDKFilter*)this_arg_ptr;
- unsigned char txid_arr[32];
+ uint8_t txid_arr[32];
CHECK(txid->arr_len == 32);
memcpy(txid_arr, txid->elems, 32); FREE(txid);
- unsigned char (*txid_ref)[32] = &txid_arr;
+ uint8_t (*txid_ref)[32] = &txid_arr;
LDKu8slice script_pubkey_ref;
script_pubkey_ref.datalen = script_pubkey->arr_len;
script_pubkey_ref.data = script_pubkey->elems;
FREE(script_pubkey);
}
-uint64_t __attribute__((export_name("TS_Filter_register_output"))) TS_Filter_register_output(uint64_t this_arg, uint64_t output) {
+void __attribute__((export_name("TS_Filter_register_output"))) TS_Filter_register_output(uint64_t this_arg, uint64_t output) {
void* this_arg_ptr = untag_ptr(this_arg);
if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
LDKFilter* this_arg_conv = (LDKFilter*)this_arg_ptr;
output_conv.is_owned = ptr_is_owned(output);
CHECK_INNER_FIELD_ACCESS_OR_NULL(output_conv);
output_conv = WatchedOutput_clone(&output_conv);
- LDKCOption_C2Tuple_usizeTransactionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_usizeTransactionZZ), "LDKCOption_C2Tuple_usizeTransactionZZ");
- *ret_copy = (this_arg_conv->register_output)(this_arg_conv->this_arg, output_conv);
- uint64_t ret_ref = tag_ptr(ret_copy, true);
- return ret_ref;
+ (this_arg_conv->register_output)(this_arg_conv->this_arg, output_conv);
}
uint32_t __attribute__((export_name("TS_LDKCOption_FilterZ_ty_from_ptr"))) TS_LDKCOption_FilterZ_ty_from_ptr(uint64_t ptr) {
}
return ret;
}
+static inline LDKCVec_MonitorUpdateIdZ CVec_MonitorUpdateIdZ_clone(const LDKCVec_MonitorUpdateIdZ *orig) {
+ LDKCVec_MonitorUpdateIdZ ret = { .data = MALLOC(sizeof(LDKMonitorUpdateId) * orig->datalen, "LDKCVec_MonitorUpdateIdZ clone bytes"), .datalen = orig->datalen };
+ for (size_t i = 0; i < ret.datalen; i++) {
+ ret.data[i] = MonitorUpdateId_clone(&orig->data[i]);
+ }
+ return ret;
+}
+static inline struct LDKOutPoint C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_a(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *NONNULL_PTR owner){
+ LDKOutPoint ret = owner->a;
+ ret.is_owned = false;
+ return ret;
+}
+uint64_t __attribute__((export_name("TS_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_a"))) TS_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_a(uint64_t owner) {
+ LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* owner_conv = (LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ*)untag_ptr(owner);
+ LDKOutPoint ret_var = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_a(owner_conv);
+ uint64_t ret_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ return ret_ref;
+}
+
+static inline struct LDKCVec_MonitorUpdateIdZ C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_b(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *NONNULL_PTR owner){
+ return CVec_MonitorUpdateIdZ_clone(&owner->b);
+}
+uint64_tArray __attribute__((export_name("TS_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_b"))) TS_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_b(uint64_t owner) {
+ LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* owner_conv = (LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ*)untag_ptr(owner);
+ LDKCVec_MonitorUpdateIdZ ret_var = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_b(owner_conv);
+ uint64_tArray ret_arr = NULL;
+ ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
+ uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
+ for (size_t r = 0; r < ret_var.datalen; r++) {
+ LDKMonitorUpdateId ret_conv_17_var = ret_var.data[r];
+ uint64_t ret_conv_17_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_17_var);
+ ret_conv_17_ref = tag_ptr(ret_conv_17_var.inner, ret_conv_17_var.is_owned);
+ ret_arr_ptr[r] = ret_conv_17_ref;
+ }
+
+ FREE(ret_var.data);
+ return ret_arr;
+}
+
+static inline LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ CVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ_clone(const LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ *orig) {
+ LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ) * orig->datalen, "LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ clone bytes"), .datalen = orig->datalen };
+ for (size_t i = 0; i < ret.datalen; i++) {
+ ret.data[i] = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone(&orig->data[i]);
+ }
+ return ret;
+}
typedef struct LDKMessageSendEventsProvider_JCalls {
atomic_size_t refcnt;
uint32_t instance_ptr;
}
LDKCVec_MessageSendEventZ get_and_clear_pending_msg_events_LDKMessageSendEventsProvider_jcall(const void* this_arg) {
LDKMessageSendEventsProvider_JCalls *j_calls = (LDKMessageSendEventsProvider_JCalls*) this_arg;
- uint64_tArray ret = (uint64_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 34, 0, 0, 0, 0, 0, 0);
+ uint64_tArray ret = (uint64_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 42, 0, 0, 0, 0, 0, 0);
LDKCVec_MessageSendEventZ ret_constr;
ret_constr.datalen = ret->arr_len;
if (ret_constr.datalen > 0)
return ret_arr;
}
+typedef struct LDKOnionMessageProvider_JCalls {
+ atomic_size_t refcnt;
+ uint32_t instance_ptr;
+} LDKOnionMessageProvider_JCalls;
+static void LDKOnionMessageProvider_JCalls_free(void* this_arg) {
+ LDKOnionMessageProvider_JCalls *j_calls = (LDKOnionMessageProvider_JCalls*) this_arg;
+ if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
+ FREE(j_calls);
+ }
+}
+LDKOnionMessage next_onion_message_for_peer_LDKOnionMessageProvider_jcall(const void* this_arg, LDKPublicKey peer_node_id) {
+ LDKOnionMessageProvider_JCalls *j_calls = (LDKOnionMessageProvider_JCalls*) this_arg;
+ int8_tArray peer_node_id_arr = init_int8_tArray(33, __LINE__);
+ memcpy(peer_node_id_arr->elems, peer_node_id.compressed_form, 33);
+ uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 43, (uint32_t)peer_node_id_arr, 0, 0, 0, 0, 0);
+ LDKOnionMessage ret_conv;
+ ret_conv.inner = untag_ptr(ret);
+ ret_conv.is_owned = ptr_is_owned(ret);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv);
+ return ret_conv;
+}
+static void LDKOnionMessageProvider_JCalls_cloned(LDKOnionMessageProvider* new_obj) {
+ LDKOnionMessageProvider_JCalls *j_calls = (LDKOnionMessageProvider_JCalls*) new_obj->this_arg;
+ atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
+}
+static inline LDKOnionMessageProvider LDKOnionMessageProvider_init (JSValue o) {
+ LDKOnionMessageProvider_JCalls *calls = MALLOC(sizeof(LDKOnionMessageProvider_JCalls), "LDKOnionMessageProvider_JCalls");
+ atomic_init(&calls->refcnt, 1);
+ calls->instance_ptr = o;
+
+ LDKOnionMessageProvider ret = {
+ .this_arg = (void*) calls,
+ .next_onion_message_for_peer = next_onion_message_for_peer_LDKOnionMessageProvider_jcall,
+ .free = LDKOnionMessageProvider_JCalls_free,
+ };
+ return ret;
+}
+uint64_t __attribute__((export_name("TS_LDKOnionMessageProvider_new"))) TS_LDKOnionMessageProvider_new(JSValue o) {
+ LDKOnionMessageProvider *res_ptr = MALLOC(sizeof(LDKOnionMessageProvider), "LDKOnionMessageProvider");
+ *res_ptr = LDKOnionMessageProvider_init(o);
+ return tag_ptr(res_ptr, true);
+}
+uint64_t __attribute__((export_name("TS_OnionMessageProvider_next_onion_message_for_peer"))) TS_OnionMessageProvider_next_onion_message_for_peer(uint64_t this_arg, int8_tArray peer_node_id) {
+ void* this_arg_ptr = untag_ptr(this_arg);
+ if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKOnionMessageProvider* this_arg_conv = (LDKOnionMessageProvider*)this_arg_ptr;
+ LDKPublicKey peer_node_id_ref;
+ CHECK(peer_node_id->arr_len == 33);
+ memcpy(peer_node_id_ref.compressed_form, peer_node_id->elems, 33); FREE(peer_node_id);
+ LDKOnionMessage ret_var = (this_arg_conv->next_onion_message_for_peer)(this_arg_conv->this_arg, peer_node_id_ref);
+ uint64_t ret_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ return ret_ref;
+}
+
typedef struct LDKEventHandler_JCalls {
atomic_size_t refcnt;
uint32_t instance_ptr;
FREE(j_calls);
}
}
-void handle_event_LDKEventHandler_jcall(const void* this_arg, const LDKEvent * event) {
+void handle_event_LDKEventHandler_jcall(const void* this_arg, LDKEvent event) {
LDKEventHandler_JCalls *j_calls = (LDKEventHandler_JCalls*) this_arg;
- LDKEvent *ret_event = MALLOC(sizeof(LDKEvent), "LDKEvent ret conversion");
- *ret_event = Event_clone(event);
- uint64_t ref_event = tag_ptr(ret_event, true);
- js_invoke_function_buuuuu(j_calls->instance_ptr, 35, ref_event, 0, 0, 0, 0, 0);
+ LDKEvent *event_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
+ *event_copy = event;
+ uint64_t event_ref = tag_ptr(event_copy, true);
+ js_invoke_function_buuuuu(j_calls->instance_ptr, 44, event_ref, 0, 0, 0, 0, 0);
}
static void LDKEventHandler_JCalls_cloned(LDKEventHandler* new_obj) {
LDKEventHandler_JCalls *j_calls = (LDKEventHandler_JCalls*) new_obj->this_arg;
void* this_arg_ptr = untag_ptr(this_arg);
if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
LDKEventHandler* this_arg_conv = (LDKEventHandler*)this_arg_ptr;
- LDKEvent* event_conv = (LDKEvent*)untag_ptr(event);
+ void* event_ptr = untag_ptr(event);
+ CHECK_ACCESS(event_ptr);
+ LDKEvent event_conv = *(LDKEvent*)(event_ptr);
+ event_conv = Event_clone((LDKEvent*)untag_ptr(event));
(this_arg_conv->handle_event)(this_arg_conv->this_arg, event_conv);
}
LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) this_arg;
LDKEventHandler* handler_ret = MALLOC(sizeof(LDKEventHandler), "LDKEventHandler");
*handler_ret = handler;
- js_invoke_function_buuuuu(j_calls->instance_ptr, 36, tag_ptr(handler_ret, true), 0, 0, 0, 0, 0);
+ js_invoke_function_buuuuu(j_calls->instance_ptr, 45, tag_ptr(handler_ret, true), 0, 0, 0, 0, 0);
}
static void LDKEventsProvider_JCalls_cloned(LDKEventsProvider* new_obj) {
LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) new_obj->this_arg;
uint64_t usage_ref = 0;
CHECK_INNER_FIELD_ACCESS_OR_NULL(usage_var);
usage_ref = tag_ptr(usage_var.inner, usage_var.is_owned);
- return js_invoke_function_bbbbuu(j_calls->instance_ptr, 37, short_channel_id_conv, source_ref, target_ref, usage_ref, 0, 0);
+ return js_invoke_function_bbbbuu(j_calls->instance_ptr, 46, short_channel_id_conv, source_ref, target_ref, usage_ref, 0, 0);
}
void payment_path_failed_LDKScore_jcall(void* this_arg, LDKCVec_RouteHopZ path, uint64_t short_channel_id) {
LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
FREE(path_var.data);
int64_t short_channel_id_conv = short_channel_id;
- js_invoke_function_ubuuuu(j_calls->instance_ptr, 38, (uint32_t)path_arr, short_channel_id_conv, 0, 0, 0, 0);
+ js_invoke_function_ubuuuu(j_calls->instance_ptr, 47, (uint32_t)path_arr, short_channel_id_conv, 0, 0, 0, 0);
}
void payment_path_successful_LDKScore_jcall(void* this_arg, LDKCVec_RouteHopZ path) {
LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
}
FREE(path_var.data);
- js_invoke_function_uuuuuu(j_calls->instance_ptr, 39, (uint32_t)path_arr, 0, 0, 0, 0, 0);
+ js_invoke_function_uuuuuu(j_calls->instance_ptr, 48, (uint32_t)path_arr, 0, 0, 0, 0, 0);
}
void probe_failed_LDKScore_jcall(void* this_arg, LDKCVec_RouteHopZ path, uint64_t short_channel_id) {
LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
FREE(path_var.data);
int64_t short_channel_id_conv = short_channel_id;
- js_invoke_function_ubuuuu(j_calls->instance_ptr, 40, (uint32_t)path_arr, short_channel_id_conv, 0, 0, 0, 0);
+ js_invoke_function_ubuuuu(j_calls->instance_ptr, 49, (uint32_t)path_arr, short_channel_id_conv, 0, 0, 0, 0);
}
void probe_successful_LDKScore_jcall(void* this_arg, LDKCVec_RouteHopZ path) {
LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
}
FREE(path_var.data);
- js_invoke_function_uuuuuu(j_calls->instance_ptr, 41, (uint32_t)path_arr, 0, 0, 0, 0, 0);
+ js_invoke_function_uuuuuu(j_calls->instance_ptr, 50, (uint32_t)path_arr, 0, 0, 0, 0, 0);
}
LDKCVec_u8Z write_LDKScore_jcall(const void* this_arg) {
LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
- int8_tArray ret = (int8_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 42, 0, 0, 0, 0, 0, 0);
+ int8_tArray ret = (int8_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 51, 0, 0, 0, 0, 0, 0);
LDKCVec_u8Z ret_ref;
ret_ref.datalen = ret->arr_len;
ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes");
return ret_arr;
}
+typedef struct LDKLockableScore_JCalls {
+ atomic_size_t refcnt;
+ uint32_t instance_ptr;
+} LDKLockableScore_JCalls;
+static void LDKLockableScore_JCalls_free(void* this_arg) {
+ LDKLockableScore_JCalls *j_calls = (LDKLockableScore_JCalls*) this_arg;
+ if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
+ FREE(j_calls);
+ }
+}
+LDKScore lock_LDKLockableScore_jcall(const void* this_arg) {
+ LDKLockableScore_JCalls *j_calls = (LDKLockableScore_JCalls*) this_arg;
+ uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 52, 0, 0, 0, 0, 0, 0);
+ void* ret_ptr = untag_ptr(ret);
+ CHECK_ACCESS(ret_ptr);
+ LDKScore ret_conv = *(LDKScore*)(ret_ptr);
+ if (ret_conv.free == LDKScore_JCalls_free) {
+ // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
+ LDKScore_JCalls_cloned(&ret_conv);
+ }// WARNING: we may need a move here but no clone is available for LDKScore
+
+ return ret_conv;
+}
+static void LDKLockableScore_JCalls_cloned(LDKLockableScore* new_obj) {
+ LDKLockableScore_JCalls *j_calls = (LDKLockableScore_JCalls*) new_obj->this_arg;
+ atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
+}
+static inline LDKLockableScore LDKLockableScore_init (JSValue o) {
+ LDKLockableScore_JCalls *calls = MALLOC(sizeof(LDKLockableScore_JCalls), "LDKLockableScore_JCalls");
+ atomic_init(&calls->refcnt, 1);
+ calls->instance_ptr = o;
+
+ LDKLockableScore ret = {
+ .this_arg = (void*) calls,
+ .lock = lock_LDKLockableScore_jcall,
+ .free = LDKLockableScore_JCalls_free,
+ };
+ return ret;
+}
+uint64_t __attribute__((export_name("TS_LDKLockableScore_new"))) TS_LDKLockableScore_new(JSValue o) {
+ LDKLockableScore *res_ptr = MALLOC(sizeof(LDKLockableScore), "LDKLockableScore");
+ *res_ptr = LDKLockableScore_init(o);
+ return tag_ptr(res_ptr, true);
+}
+uint64_t __attribute__((export_name("TS_LockableScore_lock"))) TS_LockableScore_lock(uint64_t this_arg) {
+ void* this_arg_ptr = untag_ptr(this_arg);
+ if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKLockableScore* this_arg_conv = (LDKLockableScore*)this_arg_ptr;
+ LDKScore* ret_ret = MALLOC(sizeof(LDKScore), "LDKScore");
+ *ret_ret = (this_arg_conv->lock)(this_arg_conv->this_arg);
+ return tag_ptr(ret_ret, true);
+}
+
+typedef struct LDKWriteableScore_JCalls {
+ atomic_size_t refcnt;
+ uint32_t instance_ptr;
+ LDKLockableScore_JCalls* LockableScore;
+} LDKWriteableScore_JCalls;
+static void LDKWriteableScore_JCalls_free(void* this_arg) {
+ LDKWriteableScore_JCalls *j_calls = (LDKWriteableScore_JCalls*) this_arg;
+ if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
+ FREE(j_calls);
+ }
+}
+LDKCVec_u8Z write_LDKWriteableScore_jcall(const void* this_arg) {
+ LDKWriteableScore_JCalls *j_calls = (LDKWriteableScore_JCalls*) this_arg;
+ int8_tArray ret = (int8_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 53, 0, 0, 0, 0, 0, 0);
+ LDKCVec_u8Z ret_ref;
+ ret_ref.datalen = ret->arr_len;
+ ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes");
+ memcpy(ret_ref.data, ret->elems, ret_ref.datalen); FREE(ret);
+ return ret_ref;
+}
+static void LDKWriteableScore_JCalls_cloned(LDKWriteableScore* new_obj) {
+ LDKWriteableScore_JCalls *j_calls = (LDKWriteableScore_JCalls*) new_obj->this_arg;
+ atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
+ atomic_fetch_add_explicit(&j_calls->LockableScore->refcnt, 1, memory_order_release);
+}
+static inline LDKWriteableScore LDKWriteableScore_init (JSValue o, JSValue LockableScore) {
+ LDKWriteableScore_JCalls *calls = MALLOC(sizeof(LDKWriteableScore_JCalls), "LDKWriteableScore_JCalls");
+ atomic_init(&calls->refcnt, 1);
+ calls->instance_ptr = o;
+
+ LDKWriteableScore ret = {
+ .this_arg = (void*) calls,
+ .write = write_LDKWriteableScore_jcall,
+ .free = LDKWriteableScore_JCalls_free,
+ .LockableScore = LDKLockableScore_init(LockableScore),
+ };
+ calls->LockableScore = ret.LockableScore.this_arg;
+ return ret;
+}
+uint64_t __attribute__((export_name("TS_LDKWriteableScore_new"))) TS_LDKWriteableScore_new(JSValue o, JSValue LockableScore) {
+ LDKWriteableScore *res_ptr = MALLOC(sizeof(LDKWriteableScore), "LDKWriteableScore");
+ *res_ptr = LDKWriteableScore_init(o, LockableScore);
+ return tag_ptr(res_ptr, true);
+}
+int8_tArray __attribute__((export_name("TS_WriteableScore_write"))) TS_WriteableScore_write(uint64_t this_arg) {
+ void* this_arg_ptr = untag_ptr(this_arg);
+ if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKWriteableScore* this_arg_conv = (LDKWriteableScore*)this_arg_ptr;
+ LDKCVec_u8Z ret_var = (this_arg_conv->write)(this_arg_conv->this_arg);
+ int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
+ memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
+}
+
typedef struct LDKPersister_JCalls {
atomic_size_t refcnt;
uint32_t instance_ptr;
// WARNING: we may need a move here but no clone is available for LDKChannelManager
CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_manager_var);
channel_manager_ref = tag_ptr(channel_manager_var.inner, channel_manager_var.is_owned);
- uint32_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 43, channel_manager_ref, 0, 0, 0, 0, 0);
+ uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 54, channel_manager_ref, 0, 0, 0, 0, 0);
void* ret_ptr = untag_ptr(ret);
CHECK_ACCESS(ret_ptr);
LDKCResult_NoneErrorZ ret_conv = *(LDKCResult_NoneErrorZ*)(ret_ptr);
// WARNING: we may need a move here but no clone is available for LDKNetworkGraph
CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_var);
network_graph_ref = tag_ptr(network_graph_var.inner, network_graph_var.is_owned);
- uint32_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 44, network_graph_ref, 0, 0, 0, 0, 0);
+ uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 55, network_graph_ref, 0, 0, 0, 0, 0);
void* ret_ptr = untag_ptr(ret);
CHECK_ACCESS(ret_ptr);
LDKCResult_NoneErrorZ ret_conv = *(LDKCResult_NoneErrorZ*)(ret_ptr);
FREE(untag_ptr(ret));
return ret_conv;
}
-LDKCResult_NoneErrorZ persist_scorer_LDKPersister_jcall(const void* this_arg, const LDKMultiThreadedLockableScore * scorer) {
+LDKCResult_NoneErrorZ persist_scorer_LDKPersister_jcall(const void* this_arg, const LDKWriteableScore * scorer) {
LDKPersister_JCalls *j_calls = (LDKPersister_JCalls*) this_arg;
- LDKMultiThreadedLockableScore scorer_var = *scorer;
- uint64_t scorer_ref = 0;
- // WARNING: we may need a move here but no clone is available for LDKMultiThreadedLockableScore
- CHECK_INNER_FIELD_ACCESS_OR_NULL(scorer_var);
- scorer_ref = tag_ptr(scorer_var.inner, scorer_var.is_owned);
- uint32_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 45, scorer_ref, 0, 0, 0, 0, 0);
+ // WARNING: This object doesn't live past this scope, needs clone!
+ uint64_t ret_scorer = tag_ptr(scorer, false);
+ uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 56, ret_scorer, 0, 0, 0, 0, 0);
void* ret_ptr = untag_ptr(ret);
CHECK_ACCESS(ret_ptr);
LDKCResult_NoneErrorZ ret_conv = *(LDKCResult_NoneErrorZ*)(ret_ptr);
void* this_arg_ptr = untag_ptr(this_arg);
if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
LDKPersister* this_arg_conv = (LDKPersister*)this_arg_ptr;
- LDKMultiThreadedLockableScore scorer_conv;
- scorer_conv.inner = untag_ptr(scorer);
- scorer_conv.is_owned = ptr_is_owned(scorer);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(scorer_conv);
- scorer_conv.is_owned = false;
+ void* scorer_ptr = untag_ptr(scorer);
+ if (ptr_is_owned(scorer)) { CHECK_ACCESS(scorer_ptr); }
+ LDKWriteableScore* scorer_conv = (LDKWriteableScore*)scorer_ptr;
LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
- *ret_conv = (this_arg_conv->persist_scorer)(this_arg_conv->this_arg, &scorer_conv);
+ *ret_conv = (this_arg_conv->persist_scorer)(this_arg_conv->this_arg, scorer_conv);
return tag_ptr(ret_conv, true);
}
+typedef struct LDKFutureCallback_JCalls {
+ atomic_size_t refcnt;
+ uint32_t instance_ptr;
+} LDKFutureCallback_JCalls;
+static void LDKFutureCallback_JCalls_free(void* this_arg) {
+ LDKFutureCallback_JCalls *j_calls = (LDKFutureCallback_JCalls*) this_arg;
+ if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
+ FREE(j_calls);
+ }
+}
+void call_LDKFutureCallback_jcall(const void* this_arg) {
+ LDKFutureCallback_JCalls *j_calls = (LDKFutureCallback_JCalls*) this_arg;
+ js_invoke_function_uuuuuu(j_calls->instance_ptr, 57, 0, 0, 0, 0, 0, 0);
+}
+static void LDKFutureCallback_JCalls_cloned(LDKFutureCallback* new_obj) {
+ LDKFutureCallback_JCalls *j_calls = (LDKFutureCallback_JCalls*) new_obj->this_arg;
+ atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
+}
+static inline LDKFutureCallback LDKFutureCallback_init (JSValue o) {
+ LDKFutureCallback_JCalls *calls = MALLOC(sizeof(LDKFutureCallback_JCalls), "LDKFutureCallback_JCalls");
+ atomic_init(&calls->refcnt, 1);
+ calls->instance_ptr = o;
+
+ LDKFutureCallback ret = {
+ .this_arg = (void*) calls,
+ .call = call_LDKFutureCallback_jcall,
+ .free = LDKFutureCallback_JCalls_free,
+ };
+ return ret;
+}
+uint64_t __attribute__((export_name("TS_LDKFutureCallback_new"))) TS_LDKFutureCallback_new(JSValue o) {
+ LDKFutureCallback *res_ptr = MALLOC(sizeof(LDKFutureCallback), "LDKFutureCallback");
+ *res_ptr = LDKFutureCallback_init(o);
+ return tag_ptr(res_ptr, true);
+}
+void __attribute__((export_name("TS_FutureCallback_call"))) TS_FutureCallback_call(uint64_t this_arg) {
+ void* this_arg_ptr = untag_ptr(this_arg);
+ if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKFutureCallback* this_arg_conv = (LDKFutureCallback*)this_arg_ptr;
+ (this_arg_conv->call)(this_arg_conv->this_arg);
+}
+
typedef struct LDKListen_JCalls {
atomic_size_t refcnt;
uint32_t instance_ptr;
FREE(txdata_var.data);
int32_t height_conv = height;
- js_invoke_function_uuuuuu(j_calls->instance_ptr, 46, (uint32_t)header_arr, (uint32_t)txdata_arr, height_conv, 0, 0, 0);
+ js_invoke_function_uuuuuu(j_calls->instance_ptr, 58, (uint32_t)header_arr, (uint32_t)txdata_arr, height_conv, 0, 0, 0);
}
void block_connected_LDKListen_jcall(const void* this_arg, LDKu8slice block, uint32_t height) {
LDKListen_JCalls *j_calls = (LDKListen_JCalls*) this_arg;
int8_tArray block_arr = init_int8_tArray(block_var.datalen, __LINE__);
memcpy(block_arr->elems, block_var.data, block_var.datalen);
int32_t height_conv = height;
- js_invoke_function_uuuuuu(j_calls->instance_ptr, 47, (uint32_t)block_arr, height_conv, 0, 0, 0, 0);
+ js_invoke_function_uuuuuu(j_calls->instance_ptr, 59, (uint32_t)block_arr, height_conv, 0, 0, 0, 0);
}
void block_disconnected_LDKListen_jcall(const void* this_arg, const uint8_t (* header)[80], uint32_t height) {
LDKListen_JCalls *j_calls = (LDKListen_JCalls*) this_arg;
int8_tArray header_arr = init_int8_tArray(80, __LINE__);
memcpy(header_arr->elems, *header, 80);
int32_t height_conv = height;
- js_invoke_function_uuuuuu(j_calls->instance_ptr, 48, (uint32_t)header_arr, height_conv, 0, 0, 0, 0);
+ js_invoke_function_uuuuuu(j_calls->instance_ptr, 60, (uint32_t)header_arr, height_conv, 0, 0, 0, 0);
}
static void LDKListen_JCalls_cloned(LDKListen* new_obj) {
LDKListen_JCalls *j_calls = (LDKListen_JCalls*) new_obj->this_arg;
void* this_arg_ptr = untag_ptr(this_arg);
if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
LDKListen* this_arg_conv = (LDKListen*)this_arg_ptr;
- unsigned char header_arr[80];
+ uint8_t header_arr[80];
CHECK(header->arr_len == 80);
memcpy(header_arr, header->elems, 80); FREE(header);
- unsigned char (*header_ref)[80] = &header_arr;
+ uint8_t (*header_ref)[80] = &header_arr;
LDKCVec_C2Tuple_usizeTransactionZZ txdata_constr;
txdata_constr.datalen = txdata->arr_len;
if (txdata_constr.datalen > 0)
void* this_arg_ptr = untag_ptr(this_arg);
if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
LDKListen* this_arg_conv = (LDKListen*)this_arg_ptr;
- unsigned char header_arr[80];
+ uint8_t header_arr[80];
CHECK(header->arr_len == 80);
memcpy(header_arr, header->elems, 80); FREE(header);
- unsigned char (*header_ref)[80] = &header_arr;
+ uint8_t (*header_ref)[80] = &header_arr;
(this_arg_conv->block_disconnected)(this_arg_conv->this_arg, header_ref, height);
}
FREE(txdata_var.data);
int32_t height_conv = height;
- js_invoke_function_uuuuuu(j_calls->instance_ptr, 49, (uint32_t)header_arr, (uint32_t)txdata_arr, height_conv, 0, 0, 0);
+ js_invoke_function_uuuuuu(j_calls->instance_ptr, 61, (uint32_t)header_arr, (uint32_t)txdata_arr, height_conv, 0, 0, 0);
}
void transaction_unconfirmed_LDKConfirm_jcall(const void* this_arg, const uint8_t (* txid)[32]) {
LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) this_arg;
int8_tArray txid_arr = init_int8_tArray(32, __LINE__);
memcpy(txid_arr->elems, *txid, 32);
- js_invoke_function_uuuuuu(j_calls->instance_ptr, 50, (uint32_t)txid_arr, 0, 0, 0, 0, 0);
+ js_invoke_function_uuuuuu(j_calls->instance_ptr, 62, (uint32_t)txid_arr, 0, 0, 0, 0, 0);
}
void best_block_updated_LDKConfirm_jcall(const void* this_arg, const uint8_t (* header)[80], uint32_t height) {
LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) this_arg;
int8_tArray header_arr = init_int8_tArray(80, __LINE__);
memcpy(header_arr->elems, *header, 80);
int32_t height_conv = height;
- js_invoke_function_uuuuuu(j_calls->instance_ptr, 51, (uint32_t)header_arr, height_conv, 0, 0, 0, 0);
+ js_invoke_function_uuuuuu(j_calls->instance_ptr, 63, (uint32_t)header_arr, height_conv, 0, 0, 0, 0);
}
-LDKCVec_TxidZ get_relevant_txids_LDKConfirm_jcall(const void* this_arg) {
+LDKCVec_C2Tuple_TxidBlockHashZZ get_relevant_txids_LDKConfirm_jcall(const void* this_arg) {
LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) this_arg;
- ptrArray ret = (ptrArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 52, 0, 0, 0, 0, 0, 0);
- LDKCVec_TxidZ ret_constr;
+ uint64_tArray ret = (uint64_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 64, 0, 0, 0, 0, 0, 0);
+ LDKCVec_C2Tuple_TxidBlockHashZZ ret_constr;
ret_constr.datalen = ret->arr_len;
if (ret_constr.datalen > 0)
- ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_TxidZ Elements");
+ ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKC2Tuple_TxidBlockHashZ), "LDKCVec_C2Tuple_TxidBlockHashZZ Elements");
else
ret_constr.data = NULL;
- int8_tArray* ret_vals = (void*) ret->elems;
- for (size_t m = 0; m < ret_constr.datalen; m++) {
- int8_tArray ret_conv_12 = ret_vals[m];
- LDKThirtyTwoBytes ret_conv_12_ref;
- CHECK(ret_conv_12->arr_len == 32);
- memcpy(ret_conv_12_ref.data, ret_conv_12->elems, 32); FREE(ret_conv_12);
- ret_constr.data[m] = ret_conv_12_ref;
+ uint64_t* ret_vals = ret->elems;
+ for (size_t z = 0; z < ret_constr.datalen; z++) {
+ uint64_t ret_conv_25 = ret_vals[z];
+ void* ret_conv_25_ptr = untag_ptr(ret_conv_25);
+ CHECK_ACCESS(ret_conv_25_ptr);
+ LDKC2Tuple_TxidBlockHashZ ret_conv_25_conv = *(LDKC2Tuple_TxidBlockHashZ*)(ret_conv_25_ptr);
+ FREE(untag_ptr(ret_conv_25));
+ ret_constr.data[z] = ret_conv_25_conv;
}
FREE(ret);
return ret_constr;
void* this_arg_ptr = untag_ptr(this_arg);
if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr;
- unsigned char header_arr[80];
+ uint8_t header_arr[80];
CHECK(header->arr_len == 80);
memcpy(header_arr, header->elems, 80); FREE(header);
- unsigned char (*header_ref)[80] = &header_arr;
+ uint8_t (*header_ref)[80] = &header_arr;
LDKCVec_C2Tuple_usizeTransactionZZ txdata_constr;
txdata_constr.datalen = txdata->arr_len;
if (txdata_constr.datalen > 0)
void* this_arg_ptr = untag_ptr(this_arg);
if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr;
- unsigned char txid_arr[32];
+ uint8_t txid_arr[32];
CHECK(txid->arr_len == 32);
memcpy(txid_arr, txid->elems, 32); FREE(txid);
- unsigned char (*txid_ref)[32] = &txid_arr;
+ uint8_t (*txid_ref)[32] = &txid_arr;
(this_arg_conv->transaction_unconfirmed)(this_arg_conv->this_arg, txid_ref);
}
void* this_arg_ptr = untag_ptr(this_arg);
if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr;
- unsigned char header_arr[80];
+ uint8_t header_arr[80];
CHECK(header->arr_len == 80);
memcpy(header_arr, header->elems, 80); FREE(header);
- unsigned char (*header_ref)[80] = &header_arr;
+ uint8_t (*header_ref)[80] = &header_arr;
(this_arg_conv->best_block_updated)(this_arg_conv->this_arg, header_ref, height);
}
-ptrArray __attribute__((export_name("TS_Confirm_get_relevant_txids"))) TS_Confirm_get_relevant_txids(uint64_t this_arg) {
+uint64_tArray __attribute__((export_name("TS_Confirm_get_relevant_txids"))) TS_Confirm_get_relevant_txids(uint64_t this_arg) {
void* this_arg_ptr = untag_ptr(this_arg);
if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr;
- LDKCVec_TxidZ ret_var = (this_arg_conv->get_relevant_txids)(this_arg_conv->this_arg);
- ptrArray ret_arr = NULL;
- ret_arr = init_ptrArray(ret_var.datalen, __LINE__);
- int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 8);
- for (size_t m = 0; m < ret_var.datalen; m++) {
- int8_tArray ret_conv_12_arr = init_int8_tArray(32, __LINE__);
- memcpy(ret_conv_12_arr->elems, ret_var.data[m].data, 32);
- ret_arr_ptr[m] = ret_conv_12_arr;
+ LDKCVec_C2Tuple_TxidBlockHashZZ ret_var = (this_arg_conv->get_relevant_txids)(this_arg_conv->this_arg);
+ uint64_tArray ret_arr = NULL;
+ ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
+ uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
+ for (size_t z = 0; z < ret_var.datalen; z++) {
+ LDKC2Tuple_TxidBlockHashZ* ret_conv_25_conv = MALLOC(sizeof(LDKC2Tuple_TxidBlockHashZ), "LDKC2Tuple_TxidBlockHashZ");
+ *ret_conv_25_conv = ret_var.data[z];
+ ret_arr_ptr[z] = tag_ptr(ret_conv_25_conv, true);
}
FREE(ret_var.data);
FREE(j_calls);
}
}
-LDKCResult_NoneChannelMonitorUpdateErrZ persist_new_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint channel_id, const LDKChannelMonitor * data, LDKMonitorUpdateId update_id) {
+LDKChannelMonitorUpdateStatus persist_new_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint channel_id, const LDKChannelMonitor * data, LDKMonitorUpdateId update_id) {
LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg;
LDKOutPoint channel_id_var = channel_id;
uint64_t channel_id_ref = 0;
uint64_t update_id_ref = 0;
CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_var);
update_id_ref = tag_ptr(update_id_var.inner, update_id_var.is_owned);
- uint32_t ret = js_invoke_function_bbbuuu(j_calls->instance_ptr, 53, channel_id_ref, data_ref, update_id_ref, 0, 0, 0);
- void* ret_ptr = untag_ptr(ret);
- CHECK_ACCESS(ret_ptr);
- LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr);
- FREE(untag_ptr(ret));
+ uint64_t ret = js_invoke_function_bbbuuu(j_calls->instance_ptr, 65, channel_id_ref, data_ref, update_id_ref, 0, 0, 0);
+ LDKChannelMonitorUpdateStatus ret_conv = LDKChannelMonitorUpdateStatus_from_js(ret);
return ret_conv;
}
-LDKCResult_NoneChannelMonitorUpdateErrZ update_persisted_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint channel_id, const LDKChannelMonitorUpdate * update, const LDKChannelMonitor * data, LDKMonitorUpdateId update_id) {
+LDKChannelMonitorUpdateStatus update_persisted_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint channel_id, LDKChannelMonitorUpdate update, const LDKChannelMonitor * data, LDKMonitorUpdateId update_id) {
LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg;
LDKOutPoint channel_id_var = channel_id;
uint64_t channel_id_ref = 0;
CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_var);
channel_id_ref = tag_ptr(channel_id_var.inner, channel_id_var.is_owned);
- LDKChannelMonitorUpdate update_var = *update;
+ LDKChannelMonitorUpdate update_var = update;
uint64_t update_ref = 0;
- update_var = ChannelMonitorUpdate_clone(&update_var);
CHECK_INNER_FIELD_ACCESS_OR_NULL(update_var);
update_ref = tag_ptr(update_var.inner, update_var.is_owned);
LDKChannelMonitor data_var = *data;
uint64_t update_id_ref = 0;
CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_var);
update_id_ref = tag_ptr(update_id_var.inner, update_id_var.is_owned);
- uint32_t ret = js_invoke_function_bbbbuu(j_calls->instance_ptr, 54, channel_id_ref, update_ref, data_ref, update_id_ref, 0, 0);
- void* ret_ptr = untag_ptr(ret);
- CHECK_ACCESS(ret_ptr);
- LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr);
- FREE(untag_ptr(ret));
+ uint64_t ret = js_invoke_function_bbbbuu(j_calls->instance_ptr, 66, channel_id_ref, update_ref, data_ref, update_id_ref, 0, 0);
+ LDKChannelMonitorUpdateStatus ret_conv = LDKChannelMonitorUpdateStatus_from_js(ret);
return ret_conv;
}
static void LDKPersist_JCalls_cloned(LDKPersist* new_obj) {
*res_ptr = LDKPersist_init(o);
return tag_ptr(res_ptr, true);
}
-uint64_t __attribute__((export_name("TS_Persist_persist_new_channel"))) TS_Persist_persist_new_channel(uint64_t this_arg, uint64_t channel_id, uint64_t data, uint64_t update_id) {
+uint32_t __attribute__((export_name("TS_Persist_persist_new_channel"))) TS_Persist_persist_new_channel(uint64_t this_arg, uint64_t channel_id, uint64_t data, uint64_t update_id) {
void* this_arg_ptr = untag_ptr(this_arg);
if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
LDKPersist* this_arg_conv = (LDKPersist*)this_arg_ptr;
update_id_conv.is_owned = ptr_is_owned(update_id);
CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_conv);
update_id_conv = MonitorUpdateId_clone(&update_id_conv);
- LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
- *ret_conv = (this_arg_conv->persist_new_channel)(this_arg_conv->this_arg, channel_id_conv, &data_conv, update_id_conv);
- return tag_ptr(ret_conv, true);
+ uint32_t ret_conv = LDKChannelMonitorUpdateStatus_to_js((this_arg_conv->persist_new_channel)(this_arg_conv->this_arg, channel_id_conv, &data_conv, update_id_conv));
+ return ret_conv;
}
-uint64_t __attribute__((export_name("TS_Persist_update_persisted_channel"))) TS_Persist_update_persisted_channel(uint64_t this_arg, uint64_t channel_id, uint64_t update, uint64_t data, uint64_t update_id) {
+uint32_t __attribute__((export_name("TS_Persist_update_persisted_channel"))) TS_Persist_update_persisted_channel(uint64_t this_arg, uint64_t channel_id, uint64_t update, uint64_t data, uint64_t update_id) {
void* this_arg_ptr = untag_ptr(this_arg);
if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
LDKPersist* this_arg_conv = (LDKPersist*)this_arg_ptr;
update_conv.inner = untag_ptr(update);
update_conv.is_owned = ptr_is_owned(update);
CHECK_INNER_FIELD_ACCESS_OR_NULL(update_conv);
- update_conv.is_owned = false;
+ update_conv = ChannelMonitorUpdate_clone(&update_conv);
LDKChannelMonitor data_conv;
data_conv.inner = untag_ptr(data);
data_conv.is_owned = ptr_is_owned(data);
update_id_conv.is_owned = ptr_is_owned(update_id);
CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_conv);
update_id_conv = MonitorUpdateId_clone(&update_id_conv);
- LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
- *ret_conv = (this_arg_conv->update_persisted_channel)(this_arg_conv->this_arg, channel_id_conv, &update_conv, &data_conv, update_id_conv);
- return tag_ptr(ret_conv, true);
+ uint32_t ret_conv = LDKChannelMonitorUpdateStatus_to_js((this_arg_conv->update_persisted_channel)(this_arg_conv->this_arg, channel_id_conv, update_conv, &data_conv, update_id_conv));
+ return ret_conv;
}
+uint32_t __attribute__((export_name("TS_LDKRetry_ty_from_ptr"))) TS_LDKRetry_ty_from_ptr(uint64_t ptr) {
+ LDKRetry *obj = (LDKRetry*)untag_ptr(ptr);
+ switch(obj->tag) {
+ case LDKRetry_Attempts: return 0;
+ default: abort();
+ }
+}
+uint32_t __attribute__((export_name("TS_LDKRetry_Attempts_get_attempts"))) TS_LDKRetry_Attempts_get_attempts(uint64_t ptr) {
+ LDKRetry *obj = (LDKRetry*)untag_ptr(ptr);
+ assert(obj->tag == LDKRetry_Attempts);
+ uint32_t attempts_conv = obj->attempts;
+ return attempts_conv;
+}
typedef struct LDKChannelMessageHandler_JCalls {
atomic_size_t refcnt;
uint32_t instance_ptr;
FREE(j_calls);
}
}
-void handle_open_channel_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKInitFeatures their_features, const LDKOpenChannel * msg) {
+void handle_open_channel_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKOpenChannel * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
- LDKInitFeatures their_features_var = their_features;
- uint64_t their_features_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_var);
- their_features_ref = tag_ptr(their_features_var.inner, their_features_var.is_owned);
LDKOpenChannel msg_var = *msg;
uint64_t msg_ref = 0;
msg_var = OpenChannel_clone(&msg_var);
CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
- js_invoke_function_ubbuuu(j_calls->instance_ptr, 55, (uint32_t)their_node_id_arr, their_features_ref, msg_ref, 0, 0, 0);
+ js_invoke_function_ubuuuu(j_calls->instance_ptr, 67, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
}
-void handle_accept_channel_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKInitFeatures their_features, const LDKAcceptChannel * msg) {
+void handle_accept_channel_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKAcceptChannel * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
- LDKInitFeatures their_features_var = their_features;
- uint64_t their_features_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_var);
- their_features_ref = tag_ptr(their_features_var.inner, their_features_var.is_owned);
LDKAcceptChannel msg_var = *msg;
uint64_t msg_ref = 0;
msg_var = AcceptChannel_clone(&msg_var);
CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
- js_invoke_function_ubbuuu(j_calls->instance_ptr, 56, (uint32_t)their_node_id_arr, their_features_ref, msg_ref, 0, 0, 0);
+ js_invoke_function_ubuuuu(j_calls->instance_ptr, 68, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
}
void handle_funding_created_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingCreated * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
msg_var = FundingCreated_clone(&msg_var);
CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
- js_invoke_function_ubuuuu(j_calls->instance_ptr, 57, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
+ js_invoke_function_ubuuuu(j_calls->instance_ptr, 69, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
}
void handle_funding_signed_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingSigned * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
msg_var = FundingSigned_clone(&msg_var);
CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
- js_invoke_function_ubuuuu(j_calls->instance_ptr, 58, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
+ js_invoke_function_ubuuuu(j_calls->instance_ptr, 70, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
}
void handle_channel_ready_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKChannelReady * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
msg_var = ChannelReady_clone(&msg_var);
CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
- js_invoke_function_ubuuuu(j_calls->instance_ptr, 59, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
+ js_invoke_function_ubuuuu(j_calls->instance_ptr, 71, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
}
-void handle_shutdown_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInitFeatures * their_features, const LDKShutdown * msg) {
+void handle_shutdown_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKShutdown * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
- LDKInitFeatures their_features_var = *their_features;
- uint64_t their_features_ref = 0;
- their_features_var = InitFeatures_clone(&their_features_var);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_var);
- their_features_ref = tag_ptr(their_features_var.inner, their_features_var.is_owned);
LDKShutdown msg_var = *msg;
uint64_t msg_ref = 0;
msg_var = Shutdown_clone(&msg_var);
CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
- js_invoke_function_ubbuuu(j_calls->instance_ptr, 60, (uint32_t)their_node_id_arr, their_features_ref, msg_ref, 0, 0, 0);
+ js_invoke_function_ubuuuu(j_calls->instance_ptr, 72, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
}
void handle_closing_signed_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKClosingSigned * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
msg_var = ClosingSigned_clone(&msg_var);
CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
- js_invoke_function_ubuuuu(j_calls->instance_ptr, 61, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
+ js_invoke_function_ubuuuu(j_calls->instance_ptr, 73, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
}
void handle_update_add_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateAddHTLC * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
msg_var = UpdateAddHTLC_clone(&msg_var);
CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
- js_invoke_function_ubuuuu(j_calls->instance_ptr, 62, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
+ js_invoke_function_ubuuuu(j_calls->instance_ptr, 74, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
}
void handle_update_fulfill_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFulfillHTLC * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
msg_var = UpdateFulfillHTLC_clone(&msg_var);
CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
- js_invoke_function_ubuuuu(j_calls->instance_ptr, 63, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
+ js_invoke_function_ubuuuu(j_calls->instance_ptr, 75, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
}
void handle_update_fail_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFailHTLC * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
msg_var = UpdateFailHTLC_clone(&msg_var);
CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
- js_invoke_function_ubuuuu(j_calls->instance_ptr, 64, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
+ js_invoke_function_ubuuuu(j_calls->instance_ptr, 76, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
}
void handle_update_fail_malformed_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFailMalformedHTLC * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
msg_var = UpdateFailMalformedHTLC_clone(&msg_var);
CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
- js_invoke_function_ubuuuu(j_calls->instance_ptr, 65, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
+ js_invoke_function_ubuuuu(j_calls->instance_ptr, 77, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
}
void handle_commitment_signed_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKCommitmentSigned * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
msg_var = CommitmentSigned_clone(&msg_var);
CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
- js_invoke_function_ubuuuu(j_calls->instance_ptr, 66, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
+ js_invoke_function_ubuuuu(j_calls->instance_ptr, 78, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
}
void handle_revoke_and_ack_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKRevokeAndACK * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
msg_var = RevokeAndACK_clone(&msg_var);
CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
- js_invoke_function_ubuuuu(j_calls->instance_ptr, 67, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
+ js_invoke_function_ubuuuu(j_calls->instance_ptr, 79, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
}
void handle_update_fee_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFee * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
msg_var = UpdateFee_clone(&msg_var);
CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
- js_invoke_function_ubuuuu(j_calls->instance_ptr, 68, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
+ js_invoke_function_ubuuuu(j_calls->instance_ptr, 80, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
}
void handle_announcement_signatures_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKAnnouncementSignatures * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
msg_var = AnnouncementSignatures_clone(&msg_var);
CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
- js_invoke_function_ubuuuu(j_calls->instance_ptr, 69, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
+ js_invoke_function_ubuuuu(j_calls->instance_ptr, 81, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
}
-void peer_disconnected_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, bool no_connection_possible) {
+void peer_disconnected_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
- jboolean no_connection_possible_conv = no_connection_possible;
- js_invoke_function_uuuuuu(j_calls->instance_ptr, 70, (uint32_t)their_node_id_arr, no_connection_possible_conv, 0, 0, 0, 0);
+ js_invoke_function_uuuuuu(j_calls->instance_ptr, 82, (uint32_t)their_node_id_arr, 0, 0, 0, 0, 0);
}
-void peer_connected_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit * msg) {
+LDKCResult_NoneNoneZ peer_connected_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit * msg, bool inbound) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
msg_var = Init_clone(&msg_var);
CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
- js_invoke_function_ubuuuu(j_calls->instance_ptr, 71, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
+ jboolean inbound_conv = inbound;
+ uint64_t ret = js_invoke_function_ubuuuu(j_calls->instance_ptr, 83, (uint32_t)their_node_id_arr, msg_ref, inbound_conv, 0, 0, 0);
+ void* ret_ptr = untag_ptr(ret);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr);
+ FREE(untag_ptr(ret));
+ return ret_conv;
}
void handle_channel_reestablish_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKChannelReestablish * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
msg_var = ChannelReestablish_clone(&msg_var);
CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
- js_invoke_function_ubuuuu(j_calls->instance_ptr, 72, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
+ js_invoke_function_ubuuuu(j_calls->instance_ptr, 84, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
}
void handle_channel_update_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKChannelUpdate * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
msg_var = ChannelUpdate_clone(&msg_var);
CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
- js_invoke_function_ubuuuu(j_calls->instance_ptr, 73, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
+ js_invoke_function_ubuuuu(j_calls->instance_ptr, 85, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
}
void handle_error_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKErrorMessage * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
msg_var = ErrorMessage_clone(&msg_var);
CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
- js_invoke_function_ubuuuu(j_calls->instance_ptr, 74, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
+ js_invoke_function_ubuuuu(j_calls->instance_ptr, 86, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
+}
+LDKNodeFeatures provided_node_features_LDKChannelMessageHandler_jcall(const void* this_arg) {
+ LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
+ uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 87, 0, 0, 0, 0, 0, 0);
+ LDKNodeFeatures ret_conv;
+ ret_conv.inner = untag_ptr(ret);
+ ret_conv.is_owned = ptr_is_owned(ret);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv);
+ return ret_conv;
+}
+LDKInitFeatures provided_init_features_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id) {
+ LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
+ int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
+ memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
+ uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 88, (uint32_t)their_node_id_arr, 0, 0, 0, 0, 0);
+ LDKInitFeatures ret_conv;
+ ret_conv.inner = untag_ptr(ret);
+ ret_conv.is_owned = ptr_is_owned(ret);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv);
+ return ret_conv;
}
static void LDKChannelMessageHandler_JCalls_cloned(LDKChannelMessageHandler* new_obj) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) new_obj->this_arg;
.handle_channel_reestablish = handle_channel_reestablish_LDKChannelMessageHandler_jcall,
.handle_channel_update = handle_channel_update_LDKChannelMessageHandler_jcall,
.handle_error = handle_error_LDKChannelMessageHandler_jcall,
+ .provided_node_features = provided_node_features_LDKChannelMessageHandler_jcall,
+ .provided_init_features = provided_init_features_LDKChannelMessageHandler_jcall,
.free = LDKChannelMessageHandler_JCalls_free,
.MessageSendEventsProvider = LDKMessageSendEventsProvider_init(MessageSendEventsProvider),
};
*res_ptr = LDKChannelMessageHandler_init(o, MessageSendEventsProvider);
return tag_ptr(res_ptr, true);
}
-void __attribute__((export_name("TS_ChannelMessageHandler_handle_open_channel"))) TS_ChannelMessageHandler_handle_open_channel(uint64_t this_arg, int8_tArray their_node_id, uint64_t their_features, uint64_t msg) {
+void __attribute__((export_name("TS_ChannelMessageHandler_handle_open_channel"))) TS_ChannelMessageHandler_handle_open_channel(uint64_t this_arg, int8_tArray their_node_id, uint64_t msg) {
void* this_arg_ptr = untag_ptr(this_arg);
if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK(their_node_id->arr_len == 33);
memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
- LDKInitFeatures their_features_conv;
- their_features_conv.inner = untag_ptr(their_features);
- their_features_conv.is_owned = ptr_is_owned(their_features);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_conv);
- their_features_conv = InitFeatures_clone(&their_features_conv);
LDKOpenChannel msg_conv;
msg_conv.inner = untag_ptr(msg);
msg_conv.is_owned = ptr_is_owned(msg);
CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
msg_conv.is_owned = false;
- (this_arg_conv->handle_open_channel)(this_arg_conv->this_arg, their_node_id_ref, their_features_conv, &msg_conv);
+ (this_arg_conv->handle_open_channel)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
}
-void __attribute__((export_name("TS_ChannelMessageHandler_handle_accept_channel"))) TS_ChannelMessageHandler_handle_accept_channel(uint64_t this_arg, int8_tArray their_node_id, uint64_t their_features, uint64_t msg) {
+void __attribute__((export_name("TS_ChannelMessageHandler_handle_accept_channel"))) TS_ChannelMessageHandler_handle_accept_channel(uint64_t this_arg, int8_tArray their_node_id, uint64_t msg) {
void* this_arg_ptr = untag_ptr(this_arg);
if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK(their_node_id->arr_len == 33);
memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
- LDKInitFeatures their_features_conv;
- their_features_conv.inner = untag_ptr(their_features);
- their_features_conv.is_owned = ptr_is_owned(their_features);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_conv);
- their_features_conv = InitFeatures_clone(&their_features_conv);
LDKAcceptChannel msg_conv;
msg_conv.inner = untag_ptr(msg);
msg_conv.is_owned = ptr_is_owned(msg);
CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
msg_conv.is_owned = false;
- (this_arg_conv->handle_accept_channel)(this_arg_conv->this_arg, their_node_id_ref, their_features_conv, &msg_conv);
+ (this_arg_conv->handle_accept_channel)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
}
void __attribute__((export_name("TS_ChannelMessageHandler_handle_funding_created"))) TS_ChannelMessageHandler_handle_funding_created(uint64_t this_arg, int8_tArray their_node_id, uint64_t msg) {
(this_arg_conv->handle_channel_ready)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
}
-void __attribute__((export_name("TS_ChannelMessageHandler_handle_shutdown"))) TS_ChannelMessageHandler_handle_shutdown(uint64_t this_arg, int8_tArray their_node_id, uint64_t their_features, uint64_t msg) {
+void __attribute__((export_name("TS_ChannelMessageHandler_handle_shutdown"))) TS_ChannelMessageHandler_handle_shutdown(uint64_t this_arg, int8_tArray their_node_id, uint64_t msg) {
void* this_arg_ptr = untag_ptr(this_arg);
if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK(their_node_id->arr_len == 33);
memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
- LDKInitFeatures their_features_conv;
- their_features_conv.inner = untag_ptr(their_features);
- their_features_conv.is_owned = ptr_is_owned(their_features);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_conv);
- their_features_conv.is_owned = false;
LDKShutdown msg_conv;
msg_conv.inner = untag_ptr(msg);
msg_conv.is_owned = ptr_is_owned(msg);
CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
msg_conv.is_owned = false;
- (this_arg_conv->handle_shutdown)(this_arg_conv->this_arg, their_node_id_ref, &their_features_conv, &msg_conv);
+ (this_arg_conv->handle_shutdown)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
}
void __attribute__((export_name("TS_ChannelMessageHandler_handle_closing_signed"))) TS_ChannelMessageHandler_handle_closing_signed(uint64_t this_arg, int8_tArray their_node_id, uint64_t msg) {
(this_arg_conv->handle_announcement_signatures)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
}
-void __attribute__((export_name("TS_ChannelMessageHandler_peer_disconnected"))) TS_ChannelMessageHandler_peer_disconnected(uint64_t this_arg, int8_tArray their_node_id, jboolean no_connection_possible) {
+void __attribute__((export_name("TS_ChannelMessageHandler_peer_disconnected"))) TS_ChannelMessageHandler_peer_disconnected(uint64_t this_arg, int8_tArray their_node_id) {
void* this_arg_ptr = untag_ptr(this_arg);
if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK(their_node_id->arr_len == 33);
memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
- (this_arg_conv->peer_disconnected)(this_arg_conv->this_arg, their_node_id_ref, no_connection_possible);
+ (this_arg_conv->peer_disconnected)(this_arg_conv->this_arg, their_node_id_ref);
}
-void __attribute__((export_name("TS_ChannelMessageHandler_peer_connected"))) TS_ChannelMessageHandler_peer_connected(uint64_t this_arg, int8_tArray their_node_id, uint64_t msg) {
+uint64_t __attribute__((export_name("TS_ChannelMessageHandler_peer_connected"))) TS_ChannelMessageHandler_peer_connected(uint64_t this_arg, int8_tArray their_node_id, uint64_t msg, jboolean inbound) {
void* this_arg_ptr = untag_ptr(this_arg);
if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
msg_conv.is_owned = ptr_is_owned(msg);
CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
msg_conv.is_owned = false;
- (this_arg_conv->peer_connected)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
+ LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
+ *ret_conv = (this_arg_conv->peer_connected)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv, inbound);
+ return tag_ptr(ret_conv, true);
}
void __attribute__((export_name("TS_ChannelMessageHandler_handle_channel_reestablish"))) TS_ChannelMessageHandler_handle_channel_reestablish(uint64_t this_arg, int8_tArray their_node_id, uint64_t msg) {
(this_arg_conv->handle_error)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
}
+uint64_t __attribute__((export_name("TS_ChannelMessageHandler_provided_node_features"))) TS_ChannelMessageHandler_provided_node_features(uint64_t this_arg) {
+ void* this_arg_ptr = untag_ptr(this_arg);
+ if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
+ LDKNodeFeatures ret_var = (this_arg_conv->provided_node_features)(this_arg_conv->this_arg);
+ uint64_t ret_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ return ret_ref;
+}
+
+uint64_t __attribute__((export_name("TS_ChannelMessageHandler_provided_init_features"))) TS_ChannelMessageHandler_provided_init_features(uint64_t this_arg, int8_tArray their_node_id) {
+ void* this_arg_ptr = untag_ptr(this_arg);
+ if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
+ LDKPublicKey their_node_id_ref;
+ CHECK(their_node_id->arr_len == 33);
+ memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
+ LDKInitFeatures ret_var = (this_arg_conv->provided_init_features)(this_arg_conv->this_arg, their_node_id_ref);
+ uint64_t ret_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ return ret_ref;
+}
+
typedef struct LDKRoutingMessageHandler_JCalls {
atomic_size_t refcnt;
uint32_t instance_ptr;
msg_var = NodeAnnouncement_clone(&msg_var);
CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
- uint32_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 75, msg_ref, 0, 0, 0, 0, 0);
+ uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 89, msg_ref, 0, 0, 0, 0, 0);
void* ret_ptr = untag_ptr(ret);
CHECK_ACCESS(ret_ptr);
LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr);
msg_var = ChannelAnnouncement_clone(&msg_var);
CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
- uint32_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 76, msg_ref, 0, 0, 0, 0, 0);
+ uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 90, msg_ref, 0, 0, 0, 0, 0);
void* ret_ptr = untag_ptr(ret);
CHECK_ACCESS(ret_ptr);
LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr);
msg_var = ChannelUpdate_clone(&msg_var);
CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
- uint32_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 77, msg_ref, 0, 0, 0, 0, 0);
+ uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 91, msg_ref, 0, 0, 0, 0, 0);
void* ret_ptr = untag_ptr(ret);
CHECK_ACCESS(ret_ptr);
LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr);
FREE(untag_ptr(ret));
return ret_conv;
}
-LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ get_next_channel_announcements_LDKRoutingMessageHandler_jcall(const void* this_arg, uint64_t starting_point, uint8_t batch_amount) {
+LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ get_next_channel_announcement_LDKRoutingMessageHandler_jcall(const void* this_arg, uint64_t starting_point) {
LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
int64_t starting_point_conv = starting_point;
- int8_t batch_amount_conv = batch_amount;
- uint64_tArray ret = (uint64_tArray)js_invoke_function_buuuuu(j_calls->instance_ptr, 78, starting_point_conv, batch_amount_conv, 0, 0, 0, 0);
- LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ ret_constr;
- ret_constr.datalen = ret->arr_len;
- if (ret_constr.datalen > 0)
- ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ Elements");
- else
- ret_constr.data = NULL;
- uint64_t* ret_vals = ret->elems;
- for (size_t h = 0; h < ret_constr.datalen; h++) {
- uint64_t ret_conv_59 = ret_vals[h];
- void* ret_conv_59_ptr = untag_ptr(ret_conv_59);
- CHECK_ACCESS(ret_conv_59_ptr);
- LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ ret_conv_59_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(ret_conv_59_ptr);
- FREE(untag_ptr(ret_conv_59));
- ret_constr.data[h] = ret_conv_59_conv;
- }
- FREE(ret);
- return ret_constr;
+ uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 92, starting_point_conv, 0, 0, 0, 0, 0);
+ void* ret_ptr = untag_ptr(ret);
+ CHECK_ACCESS(ret_ptr);
+ LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ ret_conv = *(LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ*)(ret_ptr);
+ FREE(untag_ptr(ret));
+ return ret_conv;
}
-LDKCVec_NodeAnnouncementZ get_next_node_announcements_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey starting_point, uint8_t batch_amount) {
+LDKNodeAnnouncement get_next_node_announcement_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKNodeId starting_point) {
LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
- int8_tArray starting_point_arr = init_int8_tArray(33, __LINE__);
- memcpy(starting_point_arr->elems, starting_point.compressed_form, 33);
- int8_t batch_amount_conv = batch_amount;
- uint64_tArray ret = (uint64_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 79, (uint32_t)starting_point_arr, batch_amount_conv, 0, 0, 0, 0);
- LDKCVec_NodeAnnouncementZ ret_constr;
- ret_constr.datalen = ret->arr_len;
- if (ret_constr.datalen > 0)
- ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKNodeAnnouncement), "LDKCVec_NodeAnnouncementZ Elements");
- else
- ret_constr.data = NULL;
- uint64_t* ret_vals = ret->elems;
- for (size_t s = 0; s < ret_constr.datalen; s++) {
- uint64_t ret_conv_18 = ret_vals[s];
- LDKNodeAnnouncement ret_conv_18_conv;
- ret_conv_18_conv.inner = untag_ptr(ret_conv_18);
- ret_conv_18_conv.is_owned = ptr_is_owned(ret_conv_18);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_18_conv);
- ret_constr.data[s] = ret_conv_18_conv;
- }
- FREE(ret);
- return ret_constr;
+ LDKNodeId starting_point_var = starting_point;
+ uint64_t starting_point_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(starting_point_var);
+ starting_point_ref = tag_ptr(starting_point_var.inner, starting_point_var.is_owned);
+ uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 93, starting_point_ref, 0, 0, 0, 0, 0);
+ LDKNodeAnnouncement ret_conv;
+ ret_conv.inner = untag_ptr(ret);
+ ret_conv.is_owned = ptr_is_owned(ret);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv);
+ return ret_conv;
}
-void peer_connected_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit * init) {
+LDKCResult_NoneNoneZ peer_connected_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit * init, bool inbound) {
LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
init_var = Init_clone(&init_var);
CHECK_INNER_FIELD_ACCESS_OR_NULL(init_var);
init_ref = tag_ptr(init_var.inner, init_var.is_owned);
- js_invoke_function_ubuuuu(j_calls->instance_ptr, 80, (uint32_t)their_node_id_arr, init_ref, 0, 0, 0, 0);
+ jboolean inbound_conv = inbound;
+ uint64_t ret = js_invoke_function_ubuuuu(j_calls->instance_ptr, 94, (uint32_t)their_node_id_arr, init_ref, inbound_conv, 0, 0, 0);
+ void* ret_ptr = untag_ptr(ret);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr);
+ FREE(untag_ptr(ret));
+ return ret_conv;
}
LDKCResult_NoneLightningErrorZ handle_reply_channel_range_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKReplyChannelRange msg) {
LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
uint64_t msg_ref = 0;
CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
- uint32_t ret = js_invoke_function_ubuuuu(j_calls->instance_ptr, 81, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
+ uint64_t ret = js_invoke_function_ubuuuu(j_calls->instance_ptr, 95, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
void* ret_ptr = untag_ptr(ret);
CHECK_ACCESS(ret_ptr);
LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
uint64_t msg_ref = 0;
CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
- uint32_t ret = js_invoke_function_ubuuuu(j_calls->instance_ptr, 82, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
+ uint64_t ret = js_invoke_function_ubuuuu(j_calls->instance_ptr, 96, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
void* ret_ptr = untag_ptr(ret);
CHECK_ACCESS(ret_ptr);
LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
uint64_t msg_ref = 0;
CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
- uint32_t ret = js_invoke_function_ubuuuu(j_calls->instance_ptr, 83, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
+ uint64_t ret = js_invoke_function_ubuuuu(j_calls->instance_ptr, 97, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
void* ret_ptr = untag_ptr(ret);
CHECK_ACCESS(ret_ptr);
LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
uint64_t msg_ref = 0;
CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
- uint32_t ret = js_invoke_function_ubuuuu(j_calls->instance_ptr, 84, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
+ uint64_t ret = js_invoke_function_ubuuuu(j_calls->instance_ptr, 98, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
void* ret_ptr = untag_ptr(ret);
CHECK_ACCESS(ret_ptr);
LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
FREE(untag_ptr(ret));
return ret_conv;
}
+bool processing_queue_high_LDKRoutingMessageHandler_jcall(const void* this_arg) {
+ LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
+ return js_invoke_function_uuuuuu(j_calls->instance_ptr, 99, 0, 0, 0, 0, 0, 0);
+}
+LDKNodeFeatures provided_node_features_LDKRoutingMessageHandler_jcall(const void* this_arg) {
+ LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
+ uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 100, 0, 0, 0, 0, 0, 0);
+ LDKNodeFeatures ret_conv;
+ ret_conv.inner = untag_ptr(ret);
+ ret_conv.is_owned = ptr_is_owned(ret);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv);
+ return ret_conv;
+}
+LDKInitFeatures provided_init_features_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id) {
+ LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
+ int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
+ memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
+ uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 101, (uint32_t)their_node_id_arr, 0, 0, 0, 0, 0);
+ LDKInitFeatures ret_conv;
+ ret_conv.inner = untag_ptr(ret);
+ ret_conv.is_owned = ptr_is_owned(ret);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv);
+ return ret_conv;
+}
static void LDKRoutingMessageHandler_JCalls_cloned(LDKRoutingMessageHandler* new_obj) {
LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) new_obj->this_arg;
atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
.handle_node_announcement = handle_node_announcement_LDKRoutingMessageHandler_jcall,
.handle_channel_announcement = handle_channel_announcement_LDKRoutingMessageHandler_jcall,
.handle_channel_update = handle_channel_update_LDKRoutingMessageHandler_jcall,
- .get_next_channel_announcements = get_next_channel_announcements_LDKRoutingMessageHandler_jcall,
- .get_next_node_announcements = get_next_node_announcements_LDKRoutingMessageHandler_jcall,
+ .get_next_channel_announcement = get_next_channel_announcement_LDKRoutingMessageHandler_jcall,
+ .get_next_node_announcement = get_next_node_announcement_LDKRoutingMessageHandler_jcall,
.peer_connected = peer_connected_LDKRoutingMessageHandler_jcall,
.handle_reply_channel_range = handle_reply_channel_range_LDKRoutingMessageHandler_jcall,
.handle_reply_short_channel_ids_end = handle_reply_short_channel_ids_end_LDKRoutingMessageHandler_jcall,
.handle_query_channel_range = handle_query_channel_range_LDKRoutingMessageHandler_jcall,
.handle_query_short_channel_ids = handle_query_short_channel_ids_LDKRoutingMessageHandler_jcall,
+ .processing_queue_high = processing_queue_high_LDKRoutingMessageHandler_jcall,
+ .provided_node_features = provided_node_features_LDKRoutingMessageHandler_jcall,
+ .provided_init_features = provided_init_features_LDKRoutingMessageHandler_jcall,
.free = LDKRoutingMessageHandler_JCalls_free,
.MessageSendEventsProvider = LDKMessageSendEventsProvider_init(MessageSendEventsProvider),
};
return tag_ptr(ret_conv, true);
}
-uint64_tArray __attribute__((export_name("TS_RoutingMessageHandler_get_next_channel_announcements"))) TS_RoutingMessageHandler_get_next_channel_announcements(uint64_t this_arg, int64_t starting_point, int8_t batch_amount) {
+uint64_t __attribute__((export_name("TS_RoutingMessageHandler_get_next_channel_announcement"))) TS_RoutingMessageHandler_get_next_channel_announcement(uint64_t this_arg, int64_t starting_point) {
void* this_arg_ptr = untag_ptr(this_arg);
if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
- LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ ret_var = (this_arg_conv->get_next_channel_announcements)(this_arg_conv->this_arg, starting_point, batch_amount);
- uint64_tArray ret_arr = NULL;
- ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
- uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
- for (size_t h = 0; h < ret_var.datalen; h++) {
- LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret_conv_59_conv = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ");
- *ret_conv_59_conv = ret_var.data[h];
- ret_arr_ptr[h] = tag_ptr(ret_conv_59_conv, true);
- }
-
- FREE(ret_var.data);
- return ret_arr;
+ LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *ret_copy = MALLOC(sizeof(LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ), "LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ");
+ *ret_copy = (this_arg_conv->get_next_channel_announcement)(this_arg_conv->this_arg, starting_point);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
}
-uint64_tArray __attribute__((export_name("TS_RoutingMessageHandler_get_next_node_announcements"))) TS_RoutingMessageHandler_get_next_node_announcements(uint64_t this_arg, int8_tArray starting_point, int8_t batch_amount) {
+uint64_t __attribute__((export_name("TS_RoutingMessageHandler_get_next_node_announcement"))) TS_RoutingMessageHandler_get_next_node_announcement(uint64_t this_arg, uint64_t starting_point) {
void* this_arg_ptr = untag_ptr(this_arg);
if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
- LDKPublicKey starting_point_ref;
- CHECK(starting_point->arr_len == 33);
- memcpy(starting_point_ref.compressed_form, starting_point->elems, 33); FREE(starting_point);
- LDKCVec_NodeAnnouncementZ ret_var = (this_arg_conv->get_next_node_announcements)(this_arg_conv->this_arg, starting_point_ref, batch_amount);
- uint64_tArray ret_arr = NULL;
- ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
- uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
- for (size_t s = 0; s < ret_var.datalen; s++) {
- LDKNodeAnnouncement ret_conv_18_var = ret_var.data[s];
- uint64_t ret_conv_18_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_18_var);
- ret_conv_18_ref = tag_ptr(ret_conv_18_var.inner, ret_conv_18_var.is_owned);
- ret_arr_ptr[s] = ret_conv_18_ref;
- }
-
- FREE(ret_var.data);
- return ret_arr;
+ LDKNodeId starting_point_conv;
+ starting_point_conv.inner = untag_ptr(starting_point);
+ starting_point_conv.is_owned = ptr_is_owned(starting_point);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(starting_point_conv);
+ starting_point_conv = NodeId_clone(&starting_point_conv);
+ LDKNodeAnnouncement ret_var = (this_arg_conv->get_next_node_announcement)(this_arg_conv->this_arg, starting_point_conv);
+ uint64_t ret_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ return ret_ref;
}
-void __attribute__((export_name("TS_RoutingMessageHandler_peer_connected"))) TS_RoutingMessageHandler_peer_connected(uint64_t this_arg, int8_tArray their_node_id, uint64_t init) {
+uint64_t __attribute__((export_name("TS_RoutingMessageHandler_peer_connected"))) TS_RoutingMessageHandler_peer_connected(uint64_t this_arg, int8_tArray their_node_id, uint64_t init, jboolean inbound) {
void* this_arg_ptr = untag_ptr(this_arg);
if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
init_conv.is_owned = ptr_is_owned(init);
CHECK_INNER_FIELD_ACCESS_OR_NULL(init_conv);
init_conv.is_owned = false;
- (this_arg_conv->peer_connected)(this_arg_conv->this_arg, their_node_id_ref, &init_conv);
+ LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
+ *ret_conv = (this_arg_conv->peer_connected)(this_arg_conv->this_arg, their_node_id_ref, &init_conv, inbound);
+ return tag_ptr(ret_conv, true);
}
uint64_t __attribute__((export_name("TS_RoutingMessageHandler_handle_reply_channel_range"))) TS_RoutingMessageHandler_handle_reply_channel_range(uint64_t this_arg, int8_tArray their_node_id, uint64_t msg) {
return tag_ptr(ret_conv, true);
}
+jboolean __attribute__((export_name("TS_RoutingMessageHandler_processing_queue_high"))) TS_RoutingMessageHandler_processing_queue_high(uint64_t this_arg) {
+ void* this_arg_ptr = untag_ptr(this_arg);
+ if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
+ jboolean ret_conv = (this_arg_conv->processing_queue_high)(this_arg_conv->this_arg);
+ return ret_conv;
+}
+
+uint64_t __attribute__((export_name("TS_RoutingMessageHandler_provided_node_features"))) TS_RoutingMessageHandler_provided_node_features(uint64_t this_arg) {
+ void* this_arg_ptr = untag_ptr(this_arg);
+ if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
+ LDKNodeFeatures ret_var = (this_arg_conv->provided_node_features)(this_arg_conv->this_arg);
+ uint64_t ret_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ return ret_ref;
+}
+
+uint64_t __attribute__((export_name("TS_RoutingMessageHandler_provided_init_features"))) TS_RoutingMessageHandler_provided_init_features(uint64_t this_arg, int8_tArray their_node_id) {
+ void* this_arg_ptr = untag_ptr(this_arg);
+ if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
+ LDKPublicKey their_node_id_ref;
+ CHECK(their_node_id->arr_len == 33);
+ memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
+ LDKInitFeatures ret_var = (this_arg_conv->provided_init_features)(this_arg_conv->this_arg, their_node_id_ref);
+ uint64_t ret_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ return ret_ref;
+}
+
+typedef struct LDKOnionMessageHandler_JCalls {
+ atomic_size_t refcnt;
+ uint32_t instance_ptr;
+ LDKOnionMessageProvider_JCalls* OnionMessageProvider;
+} LDKOnionMessageHandler_JCalls;
+static void LDKOnionMessageHandler_JCalls_free(void* this_arg) {
+ LDKOnionMessageHandler_JCalls *j_calls = (LDKOnionMessageHandler_JCalls*) this_arg;
+ if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
+ FREE(j_calls);
+ }
+}
+void handle_onion_message_LDKOnionMessageHandler_jcall(const void* this_arg, LDKPublicKey peer_node_id, const LDKOnionMessage * msg) {
+ LDKOnionMessageHandler_JCalls *j_calls = (LDKOnionMessageHandler_JCalls*) this_arg;
+ int8_tArray peer_node_id_arr = init_int8_tArray(33, __LINE__);
+ memcpy(peer_node_id_arr->elems, peer_node_id.compressed_form, 33);
+ LDKOnionMessage msg_var = *msg;
+ uint64_t msg_ref = 0;
+ msg_var = OnionMessage_clone(&msg_var);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
+ msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
+ js_invoke_function_ubuuuu(j_calls->instance_ptr, 102, (uint32_t)peer_node_id_arr, msg_ref, 0, 0, 0, 0);
+}
+LDKCResult_NoneNoneZ peer_connected_LDKOnionMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit * init, bool inbound) {
+ LDKOnionMessageHandler_JCalls *j_calls = (LDKOnionMessageHandler_JCalls*) this_arg;
+ int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
+ memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
+ LDKInit init_var = *init;
+ uint64_t init_ref = 0;
+ init_var = Init_clone(&init_var);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(init_var);
+ init_ref = tag_ptr(init_var.inner, init_var.is_owned);
+ jboolean inbound_conv = inbound;
+ uint64_t ret = js_invoke_function_ubuuuu(j_calls->instance_ptr, 103, (uint32_t)their_node_id_arr, init_ref, inbound_conv, 0, 0, 0);
+ void* ret_ptr = untag_ptr(ret);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr);
+ FREE(untag_ptr(ret));
+ return ret_conv;
+}
+void peer_disconnected_LDKOnionMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id) {
+ LDKOnionMessageHandler_JCalls *j_calls = (LDKOnionMessageHandler_JCalls*) this_arg;
+ int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
+ memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
+ js_invoke_function_uuuuuu(j_calls->instance_ptr, 104, (uint32_t)their_node_id_arr, 0, 0, 0, 0, 0);
+}
+LDKNodeFeatures provided_node_features_LDKOnionMessageHandler_jcall(const void* this_arg) {
+ LDKOnionMessageHandler_JCalls *j_calls = (LDKOnionMessageHandler_JCalls*) this_arg;
+ uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 105, 0, 0, 0, 0, 0, 0);
+ LDKNodeFeatures ret_conv;
+ ret_conv.inner = untag_ptr(ret);
+ ret_conv.is_owned = ptr_is_owned(ret);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv);
+ return ret_conv;
+}
+LDKInitFeatures provided_init_features_LDKOnionMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id) {
+ LDKOnionMessageHandler_JCalls *j_calls = (LDKOnionMessageHandler_JCalls*) this_arg;
+ int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
+ memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
+ uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 106, (uint32_t)their_node_id_arr, 0, 0, 0, 0, 0);
+ LDKInitFeatures ret_conv;
+ ret_conv.inner = untag_ptr(ret);
+ ret_conv.is_owned = ptr_is_owned(ret);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv);
+ return ret_conv;
+}
+static void LDKOnionMessageHandler_JCalls_cloned(LDKOnionMessageHandler* new_obj) {
+ LDKOnionMessageHandler_JCalls *j_calls = (LDKOnionMessageHandler_JCalls*) new_obj->this_arg;
+ atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
+ atomic_fetch_add_explicit(&j_calls->OnionMessageProvider->refcnt, 1, memory_order_release);
+}
+static inline LDKOnionMessageHandler LDKOnionMessageHandler_init (JSValue o, JSValue OnionMessageProvider) {
+ LDKOnionMessageHandler_JCalls *calls = MALLOC(sizeof(LDKOnionMessageHandler_JCalls), "LDKOnionMessageHandler_JCalls");
+ atomic_init(&calls->refcnt, 1);
+ calls->instance_ptr = o;
+
+ LDKOnionMessageHandler ret = {
+ .this_arg = (void*) calls,
+ .handle_onion_message = handle_onion_message_LDKOnionMessageHandler_jcall,
+ .peer_connected = peer_connected_LDKOnionMessageHandler_jcall,
+ .peer_disconnected = peer_disconnected_LDKOnionMessageHandler_jcall,
+ .provided_node_features = provided_node_features_LDKOnionMessageHandler_jcall,
+ .provided_init_features = provided_init_features_LDKOnionMessageHandler_jcall,
+ .free = LDKOnionMessageHandler_JCalls_free,
+ .OnionMessageProvider = LDKOnionMessageProvider_init(OnionMessageProvider),
+ };
+ calls->OnionMessageProvider = ret.OnionMessageProvider.this_arg;
+ return ret;
+}
+uint64_t __attribute__((export_name("TS_LDKOnionMessageHandler_new"))) TS_LDKOnionMessageHandler_new(JSValue o, JSValue OnionMessageProvider) {
+ LDKOnionMessageHandler *res_ptr = MALLOC(sizeof(LDKOnionMessageHandler), "LDKOnionMessageHandler");
+ *res_ptr = LDKOnionMessageHandler_init(o, OnionMessageProvider);
+ return tag_ptr(res_ptr, true);
+}
+void __attribute__((export_name("TS_OnionMessageHandler_handle_onion_message"))) TS_OnionMessageHandler_handle_onion_message(uint64_t this_arg, int8_tArray peer_node_id, uint64_t msg) {
+ void* this_arg_ptr = untag_ptr(this_arg);
+ if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKOnionMessageHandler* this_arg_conv = (LDKOnionMessageHandler*)this_arg_ptr;
+ LDKPublicKey peer_node_id_ref;
+ CHECK(peer_node_id->arr_len == 33);
+ memcpy(peer_node_id_ref.compressed_form, peer_node_id->elems, 33); FREE(peer_node_id);
+ LDKOnionMessage msg_conv;
+ msg_conv.inner = untag_ptr(msg);
+ msg_conv.is_owned = ptr_is_owned(msg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
+ msg_conv.is_owned = false;
+ (this_arg_conv->handle_onion_message)(this_arg_conv->this_arg, peer_node_id_ref, &msg_conv);
+}
+
+uint64_t __attribute__((export_name("TS_OnionMessageHandler_peer_connected"))) TS_OnionMessageHandler_peer_connected(uint64_t this_arg, int8_tArray their_node_id, uint64_t init, jboolean inbound) {
+ void* this_arg_ptr = untag_ptr(this_arg);
+ if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKOnionMessageHandler* this_arg_conv = (LDKOnionMessageHandler*)this_arg_ptr;
+ LDKPublicKey their_node_id_ref;
+ CHECK(their_node_id->arr_len == 33);
+ memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
+ LDKInit init_conv;
+ init_conv.inner = untag_ptr(init);
+ init_conv.is_owned = ptr_is_owned(init);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(init_conv);
+ init_conv.is_owned = false;
+ LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
+ *ret_conv = (this_arg_conv->peer_connected)(this_arg_conv->this_arg, their_node_id_ref, &init_conv, inbound);
+ return tag_ptr(ret_conv, true);
+}
+
+void __attribute__((export_name("TS_OnionMessageHandler_peer_disconnected"))) TS_OnionMessageHandler_peer_disconnected(uint64_t this_arg, int8_tArray their_node_id) {
+ void* this_arg_ptr = untag_ptr(this_arg);
+ if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKOnionMessageHandler* this_arg_conv = (LDKOnionMessageHandler*)this_arg_ptr;
+ LDKPublicKey their_node_id_ref;
+ CHECK(their_node_id->arr_len == 33);
+ memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
+ (this_arg_conv->peer_disconnected)(this_arg_conv->this_arg, their_node_id_ref);
+}
+
+uint64_t __attribute__((export_name("TS_OnionMessageHandler_provided_node_features"))) TS_OnionMessageHandler_provided_node_features(uint64_t this_arg) {
+ void* this_arg_ptr = untag_ptr(this_arg);
+ if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKOnionMessageHandler* this_arg_conv = (LDKOnionMessageHandler*)this_arg_ptr;
+ LDKNodeFeatures ret_var = (this_arg_conv->provided_node_features)(this_arg_conv->this_arg);
+ uint64_t ret_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ return ret_ref;
+}
+
+uint64_t __attribute__((export_name("TS_OnionMessageHandler_provided_init_features"))) TS_OnionMessageHandler_provided_init_features(uint64_t this_arg, int8_tArray their_node_id) {
+ void* this_arg_ptr = untag_ptr(this_arg);
+ if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKOnionMessageHandler* this_arg_conv = (LDKOnionMessageHandler*)this_arg_ptr;
+ LDKPublicKey their_node_id_ref;
+ CHECK(their_node_id->arr_len == 33);
+ memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
+ LDKInitFeatures ret_var = (this_arg_conv->provided_init_features)(this_arg_conv->this_arg, their_node_id_ref);
+ uint64_t ret_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ return ret_ref;
+}
+
typedef struct LDKCustomMessageReader_JCalls {
atomic_size_t refcnt;
uint32_t instance_ptr;
LDKu8slice buffer_var = buffer;
int8_tArray buffer_arr = init_int8_tArray(buffer_var.datalen, __LINE__);
memcpy(buffer_arr->elems, buffer_var.data, buffer_var.datalen);
- uint32_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 85, message_type_conv, (uint32_t)buffer_arr, 0, 0, 0, 0);
+ uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 107, message_type_conv, (uint32_t)buffer_arr, 0, 0, 0, 0);
void* ret_ptr = untag_ptr(ret);
CHECK_ACCESS(ret_ptr);
LDKCResult_COption_TypeZDecodeErrorZ ret_conv = *(LDKCResult_COption_TypeZDecodeErrorZ*)(ret_ptr);
*msg_ret = msg;
int8_tArray sender_node_id_arr = init_int8_tArray(33, __LINE__);
memcpy(sender_node_id_arr->elems, sender_node_id.compressed_form, 33);
- uint32_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 86, tag_ptr(msg_ret, true), (uint32_t)sender_node_id_arr, 0, 0, 0, 0);
+ uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 108, tag_ptr(msg_ret, true), (uint32_t)sender_node_id_arr, 0, 0, 0, 0);
void* ret_ptr = untag_ptr(ret);
CHECK_ACCESS(ret_ptr);
LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
}
LDKCVec_C2Tuple_PublicKeyTypeZZ get_and_clear_pending_msg_LDKCustomMessageHandler_jcall(const void* this_arg) {
LDKCustomMessageHandler_JCalls *j_calls = (LDKCustomMessageHandler_JCalls*) this_arg;
- uint64_tArray ret = (uint64_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 87, 0, 0, 0, 0, 0, 0);
+ uint64_tArray ret = (uint64_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 109, 0, 0, 0, 0, 0, 0);
LDKCVec_C2Tuple_PublicKeyTypeZZ ret_constr;
ret_constr.datalen = ret->arr_len;
if (ret_constr.datalen > 0)
return ret_arr;
}
+typedef struct LDKCustomOnionMessageHandler_JCalls {
+ atomic_size_t refcnt;
+ uint32_t instance_ptr;
+} LDKCustomOnionMessageHandler_JCalls;
+static void LDKCustomOnionMessageHandler_JCalls_free(void* this_arg) {
+ LDKCustomOnionMessageHandler_JCalls *j_calls = (LDKCustomOnionMessageHandler_JCalls*) this_arg;
+ if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
+ FREE(j_calls);
+ }
+}
+void handle_custom_message_LDKCustomOnionMessageHandler_jcall(const void* this_arg, LDKCustomOnionMessageContents msg) {
+ LDKCustomOnionMessageHandler_JCalls *j_calls = (LDKCustomOnionMessageHandler_JCalls*) this_arg;
+ LDKCustomOnionMessageContents* msg_ret = MALLOC(sizeof(LDKCustomOnionMessageContents), "LDKCustomOnionMessageContents");
+ *msg_ret = msg;
+ js_invoke_function_buuuuu(j_calls->instance_ptr, 110, tag_ptr(msg_ret, true), 0, 0, 0, 0, 0);
+}
+LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ read_custom_message_LDKCustomOnionMessageHandler_jcall(const void* this_arg, uint64_t message_type, LDKu8slice buffer) {
+ LDKCustomOnionMessageHandler_JCalls *j_calls = (LDKCustomOnionMessageHandler_JCalls*) this_arg;
+ int64_t message_type_conv = message_type;
+ LDKu8slice buffer_var = buffer;
+ int8_tArray buffer_arr = init_int8_tArray(buffer_var.datalen, __LINE__);
+ memcpy(buffer_arr->elems, buffer_var.data, buffer_var.datalen);
+ uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 111, message_type_conv, (uint32_t)buffer_arr, 0, 0, 0, 0);
+ void* ret_ptr = untag_ptr(ret);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ ret_conv = *(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ*)(ret_ptr);
+ FREE(untag_ptr(ret));
+ return ret_conv;
+}
+static void LDKCustomOnionMessageHandler_JCalls_cloned(LDKCustomOnionMessageHandler* new_obj) {
+ LDKCustomOnionMessageHandler_JCalls *j_calls = (LDKCustomOnionMessageHandler_JCalls*) new_obj->this_arg;
+ atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
+}
+static inline LDKCustomOnionMessageHandler LDKCustomOnionMessageHandler_init (JSValue o) {
+ LDKCustomOnionMessageHandler_JCalls *calls = MALLOC(sizeof(LDKCustomOnionMessageHandler_JCalls), "LDKCustomOnionMessageHandler_JCalls");
+ atomic_init(&calls->refcnt, 1);
+ calls->instance_ptr = o;
+
+ LDKCustomOnionMessageHandler ret = {
+ .this_arg = (void*) calls,
+ .handle_custom_message = handle_custom_message_LDKCustomOnionMessageHandler_jcall,
+ .read_custom_message = read_custom_message_LDKCustomOnionMessageHandler_jcall,
+ .free = LDKCustomOnionMessageHandler_JCalls_free,
+ };
+ return ret;
+}
+uint64_t __attribute__((export_name("TS_LDKCustomOnionMessageHandler_new"))) TS_LDKCustomOnionMessageHandler_new(JSValue o) {
+ LDKCustomOnionMessageHandler *res_ptr = MALLOC(sizeof(LDKCustomOnionMessageHandler), "LDKCustomOnionMessageHandler");
+ *res_ptr = LDKCustomOnionMessageHandler_init(o);
+ return tag_ptr(res_ptr, true);
+}
+void __attribute__((export_name("TS_CustomOnionMessageHandler_handle_custom_message"))) TS_CustomOnionMessageHandler_handle_custom_message(uint64_t this_arg, uint64_t msg) {
+ void* this_arg_ptr = untag_ptr(this_arg);
+ if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKCustomOnionMessageHandler* this_arg_conv = (LDKCustomOnionMessageHandler*)this_arg_ptr;
+ void* msg_ptr = untag_ptr(msg);
+ CHECK_ACCESS(msg_ptr);
+ LDKCustomOnionMessageContents msg_conv = *(LDKCustomOnionMessageContents*)(msg_ptr);
+ if (msg_conv.free == LDKCustomOnionMessageContents_JCalls_free) {
+ // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
+ LDKCustomOnionMessageContents_JCalls_cloned(&msg_conv);
+ }
+ (this_arg_conv->handle_custom_message)(this_arg_conv->this_arg, msg_conv);
+}
+
+uint64_t __attribute__((export_name("TS_CustomOnionMessageHandler_read_custom_message"))) TS_CustomOnionMessageHandler_read_custom_message(uint64_t this_arg, int64_t message_type, int8_tArray buffer) {
+ void* this_arg_ptr = untag_ptr(this_arg);
+ if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKCustomOnionMessageHandler* this_arg_conv = (LDKCustomOnionMessageHandler*)this_arg_ptr;
+ LDKu8slice buffer_ref;
+ buffer_ref.datalen = buffer->arr_len;
+ buffer_ref.data = buffer->elems;
+ LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ), "LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ");
+ *ret_conv = (this_arg_conv->read_custom_message)(this_arg_conv->this_arg, message_type, buffer_ref);
+ FREE(buffer);
+ return tag_ptr(ret_conv, true);
+}
+
typedef struct LDKSocketDescriptor_JCalls {
atomic_size_t refcnt;
uint32_t instance_ptr;
int8_tArray data_arr = init_int8_tArray(data_var.datalen, __LINE__);
memcpy(data_arr->elems, data_var.data, data_var.datalen);
jboolean resume_read_conv = resume_read;
- return js_invoke_function_uuuuuu(j_calls->instance_ptr, 88, (uint32_t)data_arr, resume_read_conv, 0, 0, 0, 0);
+ return js_invoke_function_uuuuuu(j_calls->instance_ptr, 112, (uint32_t)data_arr, resume_read_conv, 0, 0, 0, 0);
}
void disconnect_socket_LDKSocketDescriptor_jcall(void* this_arg) {
LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
- js_invoke_function_uuuuuu(j_calls->instance_ptr, 89, 0, 0, 0, 0, 0, 0);
+ js_invoke_function_uuuuuu(j_calls->instance_ptr, 113, 0, 0, 0, 0, 0, 0);
}
bool eq_LDKSocketDescriptor_jcall(const void* this_arg, const LDKSocketDescriptor * other_arg) {
LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
LDKSocketDescriptor *other_arg_clone = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor");
*other_arg_clone = SocketDescriptor_clone(other_arg);
- return js_invoke_function_buuuuu(j_calls->instance_ptr, 90, tag_ptr(other_arg_clone, true), 0, 0, 0, 0, 0);
+ return js_invoke_function_buuuuu(j_calls->instance_ptr, 114, tag_ptr(other_arg_clone, true), 0, 0, 0, 0, 0);
}
uint64_t hash_LDKSocketDescriptor_jcall(const void* this_arg) {
LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
- return js_invoke_function_uuuuuu(j_calls->instance_ptr, 91, 0, 0, 0, 0, 0, 0);
+ return js_invoke_function_uuuuuu(j_calls->instance_ptr, 115, 0, 0, 0, 0, 0, 0);
}
static void LDKSocketDescriptor_JCalls_cloned(LDKSocketDescriptor* new_obj) {
LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) new_obj->this_arg;
int64_t capacity_msat_conv = obj->total.capacity_msat;
return capacity_msat_conv;
}
-uint64_t __attribute__((export_name("TS_LDKEffectiveCapacity_Total_get_htlc_maximum_msat"))) TS_LDKEffectiveCapacity_Total_get_htlc_maximum_msat(uint64_t ptr) {
+int64_t __attribute__((export_name("TS_LDKEffectiveCapacity_Total_get_htlc_maximum_msat"))) TS_LDKEffectiveCapacity_Total_get_htlc_maximum_msat(uint64_t ptr) {
LDKEffectiveCapacity *obj = (LDKEffectiveCapacity*)untag_ptr(ptr);
assert(obj->tag == LDKEffectiveCapacity_Total);
- uint64_t htlc_maximum_msat_ref = tag_ptr(&obj->total.htlc_maximum_msat, false);
- return htlc_maximum_msat_ref;
+ int64_t htlc_maximum_msat_conv = obj->total.htlc_maximum_msat;
+ return htlc_maximum_msat_conv;
}
-typedef struct LDKLockableScore_JCalls {
- atomic_size_t refcnt;
- uint32_t instance_ptr;
-} LDKLockableScore_JCalls;
-static void LDKLockableScore_JCalls_free(void* this_arg) {
- LDKLockableScore_JCalls *j_calls = (LDKLockableScore_JCalls*) this_arg;
- if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
- FREE(j_calls);
+uint32_t __attribute__((export_name("TS_LDKDestination_ty_from_ptr"))) TS_LDKDestination_ty_from_ptr(uint64_t ptr) {
+ LDKDestination *obj = (LDKDestination*)untag_ptr(ptr);
+ switch(obj->tag) {
+ case LDKDestination_Node: return 0;
+ case LDKDestination_BlindedPath: return 1;
+ default: abort();
}
}
-LDKScore lock_LDKLockableScore_jcall(const void* this_arg) {
- LDKLockableScore_JCalls *j_calls = (LDKLockableScore_JCalls*) this_arg;
- uint32_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 92, 0, 0, 0, 0, 0, 0);
- void* ret_ptr = untag_ptr(ret);
- CHECK_ACCESS(ret_ptr);
- LDKScore ret_conv = *(LDKScore*)(ret_ptr);
- if (ret_conv.free == LDKScore_JCalls_free) {
- // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
- LDKScore_JCalls_cloned(&ret_conv);
- }// WARNING: we may need a move here but no clone is available for LDKScore
-
- return ret_conv;
-}
-static void LDKLockableScore_JCalls_cloned(LDKLockableScore* new_obj) {
- LDKLockableScore_JCalls *j_calls = (LDKLockableScore_JCalls*) new_obj->this_arg;
- atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
+int8_tArray __attribute__((export_name("TS_LDKDestination_Node_get_node"))) TS_LDKDestination_Node_get_node(uint64_t ptr) {
+ LDKDestination *obj = (LDKDestination*)untag_ptr(ptr);
+ assert(obj->tag == LDKDestination_Node);
+ int8_tArray node_arr = init_int8_tArray(33, __LINE__);
+ memcpy(node_arr->elems, obj->node.compressed_form, 33);
+ return node_arr;
+}
+uint64_t __attribute__((export_name("TS_LDKDestination_BlindedPath_get_blinded_path"))) TS_LDKDestination_BlindedPath_get_blinded_path(uint64_t ptr) {
+ LDKDestination *obj = (LDKDestination*)untag_ptr(ptr);
+ assert(obj->tag == LDKDestination_BlindedPath);
+ LDKBlindedPath blinded_path_var = obj->blinded_path;
+ uint64_t blinded_path_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(blinded_path_var);
+ blinded_path_ref = tag_ptr(blinded_path_var.inner, false);
+ return blinded_path_ref;
+}
+uint32_t __attribute__((export_name("TS_LDKOnionMessageContents_ty_from_ptr"))) TS_LDKOnionMessageContents_ty_from_ptr(uint64_t ptr) {
+ LDKOnionMessageContents *obj = (LDKOnionMessageContents*)untag_ptr(ptr);
+ switch(obj->tag) {
+ case LDKOnionMessageContents_Custom: return 0;
+ default: abort();
+ }
}
-static inline LDKLockableScore LDKLockableScore_init (JSValue o) {
- LDKLockableScore_JCalls *calls = MALLOC(sizeof(LDKLockableScore_JCalls), "LDKLockableScore_JCalls");
- atomic_init(&calls->refcnt, 1);
- calls->instance_ptr = o;
-
- LDKLockableScore ret = {
- .this_arg = (void*) calls,
- .lock = lock_LDKLockableScore_jcall,
- .free = LDKLockableScore_JCalls_free,
- };
- return ret;
+uint64_t __attribute__((export_name("TS_LDKOnionMessageContents_Custom_get_custom"))) TS_LDKOnionMessageContents_Custom_get_custom(uint64_t ptr) {
+ LDKOnionMessageContents *obj = (LDKOnionMessageContents*)untag_ptr(ptr);
+ assert(obj->tag == LDKOnionMessageContents_Custom);
+ LDKCustomOnionMessageContents* custom_ret = MALLOC(sizeof(LDKCustomOnionMessageContents), "LDKCustomOnionMessageContents");
+ *custom_ret = CustomOnionMessageContents_clone(&obj->custom);
+ return tag_ptr(custom_ret, true);
}
-uint64_t __attribute__((export_name("TS_LDKLockableScore_new"))) TS_LDKLockableScore_new(JSValue o) {
- LDKLockableScore *res_ptr = MALLOC(sizeof(LDKLockableScore), "LDKLockableScore");
- *res_ptr = LDKLockableScore_init(o);
- return tag_ptr(res_ptr, true);
+uint32_t __attribute__((export_name("TS_LDKGossipSync_ty_from_ptr"))) TS_LDKGossipSync_ty_from_ptr(uint64_t ptr) {
+ LDKGossipSync *obj = (LDKGossipSync*)untag_ptr(ptr);
+ switch(obj->tag) {
+ case LDKGossipSync_P2P: return 0;
+ case LDKGossipSync_Rapid: return 1;
+ case LDKGossipSync_None: return 2;
+ default: abort();
+ }
}
-uint64_t __attribute__((export_name("TS_LockableScore_lock"))) TS_LockableScore_lock(uint64_t this_arg) {
- void* this_arg_ptr = untag_ptr(this_arg);
- if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
- LDKLockableScore* this_arg_conv = (LDKLockableScore*)this_arg_ptr;
- LDKScore* ret_ret = MALLOC(sizeof(LDKScore), "LDKScore");
- *ret_ret = (this_arg_conv->lock)(this_arg_conv->this_arg);
- return tag_ptr(ret_ret, true);
+uint64_t __attribute__((export_name("TS_LDKGossipSync_P2P_get_p2p"))) TS_LDKGossipSync_P2P_get_p2p(uint64_t ptr) {
+ LDKGossipSync *obj = (LDKGossipSync*)untag_ptr(ptr);
+ assert(obj->tag == LDKGossipSync_P2P);
+ LDKP2PGossipSync p2p_var = obj->p2p;
+ uint64_t p2p_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(p2p_var);
+ p2p_ref = tag_ptr(p2p_var.inner, false);
+ return p2p_ref;
+}
+uint64_t __attribute__((export_name("TS_LDKGossipSync_Rapid_get_rapid"))) TS_LDKGossipSync_Rapid_get_rapid(uint64_t ptr) {
+ LDKGossipSync *obj = (LDKGossipSync*)untag_ptr(ptr);
+ assert(obj->tag == LDKGossipSync_Rapid);
+ LDKRapidGossipSync rapid_var = obj->rapid;
+ uint64_t rapid_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(rapid_var);
+ rapid_ref = tag_ptr(rapid_var.inner, false);
+ return rapid_ref;
}
-
uint32_t __attribute__((export_name("TS_LDKFallback_ty_from_ptr"))) TS_LDKFallback_ty_from_ptr(uint64_t ptr) {
LDKFallback *obj = (LDKFallback*)untag_ptr(ptr);
switch(obj->tag) {
memcpy(script_hash_arr->elems, obj->script_hash.data, 20);
return script_hash_arr;
}
-typedef struct LDKPayer_JCalls {
- atomic_size_t refcnt;
- uint32_t instance_ptr;
-} LDKPayer_JCalls;
-static void LDKPayer_JCalls_free(void* this_arg) {
- LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
- if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
- FREE(j_calls);
- }
-}
-LDKPublicKey node_id_LDKPayer_jcall(const void* this_arg) {
- LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
- int8_tArray ret = (int8_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 93, 0, 0, 0, 0, 0, 0);
- LDKPublicKey ret_ref;
- CHECK(ret->arr_len == 33);
- memcpy(ret_ref.compressed_form, ret->elems, 33); FREE(ret);
- return ret_ref;
-}
-LDKCVec_ChannelDetailsZ first_hops_LDKPayer_jcall(const void* this_arg) {
- LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
- uint64_tArray ret = (uint64_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 94, 0, 0, 0, 0, 0, 0);
- LDKCVec_ChannelDetailsZ ret_constr;
- ret_constr.datalen = ret->arr_len;
- if (ret_constr.datalen > 0)
- ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
- else
- ret_constr.data = NULL;
- uint64_t* ret_vals = ret->elems;
- for (size_t q = 0; q < ret_constr.datalen; q++) {
- uint64_t ret_conv_16 = ret_vals[q];
- LDKChannelDetails ret_conv_16_conv;
- ret_conv_16_conv.inner = untag_ptr(ret_conv_16);
- ret_conv_16_conv.is_owned = ptr_is_owned(ret_conv_16);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_conv);
- ret_constr.data[q] = ret_conv_16_conv;
- }
- FREE(ret);
- return ret_constr;
-}
-LDKCResult_PaymentIdPaymentSendFailureZ send_payment_LDKPayer_jcall(const void* this_arg, const LDKRoute * route, LDKThirtyTwoBytes payment_hash, LDKThirtyTwoBytes payment_secret) {
- LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
- LDKRoute route_var = *route;
- uint64_t route_ref = 0;
- route_var = Route_clone(&route_var);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(route_var);
- route_ref = tag_ptr(route_var.inner, route_var.is_owned);
- int8_tArray payment_hash_arr = init_int8_tArray(32, __LINE__);
- memcpy(payment_hash_arr->elems, payment_hash.data, 32);
- int8_tArray payment_secret_arr = init_int8_tArray(32, __LINE__);
- memcpy(payment_secret_arr->elems, payment_secret.data, 32);
- uint32_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 95, route_ref, (uint32_t)payment_hash_arr, (uint32_t)payment_secret_arr, 0, 0, 0);
- void* ret_ptr = untag_ptr(ret);
- CHECK_ACCESS(ret_ptr);
- LDKCResult_PaymentIdPaymentSendFailureZ ret_conv = *(LDKCResult_PaymentIdPaymentSendFailureZ*)(ret_ptr);
- FREE(untag_ptr(ret));
- return ret_conv;
-}
-LDKCResult_PaymentIdPaymentSendFailureZ send_spontaneous_payment_LDKPayer_jcall(const void* this_arg, const LDKRoute * route, LDKThirtyTwoBytes payment_preimage) {
- LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
- LDKRoute route_var = *route;
- uint64_t route_ref = 0;
- route_var = Route_clone(&route_var);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(route_var);
- route_ref = tag_ptr(route_var.inner, route_var.is_owned);
- int8_tArray payment_preimage_arr = init_int8_tArray(32, __LINE__);
- memcpy(payment_preimage_arr->elems, payment_preimage.data, 32);
- uint32_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 96, route_ref, (uint32_t)payment_preimage_arr, 0, 0, 0, 0);
- void* ret_ptr = untag_ptr(ret);
- CHECK_ACCESS(ret_ptr);
- LDKCResult_PaymentIdPaymentSendFailureZ ret_conv = *(LDKCResult_PaymentIdPaymentSendFailureZ*)(ret_ptr);
- FREE(untag_ptr(ret));
- return ret_conv;
-}
-LDKCResult_NonePaymentSendFailureZ retry_payment_LDKPayer_jcall(const void* this_arg, const LDKRoute * route, LDKThirtyTwoBytes payment_id) {
- LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
- LDKRoute route_var = *route;
- uint64_t route_ref = 0;
- route_var = Route_clone(&route_var);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(route_var);
- route_ref = tag_ptr(route_var.inner, route_var.is_owned);
- int8_tArray payment_id_arr = init_int8_tArray(32, __LINE__);
- memcpy(payment_id_arr->elems, payment_id.data, 32);
- uint32_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 97, route_ref, (uint32_t)payment_id_arr, 0, 0, 0, 0);
- void* ret_ptr = untag_ptr(ret);
- CHECK_ACCESS(ret_ptr);
- LDKCResult_NonePaymentSendFailureZ ret_conv = *(LDKCResult_NonePaymentSendFailureZ*)(ret_ptr);
- FREE(untag_ptr(ret));
- return ret_conv;
-}
-void abandon_payment_LDKPayer_jcall(const void* this_arg, LDKThirtyTwoBytes payment_id) {
- LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
- int8_tArray payment_id_arr = init_int8_tArray(32, __LINE__);
- memcpy(payment_id_arr->elems, payment_id.data, 32);
- js_invoke_function_uuuuuu(j_calls->instance_ptr, 98, (uint32_t)payment_id_arr, 0, 0, 0, 0, 0);
-}
-static void LDKPayer_JCalls_cloned(LDKPayer* new_obj) {
- LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) new_obj->this_arg;
- atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
-}
-static inline LDKPayer LDKPayer_init (JSValue o) {
- LDKPayer_JCalls *calls = MALLOC(sizeof(LDKPayer_JCalls), "LDKPayer_JCalls");
- atomic_init(&calls->refcnt, 1);
- calls->instance_ptr = o;
-
- LDKPayer ret = {
- .this_arg = (void*) calls,
- .node_id = node_id_LDKPayer_jcall,
- .first_hops = first_hops_LDKPayer_jcall,
- .send_payment = send_payment_LDKPayer_jcall,
- .send_spontaneous_payment = send_spontaneous_payment_LDKPayer_jcall,
- .retry_payment = retry_payment_LDKPayer_jcall,
- .abandon_payment = abandon_payment_LDKPayer_jcall,
- .free = LDKPayer_JCalls_free,
- };
- return ret;
-}
-uint64_t __attribute__((export_name("TS_LDKPayer_new"))) TS_LDKPayer_new(JSValue o) {
- LDKPayer *res_ptr = MALLOC(sizeof(LDKPayer), "LDKPayer");
- *res_ptr = LDKPayer_init(o);
- return tag_ptr(res_ptr, true);
-}
-int8_tArray __attribute__((export_name("TS_Payer_node_id"))) TS_Payer_node_id(uint64_t this_arg) {
- void* this_arg_ptr = untag_ptr(this_arg);
- if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
- LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr;
- int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
- memcpy(ret_arr->elems, (this_arg_conv->node_id)(this_arg_conv->this_arg).compressed_form, 33);
- return ret_arr;
-}
-
-uint64_tArray __attribute__((export_name("TS_Payer_first_hops"))) TS_Payer_first_hops(uint64_t this_arg) {
- void* this_arg_ptr = untag_ptr(this_arg);
- if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
- LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr;
- LDKCVec_ChannelDetailsZ ret_var = (this_arg_conv->first_hops)(this_arg_conv->this_arg);
- uint64_tArray ret_arr = NULL;
- ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
- uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
- for (size_t q = 0; q < ret_var.datalen; q++) {
- LDKChannelDetails ret_conv_16_var = ret_var.data[q];
- uint64_t ret_conv_16_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var);
- ret_conv_16_ref = tag_ptr(ret_conv_16_var.inner, ret_conv_16_var.is_owned);
- ret_arr_ptr[q] = ret_conv_16_ref;
- }
-
- FREE(ret_var.data);
- return ret_arr;
-}
-
-uint64_t __attribute__((export_name("TS_Payer_send_payment"))) TS_Payer_send_payment(uint64_t this_arg, uint64_t route, int8_tArray payment_hash, int8_tArray payment_secret) {
- void* this_arg_ptr = untag_ptr(this_arg);
- if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
- LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr;
- LDKRoute route_conv;
- route_conv.inner = untag_ptr(route);
- route_conv.is_owned = ptr_is_owned(route);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv);
- route_conv.is_owned = false;
- LDKThirtyTwoBytes payment_hash_ref;
- CHECK(payment_hash->arr_len == 32);
- memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
- LDKThirtyTwoBytes payment_secret_ref;
- CHECK(payment_secret->arr_len == 32);
- memcpy(payment_secret_ref.data, payment_secret->elems, 32); FREE(payment_secret);
- LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ");
- *ret_conv = (this_arg_conv->send_payment)(this_arg_conv->this_arg, &route_conv, payment_hash_ref, payment_secret_ref);
- return tag_ptr(ret_conv, true);
-}
-
-uint64_t __attribute__((export_name("TS_Payer_send_spontaneous_payment"))) TS_Payer_send_spontaneous_payment(uint64_t this_arg, uint64_t route, int8_tArray payment_preimage) {
- void* this_arg_ptr = untag_ptr(this_arg);
- if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
- LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr;
- LDKRoute route_conv;
- route_conv.inner = untag_ptr(route);
- route_conv.is_owned = ptr_is_owned(route);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv);
- route_conv.is_owned = false;
- LDKThirtyTwoBytes payment_preimage_ref;
- CHECK(payment_preimage->arr_len == 32);
- memcpy(payment_preimage_ref.data, payment_preimage->elems, 32); FREE(payment_preimage);
- LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ");
- *ret_conv = (this_arg_conv->send_spontaneous_payment)(this_arg_conv->this_arg, &route_conv, payment_preimage_ref);
- return tag_ptr(ret_conv, true);
-}
-
-uint64_t __attribute__((export_name("TS_Payer_retry_payment"))) TS_Payer_retry_payment(uint64_t this_arg, uint64_t route, int8_tArray payment_id) {
- void* this_arg_ptr = untag_ptr(this_arg);
- if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
- LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr;
- LDKRoute route_conv;
- route_conv.inner = untag_ptr(route);
- route_conv.is_owned = ptr_is_owned(route);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv);
- route_conv.is_owned = false;
- LDKThirtyTwoBytes payment_id_ref;
- CHECK(payment_id->arr_len == 32);
- memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id);
- LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
- *ret_conv = (this_arg_conv->retry_payment)(this_arg_conv->this_arg, &route_conv, payment_id_ref);
- return tag_ptr(ret_conv, true);
-}
-
-void __attribute__((export_name("TS_Payer_abandon_payment"))) TS_Payer_abandon_payment(uint64_t this_arg, int8_tArray payment_id) {
- void* this_arg_ptr = untag_ptr(this_arg);
- if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
- LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr;
- LDKThirtyTwoBytes payment_id_ref;
- CHECK(payment_id->arr_len == 32);
- memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id);
- (this_arg_conv->abandon_payment)(this_arg_conv->this_arg, payment_id_ref);
-}
-
-typedef struct LDKRouter_JCalls {
- atomic_size_t refcnt;
- uint32_t instance_ptr;
-} LDKRouter_JCalls;
-static void LDKRouter_JCalls_free(void* this_arg) {
- LDKRouter_JCalls *j_calls = (LDKRouter_JCalls*) this_arg;
- if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
- FREE(j_calls);
- }
-}
-LDKCResult_RouteLightningErrorZ find_route_LDKRouter_jcall(const void* this_arg, LDKPublicKey payer, const LDKRouteParameters * route_params, const uint8_t (* payment_hash)[32], LDKCVec_ChannelDetailsZ * first_hops, const LDKScore * scorer) {
- LDKRouter_JCalls *j_calls = (LDKRouter_JCalls*) this_arg;
- int8_tArray payer_arr = init_int8_tArray(33, __LINE__);
- memcpy(payer_arr->elems, payer.compressed_form, 33);
- LDKRouteParameters route_params_var = *route_params;
- uint64_t route_params_ref = 0;
- route_params_var = RouteParameters_clone(&route_params_var);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_var);
- route_params_ref = tag_ptr(route_params_var.inner, route_params_var.is_owned);
- int8_tArray payment_hash_arr = init_int8_tArray(32, __LINE__);
- memcpy(payment_hash_arr->elems, *payment_hash, 32);
- LDKCVec_ChannelDetailsZ *first_hops_var_ptr = first_hops;
- uint64_tArray first_hops_arr = NULL;
- if (first_hops != NULL) {
- LDKCVec_ChannelDetailsZ first_hops_var = *first_hops_var_ptr;
- first_hops_arr = init_uint64_tArray(first_hops_var.datalen, __LINE__);
- uint64_t *first_hops_arr_ptr = (uint64_t*)(((uint8_t*)first_hops_arr) + 8);
- for (size_t q = 0; q < first_hops_var.datalen; q++) {
- LDKChannelDetails first_hops_conv_16_var = first_hops_var.data[q];
- uint64_t first_hops_conv_16_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_var);
- first_hops_conv_16_ref = tag_ptr(first_hops_conv_16_var.inner, first_hops_conv_16_var.is_owned);
- first_hops_arr_ptr[q] = first_hops_conv_16_ref;
- }
-
- }
- // WARNING: This object doesn't live past this scope, needs clone!
- uint64_t ret_scorer = tag_ptr(scorer, false);
- uint32_t ret = js_invoke_function_ubuubu(j_calls->instance_ptr, 99, (uint32_t)payer_arr, route_params_ref, (uint32_t)payment_hash_arr, (uint32_t)first_hops_arr, ret_scorer, 0);
- void* ret_ptr = untag_ptr(ret);
- CHECK_ACCESS(ret_ptr);
- LDKCResult_RouteLightningErrorZ ret_conv = *(LDKCResult_RouteLightningErrorZ*)(ret_ptr);
- FREE(untag_ptr(ret));
- return ret_conv;
-}
-static void LDKRouter_JCalls_cloned(LDKRouter* new_obj) {
- LDKRouter_JCalls *j_calls = (LDKRouter_JCalls*) new_obj->this_arg;
- atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
-}
-static inline LDKRouter LDKRouter_init (JSValue o) {
- LDKRouter_JCalls *calls = MALLOC(sizeof(LDKRouter_JCalls), "LDKRouter_JCalls");
- atomic_init(&calls->refcnt, 1);
- calls->instance_ptr = o;
-
- LDKRouter ret = {
- .this_arg = (void*) calls,
- .find_route = find_route_LDKRouter_jcall,
- .free = LDKRouter_JCalls_free,
- };
- return ret;
-}
-uint64_t __attribute__((export_name("TS_LDKRouter_new"))) TS_LDKRouter_new(JSValue o) {
- LDKRouter *res_ptr = MALLOC(sizeof(LDKRouter), "LDKRouter");
- *res_ptr = LDKRouter_init(o);
- return tag_ptr(res_ptr, true);
-}
-uint64_t __attribute__((export_name("TS_Router_find_route"))) TS_Router_find_route(uint64_t this_arg, int8_tArray payer, uint64_t route_params, int8_tArray payment_hash, uint64_tArray first_hops, uint64_t scorer) {
- void* this_arg_ptr = untag_ptr(this_arg);
- if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
- LDKRouter* this_arg_conv = (LDKRouter*)this_arg_ptr;
- LDKPublicKey payer_ref;
- CHECK(payer->arr_len == 33);
- memcpy(payer_ref.compressed_form, payer->elems, 33); FREE(payer);
- LDKRouteParameters route_params_conv;
- route_params_conv.inner = untag_ptr(route_params);
- route_params_conv.is_owned = ptr_is_owned(route_params);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_conv);
- route_params_conv.is_owned = false;
- unsigned char payment_hash_arr[32];
- CHECK(payment_hash->arr_len == 32);
- memcpy(payment_hash_arr, payment_hash->elems, 32); FREE(payment_hash);
- unsigned char (*payment_hash_ref)[32] = &payment_hash_arr;
- LDKCVec_ChannelDetailsZ first_hops_constr;
- LDKCVec_ChannelDetailsZ *first_hops_ptr = NULL;
- if (first_hops != 0) {
- first_hops_constr.datalen = first_hops->arr_len;
- if (first_hops_constr.datalen > 0)
- first_hops_constr.data = MALLOC(first_hops_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
- else
- first_hops_constr.data = NULL;
- uint64_t* first_hops_vals = first_hops->elems;
- for (size_t q = 0; q < first_hops_constr.datalen; q++) {
- uint64_t first_hops_conv_16 = first_hops_vals[q];
- LDKChannelDetails first_hops_conv_16_conv;
- first_hops_conv_16_conv.inner = untag_ptr(first_hops_conv_16);
- first_hops_conv_16_conv.is_owned = ptr_is_owned(first_hops_conv_16);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_conv);
- first_hops_conv_16_conv.is_owned = false;
- first_hops_constr.data[q] = first_hops_conv_16_conv;
- }
- FREE(first_hops);
- first_hops_ptr = &first_hops_constr;
- }
- void* scorer_ptr = untag_ptr(scorer);
- if (ptr_is_owned(scorer)) { CHECK_ACCESS(scorer_ptr); }
- LDKScore* scorer_conv = (LDKScore*)scorer_ptr;
- LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
- *ret_conv = (this_arg_conv->find_route)(this_arg_conv->this_arg, payer_ref, &route_params_conv, payment_hash_ref, first_hops_ptr, scorer_conv);
- if (first_hops_ptr != NULL) { FREE(first_hops_constr.data); }
- return tag_ptr(ret_conv, true);
-}
-
-uint32_t __attribute__((export_name("TS_LDKRetry_ty_from_ptr"))) TS_LDKRetry_ty_from_ptr(uint64_t ptr) {
- LDKRetry *obj = (LDKRetry*)untag_ptr(ptr);
- switch(obj->tag) {
- case LDKRetry_Attempts: return 0;
- default: abort();
- }
-}
-uint32_t __attribute__((export_name("TS_LDKRetry_Attempts_get_attempts"))) TS_LDKRetry_Attempts_get_attempts(uint64_t ptr) {
- LDKRetry *obj = (LDKRetry*)untag_ptr(ptr);
- assert(obj->tag == LDKRetry_Attempts);
- uint32_t attempts_conv = obj->attempts;
- return attempts_conv;
-}
jstring __attribute__((export_name("TS__ldk_get_compiled_version"))) TS__ldk_get_compiled_version() {
LDKStr ret_str = _ldk_get_compiled_version();
jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
return ret_conv;
}
+int8_tArray __attribute__((export_name("TS_U128_le_bytes"))) TS_U128_le_bytes(int8_tArray val) {
+ LDKU128 val_ref;
+ CHECK(val->arr_len == 16);
+ memcpy(val_ref.le_bytes, val->elems, 16); FREE(val);
+ int8_tArray ret_arr = init_int8_tArray(16, __LINE__);
+ memcpy(ret_arr->elems, U128_le_bytes(val_ref).data, 16);
+ return ret_arr;
+}
+
+int8_tArray __attribute__((export_name("TS_U128_new"))) TS_U128_new(int8_tArray le_bytes) {
+ LDKSixteenBytes le_bytes_ref;
+ CHECK(le_bytes->arr_len == 16);
+ memcpy(le_bytes_ref.data, le_bytes->elems, 16); FREE(le_bytes);
+ int8_tArray ret_arr = init_int8_tArray(16, __LINE__);
+ memcpy(ret_arr->elems, U128_new(le_bytes_ref).le_bytes, 16);
+ return ret_arr;
+}
+
+uint64_t __attribute__((export_name("TS_BigEndianScalar_new"))) TS_BigEndianScalar_new(int8_tArray big_endian_bytes) {
+ LDKThirtyTwoBytes big_endian_bytes_ref;
+ CHECK(big_endian_bytes->arr_len == 32);
+ memcpy(big_endian_bytes_ref.data, big_endian_bytes->elems, 32); FREE(big_endian_bytes);
+ LDKBigEndianScalar* ret_ref = MALLOC(sizeof(LDKBigEndianScalar), "LDKBigEndianScalar");
+ *ret_ref = BigEndianScalar_new(big_endian_bytes_ref);
+ return tag_ptr(ret_ref, true);
+}
+
static inline uint64_t Bech32Error_clone_ptr(LDKBech32Error *NONNULL_PTR arg) {
LDKBech32Error *ret_copy = MALLOC(sizeof(LDKBech32Error), "LDKBech32Error");
*ret_copy = Bech32Error_clone(arg);
Transaction_free(_res_ref);
}
+void __attribute__((export_name("TS_Witness_free"))) TS_Witness_free(int8_tArray _res) {
+ LDKWitness _res_ref;
+ _res_ref.datalen = _res->arr_len;
+ _res_ref.data = MALLOC(_res_ref.datalen, "LDKWitness Bytes");
+ memcpy(_res_ref.data, _res->elems, _res_ref.datalen); FREE(_res);
+ _res_ref.data_is_owned = true;
+ Witness_free(_res_ref);
+}
+
uint64_t __attribute__((export_name("TS_TxOut_new"))) TS_TxOut_new(int8_tArray script_pubkey, int64_t value) {
LDKCVec_u8Z script_pubkey_ref;
script_pubkey_ref.datalen = script_pubkey->arr_len;
Str_free(dummy);
}
+uint64_t __attribute__((export_name("TS_CResult_NoneAPIErrorZ_ok"))) TS_CResult_NoneAPIErrorZ_ok() {
+ LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
+ *ret_conv = CResult_NoneAPIErrorZ_ok();
+ return tag_ptr(ret_conv, true);
+}
+
+uint64_t __attribute__((export_name("TS_CResult_NoneAPIErrorZ_err"))) TS_CResult_NoneAPIErrorZ_err(uint64_t e) {
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKAPIError e_conv = *(LDKAPIError*)(e_ptr);
+ e_conv = APIError_clone((LDKAPIError*)untag_ptr(e));
+ LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
+ *ret_conv = CResult_NoneAPIErrorZ_err(e_conv);
+ return tag_ptr(ret_conv, true);
+}
+
+jboolean __attribute__((export_name("TS_CResult_NoneAPIErrorZ_is_ok"))) TS_CResult_NoneAPIErrorZ_is_ok(uint64_t o) {
+ LDKCResult_NoneAPIErrorZ* o_conv = (LDKCResult_NoneAPIErrorZ*)untag_ptr(o);
+ jboolean ret_conv = CResult_NoneAPIErrorZ_is_ok(o_conv);
+ return ret_conv;
+}
+
+void __attribute__((export_name("TS_CResult_NoneAPIErrorZ_free"))) TS_CResult_NoneAPIErrorZ_free(uint64_t _res) {
+ if (!ptr_is_owned(_res)) return;
+ void* _res_ptr = untag_ptr(_res);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_NoneAPIErrorZ _res_conv = *(LDKCResult_NoneAPIErrorZ*)(_res_ptr);
+ FREE(untag_ptr(_res));
+ CResult_NoneAPIErrorZ_free(_res_conv);
+}
+
+static inline uint64_t CResult_NoneAPIErrorZ_clone_ptr(LDKCResult_NoneAPIErrorZ *NONNULL_PTR arg) {
+ LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
+ *ret_conv = CResult_NoneAPIErrorZ_clone(arg);
+ return tag_ptr(ret_conv, true);
+}
+int64_t __attribute__((export_name("TS_CResult_NoneAPIErrorZ_clone_ptr"))) TS_CResult_NoneAPIErrorZ_clone_ptr(uint64_t arg) {
+ LDKCResult_NoneAPIErrorZ* arg_conv = (LDKCResult_NoneAPIErrorZ*)untag_ptr(arg);
+ int64_t ret_conv = CResult_NoneAPIErrorZ_clone_ptr(arg_conv);
+ return ret_conv;
+}
+
+uint64_t __attribute__((export_name("TS_CResult_NoneAPIErrorZ_clone"))) TS_CResult_NoneAPIErrorZ_clone(uint64_t orig) {
+ LDKCResult_NoneAPIErrorZ* orig_conv = (LDKCResult_NoneAPIErrorZ*)untag_ptr(orig);
+ LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
+ *ret_conv = CResult_NoneAPIErrorZ_clone(orig_conv);
+ return tag_ptr(ret_conv, true);
+}
+
+void __attribute__((export_name("TS_CVec_CResult_NoneAPIErrorZZ_free"))) TS_CVec_CResult_NoneAPIErrorZZ_free(uint64_tArray _res) {
+ LDKCVec_CResult_NoneAPIErrorZZ _res_constr;
+ _res_constr.datalen = _res->arr_len;
+ if (_res_constr.datalen > 0)
+ _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements");
+ else
+ _res_constr.data = NULL;
+ uint64_t* _res_vals = _res->elems;
+ for (size_t w = 0; w < _res_constr.datalen; w++) {
+ uint64_t _res_conv_22 = _res_vals[w];
+ void* _res_conv_22_ptr = untag_ptr(_res_conv_22);
+ CHECK_ACCESS(_res_conv_22_ptr);
+ LDKCResult_NoneAPIErrorZ _res_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(_res_conv_22_ptr);
+ FREE(untag_ptr(_res_conv_22));
+ _res_constr.data[w] = _res_conv_22_conv;
+ }
+ FREE(_res);
+ CVec_CResult_NoneAPIErrorZZ_free(_res_constr);
+}
+
+void __attribute__((export_name("TS_CVec_APIErrorZ_free"))) TS_CVec_APIErrorZ_free(uint64_tArray _res) {
+ LDKCVec_APIErrorZ _res_constr;
+ _res_constr.datalen = _res->arr_len;
+ if (_res_constr.datalen > 0)
+ _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKAPIError), "LDKCVec_APIErrorZ Elements");
+ else
+ _res_constr.data = NULL;
+ uint64_t* _res_vals = _res->elems;
+ for (size_t k = 0; k < _res_constr.datalen; k++) {
+ uint64_t _res_conv_10 = _res_vals[k];
+ void* _res_conv_10_ptr = untag_ptr(_res_conv_10);
+ CHECK_ACCESS(_res_conv_10_ptr);
+ LDKAPIError _res_conv_10_conv = *(LDKAPIError*)(_res_conv_10_ptr);
+ FREE(untag_ptr(_res_conv_10));
+ _res_constr.data[k] = _res_conv_10_conv;
+ }
+ FREE(_res);
+ CVec_APIErrorZ_free(_res_constr);
+}
+
+uint64_t __attribute__((export_name("TS_COption_HTLCClaimZ_some"))) TS_COption_HTLCClaimZ_some(uint32_t o) {
+ LDKHTLCClaim o_conv = LDKHTLCClaim_from_js(o);
+ LDKCOption_HTLCClaimZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCClaimZ), "LDKCOption_HTLCClaimZ");
+ *ret_copy = COption_HTLCClaimZ_some(o_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+uint64_t __attribute__((export_name("TS_COption_HTLCClaimZ_none"))) TS_COption_HTLCClaimZ_none() {
+ LDKCOption_HTLCClaimZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCClaimZ), "LDKCOption_HTLCClaimZ");
+ *ret_copy = COption_HTLCClaimZ_none();
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+void __attribute__((export_name("TS_COption_HTLCClaimZ_free"))) TS_COption_HTLCClaimZ_free(uint64_t _res) {
+ if (!ptr_is_owned(_res)) return;
+ void* _res_ptr = untag_ptr(_res);
+ CHECK_ACCESS(_res_ptr);
+ LDKCOption_HTLCClaimZ _res_conv = *(LDKCOption_HTLCClaimZ*)(_res_ptr);
+ FREE(untag_ptr(_res));
+ COption_HTLCClaimZ_free(_res_conv);
+}
+
uint64_t __attribute__((export_name("TS_CResult_NoneNoneZ_ok"))) TS_CResult_NoneNoneZ_ok() {
LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
*ret_conv = CResult_NoneNoneZ_ok();
}
uint64_t __attribute__((export_name("TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_err"))) TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ), "LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ");
*ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
return tag_ptr(ret_conv, true);
}
-uint64_t __attribute__((export_name("TS_CResult_SecretKeyErrorZ_ok"))) TS_CResult_SecretKeyErrorZ_ok(int8_tArray o) {
- LDKSecretKey o_ref;
- CHECK(o->arr_len == 32);
- memcpy(o_ref.bytes, o->elems, 32); FREE(o);
- LDKCResult_SecretKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyErrorZ), "LDKCResult_SecretKeyErrorZ");
- *ret_conv = CResult_SecretKeyErrorZ_ok(o_ref);
+uint64_t __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_ok"))) TS_CResult_TxCreationKeysDecodeErrorZ_ok(uint64_t o) {
+ LDKTxCreationKeys o_conv;
+ o_conv.inner = untag_ptr(o);
+ o_conv.is_owned = ptr_is_owned(o);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
+ o_conv = TxCreationKeys_clone(&o_conv);
+ LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ");
+ *ret_conv = CResult_TxCreationKeysDecodeErrorZ_ok(o_conv);
return tag_ptr(ret_conv, true);
}
-uint64_t __attribute__((export_name("TS_CResult_SecretKeyErrorZ_err"))) TS_CResult_SecretKeyErrorZ_err(uint32_t e) {
- LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_js(e);
- LDKCResult_SecretKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyErrorZ), "LDKCResult_SecretKeyErrorZ");
- *ret_conv = CResult_SecretKeyErrorZ_err(e_conv);
+uint64_t __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_err"))) TS_CResult_TxCreationKeysDecodeErrorZ_err(uint64_t e) {
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
+ LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ");
+ *ret_conv = CResult_TxCreationKeysDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
-jboolean __attribute__((export_name("TS_CResult_SecretKeyErrorZ_is_ok"))) TS_CResult_SecretKeyErrorZ_is_ok(uint64_t o) {
- LDKCResult_SecretKeyErrorZ* o_conv = (LDKCResult_SecretKeyErrorZ*)untag_ptr(o);
- jboolean ret_conv = CResult_SecretKeyErrorZ_is_ok(o_conv);
+jboolean __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_is_ok"))) TS_CResult_TxCreationKeysDecodeErrorZ_is_ok(uint64_t o) {
+ LDKCResult_TxCreationKeysDecodeErrorZ* o_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)untag_ptr(o);
+ jboolean ret_conv = CResult_TxCreationKeysDecodeErrorZ_is_ok(o_conv);
return ret_conv;
}
-void __attribute__((export_name("TS_CResult_SecretKeyErrorZ_free"))) TS_CResult_SecretKeyErrorZ_free(uint64_t _res) {
+void __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_free"))) TS_CResult_TxCreationKeysDecodeErrorZ_free(uint64_t _res) {
if (!ptr_is_owned(_res)) return;
void* _res_ptr = untag_ptr(_res);
CHECK_ACCESS(_res_ptr);
- LDKCResult_SecretKeyErrorZ _res_conv = *(LDKCResult_SecretKeyErrorZ*)(_res_ptr);
+ LDKCResult_TxCreationKeysDecodeErrorZ _res_conv = *(LDKCResult_TxCreationKeysDecodeErrorZ*)(_res_ptr);
FREE(untag_ptr(_res));
- CResult_SecretKeyErrorZ_free(_res_conv);
+ CResult_TxCreationKeysDecodeErrorZ_free(_res_conv);
}
-static inline uint64_t CResult_SecretKeyErrorZ_clone_ptr(LDKCResult_SecretKeyErrorZ *NONNULL_PTR arg) {
- LDKCResult_SecretKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyErrorZ), "LDKCResult_SecretKeyErrorZ");
- *ret_conv = CResult_SecretKeyErrorZ_clone(arg);
+static inline uint64_t CResult_TxCreationKeysDecodeErrorZ_clone_ptr(LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR arg) {
+ LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ");
+ *ret_conv = CResult_TxCreationKeysDecodeErrorZ_clone(arg);
return tag_ptr(ret_conv, true);
}
-int64_t __attribute__((export_name("TS_CResult_SecretKeyErrorZ_clone_ptr"))) TS_CResult_SecretKeyErrorZ_clone_ptr(uint64_t arg) {
- LDKCResult_SecretKeyErrorZ* arg_conv = (LDKCResult_SecretKeyErrorZ*)untag_ptr(arg);
- int64_t ret_conv = CResult_SecretKeyErrorZ_clone_ptr(arg_conv);
+int64_t __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_clone_ptr"))) TS_CResult_TxCreationKeysDecodeErrorZ_clone_ptr(uint64_t arg) {
+ LDKCResult_TxCreationKeysDecodeErrorZ* arg_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)untag_ptr(arg);
+ int64_t ret_conv = CResult_TxCreationKeysDecodeErrorZ_clone_ptr(arg_conv);
return ret_conv;
}
-uint64_t __attribute__((export_name("TS_CResult_SecretKeyErrorZ_clone"))) TS_CResult_SecretKeyErrorZ_clone(uint64_t orig) {
- LDKCResult_SecretKeyErrorZ* orig_conv = (LDKCResult_SecretKeyErrorZ*)untag_ptr(orig);
- LDKCResult_SecretKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyErrorZ), "LDKCResult_SecretKeyErrorZ");
- *ret_conv = CResult_SecretKeyErrorZ_clone(orig_conv);
+uint64_t __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_clone"))) TS_CResult_TxCreationKeysDecodeErrorZ_clone(uint64_t orig) {
+ LDKCResult_TxCreationKeysDecodeErrorZ* orig_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)untag_ptr(orig);
+ LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ");
+ *ret_conv = CResult_TxCreationKeysDecodeErrorZ_clone(orig_conv);
return tag_ptr(ret_conv, true);
}
-uint64_t __attribute__((export_name("TS_CResult_PublicKeyErrorZ_ok"))) TS_CResult_PublicKeyErrorZ_ok(int8_tArray o) {
- LDKPublicKey o_ref;
- CHECK(o->arr_len == 33);
- memcpy(o_ref.compressed_form, o->elems, 33); FREE(o);
- LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ");
- *ret_conv = CResult_PublicKeyErrorZ_ok(o_ref);
+uint64_t __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_ok"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_ok(uint64_t o) {
+ LDKChannelPublicKeys o_conv;
+ o_conv.inner = untag_ptr(o);
+ o_conv.is_owned = ptr_is_owned(o);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
+ o_conv = ChannelPublicKeys_clone(&o_conv);
+ LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ");
+ *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_ok(o_conv);
return tag_ptr(ret_conv, true);
}
-uint64_t __attribute__((export_name("TS_CResult_PublicKeyErrorZ_err"))) TS_CResult_PublicKeyErrorZ_err(uint32_t e) {
- LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_js(e);
- LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ");
- *ret_conv = CResult_PublicKeyErrorZ_err(e_conv);
- return tag_ptr(ret_conv, true);
-}
-
-jboolean __attribute__((export_name("TS_CResult_PublicKeyErrorZ_is_ok"))) TS_CResult_PublicKeyErrorZ_is_ok(uint64_t o) {
- LDKCResult_PublicKeyErrorZ* o_conv = (LDKCResult_PublicKeyErrorZ*)untag_ptr(o);
- jboolean ret_conv = CResult_PublicKeyErrorZ_is_ok(o_conv);
- return ret_conv;
-}
-
-void __attribute__((export_name("TS_CResult_PublicKeyErrorZ_free"))) TS_CResult_PublicKeyErrorZ_free(uint64_t _res) {
- if (!ptr_is_owned(_res)) return;
- void* _res_ptr = untag_ptr(_res);
- CHECK_ACCESS(_res_ptr);
- LDKCResult_PublicKeyErrorZ _res_conv = *(LDKCResult_PublicKeyErrorZ*)(_res_ptr);
- FREE(untag_ptr(_res));
- CResult_PublicKeyErrorZ_free(_res_conv);
-}
-
-static inline uint64_t CResult_PublicKeyErrorZ_clone_ptr(LDKCResult_PublicKeyErrorZ *NONNULL_PTR arg) {
- LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ");
- *ret_conv = CResult_PublicKeyErrorZ_clone(arg);
- return tag_ptr(ret_conv, true);
-}
-int64_t __attribute__((export_name("TS_CResult_PublicKeyErrorZ_clone_ptr"))) TS_CResult_PublicKeyErrorZ_clone_ptr(uint64_t arg) {
- LDKCResult_PublicKeyErrorZ* arg_conv = (LDKCResult_PublicKeyErrorZ*)untag_ptr(arg);
- int64_t ret_conv = CResult_PublicKeyErrorZ_clone_ptr(arg_conv);
- return ret_conv;
-}
-
-uint64_t __attribute__((export_name("TS_CResult_PublicKeyErrorZ_clone"))) TS_CResult_PublicKeyErrorZ_clone(uint64_t orig) {
- LDKCResult_PublicKeyErrorZ* orig_conv = (LDKCResult_PublicKeyErrorZ*)untag_ptr(orig);
- LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ");
- *ret_conv = CResult_PublicKeyErrorZ_clone(orig_conv);
- return tag_ptr(ret_conv, true);
-}
-
-uint64_t __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_ok"))) TS_CResult_TxCreationKeysDecodeErrorZ_ok(uint64_t o) {
- LDKTxCreationKeys o_conv;
- o_conv.inner = untag_ptr(o);
- o_conv.is_owned = ptr_is_owned(o);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
- o_conv = TxCreationKeys_clone(&o_conv);
- LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ");
- *ret_conv = CResult_TxCreationKeysDecodeErrorZ_ok(o_conv);
- return tag_ptr(ret_conv, true);
-}
-
-uint64_t __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_err"))) TS_CResult_TxCreationKeysDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
- LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ");
- *ret_conv = CResult_TxCreationKeysDecodeErrorZ_err(e_conv);
- return tag_ptr(ret_conv, true);
-}
-
-jboolean __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_is_ok"))) TS_CResult_TxCreationKeysDecodeErrorZ_is_ok(uint64_t o) {
- LDKCResult_TxCreationKeysDecodeErrorZ* o_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)untag_ptr(o);
- jboolean ret_conv = CResult_TxCreationKeysDecodeErrorZ_is_ok(o_conv);
- return ret_conv;
-}
-
-void __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_free"))) TS_CResult_TxCreationKeysDecodeErrorZ_free(uint64_t _res) {
- if (!ptr_is_owned(_res)) return;
- void* _res_ptr = untag_ptr(_res);
- CHECK_ACCESS(_res_ptr);
- LDKCResult_TxCreationKeysDecodeErrorZ _res_conv = *(LDKCResult_TxCreationKeysDecodeErrorZ*)(_res_ptr);
- FREE(untag_ptr(_res));
- CResult_TxCreationKeysDecodeErrorZ_free(_res_conv);
-}
-
-static inline uint64_t CResult_TxCreationKeysDecodeErrorZ_clone_ptr(LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR arg) {
- LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ");
- *ret_conv = CResult_TxCreationKeysDecodeErrorZ_clone(arg);
- return tag_ptr(ret_conv, true);
-}
-int64_t __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_clone_ptr"))) TS_CResult_TxCreationKeysDecodeErrorZ_clone_ptr(uint64_t arg) {
- LDKCResult_TxCreationKeysDecodeErrorZ* arg_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)untag_ptr(arg);
- int64_t ret_conv = CResult_TxCreationKeysDecodeErrorZ_clone_ptr(arg_conv);
- return ret_conv;
-}
-
-uint64_t __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_clone"))) TS_CResult_TxCreationKeysDecodeErrorZ_clone(uint64_t orig) {
- LDKCResult_TxCreationKeysDecodeErrorZ* orig_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)untag_ptr(orig);
- LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ");
- *ret_conv = CResult_TxCreationKeysDecodeErrorZ_clone(orig_conv);
- return tag_ptr(ret_conv, true);
-}
-
-uint64_t __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_ok"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_ok(uint64_t o) {
- LDKChannelPublicKeys o_conv;
- o_conv.inner = untag_ptr(o);
- o_conv.is_owned = ptr_is_owned(o);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
- o_conv = ChannelPublicKeys_clone(&o_conv);
- LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ");
- *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_ok(o_conv);
- return tag_ptr(ret_conv, true);
-}
-
-uint64_t __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_err"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
- LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ");
- *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_err(e_conv);
+uint64_t __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_err"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_err(uint64_t e) {
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
+ LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ");
+ *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
return tag_ptr(ret_conv, true);
}
-uint64_t __attribute__((export_name("TS_CResult_TxCreationKeysErrorZ_ok"))) TS_CResult_TxCreationKeysErrorZ_ok(uint64_t o) {
- LDKTxCreationKeys o_conv;
- o_conv.inner = untag_ptr(o);
- o_conv.is_owned = ptr_is_owned(o);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
- o_conv = TxCreationKeys_clone(&o_conv);
- LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ");
- *ret_conv = CResult_TxCreationKeysErrorZ_ok(o_conv);
- return tag_ptr(ret_conv, true);
-}
-
-uint64_t __attribute__((export_name("TS_CResult_TxCreationKeysErrorZ_err"))) TS_CResult_TxCreationKeysErrorZ_err(uint32_t e) {
- LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_js(e);
- LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ");
- *ret_conv = CResult_TxCreationKeysErrorZ_err(e_conv);
- return tag_ptr(ret_conv, true);
-}
-
-jboolean __attribute__((export_name("TS_CResult_TxCreationKeysErrorZ_is_ok"))) TS_CResult_TxCreationKeysErrorZ_is_ok(uint64_t o) {
- LDKCResult_TxCreationKeysErrorZ* o_conv = (LDKCResult_TxCreationKeysErrorZ*)untag_ptr(o);
- jboolean ret_conv = CResult_TxCreationKeysErrorZ_is_ok(o_conv);
- return ret_conv;
-}
-
-void __attribute__((export_name("TS_CResult_TxCreationKeysErrorZ_free"))) TS_CResult_TxCreationKeysErrorZ_free(uint64_t _res) {
- if (!ptr_is_owned(_res)) return;
- void* _res_ptr = untag_ptr(_res);
- CHECK_ACCESS(_res_ptr);
- LDKCResult_TxCreationKeysErrorZ _res_conv = *(LDKCResult_TxCreationKeysErrorZ*)(_res_ptr);
- FREE(untag_ptr(_res));
- CResult_TxCreationKeysErrorZ_free(_res_conv);
-}
-
-static inline uint64_t CResult_TxCreationKeysErrorZ_clone_ptr(LDKCResult_TxCreationKeysErrorZ *NONNULL_PTR arg) {
- LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ");
- *ret_conv = CResult_TxCreationKeysErrorZ_clone(arg);
- return tag_ptr(ret_conv, true);
-}
-int64_t __attribute__((export_name("TS_CResult_TxCreationKeysErrorZ_clone_ptr"))) TS_CResult_TxCreationKeysErrorZ_clone_ptr(uint64_t arg) {
- LDKCResult_TxCreationKeysErrorZ* arg_conv = (LDKCResult_TxCreationKeysErrorZ*)untag_ptr(arg);
- int64_t ret_conv = CResult_TxCreationKeysErrorZ_clone_ptr(arg_conv);
- return ret_conv;
-}
-
-uint64_t __attribute__((export_name("TS_CResult_TxCreationKeysErrorZ_clone"))) TS_CResult_TxCreationKeysErrorZ_clone(uint64_t orig) {
- LDKCResult_TxCreationKeysErrorZ* orig_conv = (LDKCResult_TxCreationKeysErrorZ*)untag_ptr(orig);
- LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ");
- *ret_conv = CResult_TxCreationKeysErrorZ_clone(orig_conv);
- return tag_ptr(ret_conv, true);
-}
-
uint64_t __attribute__((export_name("TS_COption_u32Z_some"))) TS_COption_u32Z_some(int32_t o) {
LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z");
*ret_copy = COption_u32Z_some(o);
}
uint64_t __attribute__((export_name("TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_err"))) TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ");
*ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
uint64_t __attribute__((export_name("TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err"))) TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ");
*ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
uint64_t __attribute__((export_name("TS_CResult_ChannelTransactionParametersDecodeErrorZ_err"))) TS_CResult_ChannelTransactionParametersDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ");
*ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
uint64_t __attribute__((export_name("TS_CResult_HolderCommitmentTransactionDecodeErrorZ_err"))) TS_CResult_HolderCommitmentTransactionDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ");
*ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
uint64_t __attribute__((export_name("TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_err"))) TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ");
*ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
uint64_t __attribute__((export_name("TS_CResult_CommitmentTransactionDecodeErrorZ_err"))) TS_CResult_CommitmentTransactionDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ");
*ret_conv = CResult_CommitmentTransactionDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
uint64_t __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_err"))) TS_CResult_ShutdownScriptDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ");
*ret_conv = CResult_ShutdownScriptDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
return tag_ptr(ret_conv, true);
}
-uint64_t __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_ok"))) TS_CResult_RouteHopDecodeErrorZ_ok(uint64_t o) {
- LDKRouteHop o_conv;
+void __attribute__((export_name("TS_CVec_PublicKeyZ_free"))) TS_CVec_PublicKeyZ_free(ptrArray _res) {
+ LDKCVec_PublicKeyZ _res_constr;
+ _res_constr.datalen = _res->arr_len;
+ if (_res_constr.datalen > 0)
+ _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements");
+ else
+ _res_constr.data = NULL;
+ int8_tArray* _res_vals = (void*) _res->elems;
+ for (size_t m = 0; m < _res_constr.datalen; m++) {
+ int8_tArray _res_conv_12 = _res_vals[m];
+ LDKPublicKey _res_conv_12_ref;
+ CHECK(_res_conv_12->arr_len == 33);
+ memcpy(_res_conv_12_ref.compressed_form, _res_conv_12->elems, 33); FREE(_res_conv_12);
+ _res_constr.data[m] = _res_conv_12_ref;
+ }
+ FREE(_res);
+ CVec_PublicKeyZ_free(_res_constr);
+}
+
+uint64_t __attribute__((export_name("TS_CResult_BlindedPathNoneZ_ok"))) TS_CResult_BlindedPathNoneZ_ok(uint64_t o) {
+ LDKBlindedPath o_conv;
o_conv.inner = untag_ptr(o);
o_conv.is_owned = ptr_is_owned(o);
CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
- o_conv = RouteHop_clone(&o_conv);
- LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ");
- *ret_conv = CResult_RouteHopDecodeErrorZ_ok(o_conv);
+ o_conv = BlindedPath_clone(&o_conv);
+ LDKCResult_BlindedPathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathNoneZ), "LDKCResult_BlindedPathNoneZ");
+ *ret_conv = CResult_BlindedPathNoneZ_ok(o_conv);
return tag_ptr(ret_conv, true);
}
-uint64_t __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_err"))) TS_CResult_RouteHopDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
+uint64_t __attribute__((export_name("TS_CResult_BlindedPathNoneZ_err"))) TS_CResult_BlindedPathNoneZ_err() {
+ LDKCResult_BlindedPathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathNoneZ), "LDKCResult_BlindedPathNoneZ");
+ *ret_conv = CResult_BlindedPathNoneZ_err();
+ return tag_ptr(ret_conv, true);
+}
+
+jboolean __attribute__((export_name("TS_CResult_BlindedPathNoneZ_is_ok"))) TS_CResult_BlindedPathNoneZ_is_ok(uint64_t o) {
+ LDKCResult_BlindedPathNoneZ* o_conv = (LDKCResult_BlindedPathNoneZ*)untag_ptr(o);
+ jboolean ret_conv = CResult_BlindedPathNoneZ_is_ok(o_conv);
+ return ret_conv;
+}
+
+void __attribute__((export_name("TS_CResult_BlindedPathNoneZ_free"))) TS_CResult_BlindedPathNoneZ_free(uint64_t _res) {
+ if (!ptr_is_owned(_res)) return;
+ void* _res_ptr = untag_ptr(_res);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_BlindedPathNoneZ _res_conv = *(LDKCResult_BlindedPathNoneZ*)(_res_ptr);
+ FREE(untag_ptr(_res));
+ CResult_BlindedPathNoneZ_free(_res_conv);
+}
+
+static inline uint64_t CResult_BlindedPathNoneZ_clone_ptr(LDKCResult_BlindedPathNoneZ *NONNULL_PTR arg) {
+ LDKCResult_BlindedPathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathNoneZ), "LDKCResult_BlindedPathNoneZ");
+ *ret_conv = CResult_BlindedPathNoneZ_clone(arg);
+ return tag_ptr(ret_conv, true);
+}
+int64_t __attribute__((export_name("TS_CResult_BlindedPathNoneZ_clone_ptr"))) TS_CResult_BlindedPathNoneZ_clone_ptr(uint64_t arg) {
+ LDKCResult_BlindedPathNoneZ* arg_conv = (LDKCResult_BlindedPathNoneZ*)untag_ptr(arg);
+ int64_t ret_conv = CResult_BlindedPathNoneZ_clone_ptr(arg_conv);
+ return ret_conv;
+}
+
+uint64_t __attribute__((export_name("TS_CResult_BlindedPathNoneZ_clone"))) TS_CResult_BlindedPathNoneZ_clone(uint64_t orig) {
+ LDKCResult_BlindedPathNoneZ* orig_conv = (LDKCResult_BlindedPathNoneZ*)untag_ptr(orig);
+ LDKCResult_BlindedPathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathNoneZ), "LDKCResult_BlindedPathNoneZ");
+ *ret_conv = CResult_BlindedPathNoneZ_clone(orig_conv);
+ return tag_ptr(ret_conv, true);
+}
+
+uint64_t __attribute__((export_name("TS_CResult_BlindedPathDecodeErrorZ_ok"))) TS_CResult_BlindedPathDecodeErrorZ_ok(uint64_t o) {
+ LDKBlindedPath o_conv;
+ o_conv.inner = untag_ptr(o);
+ o_conv.is_owned = ptr_is_owned(o);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
+ o_conv = BlindedPath_clone(&o_conv);
+ LDKCResult_BlindedPathDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathDecodeErrorZ), "LDKCResult_BlindedPathDecodeErrorZ");
+ *ret_conv = CResult_BlindedPathDecodeErrorZ_ok(o_conv);
+ return tag_ptr(ret_conv, true);
+}
+
+uint64_t __attribute__((export_name("TS_CResult_BlindedPathDecodeErrorZ_err"))) TS_CResult_BlindedPathDecodeErrorZ_err(uint64_t e) {
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
+ LDKCResult_BlindedPathDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathDecodeErrorZ), "LDKCResult_BlindedPathDecodeErrorZ");
+ *ret_conv = CResult_BlindedPathDecodeErrorZ_err(e_conv);
+ return tag_ptr(ret_conv, true);
+}
+
+jboolean __attribute__((export_name("TS_CResult_BlindedPathDecodeErrorZ_is_ok"))) TS_CResult_BlindedPathDecodeErrorZ_is_ok(uint64_t o) {
+ LDKCResult_BlindedPathDecodeErrorZ* o_conv = (LDKCResult_BlindedPathDecodeErrorZ*)untag_ptr(o);
+ jboolean ret_conv = CResult_BlindedPathDecodeErrorZ_is_ok(o_conv);
+ return ret_conv;
+}
+
+void __attribute__((export_name("TS_CResult_BlindedPathDecodeErrorZ_free"))) TS_CResult_BlindedPathDecodeErrorZ_free(uint64_t _res) {
+ if (!ptr_is_owned(_res)) return;
+ void* _res_ptr = untag_ptr(_res);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_BlindedPathDecodeErrorZ _res_conv = *(LDKCResult_BlindedPathDecodeErrorZ*)(_res_ptr);
+ FREE(untag_ptr(_res));
+ CResult_BlindedPathDecodeErrorZ_free(_res_conv);
+}
+
+static inline uint64_t CResult_BlindedPathDecodeErrorZ_clone_ptr(LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR arg) {
+ LDKCResult_BlindedPathDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathDecodeErrorZ), "LDKCResult_BlindedPathDecodeErrorZ");
+ *ret_conv = CResult_BlindedPathDecodeErrorZ_clone(arg);
+ return tag_ptr(ret_conv, true);
+}
+int64_t __attribute__((export_name("TS_CResult_BlindedPathDecodeErrorZ_clone_ptr"))) TS_CResult_BlindedPathDecodeErrorZ_clone_ptr(uint64_t arg) {
+ LDKCResult_BlindedPathDecodeErrorZ* arg_conv = (LDKCResult_BlindedPathDecodeErrorZ*)untag_ptr(arg);
+ int64_t ret_conv = CResult_BlindedPathDecodeErrorZ_clone_ptr(arg_conv);
+ return ret_conv;
+}
+
+uint64_t __attribute__((export_name("TS_CResult_BlindedPathDecodeErrorZ_clone"))) TS_CResult_BlindedPathDecodeErrorZ_clone(uint64_t orig) {
+ LDKCResult_BlindedPathDecodeErrorZ* orig_conv = (LDKCResult_BlindedPathDecodeErrorZ*)untag_ptr(orig);
+ LDKCResult_BlindedPathDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathDecodeErrorZ), "LDKCResult_BlindedPathDecodeErrorZ");
+ *ret_conv = CResult_BlindedPathDecodeErrorZ_clone(orig_conv);
+ return tag_ptr(ret_conv, true);
+}
+
+uint64_t __attribute__((export_name("TS_CResult_BlindedHopDecodeErrorZ_ok"))) TS_CResult_BlindedHopDecodeErrorZ_ok(uint64_t o) {
+ LDKBlindedHop o_conv;
+ o_conv.inner = untag_ptr(o);
+ o_conv.is_owned = ptr_is_owned(o);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
+ o_conv = BlindedHop_clone(&o_conv);
+ LDKCResult_BlindedHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopDecodeErrorZ), "LDKCResult_BlindedHopDecodeErrorZ");
+ *ret_conv = CResult_BlindedHopDecodeErrorZ_ok(o_conv);
+ return tag_ptr(ret_conv, true);
+}
+
+uint64_t __attribute__((export_name("TS_CResult_BlindedHopDecodeErrorZ_err"))) TS_CResult_BlindedHopDecodeErrorZ_err(uint64_t e) {
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
+ LDKCResult_BlindedHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopDecodeErrorZ), "LDKCResult_BlindedHopDecodeErrorZ");
+ *ret_conv = CResult_BlindedHopDecodeErrorZ_err(e_conv);
+ return tag_ptr(ret_conv, true);
+}
+
+jboolean __attribute__((export_name("TS_CResult_BlindedHopDecodeErrorZ_is_ok"))) TS_CResult_BlindedHopDecodeErrorZ_is_ok(uint64_t o) {
+ LDKCResult_BlindedHopDecodeErrorZ* o_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(o);
+ jboolean ret_conv = CResult_BlindedHopDecodeErrorZ_is_ok(o_conv);
+ return ret_conv;
+}
+
+void __attribute__((export_name("TS_CResult_BlindedHopDecodeErrorZ_free"))) TS_CResult_BlindedHopDecodeErrorZ_free(uint64_t _res) {
+ if (!ptr_is_owned(_res)) return;
+ void* _res_ptr = untag_ptr(_res);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_BlindedHopDecodeErrorZ _res_conv = *(LDKCResult_BlindedHopDecodeErrorZ*)(_res_ptr);
+ FREE(untag_ptr(_res));
+ CResult_BlindedHopDecodeErrorZ_free(_res_conv);
+}
+
+static inline uint64_t CResult_BlindedHopDecodeErrorZ_clone_ptr(LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR arg) {
+ LDKCResult_BlindedHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopDecodeErrorZ), "LDKCResult_BlindedHopDecodeErrorZ");
+ *ret_conv = CResult_BlindedHopDecodeErrorZ_clone(arg);
+ return tag_ptr(ret_conv, true);
+}
+int64_t __attribute__((export_name("TS_CResult_BlindedHopDecodeErrorZ_clone_ptr"))) TS_CResult_BlindedHopDecodeErrorZ_clone_ptr(uint64_t arg) {
+ LDKCResult_BlindedHopDecodeErrorZ* arg_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(arg);
+ int64_t ret_conv = CResult_BlindedHopDecodeErrorZ_clone_ptr(arg_conv);
+ return ret_conv;
+}
+
+uint64_t __attribute__((export_name("TS_CResult_BlindedHopDecodeErrorZ_clone"))) TS_CResult_BlindedHopDecodeErrorZ_clone(uint64_t orig) {
+ LDKCResult_BlindedHopDecodeErrorZ* orig_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(orig);
+ LDKCResult_BlindedHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopDecodeErrorZ), "LDKCResult_BlindedHopDecodeErrorZ");
+ *ret_conv = CResult_BlindedHopDecodeErrorZ_clone(orig_conv);
+ return tag_ptr(ret_conv, true);
+}
+
+void __attribute__((export_name("TS_CVec_ChannelDetailsZ_free"))) TS_CVec_ChannelDetailsZ_free(uint64_tArray _res) {
+ LDKCVec_ChannelDetailsZ _res_constr;
+ _res_constr.datalen = _res->arr_len;
+ if (_res_constr.datalen > 0)
+ _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
+ else
+ _res_constr.data = NULL;
+ uint64_t* _res_vals = _res->elems;
+ for (size_t q = 0; q < _res_constr.datalen; q++) {
+ uint64_t _res_conv_16 = _res_vals[q];
+ LDKChannelDetails _res_conv_16_conv;
+ _res_conv_16_conv.inner = untag_ptr(_res_conv_16);
+ _res_conv_16_conv.is_owned = ptr_is_owned(_res_conv_16);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_16_conv);
+ _res_constr.data[q] = _res_conv_16_conv;
+ }
+ FREE(_res);
+ CVec_ChannelDetailsZ_free(_res_constr);
+}
+
+uint64_t __attribute__((export_name("TS_CResult_RouteLightningErrorZ_ok"))) TS_CResult_RouteLightningErrorZ_ok(uint64_t o) {
+ LDKRoute o_conv;
+ o_conv.inner = untag_ptr(o);
+ o_conv.is_owned = ptr_is_owned(o);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
+ o_conv = Route_clone(&o_conv);
+ LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
+ *ret_conv = CResult_RouteLightningErrorZ_ok(o_conv);
+ return tag_ptr(ret_conv, true);
+}
+
+uint64_t __attribute__((export_name("TS_CResult_RouteLightningErrorZ_err"))) TS_CResult_RouteLightningErrorZ_err(uint64_t e) {
+ LDKLightningError e_conv;
e_conv.inner = untag_ptr(e);
e_conv.is_owned = ptr_is_owned(e);
CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
- LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ");
- *ret_conv = CResult_RouteHopDecodeErrorZ_err(e_conv);
+ e_conv = LightningError_clone(&e_conv);
+ LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
+ *ret_conv = CResult_RouteLightningErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
-jboolean __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_is_ok"))) TS_CResult_RouteHopDecodeErrorZ_is_ok(uint64_t o) {
- LDKCResult_RouteHopDecodeErrorZ* o_conv = (LDKCResult_RouteHopDecodeErrorZ*)untag_ptr(o);
- jboolean ret_conv = CResult_RouteHopDecodeErrorZ_is_ok(o_conv);
+jboolean __attribute__((export_name("TS_CResult_RouteLightningErrorZ_is_ok"))) TS_CResult_RouteLightningErrorZ_is_ok(uint64_t o) {
+ LDKCResult_RouteLightningErrorZ* o_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(o);
+ jboolean ret_conv = CResult_RouteLightningErrorZ_is_ok(o_conv);
return ret_conv;
}
-void __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_free"))) TS_CResult_RouteHopDecodeErrorZ_free(uint64_t _res) {
+void __attribute__((export_name("TS_CResult_RouteLightningErrorZ_free"))) TS_CResult_RouteLightningErrorZ_free(uint64_t _res) {
if (!ptr_is_owned(_res)) return;
void* _res_ptr = untag_ptr(_res);
CHECK_ACCESS(_res_ptr);
- LDKCResult_RouteHopDecodeErrorZ _res_conv = *(LDKCResult_RouteHopDecodeErrorZ*)(_res_ptr);
+ LDKCResult_RouteLightningErrorZ _res_conv = *(LDKCResult_RouteLightningErrorZ*)(_res_ptr);
FREE(untag_ptr(_res));
- CResult_RouteHopDecodeErrorZ_free(_res_conv);
+ CResult_RouteLightningErrorZ_free(_res_conv);
}
-static inline uint64_t CResult_RouteHopDecodeErrorZ_clone_ptr(LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR arg) {
- LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ");
- *ret_conv = CResult_RouteHopDecodeErrorZ_clone(arg);
+static inline uint64_t CResult_RouteLightningErrorZ_clone_ptr(LDKCResult_RouteLightningErrorZ *NONNULL_PTR arg) {
+ LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
+ *ret_conv = CResult_RouteLightningErrorZ_clone(arg);
return tag_ptr(ret_conv, true);
}
-int64_t __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_clone_ptr"))) TS_CResult_RouteHopDecodeErrorZ_clone_ptr(uint64_t arg) {
- LDKCResult_RouteHopDecodeErrorZ* arg_conv = (LDKCResult_RouteHopDecodeErrorZ*)untag_ptr(arg);
- int64_t ret_conv = CResult_RouteHopDecodeErrorZ_clone_ptr(arg_conv);
+int64_t __attribute__((export_name("TS_CResult_RouteLightningErrorZ_clone_ptr"))) TS_CResult_RouteLightningErrorZ_clone_ptr(uint64_t arg) {
+ LDKCResult_RouteLightningErrorZ* arg_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(arg);
+ int64_t ret_conv = CResult_RouteLightningErrorZ_clone_ptr(arg_conv);
return ret_conv;
}
-uint64_t __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_clone"))) TS_CResult_RouteHopDecodeErrorZ_clone(uint64_t orig) {
- LDKCResult_RouteHopDecodeErrorZ* orig_conv = (LDKCResult_RouteHopDecodeErrorZ*)untag_ptr(orig);
- LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ");
- *ret_conv = CResult_RouteHopDecodeErrorZ_clone(orig_conv);
+uint64_t __attribute__((export_name("TS_CResult_RouteLightningErrorZ_clone"))) TS_CResult_RouteLightningErrorZ_clone(uint64_t orig) {
+ LDKCResult_RouteLightningErrorZ* orig_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(orig);
+ LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
+ *ret_conv = CResult_RouteLightningErrorZ_clone(orig_conv);
return tag_ptr(ret_conv, true);
}
CVec_RouteHopZ_free(_res_constr);
}
+uint64_t __attribute__((export_name("TS_COption_u64Z_some"))) TS_COption_u64Z_some(int64_t o) {
+ LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
+ *ret_copy = COption_u64Z_some(o);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+uint64_t __attribute__((export_name("TS_COption_u64Z_none"))) TS_COption_u64Z_none() {
+ LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
+ *ret_copy = COption_u64Z_none();
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+void __attribute__((export_name("TS_COption_u64Z_free"))) TS_COption_u64Z_free(uint64_t _res) {
+ if (!ptr_is_owned(_res)) return;
+ void* _res_ptr = untag_ptr(_res);
+ CHECK_ACCESS(_res_ptr);
+ LDKCOption_u64Z _res_conv = *(LDKCOption_u64Z*)(_res_ptr);
+ FREE(untag_ptr(_res));
+ COption_u64Z_free(_res_conv);
+}
+
+static inline uint64_t COption_u64Z_clone_ptr(LDKCOption_u64Z *NONNULL_PTR arg) {
+ LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
+ *ret_copy = COption_u64Z_clone(arg);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+int64_t __attribute__((export_name("TS_COption_u64Z_clone_ptr"))) TS_COption_u64Z_clone_ptr(uint64_t arg) {
+ LDKCOption_u64Z* arg_conv = (LDKCOption_u64Z*)untag_ptr(arg);
+ int64_t ret_conv = COption_u64Z_clone_ptr(arg_conv);
+ return ret_conv;
+}
+
+uint64_t __attribute__((export_name("TS_COption_u64Z_clone"))) TS_COption_u64Z_clone(uint64_t orig) {
+ LDKCOption_u64Z* orig_conv = (LDKCOption_u64Z*)untag_ptr(orig);
+ LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
+ *ret_copy = COption_u64Z_clone(orig_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+uint64_t __attribute__((export_name("TS_CResult_InFlightHtlcsDecodeErrorZ_ok"))) TS_CResult_InFlightHtlcsDecodeErrorZ_ok(uint64_t o) {
+ LDKInFlightHtlcs o_conv;
+ o_conv.inner = untag_ptr(o);
+ o_conv.is_owned = ptr_is_owned(o);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
+ o_conv = InFlightHtlcs_clone(&o_conv);
+ LDKCResult_InFlightHtlcsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InFlightHtlcsDecodeErrorZ), "LDKCResult_InFlightHtlcsDecodeErrorZ");
+ *ret_conv = CResult_InFlightHtlcsDecodeErrorZ_ok(o_conv);
+ return tag_ptr(ret_conv, true);
+}
+
+uint64_t __attribute__((export_name("TS_CResult_InFlightHtlcsDecodeErrorZ_err"))) TS_CResult_InFlightHtlcsDecodeErrorZ_err(uint64_t e) {
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
+ LDKCResult_InFlightHtlcsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InFlightHtlcsDecodeErrorZ), "LDKCResult_InFlightHtlcsDecodeErrorZ");
+ *ret_conv = CResult_InFlightHtlcsDecodeErrorZ_err(e_conv);
+ return tag_ptr(ret_conv, true);
+}
+
+jboolean __attribute__((export_name("TS_CResult_InFlightHtlcsDecodeErrorZ_is_ok"))) TS_CResult_InFlightHtlcsDecodeErrorZ_is_ok(uint64_t o) {
+ LDKCResult_InFlightHtlcsDecodeErrorZ* o_conv = (LDKCResult_InFlightHtlcsDecodeErrorZ*)untag_ptr(o);
+ jboolean ret_conv = CResult_InFlightHtlcsDecodeErrorZ_is_ok(o_conv);
+ return ret_conv;
+}
+
+void __attribute__((export_name("TS_CResult_InFlightHtlcsDecodeErrorZ_free"))) TS_CResult_InFlightHtlcsDecodeErrorZ_free(uint64_t _res) {
+ if (!ptr_is_owned(_res)) return;
+ void* _res_ptr = untag_ptr(_res);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_InFlightHtlcsDecodeErrorZ _res_conv = *(LDKCResult_InFlightHtlcsDecodeErrorZ*)(_res_ptr);
+ FREE(untag_ptr(_res));
+ CResult_InFlightHtlcsDecodeErrorZ_free(_res_conv);
+}
+
+static inline uint64_t CResult_InFlightHtlcsDecodeErrorZ_clone_ptr(LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR arg) {
+ LDKCResult_InFlightHtlcsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InFlightHtlcsDecodeErrorZ), "LDKCResult_InFlightHtlcsDecodeErrorZ");
+ *ret_conv = CResult_InFlightHtlcsDecodeErrorZ_clone(arg);
+ return tag_ptr(ret_conv, true);
+}
+int64_t __attribute__((export_name("TS_CResult_InFlightHtlcsDecodeErrorZ_clone_ptr"))) TS_CResult_InFlightHtlcsDecodeErrorZ_clone_ptr(uint64_t arg) {
+ LDKCResult_InFlightHtlcsDecodeErrorZ* arg_conv = (LDKCResult_InFlightHtlcsDecodeErrorZ*)untag_ptr(arg);
+ int64_t ret_conv = CResult_InFlightHtlcsDecodeErrorZ_clone_ptr(arg_conv);
+ return ret_conv;
+}
+
+uint64_t __attribute__((export_name("TS_CResult_InFlightHtlcsDecodeErrorZ_clone"))) TS_CResult_InFlightHtlcsDecodeErrorZ_clone(uint64_t orig) {
+ LDKCResult_InFlightHtlcsDecodeErrorZ* orig_conv = (LDKCResult_InFlightHtlcsDecodeErrorZ*)untag_ptr(orig);
+ LDKCResult_InFlightHtlcsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InFlightHtlcsDecodeErrorZ), "LDKCResult_InFlightHtlcsDecodeErrorZ");
+ *ret_conv = CResult_InFlightHtlcsDecodeErrorZ_clone(orig_conv);
+ return tag_ptr(ret_conv, true);
+}
+
+uint64_t __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_ok"))) TS_CResult_RouteHopDecodeErrorZ_ok(uint64_t o) {
+ LDKRouteHop o_conv;
+ o_conv.inner = untag_ptr(o);
+ o_conv.is_owned = ptr_is_owned(o);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
+ o_conv = RouteHop_clone(&o_conv);
+ LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ");
+ *ret_conv = CResult_RouteHopDecodeErrorZ_ok(o_conv);
+ return tag_ptr(ret_conv, true);
+}
+
+uint64_t __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_err"))) TS_CResult_RouteHopDecodeErrorZ_err(uint64_t e) {
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
+ LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ");
+ *ret_conv = CResult_RouteHopDecodeErrorZ_err(e_conv);
+ return tag_ptr(ret_conv, true);
+}
+
+jboolean __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_is_ok"))) TS_CResult_RouteHopDecodeErrorZ_is_ok(uint64_t o) {
+ LDKCResult_RouteHopDecodeErrorZ* o_conv = (LDKCResult_RouteHopDecodeErrorZ*)untag_ptr(o);
+ jboolean ret_conv = CResult_RouteHopDecodeErrorZ_is_ok(o_conv);
+ return ret_conv;
+}
+
+void __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_free"))) TS_CResult_RouteHopDecodeErrorZ_free(uint64_t _res) {
+ if (!ptr_is_owned(_res)) return;
+ void* _res_ptr = untag_ptr(_res);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_RouteHopDecodeErrorZ _res_conv = *(LDKCResult_RouteHopDecodeErrorZ*)(_res_ptr);
+ FREE(untag_ptr(_res));
+ CResult_RouteHopDecodeErrorZ_free(_res_conv);
+}
+
+static inline uint64_t CResult_RouteHopDecodeErrorZ_clone_ptr(LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR arg) {
+ LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ");
+ *ret_conv = CResult_RouteHopDecodeErrorZ_clone(arg);
+ return tag_ptr(ret_conv, true);
+}
+int64_t __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_clone_ptr"))) TS_CResult_RouteHopDecodeErrorZ_clone_ptr(uint64_t arg) {
+ LDKCResult_RouteHopDecodeErrorZ* arg_conv = (LDKCResult_RouteHopDecodeErrorZ*)untag_ptr(arg);
+ int64_t ret_conv = CResult_RouteHopDecodeErrorZ_clone_ptr(arg_conv);
+ return ret_conv;
+}
+
+uint64_t __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_clone"))) TS_CResult_RouteHopDecodeErrorZ_clone(uint64_t orig) {
+ LDKCResult_RouteHopDecodeErrorZ* orig_conv = (LDKCResult_RouteHopDecodeErrorZ*)untag_ptr(orig);
+ LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ");
+ *ret_conv = CResult_RouteHopDecodeErrorZ_clone(orig_conv);
+ return tag_ptr(ret_conv, true);
+}
+
void __attribute__((export_name("TS_CVec_CVec_RouteHopZZ_free"))) TS_CVec_CVec_RouteHopZZ_free(ptrArray _res) {
LDKCVec_CVec_RouteHopZZ _res_constr;
_res_constr.datalen = _res->arr_len;
}
uint64_t __attribute__((export_name("TS_CResult_RouteDecodeErrorZ_err"))) TS_CResult_RouteDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ");
*ret_conv = CResult_RouteDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
uint64_t __attribute__((export_name("TS_CResult_RouteParametersDecodeErrorZ_err"))) TS_CResult_RouteParametersDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ");
*ret_conv = CResult_RouteParametersDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
CVec_RouteHintZ_free(_res_constr);
}
-uint64_t __attribute__((export_name("TS_COption_u64Z_some"))) TS_COption_u64Z_some(int64_t o) {
- LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
- *ret_copy = COption_u64Z_some(o);
- uint64_t ret_ref = tag_ptr(ret_copy, true);
- return ret_ref;
-}
-
-uint64_t __attribute__((export_name("TS_COption_u64Z_none"))) TS_COption_u64Z_none() {
- LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
- *ret_copy = COption_u64Z_none();
- uint64_t ret_ref = tag_ptr(ret_copy, true);
- return ret_ref;
-}
-
-void __attribute__((export_name("TS_COption_u64Z_free"))) TS_COption_u64Z_free(uint64_t _res) {
- if (!ptr_is_owned(_res)) return;
- void* _res_ptr = untag_ptr(_res);
- CHECK_ACCESS(_res_ptr);
- LDKCOption_u64Z _res_conv = *(LDKCOption_u64Z*)(_res_ptr);
- FREE(untag_ptr(_res));
- COption_u64Z_free(_res_conv);
-}
-
-static inline uint64_t COption_u64Z_clone_ptr(LDKCOption_u64Z *NONNULL_PTR arg) {
- LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
- *ret_copy = COption_u64Z_clone(arg);
- uint64_t ret_ref = tag_ptr(ret_copy, true);
- return ret_ref;
-}
-int64_t __attribute__((export_name("TS_COption_u64Z_clone_ptr"))) TS_COption_u64Z_clone_ptr(uint64_t arg) {
- LDKCOption_u64Z* arg_conv = (LDKCOption_u64Z*)untag_ptr(arg);
- int64_t ret_conv = COption_u64Z_clone_ptr(arg_conv);
- return ret_conv;
-}
-
-uint64_t __attribute__((export_name("TS_COption_u64Z_clone"))) TS_COption_u64Z_clone(uint64_t orig) {
- LDKCOption_u64Z* orig_conv = (LDKCOption_u64Z*)untag_ptr(orig);
- LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
- *ret_copy = COption_u64Z_clone(orig_conv);
- uint64_t ret_ref = tag_ptr(ret_copy, true);
- return ret_ref;
-}
-
void __attribute__((export_name("TS_CVec_u64Z_free"))) TS_CVec_u64Z_free(int64_tArray _res) {
LDKCVec_u64Z _res_constr;
_res_constr.datalen = _res->arr_len;
}
uint64_t __attribute__((export_name("TS_CResult_PaymentParametersDecodeErrorZ_err"))) TS_CResult_PaymentParametersDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_PaymentParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentParametersDecodeErrorZ), "LDKCResult_PaymentParametersDecodeErrorZ");
*ret_conv = CResult_PaymentParametersDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
uint64_t __attribute__((export_name("TS_CResult_RouteHintDecodeErrorZ_err"))) TS_CResult_RouteHintDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ");
*ret_conv = CResult_RouteHintDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
uint64_t __attribute__((export_name("TS_CResult_RouteHintHopDecodeErrorZ_err"))) TS_CResult_RouteHintHopDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ");
*ret_conv = CResult_RouteHintHopDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
return tag_ptr(ret_conv, true);
}
-void __attribute__((export_name("TS_CVec_ChannelDetailsZ_free"))) TS_CVec_ChannelDetailsZ_free(uint64_tArray _res) {
- LDKCVec_ChannelDetailsZ _res_constr;
- _res_constr.datalen = _res->arr_len;
- if (_res_constr.datalen > 0)
- _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
- else
- _res_constr.data = NULL;
- uint64_t* _res_vals = _res->elems;
- for (size_t q = 0; q < _res_constr.datalen; q++) {
- uint64_t _res_conv_16 = _res_vals[q];
- LDKChannelDetails _res_conv_16_conv;
- _res_conv_16_conv.inner = untag_ptr(_res_conv_16);
- _res_conv_16_conv.is_owned = ptr_is_owned(_res_conv_16);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_16_conv);
- _res_constr.data[q] = _res_conv_16_conv;
- }
- FREE(_res);
- CVec_ChannelDetailsZ_free(_res_constr);
-}
-
-uint64_t __attribute__((export_name("TS_CResult_RouteLightningErrorZ_ok"))) TS_CResult_RouteLightningErrorZ_ok(uint64_t o) {
- LDKRoute o_conv;
- o_conv.inner = untag_ptr(o);
- o_conv.is_owned = ptr_is_owned(o);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
- o_conv = Route_clone(&o_conv);
- LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
- *ret_conv = CResult_RouteLightningErrorZ_ok(o_conv);
+uint64_t __attribute__((export_name("TS_CResult_PaymentPurposeDecodeErrorZ_ok"))) TS_CResult_PaymentPurposeDecodeErrorZ_ok(uint64_t o) {
+ void* o_ptr = untag_ptr(o);
+ CHECK_ACCESS(o_ptr);
+ LDKPaymentPurpose o_conv = *(LDKPaymentPurpose*)(o_ptr);
+ o_conv = PaymentPurpose_clone((LDKPaymentPurpose*)untag_ptr(o));
+ LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ");
+ *ret_conv = CResult_PaymentPurposeDecodeErrorZ_ok(o_conv);
return tag_ptr(ret_conv, true);
}
-uint64_t __attribute__((export_name("TS_CResult_RouteLightningErrorZ_err"))) TS_CResult_RouteLightningErrorZ_err(uint64_t e) {
- LDKLightningError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = LightningError_clone(&e_conv);
- LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
- *ret_conv = CResult_RouteLightningErrorZ_err(e_conv);
+uint64_t __attribute__((export_name("TS_CResult_PaymentPurposeDecodeErrorZ_err"))) TS_CResult_PaymentPurposeDecodeErrorZ_err(uint64_t e) {
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
+ LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ");
+ *ret_conv = CResult_PaymentPurposeDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
-jboolean __attribute__((export_name("TS_CResult_RouteLightningErrorZ_is_ok"))) TS_CResult_RouteLightningErrorZ_is_ok(uint64_t o) {
- LDKCResult_RouteLightningErrorZ* o_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(o);
- jboolean ret_conv = CResult_RouteLightningErrorZ_is_ok(o_conv);
+jboolean __attribute__((export_name("TS_CResult_PaymentPurposeDecodeErrorZ_is_ok"))) TS_CResult_PaymentPurposeDecodeErrorZ_is_ok(uint64_t o) {
+ LDKCResult_PaymentPurposeDecodeErrorZ* o_conv = (LDKCResult_PaymentPurposeDecodeErrorZ*)untag_ptr(o);
+ jboolean ret_conv = CResult_PaymentPurposeDecodeErrorZ_is_ok(o_conv);
return ret_conv;
}
-void __attribute__((export_name("TS_CResult_RouteLightningErrorZ_free"))) TS_CResult_RouteLightningErrorZ_free(uint64_t _res) {
+void __attribute__((export_name("TS_CResult_PaymentPurposeDecodeErrorZ_free"))) TS_CResult_PaymentPurposeDecodeErrorZ_free(uint64_t _res) {
if (!ptr_is_owned(_res)) return;
void* _res_ptr = untag_ptr(_res);
CHECK_ACCESS(_res_ptr);
- LDKCResult_RouteLightningErrorZ _res_conv = *(LDKCResult_RouteLightningErrorZ*)(_res_ptr);
+ LDKCResult_PaymentPurposeDecodeErrorZ _res_conv = *(LDKCResult_PaymentPurposeDecodeErrorZ*)(_res_ptr);
FREE(untag_ptr(_res));
- CResult_RouteLightningErrorZ_free(_res_conv);
+ CResult_PaymentPurposeDecodeErrorZ_free(_res_conv);
}
-static inline uint64_t CResult_RouteLightningErrorZ_clone_ptr(LDKCResult_RouteLightningErrorZ *NONNULL_PTR arg) {
- LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
- *ret_conv = CResult_RouteLightningErrorZ_clone(arg);
+static inline uint64_t CResult_PaymentPurposeDecodeErrorZ_clone_ptr(LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR arg) {
+ LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ");
+ *ret_conv = CResult_PaymentPurposeDecodeErrorZ_clone(arg);
return tag_ptr(ret_conv, true);
}
-int64_t __attribute__((export_name("TS_CResult_RouteLightningErrorZ_clone_ptr"))) TS_CResult_RouteLightningErrorZ_clone_ptr(uint64_t arg) {
- LDKCResult_RouteLightningErrorZ* arg_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(arg);
- int64_t ret_conv = CResult_RouteLightningErrorZ_clone_ptr(arg_conv);
+int64_t __attribute__((export_name("TS_CResult_PaymentPurposeDecodeErrorZ_clone_ptr"))) TS_CResult_PaymentPurposeDecodeErrorZ_clone_ptr(uint64_t arg) {
+ LDKCResult_PaymentPurposeDecodeErrorZ* arg_conv = (LDKCResult_PaymentPurposeDecodeErrorZ*)untag_ptr(arg);
+ int64_t ret_conv = CResult_PaymentPurposeDecodeErrorZ_clone_ptr(arg_conv);
return ret_conv;
}
-uint64_t __attribute__((export_name("TS_CResult_RouteLightningErrorZ_clone"))) TS_CResult_RouteLightningErrorZ_clone(uint64_t orig) {
- LDKCResult_RouteLightningErrorZ* orig_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(orig);
- LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
- *ret_conv = CResult_RouteLightningErrorZ_clone(orig_conv);
+uint64_t __attribute__((export_name("TS_CResult_PaymentPurposeDecodeErrorZ_clone"))) TS_CResult_PaymentPurposeDecodeErrorZ_clone(uint64_t orig) {
+ LDKCResult_PaymentPurposeDecodeErrorZ* orig_conv = (LDKCResult_PaymentPurposeDecodeErrorZ*)untag_ptr(orig);
+ LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ");
+ *ret_conv = CResult_PaymentPurposeDecodeErrorZ_clone(orig_conv);
return tag_ptr(ret_conv, true);
}
-void __attribute__((export_name("TS_CVec_PublicKeyZ_free"))) TS_CVec_PublicKeyZ_free(ptrArray _res) {
- LDKCVec_PublicKeyZ _res_constr;
- _res_constr.datalen = _res->arr_len;
- if (_res_constr.datalen > 0)
- _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements");
- else
- _res_constr.data = NULL;
- int8_tArray* _res_vals = (void*) _res->elems;
- for (size_t m = 0; m < _res_constr.datalen; m++) {
- int8_tArray _res_conv_12 = _res_vals[m];
- LDKPublicKey _res_conv_12_ref;
- CHECK(_res_conv_12->arr_len == 33);
- memcpy(_res_conv_12_ref.compressed_form, _res_conv_12->elems, 33); FREE(_res_conv_12);
- _res_constr.data[m] = _res_conv_12_ref;
- }
- FREE(_res);
- CVec_PublicKeyZ_free(_res_constr);
+uint64_t __attribute__((export_name("TS_COption_NetworkUpdateZ_some"))) TS_COption_NetworkUpdateZ_some(uint64_t o) {
+ void* o_ptr = untag_ptr(o);
+ CHECK_ACCESS(o_ptr);
+ LDKNetworkUpdate o_conv = *(LDKNetworkUpdate*)(o_ptr);
+ o_conv = NetworkUpdate_clone((LDKNetworkUpdate*)untag_ptr(o));
+ LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ");
+ *ret_copy = COption_NetworkUpdateZ_some(o_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
}
-uint64_t __attribute__((export_name("TS_CResult_PaymentPurposeDecodeErrorZ_ok"))) TS_CResult_PaymentPurposeDecodeErrorZ_ok(uint64_t o) {
+uint64_t __attribute__((export_name("TS_COption_NetworkUpdateZ_none"))) TS_COption_NetworkUpdateZ_none() {
+ LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ");
+ *ret_copy = COption_NetworkUpdateZ_none();
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+void __attribute__((export_name("TS_COption_NetworkUpdateZ_free"))) TS_COption_NetworkUpdateZ_free(uint64_t _res) {
+ if (!ptr_is_owned(_res)) return;
+ void* _res_ptr = untag_ptr(_res);
+ CHECK_ACCESS(_res_ptr);
+ LDKCOption_NetworkUpdateZ _res_conv = *(LDKCOption_NetworkUpdateZ*)(_res_ptr);
+ FREE(untag_ptr(_res));
+ COption_NetworkUpdateZ_free(_res_conv);
+}
+
+static inline uint64_t COption_NetworkUpdateZ_clone_ptr(LDKCOption_NetworkUpdateZ *NONNULL_PTR arg) {
+ LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ");
+ *ret_copy = COption_NetworkUpdateZ_clone(arg);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+int64_t __attribute__((export_name("TS_COption_NetworkUpdateZ_clone_ptr"))) TS_COption_NetworkUpdateZ_clone_ptr(uint64_t arg) {
+ LDKCOption_NetworkUpdateZ* arg_conv = (LDKCOption_NetworkUpdateZ*)untag_ptr(arg);
+ int64_t ret_conv = COption_NetworkUpdateZ_clone_ptr(arg_conv);
+ return ret_conv;
+}
+
+uint64_t __attribute__((export_name("TS_COption_NetworkUpdateZ_clone"))) TS_COption_NetworkUpdateZ_clone(uint64_t orig) {
+ LDKCOption_NetworkUpdateZ* orig_conv = (LDKCOption_NetworkUpdateZ*)untag_ptr(orig);
+ LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ");
+ *ret_copy = COption_NetworkUpdateZ_clone(orig_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+uint64_t __attribute__((export_name("TS_COption_PathFailureZ_some"))) TS_COption_PathFailureZ_some(uint64_t o) {
void* o_ptr = untag_ptr(o);
CHECK_ACCESS(o_ptr);
- LDKPaymentPurpose o_conv = *(LDKPaymentPurpose*)(o_ptr);
- o_conv = PaymentPurpose_clone((LDKPaymentPurpose*)untag_ptr(o));
- LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ");
- *ret_conv = CResult_PaymentPurposeDecodeErrorZ_ok(o_conv);
+ LDKPathFailure o_conv = *(LDKPathFailure*)(o_ptr);
+ o_conv = PathFailure_clone((LDKPathFailure*)untag_ptr(o));
+ LDKCOption_PathFailureZ *ret_copy = MALLOC(sizeof(LDKCOption_PathFailureZ), "LDKCOption_PathFailureZ");
+ *ret_copy = COption_PathFailureZ_some(o_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+uint64_t __attribute__((export_name("TS_COption_PathFailureZ_none"))) TS_COption_PathFailureZ_none() {
+ LDKCOption_PathFailureZ *ret_copy = MALLOC(sizeof(LDKCOption_PathFailureZ), "LDKCOption_PathFailureZ");
+ *ret_copy = COption_PathFailureZ_none();
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+void __attribute__((export_name("TS_COption_PathFailureZ_free"))) TS_COption_PathFailureZ_free(uint64_t _res) {
+ if (!ptr_is_owned(_res)) return;
+ void* _res_ptr = untag_ptr(_res);
+ CHECK_ACCESS(_res_ptr);
+ LDKCOption_PathFailureZ _res_conv = *(LDKCOption_PathFailureZ*)(_res_ptr);
+ FREE(untag_ptr(_res));
+ COption_PathFailureZ_free(_res_conv);
+}
+
+static inline uint64_t COption_PathFailureZ_clone_ptr(LDKCOption_PathFailureZ *NONNULL_PTR arg) {
+ LDKCOption_PathFailureZ *ret_copy = MALLOC(sizeof(LDKCOption_PathFailureZ), "LDKCOption_PathFailureZ");
+ *ret_copy = COption_PathFailureZ_clone(arg);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+int64_t __attribute__((export_name("TS_COption_PathFailureZ_clone_ptr"))) TS_COption_PathFailureZ_clone_ptr(uint64_t arg) {
+ LDKCOption_PathFailureZ* arg_conv = (LDKCOption_PathFailureZ*)untag_ptr(arg);
+ int64_t ret_conv = COption_PathFailureZ_clone_ptr(arg_conv);
+ return ret_conv;
+}
+
+uint64_t __attribute__((export_name("TS_COption_PathFailureZ_clone"))) TS_COption_PathFailureZ_clone(uint64_t orig) {
+ LDKCOption_PathFailureZ* orig_conv = (LDKCOption_PathFailureZ*)untag_ptr(orig);
+ LDKCOption_PathFailureZ *ret_copy = MALLOC(sizeof(LDKCOption_PathFailureZ), "LDKCOption_PathFailureZ");
+ *ret_copy = COption_PathFailureZ_clone(orig_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+uint64_t __attribute__((export_name("TS_CResult_COption_PathFailureZDecodeErrorZ_ok"))) TS_CResult_COption_PathFailureZDecodeErrorZ_ok(uint64_t o) {
+ void* o_ptr = untag_ptr(o);
+ CHECK_ACCESS(o_ptr);
+ LDKCOption_PathFailureZ o_conv = *(LDKCOption_PathFailureZ*)(o_ptr);
+ o_conv = COption_PathFailureZ_clone((LDKCOption_PathFailureZ*)untag_ptr(o));
+ LDKCResult_COption_PathFailureZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_PathFailureZDecodeErrorZ), "LDKCResult_COption_PathFailureZDecodeErrorZ");
+ *ret_conv = CResult_COption_PathFailureZDecodeErrorZ_ok(o_conv);
return tag_ptr(ret_conv, true);
}
-uint64_t __attribute__((export_name("TS_CResult_PaymentPurposeDecodeErrorZ_err"))) TS_CResult_PaymentPurposeDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
- LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ");
- *ret_conv = CResult_PaymentPurposeDecodeErrorZ_err(e_conv);
+uint64_t __attribute__((export_name("TS_CResult_COption_PathFailureZDecodeErrorZ_err"))) TS_CResult_COption_PathFailureZDecodeErrorZ_err(uint64_t e) {
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
+ LDKCResult_COption_PathFailureZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_PathFailureZDecodeErrorZ), "LDKCResult_COption_PathFailureZDecodeErrorZ");
+ *ret_conv = CResult_COption_PathFailureZDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
-jboolean __attribute__((export_name("TS_CResult_PaymentPurposeDecodeErrorZ_is_ok"))) TS_CResult_PaymentPurposeDecodeErrorZ_is_ok(uint64_t o) {
- LDKCResult_PaymentPurposeDecodeErrorZ* o_conv = (LDKCResult_PaymentPurposeDecodeErrorZ*)untag_ptr(o);
- jboolean ret_conv = CResult_PaymentPurposeDecodeErrorZ_is_ok(o_conv);
+jboolean __attribute__((export_name("TS_CResult_COption_PathFailureZDecodeErrorZ_is_ok"))) TS_CResult_COption_PathFailureZDecodeErrorZ_is_ok(uint64_t o) {
+ LDKCResult_COption_PathFailureZDecodeErrorZ* o_conv = (LDKCResult_COption_PathFailureZDecodeErrorZ*)untag_ptr(o);
+ jboolean ret_conv = CResult_COption_PathFailureZDecodeErrorZ_is_ok(o_conv);
return ret_conv;
}
-void __attribute__((export_name("TS_CResult_PaymentPurposeDecodeErrorZ_free"))) TS_CResult_PaymentPurposeDecodeErrorZ_free(uint64_t _res) {
+void __attribute__((export_name("TS_CResult_COption_PathFailureZDecodeErrorZ_free"))) TS_CResult_COption_PathFailureZDecodeErrorZ_free(uint64_t _res) {
if (!ptr_is_owned(_res)) return;
void* _res_ptr = untag_ptr(_res);
CHECK_ACCESS(_res_ptr);
- LDKCResult_PaymentPurposeDecodeErrorZ _res_conv = *(LDKCResult_PaymentPurposeDecodeErrorZ*)(_res_ptr);
+ LDKCResult_COption_PathFailureZDecodeErrorZ _res_conv = *(LDKCResult_COption_PathFailureZDecodeErrorZ*)(_res_ptr);
FREE(untag_ptr(_res));
- CResult_PaymentPurposeDecodeErrorZ_free(_res_conv);
+ CResult_COption_PathFailureZDecodeErrorZ_free(_res_conv);
}
-static inline uint64_t CResult_PaymentPurposeDecodeErrorZ_clone_ptr(LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR arg) {
- LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ");
- *ret_conv = CResult_PaymentPurposeDecodeErrorZ_clone(arg);
+static inline uint64_t CResult_COption_PathFailureZDecodeErrorZ_clone_ptr(LDKCResult_COption_PathFailureZDecodeErrorZ *NONNULL_PTR arg) {
+ LDKCResult_COption_PathFailureZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_PathFailureZDecodeErrorZ), "LDKCResult_COption_PathFailureZDecodeErrorZ");
+ *ret_conv = CResult_COption_PathFailureZDecodeErrorZ_clone(arg);
return tag_ptr(ret_conv, true);
}
-int64_t __attribute__((export_name("TS_CResult_PaymentPurposeDecodeErrorZ_clone_ptr"))) TS_CResult_PaymentPurposeDecodeErrorZ_clone_ptr(uint64_t arg) {
- LDKCResult_PaymentPurposeDecodeErrorZ* arg_conv = (LDKCResult_PaymentPurposeDecodeErrorZ*)untag_ptr(arg);
- int64_t ret_conv = CResult_PaymentPurposeDecodeErrorZ_clone_ptr(arg_conv);
+int64_t __attribute__((export_name("TS_CResult_COption_PathFailureZDecodeErrorZ_clone_ptr"))) TS_CResult_COption_PathFailureZDecodeErrorZ_clone_ptr(uint64_t arg) {
+ LDKCResult_COption_PathFailureZDecodeErrorZ* arg_conv = (LDKCResult_COption_PathFailureZDecodeErrorZ*)untag_ptr(arg);
+ int64_t ret_conv = CResult_COption_PathFailureZDecodeErrorZ_clone_ptr(arg_conv);
return ret_conv;
}
-uint64_t __attribute__((export_name("TS_CResult_PaymentPurposeDecodeErrorZ_clone"))) TS_CResult_PaymentPurposeDecodeErrorZ_clone(uint64_t orig) {
- LDKCResult_PaymentPurposeDecodeErrorZ* orig_conv = (LDKCResult_PaymentPurposeDecodeErrorZ*)untag_ptr(orig);
- LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ");
- *ret_conv = CResult_PaymentPurposeDecodeErrorZ_clone(orig_conv);
+uint64_t __attribute__((export_name("TS_CResult_COption_PathFailureZDecodeErrorZ_clone"))) TS_CResult_COption_PathFailureZDecodeErrorZ_clone(uint64_t orig) {
+ LDKCResult_COption_PathFailureZDecodeErrorZ* orig_conv = (LDKCResult_COption_PathFailureZDecodeErrorZ*)untag_ptr(orig);
+ LDKCResult_COption_PathFailureZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_PathFailureZDecodeErrorZ), "LDKCResult_COption_PathFailureZDecodeErrorZ");
+ *ret_conv = CResult_COption_PathFailureZDecodeErrorZ_clone(orig_conv);
return tag_ptr(ret_conv, true);
}
}
uint64_t __attribute__((export_name("TS_CResult_COption_ClosureReasonZDecodeErrorZ_err"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ");
*ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
uint64_t __attribute__((export_name("TS_CResult_COption_HTLCDestinationZDecodeErrorZ_err"))) TS_CResult_COption_HTLCDestinationZDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_COption_HTLCDestinationZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_HTLCDestinationZDecodeErrorZ), "LDKCResult_COption_HTLCDestinationZDecodeErrorZ");
*ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
return tag_ptr(ret_conv, true);
}
-uint64_t __attribute__((export_name("TS_COption_NetworkUpdateZ_some"))) TS_COption_NetworkUpdateZ_some(uint64_t o) {
- void* o_ptr = untag_ptr(o);
- CHECK_ACCESS(o_ptr);
- LDKNetworkUpdate o_conv = *(LDKNetworkUpdate*)(o_ptr);
- o_conv = NetworkUpdate_clone((LDKNetworkUpdate*)untag_ptr(o));
- LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ");
- *ret_copy = COption_NetworkUpdateZ_some(o_conv);
+uint64_t __attribute__((export_name("TS_COption_u128Z_some"))) TS_COption_u128Z_some(int8_tArray o) {
+ LDKU128 o_ref;
+ CHECK(o->arr_len == 16);
+ memcpy(o_ref.le_bytes, o->elems, 16); FREE(o);
+ LDKCOption_u128Z *ret_copy = MALLOC(sizeof(LDKCOption_u128Z), "LDKCOption_u128Z");
+ *ret_copy = COption_u128Z_some(o_ref);
uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
-uint64_t __attribute__((export_name("TS_COption_NetworkUpdateZ_none"))) TS_COption_NetworkUpdateZ_none() {
- LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ");
- *ret_copy = COption_NetworkUpdateZ_none();
+uint64_t __attribute__((export_name("TS_COption_u128Z_none"))) TS_COption_u128Z_none() {
+ LDKCOption_u128Z *ret_copy = MALLOC(sizeof(LDKCOption_u128Z), "LDKCOption_u128Z");
+ *ret_copy = COption_u128Z_none();
uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
-void __attribute__((export_name("TS_COption_NetworkUpdateZ_free"))) TS_COption_NetworkUpdateZ_free(uint64_t _res) {
+void __attribute__((export_name("TS_COption_u128Z_free"))) TS_COption_u128Z_free(uint64_t _res) {
if (!ptr_is_owned(_res)) return;
void* _res_ptr = untag_ptr(_res);
CHECK_ACCESS(_res_ptr);
- LDKCOption_NetworkUpdateZ _res_conv = *(LDKCOption_NetworkUpdateZ*)(_res_ptr);
+ LDKCOption_u128Z _res_conv = *(LDKCOption_u128Z*)(_res_ptr);
FREE(untag_ptr(_res));
- COption_NetworkUpdateZ_free(_res_conv);
+ COption_u128Z_free(_res_conv);
}
-static inline uint64_t COption_NetworkUpdateZ_clone_ptr(LDKCOption_NetworkUpdateZ *NONNULL_PTR arg) {
- LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ");
- *ret_copy = COption_NetworkUpdateZ_clone(arg);
+static inline uint64_t COption_u128Z_clone_ptr(LDKCOption_u128Z *NONNULL_PTR arg) {
+ LDKCOption_u128Z *ret_copy = MALLOC(sizeof(LDKCOption_u128Z), "LDKCOption_u128Z");
+ *ret_copy = COption_u128Z_clone(arg);
uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
-int64_t __attribute__((export_name("TS_COption_NetworkUpdateZ_clone_ptr"))) TS_COption_NetworkUpdateZ_clone_ptr(uint64_t arg) {
- LDKCOption_NetworkUpdateZ* arg_conv = (LDKCOption_NetworkUpdateZ*)untag_ptr(arg);
- int64_t ret_conv = COption_NetworkUpdateZ_clone_ptr(arg_conv);
+int64_t __attribute__((export_name("TS_COption_u128Z_clone_ptr"))) TS_COption_u128Z_clone_ptr(uint64_t arg) {
+ LDKCOption_u128Z* arg_conv = (LDKCOption_u128Z*)untag_ptr(arg);
+ int64_t ret_conv = COption_u128Z_clone_ptr(arg_conv);
return ret_conv;
}
-uint64_t __attribute__((export_name("TS_COption_NetworkUpdateZ_clone"))) TS_COption_NetworkUpdateZ_clone(uint64_t orig) {
- LDKCOption_NetworkUpdateZ* orig_conv = (LDKCOption_NetworkUpdateZ*)untag_ptr(orig);
- LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ");
- *ret_copy = COption_NetworkUpdateZ_clone(orig_conv);
+uint64_t __attribute__((export_name("TS_COption_u128Z_clone"))) TS_COption_u128Z_clone(uint64_t orig) {
+ LDKCOption_u128Z* orig_conv = (LDKCOption_u128Z*)untag_ptr(orig);
+ LDKCOption_u128Z *ret_copy = MALLOC(sizeof(LDKCOption_u128Z), "LDKCOption_u128Z");
+ *ret_copy = COption_u128Z_clone(orig_conv);
uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
uint64_t __attribute__((export_name("TS_CResult_COption_EventZDecodeErrorZ_err"))) TS_CResult_COption_EventZDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ");
*ret_conv = CResult_COption_EventZDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
CVec_MessageSendEventZ_free(_res_constr);
}
-uint64_t __attribute__((export_name("TS_CResult_TxOutAccessErrorZ_ok"))) TS_CResult_TxOutAccessErrorZ_ok(uint64_t o) {
- void* o_ptr = untag_ptr(o);
- CHECK_ACCESS(o_ptr);
- LDKTxOut o_conv = *(LDKTxOut*)(o_ptr);
- o_conv = TxOut_clone((LDKTxOut*)untag_ptr(o));
- LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ");
- *ret_conv = CResult_TxOutAccessErrorZ_ok(o_conv);
- return tag_ptr(ret_conv, true);
-}
-
-uint64_t __attribute__((export_name("TS_CResult_TxOutAccessErrorZ_err"))) TS_CResult_TxOutAccessErrorZ_err(uint32_t e) {
- LDKAccessError e_conv = LDKAccessError_from_js(e);
- LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ");
- *ret_conv = CResult_TxOutAccessErrorZ_err(e_conv);
- return tag_ptr(ret_conv, true);
-}
-
-jboolean __attribute__((export_name("TS_CResult_TxOutAccessErrorZ_is_ok"))) TS_CResult_TxOutAccessErrorZ_is_ok(uint64_t o) {
- LDKCResult_TxOutAccessErrorZ* o_conv = (LDKCResult_TxOutAccessErrorZ*)untag_ptr(o);
- jboolean ret_conv = CResult_TxOutAccessErrorZ_is_ok(o_conv);
- return ret_conv;
-}
-
-void __attribute__((export_name("TS_CResult_TxOutAccessErrorZ_free"))) TS_CResult_TxOutAccessErrorZ_free(uint64_t _res) {
- if (!ptr_is_owned(_res)) return;
- void* _res_ptr = untag_ptr(_res);
- CHECK_ACCESS(_res_ptr);
- LDKCResult_TxOutAccessErrorZ _res_conv = *(LDKCResult_TxOutAccessErrorZ*)(_res_ptr);
- FREE(untag_ptr(_res));
- CResult_TxOutAccessErrorZ_free(_res_conv);
-}
-
-static inline uint64_t CResult_TxOutAccessErrorZ_clone_ptr(LDKCResult_TxOutAccessErrorZ *NONNULL_PTR arg) {
- LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ");
- *ret_conv = CResult_TxOutAccessErrorZ_clone(arg);
- return tag_ptr(ret_conv, true);
-}
-int64_t __attribute__((export_name("TS_CResult_TxOutAccessErrorZ_clone_ptr"))) TS_CResult_TxOutAccessErrorZ_clone_ptr(uint64_t arg) {
- LDKCResult_TxOutAccessErrorZ* arg_conv = (LDKCResult_TxOutAccessErrorZ*)untag_ptr(arg);
- int64_t ret_conv = CResult_TxOutAccessErrorZ_clone_ptr(arg_conv);
- return ret_conv;
-}
-
-uint64_t __attribute__((export_name("TS_CResult_TxOutAccessErrorZ_clone"))) TS_CResult_TxOutAccessErrorZ_clone(uint64_t orig) {
- LDKCResult_TxOutAccessErrorZ* orig_conv = (LDKCResult_TxOutAccessErrorZ*)untag_ptr(orig);
- LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ");
- *ret_conv = CResult_TxOutAccessErrorZ_clone(orig_conv);
- return tag_ptr(ret_conv, true);
-}
-
static inline uint64_t C2Tuple_usizeTransactionZ_clone_ptr(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR arg) {
LDKC2Tuple_usizeTransactionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ");
*ret_conv = C2Tuple_usizeTransactionZ_clone(arg);
CVec_C2Tuple_usizeTransactionZZ_free(_res_constr);
}
-void __attribute__((export_name("TS_CVec_TxidZ_free"))) TS_CVec_TxidZ_free(ptrArray _res) {
- LDKCVec_TxidZ _res_constr;
- _res_constr.datalen = _res->arr_len;
- if (_res_constr.datalen > 0)
- _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_TxidZ Elements");
- else
- _res_constr.data = NULL;
- int8_tArray* _res_vals = (void*) _res->elems;
- for (size_t m = 0; m < _res_constr.datalen; m++) {
- int8_tArray _res_conv_12 = _res_vals[m];
- LDKThirtyTwoBytes _res_conv_12_ref;
- CHECK(_res_conv_12->arr_len == 32);
- memcpy(_res_conv_12_ref.data, _res_conv_12->elems, 32); FREE(_res_conv_12);
- _res_constr.data[m] = _res_conv_12_ref;
- }
- FREE(_res);
- CVec_TxidZ_free(_res_constr);
-}
-
-uint64_t __attribute__((export_name("TS_CResult_NoneChannelMonitorUpdateErrZ_ok"))) TS_CResult_NoneChannelMonitorUpdateErrZ_ok() {
- LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
- *ret_conv = CResult_NoneChannelMonitorUpdateErrZ_ok();
+static inline uint64_t C2Tuple_TxidBlockHashZ_clone_ptr(LDKC2Tuple_TxidBlockHashZ *NONNULL_PTR arg) {
+ LDKC2Tuple_TxidBlockHashZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidBlockHashZ), "LDKC2Tuple_TxidBlockHashZ");
+ *ret_conv = C2Tuple_TxidBlockHashZ_clone(arg);
return tag_ptr(ret_conv, true);
}
+int64_t __attribute__((export_name("TS_C2Tuple_TxidBlockHashZ_clone_ptr"))) TS_C2Tuple_TxidBlockHashZ_clone_ptr(uint64_t arg) {
+ LDKC2Tuple_TxidBlockHashZ* arg_conv = (LDKC2Tuple_TxidBlockHashZ*)untag_ptr(arg);
+ int64_t ret_conv = C2Tuple_TxidBlockHashZ_clone_ptr(arg_conv);
+ return ret_conv;
+}
-uint64_t __attribute__((export_name("TS_CResult_NoneChannelMonitorUpdateErrZ_err"))) TS_CResult_NoneChannelMonitorUpdateErrZ_err(uint32_t e) {
- LDKChannelMonitorUpdateErr e_conv = LDKChannelMonitorUpdateErr_from_js(e);
- LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
- *ret_conv = CResult_NoneChannelMonitorUpdateErrZ_err(e_conv);
+uint64_t __attribute__((export_name("TS_C2Tuple_TxidBlockHashZ_clone"))) TS_C2Tuple_TxidBlockHashZ_clone(uint64_t orig) {
+ LDKC2Tuple_TxidBlockHashZ* orig_conv = (LDKC2Tuple_TxidBlockHashZ*)untag_ptr(orig);
+ LDKC2Tuple_TxidBlockHashZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidBlockHashZ), "LDKC2Tuple_TxidBlockHashZ");
+ *ret_conv = C2Tuple_TxidBlockHashZ_clone(orig_conv);
return tag_ptr(ret_conv, true);
}
-jboolean __attribute__((export_name("TS_CResult_NoneChannelMonitorUpdateErrZ_is_ok"))) TS_CResult_NoneChannelMonitorUpdateErrZ_is_ok(uint64_t o) {
- LDKCResult_NoneChannelMonitorUpdateErrZ* o_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)untag_ptr(o);
- jboolean ret_conv = CResult_NoneChannelMonitorUpdateErrZ_is_ok(o_conv);
- return ret_conv;
+uint64_t __attribute__((export_name("TS_C2Tuple_TxidBlockHashZ_new"))) TS_C2Tuple_TxidBlockHashZ_new(int8_tArray a, int8_tArray b) {
+ LDKThirtyTwoBytes a_ref;
+ CHECK(a->arr_len == 32);
+ memcpy(a_ref.data, a->elems, 32); FREE(a);
+ LDKThirtyTwoBytes b_ref;
+ CHECK(b->arr_len == 32);
+ memcpy(b_ref.data, b->elems, 32); FREE(b);
+ LDKC2Tuple_TxidBlockHashZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidBlockHashZ), "LDKC2Tuple_TxidBlockHashZ");
+ *ret_conv = C2Tuple_TxidBlockHashZ_new(a_ref, b_ref);
+ return tag_ptr(ret_conv, true);
}
-void __attribute__((export_name("TS_CResult_NoneChannelMonitorUpdateErrZ_free"))) TS_CResult_NoneChannelMonitorUpdateErrZ_free(uint64_t _res) {
+void __attribute__((export_name("TS_C2Tuple_TxidBlockHashZ_free"))) TS_C2Tuple_TxidBlockHashZ_free(uint64_t _res) {
if (!ptr_is_owned(_res)) return;
void* _res_ptr = untag_ptr(_res);
CHECK_ACCESS(_res_ptr);
- LDKCResult_NoneChannelMonitorUpdateErrZ _res_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(_res_ptr);
+ LDKC2Tuple_TxidBlockHashZ _res_conv = *(LDKC2Tuple_TxidBlockHashZ*)(_res_ptr);
FREE(untag_ptr(_res));
- CResult_NoneChannelMonitorUpdateErrZ_free(_res_conv);
+ C2Tuple_TxidBlockHashZ_free(_res_conv);
}
-static inline uint64_t CResult_NoneChannelMonitorUpdateErrZ_clone_ptr(LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR arg) {
- LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
- *ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone(arg);
- return tag_ptr(ret_conv, true);
-}
-int64_t __attribute__((export_name("TS_CResult_NoneChannelMonitorUpdateErrZ_clone_ptr"))) TS_CResult_NoneChannelMonitorUpdateErrZ_clone_ptr(uint64_t arg) {
- LDKCResult_NoneChannelMonitorUpdateErrZ* arg_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)untag_ptr(arg);
- int64_t ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone_ptr(arg_conv);
- return ret_conv;
-}
-
-uint64_t __attribute__((export_name("TS_CResult_NoneChannelMonitorUpdateErrZ_clone"))) TS_CResult_NoneChannelMonitorUpdateErrZ_clone(uint64_t orig) {
- LDKCResult_NoneChannelMonitorUpdateErrZ* orig_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)untag_ptr(orig);
- LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
- *ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone(orig_conv);
- return tag_ptr(ret_conv, true);
+void __attribute__((export_name("TS_CVec_C2Tuple_TxidBlockHashZZ_free"))) TS_CVec_C2Tuple_TxidBlockHashZZ_free(uint64_tArray _res) {
+ LDKCVec_C2Tuple_TxidBlockHashZZ _res_constr;
+ _res_constr.datalen = _res->arr_len;
+ if (_res_constr.datalen > 0)
+ _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_TxidBlockHashZ), "LDKCVec_C2Tuple_TxidBlockHashZZ Elements");
+ else
+ _res_constr.data = NULL;
+ uint64_t* _res_vals = _res->elems;
+ for (size_t z = 0; z < _res_constr.datalen; z++) {
+ uint64_t _res_conv_25 = _res_vals[z];
+ void* _res_conv_25_ptr = untag_ptr(_res_conv_25);
+ CHECK_ACCESS(_res_conv_25_ptr);
+ LDKC2Tuple_TxidBlockHashZ _res_conv_25_conv = *(LDKC2Tuple_TxidBlockHashZ*)(_res_conv_25_ptr);
+ FREE(untag_ptr(_res_conv_25));
+ _res_constr.data[z] = _res_conv_25_conv;
+ }
+ FREE(_res);
+ CVec_C2Tuple_TxidBlockHashZZ_free(_res_constr);
}
void __attribute__((export_name("TS_CVec_MonitorEventZ_free"))) TS_CVec_MonitorEventZ_free(uint64_tArray _res) {
CVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ_free(_res_constr);
}
-uint64_t __attribute__((export_name("TS_COption_C2Tuple_usizeTransactionZZ_some"))) TS_COption_C2Tuple_usizeTransactionZZ_some(uint64_t o) {
- void* o_ptr = untag_ptr(o);
- CHECK_ACCESS(o_ptr);
- LDKC2Tuple_usizeTransactionZ o_conv = *(LDKC2Tuple_usizeTransactionZ*)(o_ptr);
- o_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)untag_ptr(o));
- LDKCOption_C2Tuple_usizeTransactionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_usizeTransactionZZ), "LDKCOption_C2Tuple_usizeTransactionZZ");
- *ret_copy = COption_C2Tuple_usizeTransactionZZ_some(o_conv);
- uint64_t ret_ref = tag_ptr(ret_copy, true);
- return ret_ref;
-}
-
-uint64_t __attribute__((export_name("TS_COption_C2Tuple_usizeTransactionZZ_none"))) TS_COption_C2Tuple_usizeTransactionZZ_none() {
- LDKCOption_C2Tuple_usizeTransactionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_usizeTransactionZZ), "LDKCOption_C2Tuple_usizeTransactionZZ");
- *ret_copy = COption_C2Tuple_usizeTransactionZZ_none();
- uint64_t ret_ref = tag_ptr(ret_copy, true);
- return ret_ref;
-}
-
-void __attribute__((export_name("TS_COption_C2Tuple_usizeTransactionZZ_free"))) TS_COption_C2Tuple_usizeTransactionZZ_free(uint64_t _res) {
- if (!ptr_is_owned(_res)) return;
- void* _res_ptr = untag_ptr(_res);
- CHECK_ACCESS(_res_ptr);
- LDKCOption_C2Tuple_usizeTransactionZZ _res_conv = *(LDKCOption_C2Tuple_usizeTransactionZZ*)(_res_ptr);
- FREE(untag_ptr(_res));
- COption_C2Tuple_usizeTransactionZZ_free(_res_conv);
-}
-
-static inline uint64_t COption_C2Tuple_usizeTransactionZZ_clone_ptr(LDKCOption_C2Tuple_usizeTransactionZZ *NONNULL_PTR arg) {
- LDKCOption_C2Tuple_usizeTransactionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_usizeTransactionZZ), "LDKCOption_C2Tuple_usizeTransactionZZ");
- *ret_copy = COption_C2Tuple_usizeTransactionZZ_clone(arg);
- uint64_t ret_ref = tag_ptr(ret_copy, true);
- return ret_ref;
-}
-int64_t __attribute__((export_name("TS_COption_C2Tuple_usizeTransactionZZ_clone_ptr"))) TS_COption_C2Tuple_usizeTransactionZZ_clone_ptr(uint64_t arg) {
- LDKCOption_C2Tuple_usizeTransactionZZ* arg_conv = (LDKCOption_C2Tuple_usizeTransactionZZ*)untag_ptr(arg);
- int64_t ret_conv = COption_C2Tuple_usizeTransactionZZ_clone_ptr(arg_conv);
- return ret_conv;
-}
-
-uint64_t __attribute__((export_name("TS_COption_C2Tuple_usizeTransactionZZ_clone"))) TS_COption_C2Tuple_usizeTransactionZZ_clone(uint64_t orig) {
- LDKCOption_C2Tuple_usizeTransactionZZ* orig_conv = (LDKCOption_C2Tuple_usizeTransactionZZ*)untag_ptr(orig);
- LDKCOption_C2Tuple_usizeTransactionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_usizeTransactionZZ), "LDKCOption_C2Tuple_usizeTransactionZZ");
- *ret_copy = COption_C2Tuple_usizeTransactionZZ_clone(orig_conv);
- uint64_t ret_ref = tag_ptr(ret_copy, true);
- return ret_ref;
-}
-
uint64_t __attribute__((export_name("TS_CResult_FixedPenaltyScorerDecodeErrorZ_ok"))) TS_CResult_FixedPenaltyScorerDecodeErrorZ_ok(uint64_t o) {
LDKFixedPenaltyScorer o_conv;
o_conv.inner = untag_ptr(o);
}
uint64_t __attribute__((export_name("TS_CResult_FixedPenaltyScorerDecodeErrorZ_err"))) TS_CResult_FixedPenaltyScorerDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ");
*ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
return ret_ref;
}
+static inline uint64_t C2Tuple_Z_clone_ptr(LDKC2Tuple_Z *NONNULL_PTR arg) {
+ LDKC2Tuple_Z* ret_conv = MALLOC(sizeof(LDKC2Tuple_Z), "LDKC2Tuple_Z");
+ *ret_conv = C2Tuple_Z_clone(arg);
+ return tag_ptr(ret_conv, true);
+}
+int64_t __attribute__((export_name("TS_C2Tuple_Z_clone_ptr"))) TS_C2Tuple_Z_clone_ptr(uint64_t arg) {
+ LDKC2Tuple_Z* arg_conv = (LDKC2Tuple_Z*)untag_ptr(arg);
+ int64_t ret_conv = C2Tuple_Z_clone_ptr(arg_conv);
+ return ret_conv;
+}
+
+uint64_t __attribute__((export_name("TS_C2Tuple_Z_clone"))) TS_C2Tuple_Z_clone(uint64_t orig) {
+ LDKC2Tuple_Z* orig_conv = (LDKC2Tuple_Z*)untag_ptr(orig);
+ LDKC2Tuple_Z* ret_conv = MALLOC(sizeof(LDKC2Tuple_Z), "LDKC2Tuple_Z");
+ *ret_conv = C2Tuple_Z_clone(orig_conv);
+ return tag_ptr(ret_conv, true);
+}
+
+uint64_t __attribute__((export_name("TS_C2Tuple_Z_new"))) TS_C2Tuple_Z_new(int16_tArray a, int16_tArray b) {
+ LDKEightU16s a_ref;
+ CHECK(a->arr_len == 8);
+ memcpy(a_ref.data, a->elems, 8 * 2); FREE(a);
+ LDKEightU16s b_ref;
+ CHECK(b->arr_len == 8);
+ memcpy(b_ref.data, b->elems, 8 * 2); FREE(b);
+ LDKC2Tuple_Z* ret_conv = MALLOC(sizeof(LDKC2Tuple_Z), "LDKC2Tuple_Z");
+ *ret_conv = C2Tuple_Z_new(a_ref, b_ref);
+ return tag_ptr(ret_conv, true);
+}
+
+void __attribute__((export_name("TS_C2Tuple_Z_free"))) TS_C2Tuple_Z_free(uint64_t _res) {
+ if (!ptr_is_owned(_res)) return;
+ void* _res_ptr = untag_ptr(_res);
+ CHECK_ACCESS(_res_ptr);
+ LDKC2Tuple_Z _res_conv = *(LDKC2Tuple_Z*)(_res_ptr);
+ FREE(untag_ptr(_res));
+ C2Tuple_Z_free(_res_conv);
+}
+
+static inline uint64_t C2Tuple__u168_u168Z_clone_ptr(LDKC2Tuple__u168_u168Z *NONNULL_PTR arg) {
+ LDKC2Tuple__u168_u168Z* ret_conv = MALLOC(sizeof(LDKC2Tuple__u168_u168Z), "LDKC2Tuple__u168_u168Z");
+ *ret_conv = C2Tuple__u168_u168Z_clone(arg);
+ return tag_ptr(ret_conv, true);
+}
+int64_t __attribute__((export_name("TS_C2Tuple__u168_u168Z_clone_ptr"))) TS_C2Tuple__u168_u168Z_clone_ptr(uint64_t arg) {
+ LDKC2Tuple__u168_u168Z* arg_conv = (LDKC2Tuple__u168_u168Z*)untag_ptr(arg);
+ int64_t ret_conv = C2Tuple__u168_u168Z_clone_ptr(arg_conv);
+ return ret_conv;
+}
+
+uint64_t __attribute__((export_name("TS_C2Tuple__u168_u168Z_clone"))) TS_C2Tuple__u168_u168Z_clone(uint64_t orig) {
+ LDKC2Tuple__u168_u168Z* orig_conv = (LDKC2Tuple__u168_u168Z*)untag_ptr(orig);
+ LDKC2Tuple__u168_u168Z* ret_conv = MALLOC(sizeof(LDKC2Tuple__u168_u168Z), "LDKC2Tuple__u168_u168Z");
+ *ret_conv = C2Tuple__u168_u168Z_clone(orig_conv);
+ return tag_ptr(ret_conv, true);
+}
+
+uint64_t __attribute__((export_name("TS_C2Tuple__u168_u168Z_new"))) TS_C2Tuple__u168_u168Z_new(int16_tArray a, int16_tArray b) {
+ LDKEightU16s a_ref;
+ CHECK(a->arr_len == 8);
+ memcpy(a_ref.data, a->elems, 8 * 2); FREE(a);
+ LDKEightU16s b_ref;
+ CHECK(b->arr_len == 8);
+ memcpy(b_ref.data, b->elems, 8 * 2); FREE(b);
+ LDKC2Tuple__u168_u168Z* ret_conv = MALLOC(sizeof(LDKC2Tuple__u168_u168Z), "LDKC2Tuple__u168_u168Z");
+ *ret_conv = C2Tuple__u168_u168Z_new(a_ref, b_ref);
+ return tag_ptr(ret_conv, true);
+}
+
+void __attribute__((export_name("TS_C2Tuple__u168_u168Z_free"))) TS_C2Tuple__u168_u168Z_free(uint64_t _res) {
+ if (!ptr_is_owned(_res)) return;
+ void* _res_ptr = untag_ptr(_res);
+ CHECK_ACCESS(_res_ptr);
+ LDKC2Tuple__u168_u168Z _res_conv = *(LDKC2Tuple__u168_u168Z*)(_res_ptr);
+ FREE(untag_ptr(_res));
+ C2Tuple__u168_u168Z_free(_res_conv);
+}
+
+uint64_t __attribute__((export_name("TS_COption_C2Tuple_EightU16sEightU16sZZ_some"))) TS_COption_C2Tuple_EightU16sEightU16sZZ_some(uint64_t o) {
+ void* o_ptr = untag_ptr(o);
+ CHECK_ACCESS(o_ptr);
+ LDKC2Tuple__u168_u168Z o_conv = *(LDKC2Tuple__u168_u168Z*)(o_ptr);
+ o_conv = C2Tuple__u168_u168Z_clone((LDKC2Tuple__u168_u168Z*)untag_ptr(o));
+ LDKCOption_C2Tuple_EightU16sEightU16sZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_EightU16sEightU16sZZ), "LDKCOption_C2Tuple_EightU16sEightU16sZZ");
+ *ret_copy = COption_C2Tuple_EightU16sEightU16sZZ_some(o_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+uint64_t __attribute__((export_name("TS_COption_C2Tuple_EightU16sEightU16sZZ_none"))) TS_COption_C2Tuple_EightU16sEightU16sZZ_none() {
+ LDKCOption_C2Tuple_EightU16sEightU16sZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_EightU16sEightU16sZZ), "LDKCOption_C2Tuple_EightU16sEightU16sZZ");
+ *ret_copy = COption_C2Tuple_EightU16sEightU16sZZ_none();
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+void __attribute__((export_name("TS_COption_C2Tuple_EightU16sEightU16sZZ_free"))) TS_COption_C2Tuple_EightU16sEightU16sZZ_free(uint64_t _res) {
+ if (!ptr_is_owned(_res)) return;
+ void* _res_ptr = untag_ptr(_res);
+ CHECK_ACCESS(_res_ptr);
+ LDKCOption_C2Tuple_EightU16sEightU16sZZ _res_conv = *(LDKCOption_C2Tuple_EightU16sEightU16sZZ*)(_res_ptr);
+ FREE(untag_ptr(_res));
+ COption_C2Tuple_EightU16sEightU16sZZ_free(_res_conv);
+}
+
+static inline uint64_t COption_C2Tuple_EightU16sEightU16sZZ_clone_ptr(LDKCOption_C2Tuple_EightU16sEightU16sZZ *NONNULL_PTR arg) {
+ LDKCOption_C2Tuple_EightU16sEightU16sZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_EightU16sEightU16sZZ), "LDKCOption_C2Tuple_EightU16sEightU16sZZ");
+ *ret_copy = COption_C2Tuple_EightU16sEightU16sZZ_clone(arg);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+int64_t __attribute__((export_name("TS_COption_C2Tuple_EightU16sEightU16sZZ_clone_ptr"))) TS_COption_C2Tuple_EightU16sEightU16sZZ_clone_ptr(uint64_t arg) {
+ LDKCOption_C2Tuple_EightU16sEightU16sZZ* arg_conv = (LDKCOption_C2Tuple_EightU16sEightU16sZZ*)untag_ptr(arg);
+ int64_t ret_conv = COption_C2Tuple_EightU16sEightU16sZZ_clone_ptr(arg_conv);
+ return ret_conv;
+}
+
+uint64_t __attribute__((export_name("TS_COption_C2Tuple_EightU16sEightU16sZZ_clone"))) TS_COption_C2Tuple_EightU16sEightU16sZZ_clone(uint64_t orig) {
+ LDKCOption_C2Tuple_EightU16sEightU16sZZ* orig_conv = (LDKCOption_C2Tuple_EightU16sEightU16sZZ*)untag_ptr(orig);
+ LDKCOption_C2Tuple_EightU16sEightU16sZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_EightU16sEightU16sZZ), "LDKCOption_C2Tuple_EightU16sEightU16sZZ");
+ *ret_copy = COption_C2Tuple_EightU16sEightU16sZZ_clone(orig_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
void __attribute__((export_name("TS_CVec_NodeIdZ_free"))) TS_CVec_NodeIdZ_free(uint64_tArray _res) {
LDKCVec_NodeIdZ _res_constr;
_res_constr.datalen = _res->arr_len;
}
uint64_t __attribute__((export_name("TS_CResult_ProbabilisticScorerDecodeErrorZ_err"))) TS_CResult_ProbabilisticScorerDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_ProbabilisticScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ProbabilisticScorerDecodeErrorZ), "LDKCResult_ProbabilisticScorerDecodeErrorZ");
*ret_conv = CResult_ProbabilisticScorerDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
uint64_t __attribute__((export_name("TS_CResult_InitFeaturesDecodeErrorZ_err"))) TS_CResult_InitFeaturesDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ");
*ret_conv = CResult_InitFeaturesDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
uint64_t __attribute__((export_name("TS_CResult_ChannelFeaturesDecodeErrorZ_err"))) TS_CResult_ChannelFeaturesDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ");
*ret_conv = CResult_ChannelFeaturesDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
uint64_t __attribute__((export_name("TS_CResult_NodeFeaturesDecodeErrorZ_err"))) TS_CResult_NodeFeaturesDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ");
*ret_conv = CResult_NodeFeaturesDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
uint64_t __attribute__((export_name("TS_CResult_InvoiceFeaturesDecodeErrorZ_err"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
*ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
return tag_ptr(ret_conv, true);
}
+uint64_t __attribute__((export_name("TS_CResult_BlindedHopFeaturesDecodeErrorZ_ok"))) TS_CResult_BlindedHopFeaturesDecodeErrorZ_ok(uint64_t o) {
+ LDKBlindedHopFeatures o_conv;
+ o_conv.inner = untag_ptr(o);
+ o_conv.is_owned = ptr_is_owned(o);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
+ o_conv = BlindedHopFeatures_clone(&o_conv);
+ LDKCResult_BlindedHopFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopFeaturesDecodeErrorZ), "LDKCResult_BlindedHopFeaturesDecodeErrorZ");
+ *ret_conv = CResult_BlindedHopFeaturesDecodeErrorZ_ok(o_conv);
+ return tag_ptr(ret_conv, true);
+}
+
+uint64_t __attribute__((export_name("TS_CResult_BlindedHopFeaturesDecodeErrorZ_err"))) TS_CResult_BlindedHopFeaturesDecodeErrorZ_err(uint64_t e) {
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
+ LDKCResult_BlindedHopFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopFeaturesDecodeErrorZ), "LDKCResult_BlindedHopFeaturesDecodeErrorZ");
+ *ret_conv = CResult_BlindedHopFeaturesDecodeErrorZ_err(e_conv);
+ return tag_ptr(ret_conv, true);
+}
+
+jboolean __attribute__((export_name("TS_CResult_BlindedHopFeaturesDecodeErrorZ_is_ok"))) TS_CResult_BlindedHopFeaturesDecodeErrorZ_is_ok(uint64_t o) {
+ LDKCResult_BlindedHopFeaturesDecodeErrorZ* o_conv = (LDKCResult_BlindedHopFeaturesDecodeErrorZ*)untag_ptr(o);
+ jboolean ret_conv = CResult_BlindedHopFeaturesDecodeErrorZ_is_ok(o_conv);
+ return ret_conv;
+}
+
+void __attribute__((export_name("TS_CResult_BlindedHopFeaturesDecodeErrorZ_free"))) TS_CResult_BlindedHopFeaturesDecodeErrorZ_free(uint64_t _res) {
+ if (!ptr_is_owned(_res)) return;
+ void* _res_ptr = untag_ptr(_res);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_BlindedHopFeaturesDecodeErrorZ _res_conv = *(LDKCResult_BlindedHopFeaturesDecodeErrorZ*)(_res_ptr);
+ FREE(untag_ptr(_res));
+ CResult_BlindedHopFeaturesDecodeErrorZ_free(_res_conv);
+}
+
+static inline uint64_t CResult_BlindedHopFeaturesDecodeErrorZ_clone_ptr(LDKCResult_BlindedHopFeaturesDecodeErrorZ *NONNULL_PTR arg) {
+ LDKCResult_BlindedHopFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopFeaturesDecodeErrorZ), "LDKCResult_BlindedHopFeaturesDecodeErrorZ");
+ *ret_conv = CResult_BlindedHopFeaturesDecodeErrorZ_clone(arg);
+ return tag_ptr(ret_conv, true);
+}
+int64_t __attribute__((export_name("TS_CResult_BlindedHopFeaturesDecodeErrorZ_clone_ptr"))) TS_CResult_BlindedHopFeaturesDecodeErrorZ_clone_ptr(uint64_t arg) {
+ LDKCResult_BlindedHopFeaturesDecodeErrorZ* arg_conv = (LDKCResult_BlindedHopFeaturesDecodeErrorZ*)untag_ptr(arg);
+ int64_t ret_conv = CResult_BlindedHopFeaturesDecodeErrorZ_clone_ptr(arg_conv);
+ return ret_conv;
+}
+
+uint64_t __attribute__((export_name("TS_CResult_BlindedHopFeaturesDecodeErrorZ_clone"))) TS_CResult_BlindedHopFeaturesDecodeErrorZ_clone(uint64_t orig) {
+ LDKCResult_BlindedHopFeaturesDecodeErrorZ* orig_conv = (LDKCResult_BlindedHopFeaturesDecodeErrorZ*)untag_ptr(orig);
+ LDKCResult_BlindedHopFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopFeaturesDecodeErrorZ), "LDKCResult_BlindedHopFeaturesDecodeErrorZ");
+ *ret_conv = CResult_BlindedHopFeaturesDecodeErrorZ_clone(orig_conv);
+ return tag_ptr(ret_conv, true);
+}
+
uint64_t __attribute__((export_name("TS_CResult_ChannelTypeFeaturesDecodeErrorZ_ok"))) TS_CResult_ChannelTypeFeaturesDecodeErrorZ_ok(uint64_t o) {
LDKChannelTypeFeatures o_conv;
o_conv.inner = untag_ptr(o);
}
uint64_t __attribute__((export_name("TS_CResult_ChannelTypeFeaturesDecodeErrorZ_err"))) TS_CResult_ChannelTypeFeaturesDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ");
*ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
uint64_t __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_err"))) TS_CResult_NodeIdDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ");
*ret_conv = CResult_NodeIdDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
uint64_t __attribute__((export_name("TS_CResult_COption_NetworkUpdateZDecodeErrorZ_err"))) TS_CResult_COption_NetworkUpdateZDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ");
*ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
return tag_ptr(ret_conv, true);
}
-uint64_t __attribute__((export_name("TS_COption_AccessZ_some"))) TS_COption_AccessZ_some(uint64_t o) {
+uint64_t __attribute__((export_name("TS_COption_UtxoLookupZ_some"))) TS_COption_UtxoLookupZ_some(uint64_t o) {
void* o_ptr = untag_ptr(o);
CHECK_ACCESS(o_ptr);
- LDKAccess o_conv = *(LDKAccess*)(o_ptr);
- if (o_conv.free == LDKAccess_JCalls_free) {
+ LDKUtxoLookup o_conv = *(LDKUtxoLookup*)(o_ptr);
+ if (o_conv.free == LDKUtxoLookup_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
- LDKAccess_JCalls_cloned(&o_conv);
+ LDKUtxoLookup_JCalls_cloned(&o_conv);
}
- LDKCOption_AccessZ *ret_copy = MALLOC(sizeof(LDKCOption_AccessZ), "LDKCOption_AccessZ");
- *ret_copy = COption_AccessZ_some(o_conv);
+ LDKCOption_UtxoLookupZ *ret_copy = MALLOC(sizeof(LDKCOption_UtxoLookupZ), "LDKCOption_UtxoLookupZ");
+ *ret_copy = COption_UtxoLookupZ_some(o_conv);
uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
-uint64_t __attribute__((export_name("TS_COption_AccessZ_none"))) TS_COption_AccessZ_none() {
- LDKCOption_AccessZ *ret_copy = MALLOC(sizeof(LDKCOption_AccessZ), "LDKCOption_AccessZ");
- *ret_copy = COption_AccessZ_none();
+uint64_t __attribute__((export_name("TS_COption_UtxoLookupZ_none"))) TS_COption_UtxoLookupZ_none() {
+ LDKCOption_UtxoLookupZ *ret_copy = MALLOC(sizeof(LDKCOption_UtxoLookupZ), "LDKCOption_UtxoLookupZ");
+ *ret_copy = COption_UtxoLookupZ_none();
uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
-void __attribute__((export_name("TS_COption_AccessZ_free"))) TS_COption_AccessZ_free(uint64_t _res) {
+void __attribute__((export_name("TS_COption_UtxoLookupZ_free"))) TS_COption_UtxoLookupZ_free(uint64_t _res) {
if (!ptr_is_owned(_res)) return;
void* _res_ptr = untag_ptr(_res);
CHECK_ACCESS(_res_ptr);
- LDKCOption_AccessZ _res_conv = *(LDKCOption_AccessZ*)(_res_ptr);
+ LDKCOption_UtxoLookupZ _res_conv = *(LDKCOption_UtxoLookupZ*)(_res_ptr);
FREE(untag_ptr(_res));
- COption_AccessZ_free(_res_conv);
+ COption_UtxoLookupZ_free(_res_conv);
}
uint64_t __attribute__((export_name("TS_CResult_boolLightningErrorZ_ok"))) TS_CResult_boolLightningErrorZ_ok(jboolean o) {
C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(_res_conv);
}
-void __attribute__((export_name("TS_CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free"))) TS_CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(uint64_tArray _res) {
- LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ _res_constr;
- _res_constr.datalen = _res->arr_len;
- if (_res_constr.datalen > 0)
- _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ Elements");
- else
- _res_constr.data = NULL;
- uint64_t* _res_vals = _res->elems;
- for (size_t h = 0; h < _res_constr.datalen; h++) {
- uint64_t _res_conv_59 = _res_vals[h];
- void* _res_conv_59_ptr = untag_ptr(_res_conv_59);
- CHECK_ACCESS(_res_conv_59_ptr);
- LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res_conv_59_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(_res_conv_59_ptr);
- FREE(untag_ptr(_res_conv_59));
- _res_constr.data[h] = _res_conv_59_conv;
- }
- FREE(_res);
- CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(_res_constr);
+uint64_t __attribute__((export_name("TS_COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_some"))) TS_COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_some(uint64_t o) {
+ void* o_ptr = untag_ptr(o);
+ CHECK_ACCESS(o_ptr);
+ LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ o_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(o_ptr);
+ o_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone((LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)untag_ptr(o));
+ LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *ret_copy = MALLOC(sizeof(LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ), "LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ");
+ *ret_copy = COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_some(o_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
}
-void __attribute__((export_name("TS_CVec_NodeAnnouncementZ_free"))) TS_CVec_NodeAnnouncementZ_free(uint64_tArray _res) {
- LDKCVec_NodeAnnouncementZ _res_constr;
- _res_constr.datalen = _res->arr_len;
- if (_res_constr.datalen > 0)
- _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKNodeAnnouncement), "LDKCVec_NodeAnnouncementZ Elements");
- else
- _res_constr.data = NULL;
- uint64_t* _res_vals = _res->elems;
- for (size_t s = 0; s < _res_constr.datalen; s++) {
- uint64_t _res_conv_18 = _res_vals[s];
- LDKNodeAnnouncement _res_conv_18_conv;
- _res_conv_18_conv.inner = untag_ptr(_res_conv_18);
- _res_conv_18_conv.is_owned = ptr_is_owned(_res_conv_18);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_18_conv);
- _res_constr.data[s] = _res_conv_18_conv;
- }
- FREE(_res);
- CVec_NodeAnnouncementZ_free(_res_constr);
+uint64_t __attribute__((export_name("TS_COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_none"))) TS_COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_none() {
+ LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *ret_copy = MALLOC(sizeof(LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ), "LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ");
+ *ret_copy = COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_none();
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+void __attribute__((export_name("TS_COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free"))) TS_COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(uint64_t _res) {
+ if (!ptr_is_owned(_res)) return;
+ void* _res_ptr = untag_ptr(_res);
+ CHECK_ACCESS(_res_ptr);
+ LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ _res_conv = *(LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ*)(_res_ptr);
+ FREE(untag_ptr(_res));
+ COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(_res_conv);
+}
+
+static inline uint64_t COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_clone_ptr(LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *NONNULL_PTR arg) {
+ LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *ret_copy = MALLOC(sizeof(LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ), "LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ");
+ *ret_copy = COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_clone(arg);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+int64_t __attribute__((export_name("TS_COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_clone_ptr"))) TS_COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_clone_ptr(uint64_t arg) {
+ LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ* arg_conv = (LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ*)untag_ptr(arg);
+ int64_t ret_conv = COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_clone_ptr(arg_conv);
+ return ret_conv;
+}
+
+uint64_t __attribute__((export_name("TS_COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_clone"))) TS_COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_clone(uint64_t orig) {
+ LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ* orig_conv = (LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ*)untag_ptr(orig);
+ LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *ret_copy = MALLOC(sizeof(LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ), "LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ");
+ *ret_copy = COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_clone(orig_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
}
uint64_t __attribute__((export_name("TS_CResult_NoneLightningErrorZ_ok"))) TS_CResult_NoneLightningErrorZ_ok() {
}
uint64_t __attribute__((export_name("TS_CResult_ChannelUpdateInfoDecodeErrorZ_err"))) TS_CResult_ChannelUpdateInfoDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_ChannelUpdateInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateInfoDecodeErrorZ), "LDKCResult_ChannelUpdateInfoDecodeErrorZ");
*ret_conv = CResult_ChannelUpdateInfoDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
uint64_t __attribute__((export_name("TS_CResult_ChannelInfoDecodeErrorZ_err"))) TS_CResult_ChannelInfoDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ");
*ret_conv = CResult_ChannelInfoDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
uint64_t __attribute__((export_name("TS_CResult_RoutingFeesDecodeErrorZ_err"))) TS_CResult_RoutingFeesDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ");
*ret_conv = CResult_RoutingFeesDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
uint64_t __attribute__((export_name("TS_CResult_NodeAnnouncementInfoDecodeErrorZ_err"))) TS_CResult_NodeAnnouncementInfoDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ");
*ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
uint64_t __attribute__((export_name("TS_CResult_NodeAliasDecodeErrorZ_err"))) TS_CResult_NodeAliasDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_NodeAliasDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAliasDecodeErrorZ), "LDKCResult_NodeAliasDecodeErrorZ");
*ret_conv = CResult_NodeAliasDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
uint64_t __attribute__((export_name("TS_CResult_NodeInfoDecodeErrorZ_err"))) TS_CResult_NodeInfoDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ");
*ret_conv = CResult_NodeInfoDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
uint64_t __attribute__((export_name("TS_CResult_NetworkGraphDecodeErrorZ_err"))) TS_CResult_NetworkGraphDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ");
*ret_conv = CResult_NetworkGraphDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
uint64_t __attribute__((export_name("TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err"))) TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ");
*ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
uint64_t __attribute__((export_name("TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err"))) TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ");
*ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
uint64_t __attribute__((export_name("TS_CResult_SpendableOutputDescriptorDecodeErrorZ_err"))) TS_CResult_SpendableOutputDescriptorDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ");
*ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
return tag_ptr(ret_conv, true);
}
-static inline uint64_t C2Tuple_SignatureSignatureZ_clone_ptr(LDKC2Tuple_SignatureSignatureZ *NONNULL_PTR arg) {
- LDKC2Tuple_SignatureSignatureZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureSignatureZ), "LDKC2Tuple_SignatureSignatureZ");
- *ret_conv = C2Tuple_SignatureSignatureZ_clone(arg);
- return tag_ptr(ret_conv, true);
-}
-int64_t __attribute__((export_name("TS_C2Tuple_SignatureSignatureZ_clone_ptr"))) TS_C2Tuple_SignatureSignatureZ_clone_ptr(uint64_t arg) {
- LDKC2Tuple_SignatureSignatureZ* arg_conv = (LDKC2Tuple_SignatureSignatureZ*)untag_ptr(arg);
- int64_t ret_conv = C2Tuple_SignatureSignatureZ_clone_ptr(arg_conv);
- return ret_conv;
-}
-
-uint64_t __attribute__((export_name("TS_C2Tuple_SignatureSignatureZ_clone"))) TS_C2Tuple_SignatureSignatureZ_clone(uint64_t orig) {
- LDKC2Tuple_SignatureSignatureZ* orig_conv = (LDKC2Tuple_SignatureSignatureZ*)untag_ptr(orig);
- LDKC2Tuple_SignatureSignatureZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureSignatureZ), "LDKC2Tuple_SignatureSignatureZ");
- *ret_conv = C2Tuple_SignatureSignatureZ_clone(orig_conv);
- return tag_ptr(ret_conv, true);
-}
-
-uint64_t __attribute__((export_name("TS_C2Tuple_SignatureSignatureZ_new"))) TS_C2Tuple_SignatureSignatureZ_new(int8_tArray a, int8_tArray b) {
- LDKSignature a_ref;
- CHECK(a->arr_len == 64);
- memcpy(a_ref.compact_form, a->elems, 64); FREE(a);
- LDKSignature b_ref;
- CHECK(b->arr_len == 64);
- memcpy(b_ref.compact_form, b->elems, 64); FREE(b);
- LDKC2Tuple_SignatureSignatureZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureSignatureZ), "LDKC2Tuple_SignatureSignatureZ");
- *ret_conv = C2Tuple_SignatureSignatureZ_new(a_ref, b_ref);
- return tag_ptr(ret_conv, true);
-}
-
-void __attribute__((export_name("TS_C2Tuple_SignatureSignatureZ_free"))) TS_C2Tuple_SignatureSignatureZ_free(uint64_t _res) {
- if (!ptr_is_owned(_res)) return;
- void* _res_ptr = untag_ptr(_res);
- CHECK_ACCESS(_res_ptr);
- LDKC2Tuple_SignatureSignatureZ _res_conv = *(LDKC2Tuple_SignatureSignatureZ*)(_res_ptr);
- FREE(untag_ptr(_res));
- C2Tuple_SignatureSignatureZ_free(_res_conv);
-}
-
-uint64_t __attribute__((export_name("TS_CResult_C2Tuple_SignatureSignatureZNoneZ_ok"))) TS_CResult_C2Tuple_SignatureSignatureZNoneZ_ok(uint64_t o) {
- void* o_ptr = untag_ptr(o);
- CHECK_ACCESS(o_ptr);
- LDKC2Tuple_SignatureSignatureZ o_conv = *(LDKC2Tuple_SignatureSignatureZ*)(o_ptr);
- o_conv = C2Tuple_SignatureSignatureZ_clone((LDKC2Tuple_SignatureSignatureZ*)untag_ptr(o));
- LDKCResult_C2Tuple_SignatureSignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureSignatureZNoneZ), "LDKCResult_C2Tuple_SignatureSignatureZNoneZ");
- *ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_ok(o_conv);
+uint64_t __attribute__((export_name("TS_CResult_PublicKeyNoneZ_ok"))) TS_CResult_PublicKeyNoneZ_ok(int8_tArray o) {
+ LDKPublicKey o_ref;
+ CHECK(o->arr_len == 33);
+ memcpy(o_ref.compressed_form, o->elems, 33); FREE(o);
+ LDKCResult_PublicKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyNoneZ), "LDKCResult_PublicKeyNoneZ");
+ *ret_conv = CResult_PublicKeyNoneZ_ok(o_ref);
return tag_ptr(ret_conv, true);
}
-uint64_t __attribute__((export_name("TS_CResult_C2Tuple_SignatureSignatureZNoneZ_err"))) TS_CResult_C2Tuple_SignatureSignatureZNoneZ_err() {
- LDKCResult_C2Tuple_SignatureSignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureSignatureZNoneZ), "LDKCResult_C2Tuple_SignatureSignatureZNoneZ");
- *ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_err();
+uint64_t __attribute__((export_name("TS_CResult_PublicKeyNoneZ_err"))) TS_CResult_PublicKeyNoneZ_err() {
+ LDKCResult_PublicKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyNoneZ), "LDKCResult_PublicKeyNoneZ");
+ *ret_conv = CResult_PublicKeyNoneZ_err();
return tag_ptr(ret_conv, true);
}
-jboolean __attribute__((export_name("TS_CResult_C2Tuple_SignatureSignatureZNoneZ_is_ok"))) TS_CResult_C2Tuple_SignatureSignatureZNoneZ_is_ok(uint64_t o) {
- LDKCResult_C2Tuple_SignatureSignatureZNoneZ* o_conv = (LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)untag_ptr(o);
- jboolean ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_is_ok(o_conv);
+jboolean __attribute__((export_name("TS_CResult_PublicKeyNoneZ_is_ok"))) TS_CResult_PublicKeyNoneZ_is_ok(uint64_t o) {
+ LDKCResult_PublicKeyNoneZ* o_conv = (LDKCResult_PublicKeyNoneZ*)untag_ptr(o);
+ jboolean ret_conv = CResult_PublicKeyNoneZ_is_ok(o_conv);
return ret_conv;
}
-void __attribute__((export_name("TS_CResult_C2Tuple_SignatureSignatureZNoneZ_free"))) TS_CResult_C2Tuple_SignatureSignatureZNoneZ_free(uint64_t _res) {
+void __attribute__((export_name("TS_CResult_PublicKeyNoneZ_free"))) TS_CResult_PublicKeyNoneZ_free(uint64_t _res) {
if (!ptr_is_owned(_res)) return;
void* _res_ptr = untag_ptr(_res);
CHECK_ACCESS(_res_ptr);
- LDKCResult_C2Tuple_SignatureSignatureZNoneZ _res_conv = *(LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)(_res_ptr);
+ LDKCResult_PublicKeyNoneZ _res_conv = *(LDKCResult_PublicKeyNoneZ*)(_res_ptr);
FREE(untag_ptr(_res));
- CResult_C2Tuple_SignatureSignatureZNoneZ_free(_res_conv);
+ CResult_PublicKeyNoneZ_free(_res_conv);
}
-static inline uint64_t CResult_C2Tuple_SignatureSignatureZNoneZ_clone_ptr(LDKCResult_C2Tuple_SignatureSignatureZNoneZ *NONNULL_PTR arg) {
- LDKCResult_C2Tuple_SignatureSignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureSignatureZNoneZ), "LDKCResult_C2Tuple_SignatureSignatureZNoneZ");
- *ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_clone(arg);
+static inline uint64_t CResult_PublicKeyNoneZ_clone_ptr(LDKCResult_PublicKeyNoneZ *NONNULL_PTR arg) {
+ LDKCResult_PublicKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyNoneZ), "LDKCResult_PublicKeyNoneZ");
+ *ret_conv = CResult_PublicKeyNoneZ_clone(arg);
return tag_ptr(ret_conv, true);
}
-int64_t __attribute__((export_name("TS_CResult_C2Tuple_SignatureSignatureZNoneZ_clone_ptr"))) TS_CResult_C2Tuple_SignatureSignatureZNoneZ_clone_ptr(uint64_t arg) {
- LDKCResult_C2Tuple_SignatureSignatureZNoneZ* arg_conv = (LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)untag_ptr(arg);
- int64_t ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_clone_ptr(arg_conv);
+int64_t __attribute__((export_name("TS_CResult_PublicKeyNoneZ_clone_ptr"))) TS_CResult_PublicKeyNoneZ_clone_ptr(uint64_t arg) {
+ LDKCResult_PublicKeyNoneZ* arg_conv = (LDKCResult_PublicKeyNoneZ*)untag_ptr(arg);
+ int64_t ret_conv = CResult_PublicKeyNoneZ_clone_ptr(arg_conv);
return ret_conv;
}
-uint64_t __attribute__((export_name("TS_CResult_C2Tuple_SignatureSignatureZNoneZ_clone"))) TS_CResult_C2Tuple_SignatureSignatureZNoneZ_clone(uint64_t orig) {
- LDKCResult_C2Tuple_SignatureSignatureZNoneZ* orig_conv = (LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)untag_ptr(orig);
- LDKCResult_C2Tuple_SignatureSignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureSignatureZNoneZ), "LDKCResult_C2Tuple_SignatureSignatureZNoneZ");
- *ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_clone(orig_conv);
+uint64_t __attribute__((export_name("TS_CResult_PublicKeyNoneZ_clone"))) TS_CResult_PublicKeyNoneZ_clone(uint64_t orig) {
+ LDKCResult_PublicKeyNoneZ* orig_conv = (LDKCResult_PublicKeyNoneZ*)untag_ptr(orig);
+ LDKCResult_PublicKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyNoneZ), "LDKCResult_PublicKeyNoneZ");
+ *ret_conv = CResult_PublicKeyNoneZ_clone(orig_conv);
return tag_ptr(ret_conv, true);
}
-uint64_t __attribute__((export_name("TS_CResult_SecretKeyNoneZ_ok"))) TS_CResult_SecretKeyNoneZ_ok(int8_tArray o) {
- LDKSecretKey o_ref;
- CHECK(o->arr_len == 32);
- memcpy(o_ref.bytes, o->elems, 32); FREE(o);
- LDKCResult_SecretKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyNoneZ), "LDKCResult_SecretKeyNoneZ");
- *ret_conv = CResult_SecretKeyNoneZ_ok(o_ref);
- return tag_ptr(ret_conv, true);
-}
-
-uint64_t __attribute__((export_name("TS_CResult_SecretKeyNoneZ_err"))) TS_CResult_SecretKeyNoneZ_err() {
- LDKCResult_SecretKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyNoneZ), "LDKCResult_SecretKeyNoneZ");
- *ret_conv = CResult_SecretKeyNoneZ_err();
- return tag_ptr(ret_conv, true);
+uint64_t __attribute__((export_name("TS_COption_ScalarZ_some"))) TS_COption_ScalarZ_some(uint64_t o) {
+ void* o_ptr = untag_ptr(o);
+ CHECK_ACCESS(o_ptr);
+ LDKBigEndianScalar o_conv = *(LDKBigEndianScalar*)(o_ptr);
+ // WARNING: we may need a move here but no clone is available for LDKBigEndianScalar
+ LDKCOption_ScalarZ *ret_copy = MALLOC(sizeof(LDKCOption_ScalarZ), "LDKCOption_ScalarZ");
+ *ret_copy = COption_ScalarZ_some(o_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
}
-jboolean __attribute__((export_name("TS_CResult_SecretKeyNoneZ_is_ok"))) TS_CResult_SecretKeyNoneZ_is_ok(uint64_t o) {
- LDKCResult_SecretKeyNoneZ* o_conv = (LDKCResult_SecretKeyNoneZ*)untag_ptr(o);
- jboolean ret_conv = CResult_SecretKeyNoneZ_is_ok(o_conv);
- return ret_conv;
+uint64_t __attribute__((export_name("TS_COption_ScalarZ_none"))) TS_COption_ScalarZ_none() {
+ LDKCOption_ScalarZ *ret_copy = MALLOC(sizeof(LDKCOption_ScalarZ), "LDKCOption_ScalarZ");
+ *ret_copy = COption_ScalarZ_none();
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
}
-void __attribute__((export_name("TS_CResult_SecretKeyNoneZ_free"))) TS_CResult_SecretKeyNoneZ_free(uint64_t _res) {
+void __attribute__((export_name("TS_COption_ScalarZ_free"))) TS_COption_ScalarZ_free(uint64_t _res) {
if (!ptr_is_owned(_res)) return;
void* _res_ptr = untag_ptr(_res);
CHECK_ACCESS(_res_ptr);
- LDKCResult_SecretKeyNoneZ _res_conv = *(LDKCResult_SecretKeyNoneZ*)(_res_ptr);
+ LDKCOption_ScalarZ _res_conv = *(LDKCOption_ScalarZ*)(_res_ptr);
FREE(untag_ptr(_res));
- CResult_SecretKeyNoneZ_free(_res_conv);
+ COption_ScalarZ_free(_res_conv);
}
-static inline uint64_t CResult_SecretKeyNoneZ_clone_ptr(LDKCResult_SecretKeyNoneZ *NONNULL_PTR arg) {
- LDKCResult_SecretKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyNoneZ), "LDKCResult_SecretKeyNoneZ");
- *ret_conv = CResult_SecretKeyNoneZ_clone(arg);
- return tag_ptr(ret_conv, true);
-}
-int64_t __attribute__((export_name("TS_CResult_SecretKeyNoneZ_clone_ptr"))) TS_CResult_SecretKeyNoneZ_clone_ptr(uint64_t arg) {
- LDKCResult_SecretKeyNoneZ* arg_conv = (LDKCResult_SecretKeyNoneZ*)untag_ptr(arg);
- int64_t ret_conv = CResult_SecretKeyNoneZ_clone_ptr(arg_conv);
- return ret_conv;
-}
-
-uint64_t __attribute__((export_name("TS_CResult_SecretKeyNoneZ_clone"))) TS_CResult_SecretKeyNoneZ_clone(uint64_t orig) {
- LDKCResult_SecretKeyNoneZ* orig_conv = (LDKCResult_SecretKeyNoneZ*)untag_ptr(orig);
- LDKCResult_SecretKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyNoneZ), "LDKCResult_SecretKeyNoneZ");
- *ret_conv = CResult_SecretKeyNoneZ_clone(orig_conv);
+uint64_t __attribute__((export_name("TS_CResult_SharedSecretNoneZ_ok"))) TS_CResult_SharedSecretNoneZ_ok(int8_tArray o) {
+ LDKThirtyTwoBytes o_ref;
+ CHECK(o->arr_len == 32);
+ memcpy(o_ref.data, o->elems, 32); FREE(o);
+ LDKCResult_SharedSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SharedSecretNoneZ), "LDKCResult_SharedSecretNoneZ");
+ *ret_conv = CResult_SharedSecretNoneZ_ok(o_ref);
return tag_ptr(ret_conv, true);
}
-uint64_t __attribute__((export_name("TS_CResult_SignDecodeErrorZ_ok"))) TS_CResult_SignDecodeErrorZ_ok(uint64_t o) {
- void* o_ptr = untag_ptr(o);
- CHECK_ACCESS(o_ptr);
- LDKSign o_conv = *(LDKSign*)(o_ptr);
- if (o_conv.free == LDKSign_JCalls_free) {
- // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
- LDKSign_JCalls_cloned(&o_conv);
- }
- LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ");
- *ret_conv = CResult_SignDecodeErrorZ_ok(o_conv);
+uint64_t __attribute__((export_name("TS_CResult_SharedSecretNoneZ_err"))) TS_CResult_SharedSecretNoneZ_err() {
+ LDKCResult_SharedSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SharedSecretNoneZ), "LDKCResult_SharedSecretNoneZ");
+ *ret_conv = CResult_SharedSecretNoneZ_err();
return tag_ptr(ret_conv, true);
}
-uint64_t __attribute__((export_name("TS_CResult_SignDecodeErrorZ_err"))) TS_CResult_SignDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
- LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ");
- *ret_conv = CResult_SignDecodeErrorZ_err(e_conv);
- return tag_ptr(ret_conv, true);
-}
-
-jboolean __attribute__((export_name("TS_CResult_SignDecodeErrorZ_is_ok"))) TS_CResult_SignDecodeErrorZ_is_ok(uint64_t o) {
- LDKCResult_SignDecodeErrorZ* o_conv = (LDKCResult_SignDecodeErrorZ*)untag_ptr(o);
- jboolean ret_conv = CResult_SignDecodeErrorZ_is_ok(o_conv);
+jboolean __attribute__((export_name("TS_CResult_SharedSecretNoneZ_is_ok"))) TS_CResult_SharedSecretNoneZ_is_ok(uint64_t o) {
+ LDKCResult_SharedSecretNoneZ* o_conv = (LDKCResult_SharedSecretNoneZ*)untag_ptr(o);
+ jboolean ret_conv = CResult_SharedSecretNoneZ_is_ok(o_conv);
return ret_conv;
}
-void __attribute__((export_name("TS_CResult_SignDecodeErrorZ_free"))) TS_CResult_SignDecodeErrorZ_free(uint64_t _res) {
+void __attribute__((export_name("TS_CResult_SharedSecretNoneZ_free"))) TS_CResult_SharedSecretNoneZ_free(uint64_t _res) {
if (!ptr_is_owned(_res)) return;
void* _res_ptr = untag_ptr(_res);
CHECK_ACCESS(_res_ptr);
- LDKCResult_SignDecodeErrorZ _res_conv = *(LDKCResult_SignDecodeErrorZ*)(_res_ptr);
+ LDKCResult_SharedSecretNoneZ _res_conv = *(LDKCResult_SharedSecretNoneZ*)(_res_ptr);
FREE(untag_ptr(_res));
- CResult_SignDecodeErrorZ_free(_res_conv);
+ CResult_SharedSecretNoneZ_free(_res_conv);
}
-static inline uint64_t CResult_SignDecodeErrorZ_clone_ptr(LDKCResult_SignDecodeErrorZ *NONNULL_PTR arg) {
- LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ");
- *ret_conv = CResult_SignDecodeErrorZ_clone(arg);
+static inline uint64_t CResult_SharedSecretNoneZ_clone_ptr(LDKCResult_SharedSecretNoneZ *NONNULL_PTR arg) {
+ LDKCResult_SharedSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SharedSecretNoneZ), "LDKCResult_SharedSecretNoneZ");
+ *ret_conv = CResult_SharedSecretNoneZ_clone(arg);
return tag_ptr(ret_conv, true);
}
-int64_t __attribute__((export_name("TS_CResult_SignDecodeErrorZ_clone_ptr"))) TS_CResult_SignDecodeErrorZ_clone_ptr(uint64_t arg) {
- LDKCResult_SignDecodeErrorZ* arg_conv = (LDKCResult_SignDecodeErrorZ*)untag_ptr(arg);
- int64_t ret_conv = CResult_SignDecodeErrorZ_clone_ptr(arg_conv);
+int64_t __attribute__((export_name("TS_CResult_SharedSecretNoneZ_clone_ptr"))) TS_CResult_SharedSecretNoneZ_clone_ptr(uint64_t arg) {
+ LDKCResult_SharedSecretNoneZ* arg_conv = (LDKCResult_SharedSecretNoneZ*)untag_ptr(arg);
+ int64_t ret_conv = CResult_SharedSecretNoneZ_clone_ptr(arg_conv);
return ret_conv;
}
-uint64_t __attribute__((export_name("TS_CResult_SignDecodeErrorZ_clone"))) TS_CResult_SignDecodeErrorZ_clone(uint64_t orig) {
- LDKCResult_SignDecodeErrorZ* orig_conv = (LDKCResult_SignDecodeErrorZ*)untag_ptr(orig);
- LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ");
- *ret_conv = CResult_SignDecodeErrorZ_clone(orig_conv);
+uint64_t __attribute__((export_name("TS_CResult_SharedSecretNoneZ_clone"))) TS_CResult_SharedSecretNoneZ_clone(uint64_t orig) {
+ LDKCResult_SharedSecretNoneZ* orig_conv = (LDKCResult_SharedSecretNoneZ*)untag_ptr(orig);
+ LDKCResult_SharedSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SharedSecretNoneZ), "LDKCResult_SharedSecretNoneZ");
+ *ret_conv = CResult_SharedSecretNoneZ_clone(orig_conv);
return tag_ptr(ret_conv, true);
}
-void __attribute__((export_name("TS_CVec_u5Z_free"))) TS_CVec_u5Z_free(ptrArray _res) {
- LDKCVec_u5Z _res_constr;
+void __attribute__((export_name("TS_CVec_U5Z_free"))) TS_CVec_U5Z_free(ptrArray _res) {
+ LDKCVec_U5Z _res_constr;
_res_constr.datalen = _res->arr_len;
if (_res_constr.datalen > 0)
- _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKu5), "LDKCVec_u5Z Elements");
+ _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKU5), "LDKCVec_U5Z Elements");
else
_res_constr.data = NULL;
int8_t* _res_vals = (void*) _res->elems;
for (size_t h = 0; h < _res_constr.datalen; h++) {
int8_t _res_conv_7 = _res_vals[h];
- _res_constr.data[h] = (LDKu5){ ._0 = _res_conv_7 };
+ _res_constr.data[h] = (LDKU5){ ._0 = _res_conv_7 };
}
FREE(_res);
- CVec_u5Z_free(_res_constr);
+ CVec_U5Z_free(_res_constr);
}
uint64_t __attribute__((export_name("TS_CResult_RecoverableSignatureNoneZ_ok"))) TS_CResult_RecoverableSignatureNoneZ_ok(int8_tArray o) {
return tag_ptr(ret_conv, true);
}
+uint64_t __attribute__((export_name("TS_CResult_WriteableEcdsaChannelSignerDecodeErrorZ_ok"))) TS_CResult_WriteableEcdsaChannelSignerDecodeErrorZ_ok(uint64_t o) {
+ void* o_ptr = untag_ptr(o);
+ CHECK_ACCESS(o_ptr);
+ LDKWriteableEcdsaChannelSigner o_conv = *(LDKWriteableEcdsaChannelSigner*)(o_ptr);
+ if (o_conv.free == LDKWriteableEcdsaChannelSigner_JCalls_free) {
+ // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
+ LDKWriteableEcdsaChannelSigner_JCalls_cloned(&o_conv);
+ }
+ LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ), "LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ");
+ *ret_conv = CResult_WriteableEcdsaChannelSignerDecodeErrorZ_ok(o_conv);
+ return tag_ptr(ret_conv, true);
+}
+
+uint64_t __attribute__((export_name("TS_CResult_WriteableEcdsaChannelSignerDecodeErrorZ_err"))) TS_CResult_WriteableEcdsaChannelSignerDecodeErrorZ_err(uint64_t e) {
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
+ LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ), "LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ");
+ *ret_conv = CResult_WriteableEcdsaChannelSignerDecodeErrorZ_err(e_conv);
+ return tag_ptr(ret_conv, true);
+}
+
+jboolean __attribute__((export_name("TS_CResult_WriteableEcdsaChannelSignerDecodeErrorZ_is_ok"))) TS_CResult_WriteableEcdsaChannelSignerDecodeErrorZ_is_ok(uint64_t o) {
+ LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ* o_conv = (LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ*)untag_ptr(o);
+ jboolean ret_conv = CResult_WriteableEcdsaChannelSignerDecodeErrorZ_is_ok(o_conv);
+ return ret_conv;
+}
+
+void __attribute__((export_name("TS_CResult_WriteableEcdsaChannelSignerDecodeErrorZ_free"))) TS_CResult_WriteableEcdsaChannelSignerDecodeErrorZ_free(uint64_t _res) {
+ if (!ptr_is_owned(_res)) return;
+ void* _res_ptr = untag_ptr(_res);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ _res_conv = *(LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ*)(_res_ptr);
+ FREE(untag_ptr(_res));
+ CResult_WriteableEcdsaChannelSignerDecodeErrorZ_free(_res_conv);
+}
+
+static inline uint64_t CResult_WriteableEcdsaChannelSignerDecodeErrorZ_clone_ptr(LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ *NONNULL_PTR arg) {
+ LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ), "LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ");
+ *ret_conv = CResult_WriteableEcdsaChannelSignerDecodeErrorZ_clone(arg);
+ return tag_ptr(ret_conv, true);
+}
+int64_t __attribute__((export_name("TS_CResult_WriteableEcdsaChannelSignerDecodeErrorZ_clone_ptr"))) TS_CResult_WriteableEcdsaChannelSignerDecodeErrorZ_clone_ptr(uint64_t arg) {
+ LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ* arg_conv = (LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ*)untag_ptr(arg);
+ int64_t ret_conv = CResult_WriteableEcdsaChannelSignerDecodeErrorZ_clone_ptr(arg_conv);
+ return ret_conv;
+}
+
+uint64_t __attribute__((export_name("TS_CResult_WriteableEcdsaChannelSignerDecodeErrorZ_clone"))) TS_CResult_WriteableEcdsaChannelSignerDecodeErrorZ_clone(uint64_t orig) {
+ LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ* orig_conv = (LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ*)untag_ptr(orig);
+ LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ), "LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ");
+ *ret_conv = CResult_WriteableEcdsaChannelSignerDecodeErrorZ_clone(orig_conv);
+ return tag_ptr(ret_conv, true);
+}
+
void __attribute__((export_name("TS_CVec_u8Z_free"))) TS_CVec_u8Z_free(int8_tArray _res) {
LDKCVec_u8Z _res_ref;
_res_ref.datalen = _res->arr_len;
}
uint64_t __attribute__((export_name("TS_CResult_InMemorySignerDecodeErrorZ_err"))) TS_CResult_InMemorySignerDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ");
*ret_conv = CResult_InMemorySignerDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
return ret_ref;
}
-uint64_t __attribute__((export_name("TS_CResult_NoneAPIErrorZ_ok"))) TS_CResult_NoneAPIErrorZ_ok() {
- LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
- *ret_conv = CResult_NoneAPIErrorZ_ok();
+uint64_t __attribute__((export_name("TS_CResult__u832APIErrorZ_ok"))) TS_CResult__u832APIErrorZ_ok(int8_tArray o) {
+ LDKThirtyTwoBytes o_ref;
+ CHECK(o->arr_len == 32);
+ memcpy(o_ref.data, o->elems, 32); FREE(o);
+ LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ");
+ *ret_conv = CResult__u832APIErrorZ_ok(o_ref);
return tag_ptr(ret_conv, true);
}
-uint64_t __attribute__((export_name("TS_CResult_NoneAPIErrorZ_err"))) TS_CResult_NoneAPIErrorZ_err(uint64_t e) {
+uint64_t __attribute__((export_name("TS_CResult__u832APIErrorZ_err"))) TS_CResult__u832APIErrorZ_err(uint64_t e) {
void* e_ptr = untag_ptr(e);
CHECK_ACCESS(e_ptr);
LDKAPIError e_conv = *(LDKAPIError*)(e_ptr);
e_conv = APIError_clone((LDKAPIError*)untag_ptr(e));
- LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
- *ret_conv = CResult_NoneAPIErrorZ_err(e_conv);
+ LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ");
+ *ret_conv = CResult__u832APIErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
-jboolean __attribute__((export_name("TS_CResult_NoneAPIErrorZ_is_ok"))) TS_CResult_NoneAPIErrorZ_is_ok(uint64_t o) {
- LDKCResult_NoneAPIErrorZ* o_conv = (LDKCResult_NoneAPIErrorZ*)untag_ptr(o);
- jboolean ret_conv = CResult_NoneAPIErrorZ_is_ok(o_conv);
+jboolean __attribute__((export_name("TS_CResult__u832APIErrorZ_is_ok"))) TS_CResult__u832APIErrorZ_is_ok(uint64_t o) {
+ LDKCResult__u832APIErrorZ* o_conv = (LDKCResult__u832APIErrorZ*)untag_ptr(o);
+ jboolean ret_conv = CResult__u832APIErrorZ_is_ok(o_conv);
return ret_conv;
}
-void __attribute__((export_name("TS_CResult_NoneAPIErrorZ_free"))) TS_CResult_NoneAPIErrorZ_free(uint64_t _res) {
+void __attribute__((export_name("TS_CResult__u832APIErrorZ_free"))) TS_CResult__u832APIErrorZ_free(uint64_t _res) {
if (!ptr_is_owned(_res)) return;
void* _res_ptr = untag_ptr(_res);
CHECK_ACCESS(_res_ptr);
- LDKCResult_NoneAPIErrorZ _res_conv = *(LDKCResult_NoneAPIErrorZ*)(_res_ptr);
+ LDKCResult__u832APIErrorZ _res_conv = *(LDKCResult__u832APIErrorZ*)(_res_ptr);
FREE(untag_ptr(_res));
- CResult_NoneAPIErrorZ_free(_res_conv);
+ CResult__u832APIErrorZ_free(_res_conv);
}
-static inline uint64_t CResult_NoneAPIErrorZ_clone_ptr(LDKCResult_NoneAPIErrorZ *NONNULL_PTR arg) {
- LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
- *ret_conv = CResult_NoneAPIErrorZ_clone(arg);
+static inline uint64_t CResult__u832APIErrorZ_clone_ptr(LDKCResult__u832APIErrorZ *NONNULL_PTR arg) {
+ LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ");
+ *ret_conv = CResult__u832APIErrorZ_clone(arg);
return tag_ptr(ret_conv, true);
}
-int64_t __attribute__((export_name("TS_CResult_NoneAPIErrorZ_clone_ptr"))) TS_CResult_NoneAPIErrorZ_clone_ptr(uint64_t arg) {
- LDKCResult_NoneAPIErrorZ* arg_conv = (LDKCResult_NoneAPIErrorZ*)untag_ptr(arg);
- int64_t ret_conv = CResult_NoneAPIErrorZ_clone_ptr(arg_conv);
+int64_t __attribute__((export_name("TS_CResult__u832APIErrorZ_clone_ptr"))) TS_CResult__u832APIErrorZ_clone_ptr(uint64_t arg) {
+ LDKCResult__u832APIErrorZ* arg_conv = (LDKCResult__u832APIErrorZ*)untag_ptr(arg);
+ int64_t ret_conv = CResult__u832APIErrorZ_clone_ptr(arg_conv);
return ret_conv;
}
-uint64_t __attribute__((export_name("TS_CResult_NoneAPIErrorZ_clone"))) TS_CResult_NoneAPIErrorZ_clone(uint64_t orig) {
- LDKCResult_NoneAPIErrorZ* orig_conv = (LDKCResult_NoneAPIErrorZ*)untag_ptr(orig);
- LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
- *ret_conv = CResult_NoneAPIErrorZ_clone(orig_conv);
+uint64_t __attribute__((export_name("TS_CResult__u832APIErrorZ_clone"))) TS_CResult__u832APIErrorZ_clone(uint64_t orig) {
+ LDKCResult__u832APIErrorZ* orig_conv = (LDKCResult__u832APIErrorZ*)untag_ptr(orig);
+ LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ");
+ *ret_conv = CResult__u832APIErrorZ_clone(orig_conv);
return tag_ptr(ret_conv, true);
}
-void __attribute__((export_name("TS_CVec_CResult_NoneAPIErrorZZ_free"))) TS_CVec_CResult_NoneAPIErrorZZ_free(uint64_tArray _res) {
- LDKCVec_CResult_NoneAPIErrorZZ _res_constr;
+void __attribute__((export_name("TS_CVec_RecentPaymentDetailsZ_free"))) TS_CVec_RecentPaymentDetailsZ_free(uint64_tArray _res) {
+ LDKCVec_RecentPaymentDetailsZ _res_constr;
_res_constr.datalen = _res->arr_len;
if (_res_constr.datalen > 0)
- _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements");
+ _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKRecentPaymentDetails), "LDKCVec_RecentPaymentDetailsZ Elements");
else
_res_constr.data = NULL;
uint64_t* _res_vals = _res->elems;
uint64_t _res_conv_22 = _res_vals[w];
void* _res_conv_22_ptr = untag_ptr(_res_conv_22);
CHECK_ACCESS(_res_conv_22_ptr);
- LDKCResult_NoneAPIErrorZ _res_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(_res_conv_22_ptr);
+ LDKRecentPaymentDetails _res_conv_22_conv = *(LDKRecentPaymentDetails*)(_res_conv_22_ptr);
FREE(untag_ptr(_res_conv_22));
_res_constr.data[w] = _res_conv_22_conv;
}
FREE(_res);
- CVec_CResult_NoneAPIErrorZZ_free(_res_constr);
-}
-
-void __attribute__((export_name("TS_CVec_APIErrorZ_free"))) TS_CVec_APIErrorZ_free(uint64_tArray _res) {
- LDKCVec_APIErrorZ _res_constr;
- _res_constr.datalen = _res->arr_len;
- if (_res_constr.datalen > 0)
- _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKAPIError), "LDKCVec_APIErrorZ Elements");
- else
- _res_constr.data = NULL;
- uint64_t* _res_vals = _res->elems;
- for (size_t k = 0; k < _res_constr.datalen; k++) {
- uint64_t _res_conv_10 = _res_vals[k];
- void* _res_conv_10_ptr = untag_ptr(_res_conv_10);
- CHECK_ACCESS(_res_conv_10_ptr);
- LDKAPIError _res_conv_10_conv = *(LDKAPIError*)(_res_conv_10_ptr);
- FREE(untag_ptr(_res_conv_10));
- _res_constr.data[k] = _res_conv_10_conv;
- }
- FREE(_res);
- CVec_APIErrorZ_free(_res_constr);
+ CVec_RecentPaymentDetailsZ_free(_res_constr);
}
-uint64_t __attribute__((export_name("TS_CResult__u832APIErrorZ_ok"))) TS_CResult__u832APIErrorZ_ok(int8_tArray o) {
- LDKThirtyTwoBytes o_ref;
- CHECK(o->arr_len == 32);
- memcpy(o_ref.data, o->elems, 32); FREE(o);
- LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ");
- *ret_conv = CResult__u832APIErrorZ_ok(o_ref);
+uint64_t __attribute__((export_name("TS_CResult_NonePaymentSendFailureZ_ok"))) TS_CResult_NonePaymentSendFailureZ_ok() {
+ LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
+ *ret_conv = CResult_NonePaymentSendFailureZ_ok();
return tag_ptr(ret_conv, true);
}
-uint64_t __attribute__((export_name("TS_CResult__u832APIErrorZ_err"))) TS_CResult__u832APIErrorZ_err(uint64_t e) {
+uint64_t __attribute__((export_name("TS_CResult_NonePaymentSendFailureZ_err"))) TS_CResult_NonePaymentSendFailureZ_err(uint64_t e) {
void* e_ptr = untag_ptr(e);
CHECK_ACCESS(e_ptr);
- LDKAPIError e_conv = *(LDKAPIError*)(e_ptr);
- e_conv = APIError_clone((LDKAPIError*)untag_ptr(e));
- LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ");
- *ret_conv = CResult__u832APIErrorZ_err(e_conv);
+ LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(e_ptr);
+ e_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)untag_ptr(e));
+ LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
+ *ret_conv = CResult_NonePaymentSendFailureZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
-jboolean __attribute__((export_name("TS_CResult__u832APIErrorZ_is_ok"))) TS_CResult__u832APIErrorZ_is_ok(uint64_t o) {
- LDKCResult__u832APIErrorZ* o_conv = (LDKCResult__u832APIErrorZ*)untag_ptr(o);
- jboolean ret_conv = CResult__u832APIErrorZ_is_ok(o_conv);
+jboolean __attribute__((export_name("TS_CResult_NonePaymentSendFailureZ_is_ok"))) TS_CResult_NonePaymentSendFailureZ_is_ok(uint64_t o) {
+ LDKCResult_NonePaymentSendFailureZ* o_conv = (LDKCResult_NonePaymentSendFailureZ*)untag_ptr(o);
+ jboolean ret_conv = CResult_NonePaymentSendFailureZ_is_ok(o_conv);
return ret_conv;
}
-void __attribute__((export_name("TS_CResult__u832APIErrorZ_free"))) TS_CResult__u832APIErrorZ_free(uint64_t _res) {
+void __attribute__((export_name("TS_CResult_NonePaymentSendFailureZ_free"))) TS_CResult_NonePaymentSendFailureZ_free(uint64_t _res) {
if (!ptr_is_owned(_res)) return;
void* _res_ptr = untag_ptr(_res);
CHECK_ACCESS(_res_ptr);
- LDKCResult__u832APIErrorZ _res_conv = *(LDKCResult__u832APIErrorZ*)(_res_ptr);
+ LDKCResult_NonePaymentSendFailureZ _res_conv = *(LDKCResult_NonePaymentSendFailureZ*)(_res_ptr);
FREE(untag_ptr(_res));
- CResult__u832APIErrorZ_free(_res_conv);
+ CResult_NonePaymentSendFailureZ_free(_res_conv);
}
-static inline uint64_t CResult__u832APIErrorZ_clone_ptr(LDKCResult__u832APIErrorZ *NONNULL_PTR arg) {
- LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ");
- *ret_conv = CResult__u832APIErrorZ_clone(arg);
+static inline uint64_t CResult_NonePaymentSendFailureZ_clone_ptr(LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR arg) {
+ LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
+ *ret_conv = CResult_NonePaymentSendFailureZ_clone(arg);
return tag_ptr(ret_conv, true);
}
-int64_t __attribute__((export_name("TS_CResult__u832APIErrorZ_clone_ptr"))) TS_CResult__u832APIErrorZ_clone_ptr(uint64_t arg) {
- LDKCResult__u832APIErrorZ* arg_conv = (LDKCResult__u832APIErrorZ*)untag_ptr(arg);
- int64_t ret_conv = CResult__u832APIErrorZ_clone_ptr(arg_conv);
+int64_t __attribute__((export_name("TS_CResult_NonePaymentSendFailureZ_clone_ptr"))) TS_CResult_NonePaymentSendFailureZ_clone_ptr(uint64_t arg) {
+ LDKCResult_NonePaymentSendFailureZ* arg_conv = (LDKCResult_NonePaymentSendFailureZ*)untag_ptr(arg);
+ int64_t ret_conv = CResult_NonePaymentSendFailureZ_clone_ptr(arg_conv);
return ret_conv;
}
-uint64_t __attribute__((export_name("TS_CResult__u832APIErrorZ_clone"))) TS_CResult__u832APIErrorZ_clone(uint64_t orig) {
- LDKCResult__u832APIErrorZ* orig_conv = (LDKCResult__u832APIErrorZ*)untag_ptr(orig);
- LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ");
- *ret_conv = CResult__u832APIErrorZ_clone(orig_conv);
+uint64_t __attribute__((export_name("TS_CResult_NonePaymentSendFailureZ_clone"))) TS_CResult_NonePaymentSendFailureZ_clone(uint64_t orig) {
+ LDKCResult_NonePaymentSendFailureZ* orig_conv = (LDKCResult_NonePaymentSendFailureZ*)untag_ptr(orig);
+ LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
+ *ret_conv = CResult_NonePaymentSendFailureZ_clone(orig_conv);
return tag_ptr(ret_conv, true);
}
-uint64_t __attribute__((export_name("TS_CResult_PaymentIdPaymentSendFailureZ_ok"))) TS_CResult_PaymentIdPaymentSendFailureZ_ok(int8_tArray o) {
- LDKThirtyTwoBytes o_ref;
- CHECK(o->arr_len == 32);
- memcpy(o_ref.data, o->elems, 32); FREE(o);
- LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ");
- *ret_conv = CResult_PaymentIdPaymentSendFailureZ_ok(o_ref);
+uint64_t __attribute__((export_name("TS_CResult_NoneRetryableSendFailureZ_ok"))) TS_CResult_NoneRetryableSendFailureZ_ok() {
+ LDKCResult_NoneRetryableSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneRetryableSendFailureZ), "LDKCResult_NoneRetryableSendFailureZ");
+ *ret_conv = CResult_NoneRetryableSendFailureZ_ok();
return tag_ptr(ret_conv, true);
}
-uint64_t __attribute__((export_name("TS_CResult_PaymentIdPaymentSendFailureZ_err"))) TS_CResult_PaymentIdPaymentSendFailureZ_err(uint64_t e) {
- void* e_ptr = untag_ptr(e);
- CHECK_ACCESS(e_ptr);
- LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(e_ptr);
- e_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)untag_ptr(e));
- LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ");
- *ret_conv = CResult_PaymentIdPaymentSendFailureZ_err(e_conv);
+uint64_t __attribute__((export_name("TS_CResult_NoneRetryableSendFailureZ_err"))) TS_CResult_NoneRetryableSendFailureZ_err(uint32_t e) {
+ LDKRetryableSendFailure e_conv = LDKRetryableSendFailure_from_js(e);
+ LDKCResult_NoneRetryableSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneRetryableSendFailureZ), "LDKCResult_NoneRetryableSendFailureZ");
+ *ret_conv = CResult_NoneRetryableSendFailureZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
-jboolean __attribute__((export_name("TS_CResult_PaymentIdPaymentSendFailureZ_is_ok"))) TS_CResult_PaymentIdPaymentSendFailureZ_is_ok(uint64_t o) {
- LDKCResult_PaymentIdPaymentSendFailureZ* o_conv = (LDKCResult_PaymentIdPaymentSendFailureZ*)untag_ptr(o);
- jboolean ret_conv = CResult_PaymentIdPaymentSendFailureZ_is_ok(o_conv);
+jboolean __attribute__((export_name("TS_CResult_NoneRetryableSendFailureZ_is_ok"))) TS_CResult_NoneRetryableSendFailureZ_is_ok(uint64_t o) {
+ LDKCResult_NoneRetryableSendFailureZ* o_conv = (LDKCResult_NoneRetryableSendFailureZ*)untag_ptr(o);
+ jboolean ret_conv = CResult_NoneRetryableSendFailureZ_is_ok(o_conv);
return ret_conv;
}
-void __attribute__((export_name("TS_CResult_PaymentIdPaymentSendFailureZ_free"))) TS_CResult_PaymentIdPaymentSendFailureZ_free(uint64_t _res) {
+void __attribute__((export_name("TS_CResult_NoneRetryableSendFailureZ_free"))) TS_CResult_NoneRetryableSendFailureZ_free(uint64_t _res) {
if (!ptr_is_owned(_res)) return;
void* _res_ptr = untag_ptr(_res);
CHECK_ACCESS(_res_ptr);
- LDKCResult_PaymentIdPaymentSendFailureZ _res_conv = *(LDKCResult_PaymentIdPaymentSendFailureZ*)(_res_ptr);
+ LDKCResult_NoneRetryableSendFailureZ _res_conv = *(LDKCResult_NoneRetryableSendFailureZ*)(_res_ptr);
FREE(untag_ptr(_res));
- CResult_PaymentIdPaymentSendFailureZ_free(_res_conv);
+ CResult_NoneRetryableSendFailureZ_free(_res_conv);
}
-static inline uint64_t CResult_PaymentIdPaymentSendFailureZ_clone_ptr(LDKCResult_PaymentIdPaymentSendFailureZ *NONNULL_PTR arg) {
- LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ");
- *ret_conv = CResult_PaymentIdPaymentSendFailureZ_clone(arg);
+static inline uint64_t CResult_NoneRetryableSendFailureZ_clone_ptr(LDKCResult_NoneRetryableSendFailureZ *NONNULL_PTR arg) {
+ LDKCResult_NoneRetryableSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneRetryableSendFailureZ), "LDKCResult_NoneRetryableSendFailureZ");
+ *ret_conv = CResult_NoneRetryableSendFailureZ_clone(arg);
return tag_ptr(ret_conv, true);
}
-int64_t __attribute__((export_name("TS_CResult_PaymentIdPaymentSendFailureZ_clone_ptr"))) TS_CResult_PaymentIdPaymentSendFailureZ_clone_ptr(uint64_t arg) {
- LDKCResult_PaymentIdPaymentSendFailureZ* arg_conv = (LDKCResult_PaymentIdPaymentSendFailureZ*)untag_ptr(arg);
- int64_t ret_conv = CResult_PaymentIdPaymentSendFailureZ_clone_ptr(arg_conv);
+int64_t __attribute__((export_name("TS_CResult_NoneRetryableSendFailureZ_clone_ptr"))) TS_CResult_NoneRetryableSendFailureZ_clone_ptr(uint64_t arg) {
+ LDKCResult_NoneRetryableSendFailureZ* arg_conv = (LDKCResult_NoneRetryableSendFailureZ*)untag_ptr(arg);
+ int64_t ret_conv = CResult_NoneRetryableSendFailureZ_clone_ptr(arg_conv);
return ret_conv;
}
-uint64_t __attribute__((export_name("TS_CResult_PaymentIdPaymentSendFailureZ_clone"))) TS_CResult_PaymentIdPaymentSendFailureZ_clone(uint64_t orig) {
- LDKCResult_PaymentIdPaymentSendFailureZ* orig_conv = (LDKCResult_PaymentIdPaymentSendFailureZ*)untag_ptr(orig);
- LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ");
- *ret_conv = CResult_PaymentIdPaymentSendFailureZ_clone(orig_conv);
+uint64_t __attribute__((export_name("TS_CResult_NoneRetryableSendFailureZ_clone"))) TS_CResult_NoneRetryableSendFailureZ_clone(uint64_t orig) {
+ LDKCResult_NoneRetryableSendFailureZ* orig_conv = (LDKCResult_NoneRetryableSendFailureZ*)untag_ptr(orig);
+ LDKCResult_NoneRetryableSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneRetryableSendFailureZ), "LDKCResult_NoneRetryableSendFailureZ");
+ *ret_conv = CResult_NoneRetryableSendFailureZ_clone(orig_conv);
return tag_ptr(ret_conv, true);
}
-uint64_t __attribute__((export_name("TS_CResult_NonePaymentSendFailureZ_ok"))) TS_CResult_NonePaymentSendFailureZ_ok() {
- LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
- *ret_conv = CResult_NonePaymentSendFailureZ_ok();
+uint64_t __attribute__((export_name("TS_CResult_PaymentHashPaymentSendFailureZ_ok"))) TS_CResult_PaymentHashPaymentSendFailureZ_ok(int8_tArray o) {
+ LDKThirtyTwoBytes o_ref;
+ CHECK(o->arr_len == 32);
+ memcpy(o_ref.data, o->elems, 32); FREE(o);
+ LDKCResult_PaymentHashPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentHashPaymentSendFailureZ), "LDKCResult_PaymentHashPaymentSendFailureZ");
+ *ret_conv = CResult_PaymentHashPaymentSendFailureZ_ok(o_ref);
return tag_ptr(ret_conv, true);
}
-uint64_t __attribute__((export_name("TS_CResult_NonePaymentSendFailureZ_err"))) TS_CResult_NonePaymentSendFailureZ_err(uint64_t e) {
+uint64_t __attribute__((export_name("TS_CResult_PaymentHashPaymentSendFailureZ_err"))) TS_CResult_PaymentHashPaymentSendFailureZ_err(uint64_t e) {
void* e_ptr = untag_ptr(e);
CHECK_ACCESS(e_ptr);
LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(e_ptr);
e_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)untag_ptr(e));
- LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
- *ret_conv = CResult_NonePaymentSendFailureZ_err(e_conv);
+ LDKCResult_PaymentHashPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentHashPaymentSendFailureZ), "LDKCResult_PaymentHashPaymentSendFailureZ");
+ *ret_conv = CResult_PaymentHashPaymentSendFailureZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
-jboolean __attribute__((export_name("TS_CResult_NonePaymentSendFailureZ_is_ok"))) TS_CResult_NonePaymentSendFailureZ_is_ok(uint64_t o) {
- LDKCResult_NonePaymentSendFailureZ* o_conv = (LDKCResult_NonePaymentSendFailureZ*)untag_ptr(o);
- jboolean ret_conv = CResult_NonePaymentSendFailureZ_is_ok(o_conv);
+jboolean __attribute__((export_name("TS_CResult_PaymentHashPaymentSendFailureZ_is_ok"))) TS_CResult_PaymentHashPaymentSendFailureZ_is_ok(uint64_t o) {
+ LDKCResult_PaymentHashPaymentSendFailureZ* o_conv = (LDKCResult_PaymentHashPaymentSendFailureZ*)untag_ptr(o);
+ jboolean ret_conv = CResult_PaymentHashPaymentSendFailureZ_is_ok(o_conv);
return ret_conv;
}
-void __attribute__((export_name("TS_CResult_NonePaymentSendFailureZ_free"))) TS_CResult_NonePaymentSendFailureZ_free(uint64_t _res) {
+void __attribute__((export_name("TS_CResult_PaymentHashPaymentSendFailureZ_free"))) TS_CResult_PaymentHashPaymentSendFailureZ_free(uint64_t _res) {
if (!ptr_is_owned(_res)) return;
void* _res_ptr = untag_ptr(_res);
CHECK_ACCESS(_res_ptr);
- LDKCResult_NonePaymentSendFailureZ _res_conv = *(LDKCResult_NonePaymentSendFailureZ*)(_res_ptr);
+ LDKCResult_PaymentHashPaymentSendFailureZ _res_conv = *(LDKCResult_PaymentHashPaymentSendFailureZ*)(_res_ptr);
FREE(untag_ptr(_res));
- CResult_NonePaymentSendFailureZ_free(_res_conv);
+ CResult_PaymentHashPaymentSendFailureZ_free(_res_conv);
}
-static inline uint64_t CResult_NonePaymentSendFailureZ_clone_ptr(LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR arg) {
- LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
- *ret_conv = CResult_NonePaymentSendFailureZ_clone(arg);
+static inline uint64_t CResult_PaymentHashPaymentSendFailureZ_clone_ptr(LDKCResult_PaymentHashPaymentSendFailureZ *NONNULL_PTR arg) {
+ LDKCResult_PaymentHashPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentHashPaymentSendFailureZ), "LDKCResult_PaymentHashPaymentSendFailureZ");
+ *ret_conv = CResult_PaymentHashPaymentSendFailureZ_clone(arg);
return tag_ptr(ret_conv, true);
}
-int64_t __attribute__((export_name("TS_CResult_NonePaymentSendFailureZ_clone_ptr"))) TS_CResult_NonePaymentSendFailureZ_clone_ptr(uint64_t arg) {
- LDKCResult_NonePaymentSendFailureZ* arg_conv = (LDKCResult_NonePaymentSendFailureZ*)untag_ptr(arg);
- int64_t ret_conv = CResult_NonePaymentSendFailureZ_clone_ptr(arg_conv);
+int64_t __attribute__((export_name("TS_CResult_PaymentHashPaymentSendFailureZ_clone_ptr"))) TS_CResult_PaymentHashPaymentSendFailureZ_clone_ptr(uint64_t arg) {
+ LDKCResult_PaymentHashPaymentSendFailureZ* arg_conv = (LDKCResult_PaymentHashPaymentSendFailureZ*)untag_ptr(arg);
+ int64_t ret_conv = CResult_PaymentHashPaymentSendFailureZ_clone_ptr(arg_conv);
return ret_conv;
}
-uint64_t __attribute__((export_name("TS_CResult_NonePaymentSendFailureZ_clone"))) TS_CResult_NonePaymentSendFailureZ_clone(uint64_t orig) {
- LDKCResult_NonePaymentSendFailureZ* orig_conv = (LDKCResult_NonePaymentSendFailureZ*)untag_ptr(orig);
- LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
- *ret_conv = CResult_NonePaymentSendFailureZ_clone(orig_conv);
+uint64_t __attribute__((export_name("TS_CResult_PaymentHashPaymentSendFailureZ_clone"))) TS_CResult_PaymentHashPaymentSendFailureZ_clone(uint64_t orig) {
+ LDKCResult_PaymentHashPaymentSendFailureZ* orig_conv = (LDKCResult_PaymentHashPaymentSendFailureZ*)untag_ptr(orig);
+ LDKCResult_PaymentHashPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentHashPaymentSendFailureZ), "LDKCResult_PaymentHashPaymentSendFailureZ");
+ *ret_conv = CResult_PaymentHashPaymentSendFailureZ_clone(orig_conv);
+ return tag_ptr(ret_conv, true);
+}
+
+uint64_t __attribute__((export_name("TS_CResult_PaymentHashRetryableSendFailureZ_ok"))) TS_CResult_PaymentHashRetryableSendFailureZ_ok(int8_tArray o) {
+ LDKThirtyTwoBytes o_ref;
+ CHECK(o->arr_len == 32);
+ memcpy(o_ref.data, o->elems, 32); FREE(o);
+ LDKCResult_PaymentHashRetryableSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentHashRetryableSendFailureZ), "LDKCResult_PaymentHashRetryableSendFailureZ");
+ *ret_conv = CResult_PaymentHashRetryableSendFailureZ_ok(o_ref);
+ return tag_ptr(ret_conv, true);
+}
+
+uint64_t __attribute__((export_name("TS_CResult_PaymentHashRetryableSendFailureZ_err"))) TS_CResult_PaymentHashRetryableSendFailureZ_err(uint32_t e) {
+ LDKRetryableSendFailure e_conv = LDKRetryableSendFailure_from_js(e);
+ LDKCResult_PaymentHashRetryableSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentHashRetryableSendFailureZ), "LDKCResult_PaymentHashRetryableSendFailureZ");
+ *ret_conv = CResult_PaymentHashRetryableSendFailureZ_err(e_conv);
+ return tag_ptr(ret_conv, true);
+}
+
+jboolean __attribute__((export_name("TS_CResult_PaymentHashRetryableSendFailureZ_is_ok"))) TS_CResult_PaymentHashRetryableSendFailureZ_is_ok(uint64_t o) {
+ LDKCResult_PaymentHashRetryableSendFailureZ* o_conv = (LDKCResult_PaymentHashRetryableSendFailureZ*)untag_ptr(o);
+ jboolean ret_conv = CResult_PaymentHashRetryableSendFailureZ_is_ok(o_conv);
+ return ret_conv;
+}
+
+void __attribute__((export_name("TS_CResult_PaymentHashRetryableSendFailureZ_free"))) TS_CResult_PaymentHashRetryableSendFailureZ_free(uint64_t _res) {
+ if (!ptr_is_owned(_res)) return;
+ void* _res_ptr = untag_ptr(_res);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_PaymentHashRetryableSendFailureZ _res_conv = *(LDKCResult_PaymentHashRetryableSendFailureZ*)(_res_ptr);
+ FREE(untag_ptr(_res));
+ CResult_PaymentHashRetryableSendFailureZ_free(_res_conv);
+}
+
+static inline uint64_t CResult_PaymentHashRetryableSendFailureZ_clone_ptr(LDKCResult_PaymentHashRetryableSendFailureZ *NONNULL_PTR arg) {
+ LDKCResult_PaymentHashRetryableSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentHashRetryableSendFailureZ), "LDKCResult_PaymentHashRetryableSendFailureZ");
+ *ret_conv = CResult_PaymentHashRetryableSendFailureZ_clone(arg);
+ return tag_ptr(ret_conv, true);
+}
+int64_t __attribute__((export_name("TS_CResult_PaymentHashRetryableSendFailureZ_clone_ptr"))) TS_CResult_PaymentHashRetryableSendFailureZ_clone_ptr(uint64_t arg) {
+ LDKCResult_PaymentHashRetryableSendFailureZ* arg_conv = (LDKCResult_PaymentHashRetryableSendFailureZ*)untag_ptr(arg);
+ int64_t ret_conv = CResult_PaymentHashRetryableSendFailureZ_clone_ptr(arg_conv);
+ return ret_conv;
+}
+
+uint64_t __attribute__((export_name("TS_CResult_PaymentHashRetryableSendFailureZ_clone"))) TS_CResult_PaymentHashRetryableSendFailureZ_clone(uint64_t orig) {
+ LDKCResult_PaymentHashRetryableSendFailureZ* orig_conv = (LDKCResult_PaymentHashRetryableSendFailureZ*)untag_ptr(orig);
+ LDKCResult_PaymentHashRetryableSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentHashRetryableSendFailureZ), "LDKCResult_PaymentHashRetryableSendFailureZ");
+ *ret_conv = CResult_PaymentHashRetryableSendFailureZ_clone(orig_conv);
return tag_ptr(ret_conv, true);
}
}
uint64_t __attribute__((export_name("TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_err"))) TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ");
*ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
uint64_t __attribute__((export_name("TS_CResult_ChannelCounterpartyDecodeErrorZ_err"))) TS_CResult_ChannelCounterpartyDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ");
*ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
uint64_t __attribute__((export_name("TS_CResult_ChannelDetailsDecodeErrorZ_err"))) TS_CResult_ChannelDetailsDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ");
*ret_conv = CResult_ChannelDetailsDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
uint64_t __attribute__((export_name("TS_CResult_PhantomRouteHintsDecodeErrorZ_err"))) TS_CResult_PhantomRouteHintsDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ");
*ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
uint64_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err"))) TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ");
*ret_conv = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
uint64_t __attribute__((export_name("TS_CResult_ChannelConfigDecodeErrorZ_err"))) TS_CResult_ChannelConfigDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ");
*ret_conv = CResult_ChannelConfigDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
return tag_ptr(ret_conv, true);
}
+uint64_t __attribute__((export_name("TS_COption_APIErrorZ_some"))) TS_COption_APIErrorZ_some(uint64_t o) {
+ void* o_ptr = untag_ptr(o);
+ CHECK_ACCESS(o_ptr);
+ LDKAPIError o_conv = *(LDKAPIError*)(o_ptr);
+ o_conv = APIError_clone((LDKAPIError*)untag_ptr(o));
+ LDKCOption_APIErrorZ *ret_copy = MALLOC(sizeof(LDKCOption_APIErrorZ), "LDKCOption_APIErrorZ");
+ *ret_copy = COption_APIErrorZ_some(o_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+uint64_t __attribute__((export_name("TS_COption_APIErrorZ_none"))) TS_COption_APIErrorZ_none() {
+ LDKCOption_APIErrorZ *ret_copy = MALLOC(sizeof(LDKCOption_APIErrorZ), "LDKCOption_APIErrorZ");
+ *ret_copy = COption_APIErrorZ_none();
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+void __attribute__((export_name("TS_COption_APIErrorZ_free"))) TS_COption_APIErrorZ_free(uint64_t _res) {
+ if (!ptr_is_owned(_res)) return;
+ void* _res_ptr = untag_ptr(_res);
+ CHECK_ACCESS(_res_ptr);
+ LDKCOption_APIErrorZ _res_conv = *(LDKCOption_APIErrorZ*)(_res_ptr);
+ FREE(untag_ptr(_res));
+ COption_APIErrorZ_free(_res_conv);
+}
+
+static inline uint64_t COption_APIErrorZ_clone_ptr(LDKCOption_APIErrorZ *NONNULL_PTR arg) {
+ LDKCOption_APIErrorZ *ret_copy = MALLOC(sizeof(LDKCOption_APIErrorZ), "LDKCOption_APIErrorZ");
+ *ret_copy = COption_APIErrorZ_clone(arg);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+int64_t __attribute__((export_name("TS_COption_APIErrorZ_clone_ptr"))) TS_COption_APIErrorZ_clone_ptr(uint64_t arg) {
+ LDKCOption_APIErrorZ* arg_conv = (LDKCOption_APIErrorZ*)untag_ptr(arg);
+ int64_t ret_conv = COption_APIErrorZ_clone_ptr(arg_conv);
+ return ret_conv;
+}
+
+uint64_t __attribute__((export_name("TS_COption_APIErrorZ_clone"))) TS_COption_APIErrorZ_clone(uint64_t orig) {
+ LDKCOption_APIErrorZ* orig_conv = (LDKCOption_APIErrorZ*)untag_ptr(orig);
+ LDKCOption_APIErrorZ *ret_copy = MALLOC(sizeof(LDKCOption_APIErrorZ), "LDKCOption_APIErrorZ");
+ *ret_copy = COption_APIErrorZ_clone(orig_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+uint64_t __attribute__((export_name("TS_CResult_COption_APIErrorZDecodeErrorZ_ok"))) TS_CResult_COption_APIErrorZDecodeErrorZ_ok(uint64_t o) {
+ void* o_ptr = untag_ptr(o);
+ CHECK_ACCESS(o_ptr);
+ LDKCOption_APIErrorZ o_conv = *(LDKCOption_APIErrorZ*)(o_ptr);
+ o_conv = COption_APIErrorZ_clone((LDKCOption_APIErrorZ*)untag_ptr(o));
+ LDKCResult_COption_APIErrorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_APIErrorZDecodeErrorZ), "LDKCResult_COption_APIErrorZDecodeErrorZ");
+ *ret_conv = CResult_COption_APIErrorZDecodeErrorZ_ok(o_conv);
+ return tag_ptr(ret_conv, true);
+}
+
+uint64_t __attribute__((export_name("TS_CResult_COption_APIErrorZDecodeErrorZ_err"))) TS_CResult_COption_APIErrorZDecodeErrorZ_err(uint64_t e) {
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
+ LDKCResult_COption_APIErrorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_APIErrorZDecodeErrorZ), "LDKCResult_COption_APIErrorZDecodeErrorZ");
+ *ret_conv = CResult_COption_APIErrorZDecodeErrorZ_err(e_conv);
+ return tag_ptr(ret_conv, true);
+}
+
+jboolean __attribute__((export_name("TS_CResult_COption_APIErrorZDecodeErrorZ_is_ok"))) TS_CResult_COption_APIErrorZDecodeErrorZ_is_ok(uint64_t o) {
+ LDKCResult_COption_APIErrorZDecodeErrorZ* o_conv = (LDKCResult_COption_APIErrorZDecodeErrorZ*)untag_ptr(o);
+ jboolean ret_conv = CResult_COption_APIErrorZDecodeErrorZ_is_ok(o_conv);
+ return ret_conv;
+}
+
+void __attribute__((export_name("TS_CResult_COption_APIErrorZDecodeErrorZ_free"))) TS_CResult_COption_APIErrorZDecodeErrorZ_free(uint64_t _res) {
+ if (!ptr_is_owned(_res)) return;
+ void* _res_ptr = untag_ptr(_res);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_COption_APIErrorZDecodeErrorZ _res_conv = *(LDKCResult_COption_APIErrorZDecodeErrorZ*)(_res_ptr);
+ FREE(untag_ptr(_res));
+ CResult_COption_APIErrorZDecodeErrorZ_free(_res_conv);
+}
+
+static inline uint64_t CResult_COption_APIErrorZDecodeErrorZ_clone_ptr(LDKCResult_COption_APIErrorZDecodeErrorZ *NONNULL_PTR arg) {
+ LDKCResult_COption_APIErrorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_APIErrorZDecodeErrorZ), "LDKCResult_COption_APIErrorZDecodeErrorZ");
+ *ret_conv = CResult_COption_APIErrorZDecodeErrorZ_clone(arg);
+ return tag_ptr(ret_conv, true);
+}
+int64_t __attribute__((export_name("TS_CResult_COption_APIErrorZDecodeErrorZ_clone_ptr"))) TS_CResult_COption_APIErrorZDecodeErrorZ_clone_ptr(uint64_t arg) {
+ LDKCResult_COption_APIErrorZDecodeErrorZ* arg_conv = (LDKCResult_COption_APIErrorZDecodeErrorZ*)untag_ptr(arg);
+ int64_t ret_conv = CResult_COption_APIErrorZDecodeErrorZ_clone_ptr(arg_conv);
+ return ret_conv;
+}
+
+uint64_t __attribute__((export_name("TS_CResult_COption_APIErrorZDecodeErrorZ_clone"))) TS_CResult_COption_APIErrorZDecodeErrorZ_clone(uint64_t orig) {
+ LDKCResult_COption_APIErrorZDecodeErrorZ* orig_conv = (LDKCResult_COption_APIErrorZDecodeErrorZ*)untag_ptr(orig);
+ LDKCResult_COption_APIErrorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_APIErrorZDecodeErrorZ), "LDKCResult_COption_APIErrorZDecodeErrorZ");
+ *ret_conv = CResult_COption_APIErrorZDecodeErrorZ_clone(orig_conv);
+ return tag_ptr(ret_conv, true);
+}
+
uint64_t __attribute__((export_name("TS_CResult_OutPointDecodeErrorZ_ok"))) TS_CResult_OutPointDecodeErrorZ_ok(uint64_t o) {
LDKOutPoint o_conv;
o_conv.inner = untag_ptr(o);
}
uint64_t __attribute__((export_name("TS_CResult_OutPointDecodeErrorZ_err"))) TS_CResult_OutPointDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ");
*ret_conv = CResult_OutPointDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
uint64_t __attribute__((export_name("TS_CResult_COption_TypeZDecodeErrorZ_err"))) TS_CResult_COption_TypeZDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ");
*ret_conv = CResult_COption_TypeZDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
return tag_ptr(ret_conv, true);
}
-uint64_t __attribute__((export_name("TS_CResult_SiPrefixParseErrorZ_ok"))) TS_CResult_SiPrefixParseErrorZ_ok(uint32_t o) {
- LDKSiPrefix o_conv = LDKSiPrefix_from_js(o);
- LDKCResult_SiPrefixParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixParseErrorZ), "LDKCResult_SiPrefixParseErrorZ");
- *ret_conv = CResult_SiPrefixParseErrorZ_ok(o_conv);
+uint64_t __attribute__((export_name("TS_CResult_NonePaymentErrorZ_ok"))) TS_CResult_NonePaymentErrorZ_ok() {
+ LDKCResult_NonePaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentErrorZ), "LDKCResult_NonePaymentErrorZ");
+ *ret_conv = CResult_NonePaymentErrorZ_ok();
return tag_ptr(ret_conv, true);
}
-uint64_t __attribute__((export_name("TS_CResult_SiPrefixParseErrorZ_err"))) TS_CResult_SiPrefixParseErrorZ_err(uint64_t e) {
+uint64_t __attribute__((export_name("TS_CResult_NonePaymentErrorZ_err"))) TS_CResult_NonePaymentErrorZ_err(uint64_t e) {
void* e_ptr = untag_ptr(e);
CHECK_ACCESS(e_ptr);
- LDKParseError e_conv = *(LDKParseError*)(e_ptr);
- e_conv = ParseError_clone((LDKParseError*)untag_ptr(e));
- LDKCResult_SiPrefixParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixParseErrorZ), "LDKCResult_SiPrefixParseErrorZ");
- *ret_conv = CResult_SiPrefixParseErrorZ_err(e_conv);
+ LDKPaymentError e_conv = *(LDKPaymentError*)(e_ptr);
+ e_conv = PaymentError_clone((LDKPaymentError*)untag_ptr(e));
+ LDKCResult_NonePaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentErrorZ), "LDKCResult_NonePaymentErrorZ");
+ *ret_conv = CResult_NonePaymentErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
-jboolean __attribute__((export_name("TS_CResult_SiPrefixParseErrorZ_is_ok"))) TS_CResult_SiPrefixParseErrorZ_is_ok(uint64_t o) {
- LDKCResult_SiPrefixParseErrorZ* o_conv = (LDKCResult_SiPrefixParseErrorZ*)untag_ptr(o);
- jboolean ret_conv = CResult_SiPrefixParseErrorZ_is_ok(o_conv);
+jboolean __attribute__((export_name("TS_CResult_NonePaymentErrorZ_is_ok"))) TS_CResult_NonePaymentErrorZ_is_ok(uint64_t o) {
+ LDKCResult_NonePaymentErrorZ* o_conv = (LDKCResult_NonePaymentErrorZ*)untag_ptr(o);
+ jboolean ret_conv = CResult_NonePaymentErrorZ_is_ok(o_conv);
return ret_conv;
}
-void __attribute__((export_name("TS_CResult_SiPrefixParseErrorZ_free"))) TS_CResult_SiPrefixParseErrorZ_free(uint64_t _res) {
+void __attribute__((export_name("TS_CResult_NonePaymentErrorZ_free"))) TS_CResult_NonePaymentErrorZ_free(uint64_t _res) {
if (!ptr_is_owned(_res)) return;
void* _res_ptr = untag_ptr(_res);
CHECK_ACCESS(_res_ptr);
- LDKCResult_SiPrefixParseErrorZ _res_conv = *(LDKCResult_SiPrefixParseErrorZ*)(_res_ptr);
+ LDKCResult_NonePaymentErrorZ _res_conv = *(LDKCResult_NonePaymentErrorZ*)(_res_ptr);
FREE(untag_ptr(_res));
- CResult_SiPrefixParseErrorZ_free(_res_conv);
+ CResult_NonePaymentErrorZ_free(_res_conv);
}
-static inline uint64_t CResult_SiPrefixParseErrorZ_clone_ptr(LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR arg) {
- LDKCResult_SiPrefixParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixParseErrorZ), "LDKCResult_SiPrefixParseErrorZ");
- *ret_conv = CResult_SiPrefixParseErrorZ_clone(arg);
+static inline uint64_t CResult_NonePaymentErrorZ_clone_ptr(LDKCResult_NonePaymentErrorZ *NONNULL_PTR arg) {
+ LDKCResult_NonePaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentErrorZ), "LDKCResult_NonePaymentErrorZ");
+ *ret_conv = CResult_NonePaymentErrorZ_clone(arg);
return tag_ptr(ret_conv, true);
}
-int64_t __attribute__((export_name("TS_CResult_SiPrefixParseErrorZ_clone_ptr"))) TS_CResult_SiPrefixParseErrorZ_clone_ptr(uint64_t arg) {
- LDKCResult_SiPrefixParseErrorZ* arg_conv = (LDKCResult_SiPrefixParseErrorZ*)untag_ptr(arg);
- int64_t ret_conv = CResult_SiPrefixParseErrorZ_clone_ptr(arg_conv);
+int64_t __attribute__((export_name("TS_CResult_NonePaymentErrorZ_clone_ptr"))) TS_CResult_NonePaymentErrorZ_clone_ptr(uint64_t arg) {
+ LDKCResult_NonePaymentErrorZ* arg_conv = (LDKCResult_NonePaymentErrorZ*)untag_ptr(arg);
+ int64_t ret_conv = CResult_NonePaymentErrorZ_clone_ptr(arg_conv);
return ret_conv;
}
-uint64_t __attribute__((export_name("TS_CResult_SiPrefixParseErrorZ_clone"))) TS_CResult_SiPrefixParseErrorZ_clone(uint64_t orig) {
- LDKCResult_SiPrefixParseErrorZ* orig_conv = (LDKCResult_SiPrefixParseErrorZ*)untag_ptr(orig);
- LDKCResult_SiPrefixParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixParseErrorZ), "LDKCResult_SiPrefixParseErrorZ");
- *ret_conv = CResult_SiPrefixParseErrorZ_clone(orig_conv);
+uint64_t __attribute__((export_name("TS_CResult_NonePaymentErrorZ_clone"))) TS_CResult_NonePaymentErrorZ_clone(uint64_t orig) {
+ LDKCResult_NonePaymentErrorZ* orig_conv = (LDKCResult_NonePaymentErrorZ*)untag_ptr(orig);
+ LDKCResult_NonePaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentErrorZ), "LDKCResult_NonePaymentErrorZ");
+ *ret_conv = CResult_NonePaymentErrorZ_clone(orig_conv);
return tag_ptr(ret_conv, true);
}
-uint64_t __attribute__((export_name("TS_CResult_InvoiceParseOrSemanticErrorZ_ok"))) TS_CResult_InvoiceParseOrSemanticErrorZ_ok(uint64_t o) {
- LDKInvoice o_conv;
- o_conv.inner = untag_ptr(o);
- o_conv.is_owned = ptr_is_owned(o);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
- o_conv = Invoice_clone(&o_conv);
- LDKCResult_InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceParseOrSemanticErrorZ), "LDKCResult_InvoiceParseOrSemanticErrorZ");
- *ret_conv = CResult_InvoiceParseOrSemanticErrorZ_ok(o_conv);
+uint64_t __attribute__((export_name("TS_CResult_StringErrorZ_ok"))) TS_CResult_StringErrorZ_ok(jstring o) {
+ LDKStr o_conv = str_ref_to_owned_c(o);
+ LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ");
+ *ret_conv = CResult_StringErrorZ_ok(o_conv);
return tag_ptr(ret_conv, true);
}
-uint64_t __attribute__((export_name("TS_CResult_InvoiceParseOrSemanticErrorZ_err"))) TS_CResult_InvoiceParseOrSemanticErrorZ_err(uint64_t e) {
- void* e_ptr = untag_ptr(e);
- CHECK_ACCESS(e_ptr);
- LDKParseOrSemanticError e_conv = *(LDKParseOrSemanticError*)(e_ptr);
- e_conv = ParseOrSemanticError_clone((LDKParseOrSemanticError*)untag_ptr(e));
- LDKCResult_InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceParseOrSemanticErrorZ), "LDKCResult_InvoiceParseOrSemanticErrorZ");
- *ret_conv = CResult_InvoiceParseOrSemanticErrorZ_err(e_conv);
+uint64_t __attribute__((export_name("TS_CResult_StringErrorZ_err"))) TS_CResult_StringErrorZ_err(uint32_t e) {
+ LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_js(e);
+ LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ");
+ *ret_conv = CResult_StringErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
-jboolean __attribute__((export_name("TS_CResult_InvoiceParseOrSemanticErrorZ_is_ok"))) TS_CResult_InvoiceParseOrSemanticErrorZ_is_ok(uint64_t o) {
- LDKCResult_InvoiceParseOrSemanticErrorZ* o_conv = (LDKCResult_InvoiceParseOrSemanticErrorZ*)untag_ptr(o);
- jboolean ret_conv = CResult_InvoiceParseOrSemanticErrorZ_is_ok(o_conv);
+jboolean __attribute__((export_name("TS_CResult_StringErrorZ_is_ok"))) TS_CResult_StringErrorZ_is_ok(uint64_t o) {
+ LDKCResult_StringErrorZ* o_conv = (LDKCResult_StringErrorZ*)untag_ptr(o);
+ jboolean ret_conv = CResult_StringErrorZ_is_ok(o_conv);
return ret_conv;
}
-void __attribute__((export_name("TS_CResult_InvoiceParseOrSemanticErrorZ_free"))) TS_CResult_InvoiceParseOrSemanticErrorZ_free(uint64_t _res) {
+void __attribute__((export_name("TS_CResult_StringErrorZ_free"))) TS_CResult_StringErrorZ_free(uint64_t _res) {
if (!ptr_is_owned(_res)) return;
void* _res_ptr = untag_ptr(_res);
CHECK_ACCESS(_res_ptr);
- LDKCResult_InvoiceParseOrSemanticErrorZ _res_conv = *(LDKCResult_InvoiceParseOrSemanticErrorZ*)(_res_ptr);
+ LDKCResult_StringErrorZ _res_conv = *(LDKCResult_StringErrorZ*)(_res_ptr);
FREE(untag_ptr(_res));
- CResult_InvoiceParseOrSemanticErrorZ_free(_res_conv);
+ CResult_StringErrorZ_free(_res_conv);
}
-static inline uint64_t CResult_InvoiceParseOrSemanticErrorZ_clone_ptr(LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR arg) {
- LDKCResult_InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceParseOrSemanticErrorZ), "LDKCResult_InvoiceParseOrSemanticErrorZ");
- *ret_conv = CResult_InvoiceParseOrSemanticErrorZ_clone(arg);
+static inline uint64_t CResult_StringErrorZ_clone_ptr(LDKCResult_StringErrorZ *NONNULL_PTR arg) {
+ LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ");
+ *ret_conv = CResult_StringErrorZ_clone(arg);
return tag_ptr(ret_conv, true);
}
-int64_t __attribute__((export_name("TS_CResult_InvoiceParseOrSemanticErrorZ_clone_ptr"))) TS_CResult_InvoiceParseOrSemanticErrorZ_clone_ptr(uint64_t arg) {
- LDKCResult_InvoiceParseOrSemanticErrorZ* arg_conv = (LDKCResult_InvoiceParseOrSemanticErrorZ*)untag_ptr(arg);
- int64_t ret_conv = CResult_InvoiceParseOrSemanticErrorZ_clone_ptr(arg_conv);
+int64_t __attribute__((export_name("TS_CResult_StringErrorZ_clone_ptr"))) TS_CResult_StringErrorZ_clone_ptr(uint64_t arg) {
+ LDKCResult_StringErrorZ* arg_conv = (LDKCResult_StringErrorZ*)untag_ptr(arg);
+ int64_t ret_conv = CResult_StringErrorZ_clone_ptr(arg_conv);
return ret_conv;
}
-uint64_t __attribute__((export_name("TS_CResult_InvoiceParseOrSemanticErrorZ_clone"))) TS_CResult_InvoiceParseOrSemanticErrorZ_clone(uint64_t orig) {
- LDKCResult_InvoiceParseOrSemanticErrorZ* orig_conv = (LDKCResult_InvoiceParseOrSemanticErrorZ*)untag_ptr(orig);
- LDKCResult_InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceParseOrSemanticErrorZ), "LDKCResult_InvoiceParseOrSemanticErrorZ");
- *ret_conv = CResult_InvoiceParseOrSemanticErrorZ_clone(orig_conv);
+uint64_t __attribute__((export_name("TS_CResult_StringErrorZ_clone"))) TS_CResult_StringErrorZ_clone(uint64_t orig) {
+ LDKCResult_StringErrorZ* orig_conv = (LDKCResult_StringErrorZ*)untag_ptr(orig);
+ LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ");
+ *ret_conv = CResult_StringErrorZ_clone(orig_conv);
return tag_ptr(ret_conv, true);
}
-uint64_t __attribute__((export_name("TS_CResult_SignedRawInvoiceParseErrorZ_ok"))) TS_CResult_SignedRawInvoiceParseErrorZ_ok(uint64_t o) {
- LDKSignedRawInvoice o_conv;
- o_conv.inner = untag_ptr(o);
- o_conv.is_owned = ptr_is_owned(o);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
- o_conv = SignedRawInvoice_clone(&o_conv);
- LDKCResult_SignedRawInvoiceParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceParseErrorZ), "LDKCResult_SignedRawInvoiceParseErrorZ");
- *ret_conv = CResult_SignedRawInvoiceParseErrorZ_ok(o_conv);
+uint64_t __attribute__((export_name("TS_CResult_PublicKeyErrorZ_ok"))) TS_CResult_PublicKeyErrorZ_ok(int8_tArray o) {
+ LDKPublicKey o_ref;
+ CHECK(o->arr_len == 33);
+ memcpy(o_ref.compressed_form, o->elems, 33); FREE(o);
+ LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ");
+ *ret_conv = CResult_PublicKeyErrorZ_ok(o_ref);
return tag_ptr(ret_conv, true);
}
-uint64_t __attribute__((export_name("TS_CResult_SignedRawInvoiceParseErrorZ_err"))) TS_CResult_SignedRawInvoiceParseErrorZ_err(uint64_t e) {
- void* e_ptr = untag_ptr(e);
- CHECK_ACCESS(e_ptr);
- LDKParseError e_conv = *(LDKParseError*)(e_ptr);
- e_conv = ParseError_clone((LDKParseError*)untag_ptr(e));
- LDKCResult_SignedRawInvoiceParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceParseErrorZ), "LDKCResult_SignedRawInvoiceParseErrorZ");
- *ret_conv = CResult_SignedRawInvoiceParseErrorZ_err(e_conv);
+uint64_t __attribute__((export_name("TS_CResult_PublicKeyErrorZ_err"))) TS_CResult_PublicKeyErrorZ_err(uint32_t e) {
+ LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_js(e);
+ LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ");
+ *ret_conv = CResult_PublicKeyErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
-jboolean __attribute__((export_name("TS_CResult_SignedRawInvoiceParseErrorZ_is_ok"))) TS_CResult_SignedRawInvoiceParseErrorZ_is_ok(uint64_t o) {
- LDKCResult_SignedRawInvoiceParseErrorZ* o_conv = (LDKCResult_SignedRawInvoiceParseErrorZ*)untag_ptr(o);
- jboolean ret_conv = CResult_SignedRawInvoiceParseErrorZ_is_ok(o_conv);
+jboolean __attribute__((export_name("TS_CResult_PublicKeyErrorZ_is_ok"))) TS_CResult_PublicKeyErrorZ_is_ok(uint64_t o) {
+ LDKCResult_PublicKeyErrorZ* o_conv = (LDKCResult_PublicKeyErrorZ*)untag_ptr(o);
+ jboolean ret_conv = CResult_PublicKeyErrorZ_is_ok(o_conv);
return ret_conv;
}
-void __attribute__((export_name("TS_CResult_SignedRawInvoiceParseErrorZ_free"))) TS_CResult_SignedRawInvoiceParseErrorZ_free(uint64_t _res) {
+void __attribute__((export_name("TS_CResult_PublicKeyErrorZ_free"))) TS_CResult_PublicKeyErrorZ_free(uint64_t _res) {
if (!ptr_is_owned(_res)) return;
void* _res_ptr = untag_ptr(_res);
CHECK_ACCESS(_res_ptr);
- LDKCResult_SignedRawInvoiceParseErrorZ _res_conv = *(LDKCResult_SignedRawInvoiceParseErrorZ*)(_res_ptr);
+ LDKCResult_PublicKeyErrorZ _res_conv = *(LDKCResult_PublicKeyErrorZ*)(_res_ptr);
FREE(untag_ptr(_res));
- CResult_SignedRawInvoiceParseErrorZ_free(_res_conv);
+ CResult_PublicKeyErrorZ_free(_res_conv);
}
-static inline uint64_t CResult_SignedRawInvoiceParseErrorZ_clone_ptr(LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR arg) {
- LDKCResult_SignedRawInvoiceParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceParseErrorZ), "LDKCResult_SignedRawInvoiceParseErrorZ");
- *ret_conv = CResult_SignedRawInvoiceParseErrorZ_clone(arg);
+static inline uint64_t CResult_PublicKeyErrorZ_clone_ptr(LDKCResult_PublicKeyErrorZ *NONNULL_PTR arg) {
+ LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ");
+ *ret_conv = CResult_PublicKeyErrorZ_clone(arg);
return tag_ptr(ret_conv, true);
}
-int64_t __attribute__((export_name("TS_CResult_SignedRawInvoiceParseErrorZ_clone_ptr"))) TS_CResult_SignedRawInvoiceParseErrorZ_clone_ptr(uint64_t arg) {
- LDKCResult_SignedRawInvoiceParseErrorZ* arg_conv = (LDKCResult_SignedRawInvoiceParseErrorZ*)untag_ptr(arg);
- int64_t ret_conv = CResult_SignedRawInvoiceParseErrorZ_clone_ptr(arg_conv);
+int64_t __attribute__((export_name("TS_CResult_PublicKeyErrorZ_clone_ptr"))) TS_CResult_PublicKeyErrorZ_clone_ptr(uint64_t arg) {
+ LDKCResult_PublicKeyErrorZ* arg_conv = (LDKCResult_PublicKeyErrorZ*)untag_ptr(arg);
+ int64_t ret_conv = CResult_PublicKeyErrorZ_clone_ptr(arg_conv);
return ret_conv;
}
-uint64_t __attribute__((export_name("TS_CResult_SignedRawInvoiceParseErrorZ_clone"))) TS_CResult_SignedRawInvoiceParseErrorZ_clone(uint64_t orig) {
- LDKCResult_SignedRawInvoiceParseErrorZ* orig_conv = (LDKCResult_SignedRawInvoiceParseErrorZ*)untag_ptr(orig);
- LDKCResult_SignedRawInvoiceParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceParseErrorZ), "LDKCResult_SignedRawInvoiceParseErrorZ");
- *ret_conv = CResult_SignedRawInvoiceParseErrorZ_clone(orig_conv);
+uint64_t __attribute__((export_name("TS_CResult_PublicKeyErrorZ_clone"))) TS_CResult_PublicKeyErrorZ_clone(uint64_t orig) {
+ LDKCResult_PublicKeyErrorZ* orig_conv = (LDKCResult_PublicKeyErrorZ*)untag_ptr(orig);
+ LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ");
+ *ret_conv = CResult_PublicKeyErrorZ_clone(orig_conv);
return tag_ptr(ret_conv, true);
}
-static inline uint64_t C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone_ptr(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR arg) {
- LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ");
- *ret_conv = C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone(arg);
+uint64_t __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeErrorZ_ok"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_ok(uint64_t o) {
+ LDKChannelMonitorUpdate o_conv;
+ o_conv.inner = untag_ptr(o);
+ o_conv.is_owned = ptr_is_owned(o);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
+ o_conv = ChannelMonitorUpdate_clone(&o_conv);
+ LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ");
+ *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_ok(o_conv);
return tag_ptr(ret_conv, true);
}
-int64_t __attribute__((export_name("TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone_ptr"))) TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone_ptr(uint64_t arg) {
- LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* arg_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)untag_ptr(arg);
- int64_t ret_conv = C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone_ptr(arg_conv);
- return ret_conv;
-}
-uint64_t __attribute__((export_name("TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone"))) TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone(uint64_t orig) {
- LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* orig_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)untag_ptr(orig);
- LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ");
- *ret_conv = C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone(orig_conv);
+uint64_t __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeErrorZ_err"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_err(uint64_t e) {
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
+ LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ");
+ *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
-uint64_t __attribute__((export_name("TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_new"))) TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_new(uint64_t a, int8_tArray b, uint64_t c) {
- LDKRawInvoice a_conv;
- a_conv.inner = untag_ptr(a);
- a_conv.is_owned = ptr_is_owned(a);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
- a_conv = RawInvoice_clone(&a_conv);
- LDKThirtyTwoBytes b_ref;
- CHECK(b->arr_len == 32);
- memcpy(b_ref.data, b->elems, 32); FREE(b);
- LDKInvoiceSignature c_conv;
- c_conv.inner = untag_ptr(c);
- c_conv.is_owned = ptr_is_owned(c);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(c_conv);
- c_conv = InvoiceSignature_clone(&c_conv);
- LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ");
- *ret_conv = C3Tuple_RawInvoice_u832InvoiceSignatureZ_new(a_conv, b_ref, c_conv);
- return tag_ptr(ret_conv, true);
+jboolean __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok(uint64_t o) {
+ LDKCResult_ChannelMonitorUpdateDecodeErrorZ* o_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)untag_ptr(o);
+ jboolean ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok(o_conv);
+ return ret_conv;
}
-void __attribute__((export_name("TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_free"))) TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_free(uint64_t _res) {
+void __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeErrorZ_free"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_free(uint64_t _res) {
if (!ptr_is_owned(_res)) return;
void* _res_ptr = untag_ptr(_res);
CHECK_ACCESS(_res_ptr);
- LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ _res_conv = *(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)(_res_ptr);
+ LDKCResult_ChannelMonitorUpdateDecodeErrorZ _res_conv = *(LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)(_res_ptr);
FREE(untag_ptr(_res));
- C3Tuple_RawInvoice_u832InvoiceSignatureZ_free(_res_conv);
+ CResult_ChannelMonitorUpdateDecodeErrorZ_free(_res_conv);
}
-uint64_t __attribute__((export_name("TS_CResult_PayeePubKeyErrorZ_ok"))) TS_CResult_PayeePubKeyErrorZ_ok(uint64_t o) {
- LDKPayeePubKey o_conv;
- o_conv.inner = untag_ptr(o);
- o_conv.is_owned = ptr_is_owned(o);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
- o_conv = PayeePubKey_clone(&o_conv);
- LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ");
- *ret_conv = CResult_PayeePubKeyErrorZ_ok(o_conv);
+static inline uint64_t CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr(LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR arg) {
+ LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ");
+ *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_clone(arg);
return tag_ptr(ret_conv, true);
}
+int64_t __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr(uint64_t arg) {
+ LDKCResult_ChannelMonitorUpdateDecodeErrorZ* arg_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)untag_ptr(arg);
+ int64_t ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr(arg_conv);
+ return ret_conv;
+}
-uint64_t __attribute__((export_name("TS_CResult_PayeePubKeyErrorZ_err"))) TS_CResult_PayeePubKeyErrorZ_err(uint32_t e) {
- LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_js(e);
- LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ");
- *ret_conv = CResult_PayeePubKeyErrorZ_err(e_conv);
+uint64_t __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeErrorZ_clone"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_clone(uint64_t orig) {
+ LDKCResult_ChannelMonitorUpdateDecodeErrorZ* orig_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)untag_ptr(orig);
+ LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ");
+ *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_clone(orig_conv);
return tag_ptr(ret_conv, true);
}
-jboolean __attribute__((export_name("TS_CResult_PayeePubKeyErrorZ_is_ok"))) TS_CResult_PayeePubKeyErrorZ_is_ok(uint64_t o) {
- LDKCResult_PayeePubKeyErrorZ* o_conv = (LDKCResult_PayeePubKeyErrorZ*)untag_ptr(o);
- jboolean ret_conv = CResult_PayeePubKeyErrorZ_is_ok(o_conv);
- return ret_conv;
+uint64_t __attribute__((export_name("TS_COption_MonitorEventZ_some"))) TS_COption_MonitorEventZ_some(uint64_t o) {
+ void* o_ptr = untag_ptr(o);
+ CHECK_ACCESS(o_ptr);
+ LDKMonitorEvent o_conv = *(LDKMonitorEvent*)(o_ptr);
+ o_conv = MonitorEvent_clone((LDKMonitorEvent*)untag_ptr(o));
+ LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ");
+ *ret_copy = COption_MonitorEventZ_some(o_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
}
-void __attribute__((export_name("TS_CResult_PayeePubKeyErrorZ_free"))) TS_CResult_PayeePubKeyErrorZ_free(uint64_t _res) {
+uint64_t __attribute__((export_name("TS_COption_MonitorEventZ_none"))) TS_COption_MonitorEventZ_none() {
+ LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ");
+ *ret_copy = COption_MonitorEventZ_none();
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+void __attribute__((export_name("TS_COption_MonitorEventZ_free"))) TS_COption_MonitorEventZ_free(uint64_t _res) {
if (!ptr_is_owned(_res)) return;
void* _res_ptr = untag_ptr(_res);
CHECK_ACCESS(_res_ptr);
- LDKCResult_PayeePubKeyErrorZ _res_conv = *(LDKCResult_PayeePubKeyErrorZ*)(_res_ptr);
+ LDKCOption_MonitorEventZ _res_conv = *(LDKCOption_MonitorEventZ*)(_res_ptr);
FREE(untag_ptr(_res));
- CResult_PayeePubKeyErrorZ_free(_res_conv);
+ COption_MonitorEventZ_free(_res_conv);
}
-static inline uint64_t CResult_PayeePubKeyErrorZ_clone_ptr(LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR arg) {
- LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ");
- *ret_conv = CResult_PayeePubKeyErrorZ_clone(arg);
- return tag_ptr(ret_conv, true);
+static inline uint64_t COption_MonitorEventZ_clone_ptr(LDKCOption_MonitorEventZ *NONNULL_PTR arg) {
+ LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ");
+ *ret_copy = COption_MonitorEventZ_clone(arg);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
}
-int64_t __attribute__((export_name("TS_CResult_PayeePubKeyErrorZ_clone_ptr"))) TS_CResult_PayeePubKeyErrorZ_clone_ptr(uint64_t arg) {
- LDKCResult_PayeePubKeyErrorZ* arg_conv = (LDKCResult_PayeePubKeyErrorZ*)untag_ptr(arg);
- int64_t ret_conv = CResult_PayeePubKeyErrorZ_clone_ptr(arg_conv);
+int64_t __attribute__((export_name("TS_COption_MonitorEventZ_clone_ptr"))) TS_COption_MonitorEventZ_clone_ptr(uint64_t arg) {
+ LDKCOption_MonitorEventZ* arg_conv = (LDKCOption_MonitorEventZ*)untag_ptr(arg);
+ int64_t ret_conv = COption_MonitorEventZ_clone_ptr(arg_conv);
return ret_conv;
}
-uint64_t __attribute__((export_name("TS_CResult_PayeePubKeyErrorZ_clone"))) TS_CResult_PayeePubKeyErrorZ_clone(uint64_t orig) {
- LDKCResult_PayeePubKeyErrorZ* orig_conv = (LDKCResult_PayeePubKeyErrorZ*)untag_ptr(orig);
- LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ");
- *ret_conv = CResult_PayeePubKeyErrorZ_clone(orig_conv);
- return tag_ptr(ret_conv, true);
-}
-
-void __attribute__((export_name("TS_CVec_PrivateRouteZ_free"))) TS_CVec_PrivateRouteZ_free(uint64_tArray _res) {
- LDKCVec_PrivateRouteZ _res_constr;
- _res_constr.datalen = _res->arr_len;
- if (_res_constr.datalen > 0)
- _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKPrivateRoute), "LDKCVec_PrivateRouteZ Elements");
- else
- _res_constr.data = NULL;
- uint64_t* _res_vals = _res->elems;
- for (size_t o = 0; o < _res_constr.datalen; o++) {
- uint64_t _res_conv_14 = _res_vals[o];
- LDKPrivateRoute _res_conv_14_conv;
- _res_conv_14_conv.inner = untag_ptr(_res_conv_14);
- _res_conv_14_conv.is_owned = ptr_is_owned(_res_conv_14);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_14_conv);
- _res_constr.data[o] = _res_conv_14_conv;
- }
- FREE(_res);
- CVec_PrivateRouteZ_free(_res_constr);
+uint64_t __attribute__((export_name("TS_COption_MonitorEventZ_clone"))) TS_COption_MonitorEventZ_clone(uint64_t orig) {
+ LDKCOption_MonitorEventZ* orig_conv = (LDKCOption_MonitorEventZ*)untag_ptr(orig);
+ LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ");
+ *ret_copy = COption_MonitorEventZ_clone(orig_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
}
-uint64_t __attribute__((export_name("TS_CResult_PositiveTimestampCreationErrorZ_ok"))) TS_CResult_PositiveTimestampCreationErrorZ_ok(uint64_t o) {
- LDKPositiveTimestamp o_conv;
- o_conv.inner = untag_ptr(o);
- o_conv.is_owned = ptr_is_owned(o);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
- o_conv = PositiveTimestamp_clone(&o_conv);
- LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ");
- *ret_conv = CResult_PositiveTimestampCreationErrorZ_ok(o_conv);
+uint64_t __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErrorZ_ok"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_ok(uint64_t o) {
+ void* o_ptr = untag_ptr(o);
+ CHECK_ACCESS(o_ptr);
+ LDKCOption_MonitorEventZ o_conv = *(LDKCOption_MonitorEventZ*)(o_ptr);
+ o_conv = COption_MonitorEventZ_clone((LDKCOption_MonitorEventZ*)untag_ptr(o));
+ LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ");
+ *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_ok(o_conv);
return tag_ptr(ret_conv, true);
}
-uint64_t __attribute__((export_name("TS_CResult_PositiveTimestampCreationErrorZ_err"))) TS_CResult_PositiveTimestampCreationErrorZ_err(uint32_t e) {
- LDKCreationError e_conv = LDKCreationError_from_js(e);
- LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ");
- *ret_conv = CResult_PositiveTimestampCreationErrorZ_err(e_conv);
+uint64_t __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErrorZ_err"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_err(uint64_t e) {
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
+ LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ");
+ *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
-jboolean __attribute__((export_name("TS_CResult_PositiveTimestampCreationErrorZ_is_ok"))) TS_CResult_PositiveTimestampCreationErrorZ_is_ok(uint64_t o) {
- LDKCResult_PositiveTimestampCreationErrorZ* o_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)untag_ptr(o);
- jboolean ret_conv = CResult_PositiveTimestampCreationErrorZ_is_ok(o_conv);
+jboolean __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErrorZ_is_ok"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_is_ok(uint64_t o) {
+ LDKCResult_COption_MonitorEventZDecodeErrorZ* o_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)untag_ptr(o);
+ jboolean ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_is_ok(o_conv);
return ret_conv;
}
-void __attribute__((export_name("TS_CResult_PositiveTimestampCreationErrorZ_free"))) TS_CResult_PositiveTimestampCreationErrorZ_free(uint64_t _res) {
+void __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErrorZ_free"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_free(uint64_t _res) {
if (!ptr_is_owned(_res)) return;
void* _res_ptr = untag_ptr(_res);
CHECK_ACCESS(_res_ptr);
- LDKCResult_PositiveTimestampCreationErrorZ _res_conv = *(LDKCResult_PositiveTimestampCreationErrorZ*)(_res_ptr);
+ LDKCResult_COption_MonitorEventZDecodeErrorZ _res_conv = *(LDKCResult_COption_MonitorEventZDecodeErrorZ*)(_res_ptr);
FREE(untag_ptr(_res));
- CResult_PositiveTimestampCreationErrorZ_free(_res_conv);
+ CResult_COption_MonitorEventZDecodeErrorZ_free(_res_conv);
}
-static inline uint64_t CResult_PositiveTimestampCreationErrorZ_clone_ptr(LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR arg) {
- LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ");
- *ret_conv = CResult_PositiveTimestampCreationErrorZ_clone(arg);
+static inline uint64_t CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr(LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR arg) {
+ LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ");
+ *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_clone(arg);
return tag_ptr(ret_conv, true);
}
-int64_t __attribute__((export_name("TS_CResult_PositiveTimestampCreationErrorZ_clone_ptr"))) TS_CResult_PositiveTimestampCreationErrorZ_clone_ptr(uint64_t arg) {
- LDKCResult_PositiveTimestampCreationErrorZ* arg_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)untag_ptr(arg);
- int64_t ret_conv = CResult_PositiveTimestampCreationErrorZ_clone_ptr(arg_conv);
+int64_t __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr(uint64_t arg) {
+ LDKCResult_COption_MonitorEventZDecodeErrorZ* arg_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)untag_ptr(arg);
+ int64_t ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr(arg_conv);
return ret_conv;
}
-uint64_t __attribute__((export_name("TS_CResult_PositiveTimestampCreationErrorZ_clone"))) TS_CResult_PositiveTimestampCreationErrorZ_clone(uint64_t orig) {
- LDKCResult_PositiveTimestampCreationErrorZ* orig_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)untag_ptr(orig);
- LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ");
- *ret_conv = CResult_PositiveTimestampCreationErrorZ_clone(orig_conv);
+uint64_t __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErrorZ_clone"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_clone(uint64_t orig) {
+ LDKCResult_COption_MonitorEventZDecodeErrorZ* orig_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)untag_ptr(orig);
+ LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ");
+ *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_clone(orig_conv);
return tag_ptr(ret_conv, true);
}
-uint64_t __attribute__((export_name("TS_CResult_NoneSemanticErrorZ_ok"))) TS_CResult_NoneSemanticErrorZ_ok() {
- LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ");
- *ret_conv = CResult_NoneSemanticErrorZ_ok();
+uint64_t __attribute__((export_name("TS_CResult_HTLCUpdateDecodeErrorZ_ok"))) TS_CResult_HTLCUpdateDecodeErrorZ_ok(uint64_t o) {
+ LDKHTLCUpdate o_conv;
+ o_conv.inner = untag_ptr(o);
+ o_conv.is_owned = ptr_is_owned(o);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
+ o_conv = HTLCUpdate_clone(&o_conv);
+ LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ");
+ *ret_conv = CResult_HTLCUpdateDecodeErrorZ_ok(o_conv);
return tag_ptr(ret_conv, true);
}
-uint64_t __attribute__((export_name("TS_CResult_NoneSemanticErrorZ_err"))) TS_CResult_NoneSemanticErrorZ_err(uint32_t e) {
- LDKSemanticError e_conv = LDKSemanticError_from_js(e);
- LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ");
- *ret_conv = CResult_NoneSemanticErrorZ_err(e_conv);
- return tag_ptr(ret_conv, true);
-}
-
-jboolean __attribute__((export_name("TS_CResult_NoneSemanticErrorZ_is_ok"))) TS_CResult_NoneSemanticErrorZ_is_ok(uint64_t o) {
- LDKCResult_NoneSemanticErrorZ* o_conv = (LDKCResult_NoneSemanticErrorZ*)untag_ptr(o);
- jboolean ret_conv = CResult_NoneSemanticErrorZ_is_ok(o_conv);
- return ret_conv;
-}
-
-void __attribute__((export_name("TS_CResult_NoneSemanticErrorZ_free"))) TS_CResult_NoneSemanticErrorZ_free(uint64_t _res) {
- if (!ptr_is_owned(_res)) return;
- void* _res_ptr = untag_ptr(_res);
- CHECK_ACCESS(_res_ptr);
- LDKCResult_NoneSemanticErrorZ _res_conv = *(LDKCResult_NoneSemanticErrorZ*)(_res_ptr);
- FREE(untag_ptr(_res));
- CResult_NoneSemanticErrorZ_free(_res_conv);
-}
-
-static inline uint64_t CResult_NoneSemanticErrorZ_clone_ptr(LDKCResult_NoneSemanticErrorZ *NONNULL_PTR arg) {
- LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ");
- *ret_conv = CResult_NoneSemanticErrorZ_clone(arg);
- return tag_ptr(ret_conv, true);
-}
-int64_t __attribute__((export_name("TS_CResult_NoneSemanticErrorZ_clone_ptr"))) TS_CResult_NoneSemanticErrorZ_clone_ptr(uint64_t arg) {
- LDKCResult_NoneSemanticErrorZ* arg_conv = (LDKCResult_NoneSemanticErrorZ*)untag_ptr(arg);
- int64_t ret_conv = CResult_NoneSemanticErrorZ_clone_ptr(arg_conv);
- return ret_conv;
-}
-
-uint64_t __attribute__((export_name("TS_CResult_NoneSemanticErrorZ_clone"))) TS_CResult_NoneSemanticErrorZ_clone(uint64_t orig) {
- LDKCResult_NoneSemanticErrorZ* orig_conv = (LDKCResult_NoneSemanticErrorZ*)untag_ptr(orig);
- LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ");
- *ret_conv = CResult_NoneSemanticErrorZ_clone(orig_conv);
- return tag_ptr(ret_conv, true);
-}
-
-uint64_t __attribute__((export_name("TS_CResult_InvoiceSemanticErrorZ_ok"))) TS_CResult_InvoiceSemanticErrorZ_ok(uint64_t o) {
- LDKInvoice o_conv;
- o_conv.inner = untag_ptr(o);
- o_conv.is_owned = ptr_is_owned(o);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
- o_conv = Invoice_clone(&o_conv);
- LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ");
- *ret_conv = CResult_InvoiceSemanticErrorZ_ok(o_conv);
- return tag_ptr(ret_conv, true);
-}
-
-uint64_t __attribute__((export_name("TS_CResult_InvoiceSemanticErrorZ_err"))) TS_CResult_InvoiceSemanticErrorZ_err(uint32_t e) {
- LDKSemanticError e_conv = LDKSemanticError_from_js(e);
- LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ");
- *ret_conv = CResult_InvoiceSemanticErrorZ_err(e_conv);
- return tag_ptr(ret_conv, true);
-}
-
-jboolean __attribute__((export_name("TS_CResult_InvoiceSemanticErrorZ_is_ok"))) TS_CResult_InvoiceSemanticErrorZ_is_ok(uint64_t o) {
- LDKCResult_InvoiceSemanticErrorZ* o_conv = (LDKCResult_InvoiceSemanticErrorZ*)untag_ptr(o);
- jboolean ret_conv = CResult_InvoiceSemanticErrorZ_is_ok(o_conv);
- return ret_conv;
-}
-
-void __attribute__((export_name("TS_CResult_InvoiceSemanticErrorZ_free"))) TS_CResult_InvoiceSemanticErrorZ_free(uint64_t _res) {
- if (!ptr_is_owned(_res)) return;
- void* _res_ptr = untag_ptr(_res);
- CHECK_ACCESS(_res_ptr);
- LDKCResult_InvoiceSemanticErrorZ _res_conv = *(LDKCResult_InvoiceSemanticErrorZ*)(_res_ptr);
- FREE(untag_ptr(_res));
- CResult_InvoiceSemanticErrorZ_free(_res_conv);
-}
-
-static inline uint64_t CResult_InvoiceSemanticErrorZ_clone_ptr(LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR arg) {
- LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ");
- *ret_conv = CResult_InvoiceSemanticErrorZ_clone(arg);
- return tag_ptr(ret_conv, true);
-}
-int64_t __attribute__((export_name("TS_CResult_InvoiceSemanticErrorZ_clone_ptr"))) TS_CResult_InvoiceSemanticErrorZ_clone_ptr(uint64_t arg) {
- LDKCResult_InvoiceSemanticErrorZ* arg_conv = (LDKCResult_InvoiceSemanticErrorZ*)untag_ptr(arg);
- int64_t ret_conv = CResult_InvoiceSemanticErrorZ_clone_ptr(arg_conv);
- return ret_conv;
-}
-
-uint64_t __attribute__((export_name("TS_CResult_InvoiceSemanticErrorZ_clone"))) TS_CResult_InvoiceSemanticErrorZ_clone(uint64_t orig) {
- LDKCResult_InvoiceSemanticErrorZ* orig_conv = (LDKCResult_InvoiceSemanticErrorZ*)untag_ptr(orig);
- LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ");
- *ret_conv = CResult_InvoiceSemanticErrorZ_clone(orig_conv);
- return tag_ptr(ret_conv, true);
-}
-
-uint64_t __attribute__((export_name("TS_CResult_DescriptionCreationErrorZ_ok"))) TS_CResult_DescriptionCreationErrorZ_ok(uint64_t o) {
- LDKDescription o_conv;
- o_conv.inner = untag_ptr(o);
- o_conv.is_owned = ptr_is_owned(o);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
- o_conv = Description_clone(&o_conv);
- LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ");
- *ret_conv = CResult_DescriptionCreationErrorZ_ok(o_conv);
- return tag_ptr(ret_conv, true);
-}
-
-uint64_t __attribute__((export_name("TS_CResult_DescriptionCreationErrorZ_err"))) TS_CResult_DescriptionCreationErrorZ_err(uint32_t e) {
- LDKCreationError e_conv = LDKCreationError_from_js(e);
- LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ");
- *ret_conv = CResult_DescriptionCreationErrorZ_err(e_conv);
- return tag_ptr(ret_conv, true);
-}
-
-jboolean __attribute__((export_name("TS_CResult_DescriptionCreationErrorZ_is_ok"))) TS_CResult_DescriptionCreationErrorZ_is_ok(uint64_t o) {
- LDKCResult_DescriptionCreationErrorZ* o_conv = (LDKCResult_DescriptionCreationErrorZ*)untag_ptr(o);
- jboolean ret_conv = CResult_DescriptionCreationErrorZ_is_ok(o_conv);
- return ret_conv;
-}
-
-void __attribute__((export_name("TS_CResult_DescriptionCreationErrorZ_free"))) TS_CResult_DescriptionCreationErrorZ_free(uint64_t _res) {
- if (!ptr_is_owned(_res)) return;
- void* _res_ptr = untag_ptr(_res);
- CHECK_ACCESS(_res_ptr);
- LDKCResult_DescriptionCreationErrorZ _res_conv = *(LDKCResult_DescriptionCreationErrorZ*)(_res_ptr);
- FREE(untag_ptr(_res));
- CResult_DescriptionCreationErrorZ_free(_res_conv);
-}
-
-static inline uint64_t CResult_DescriptionCreationErrorZ_clone_ptr(LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR arg) {
- LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ");
- *ret_conv = CResult_DescriptionCreationErrorZ_clone(arg);
- return tag_ptr(ret_conv, true);
-}
-int64_t __attribute__((export_name("TS_CResult_DescriptionCreationErrorZ_clone_ptr"))) TS_CResult_DescriptionCreationErrorZ_clone_ptr(uint64_t arg) {
- LDKCResult_DescriptionCreationErrorZ* arg_conv = (LDKCResult_DescriptionCreationErrorZ*)untag_ptr(arg);
- int64_t ret_conv = CResult_DescriptionCreationErrorZ_clone_ptr(arg_conv);
- return ret_conv;
-}
-
-uint64_t __attribute__((export_name("TS_CResult_DescriptionCreationErrorZ_clone"))) TS_CResult_DescriptionCreationErrorZ_clone(uint64_t orig) {
- LDKCResult_DescriptionCreationErrorZ* orig_conv = (LDKCResult_DescriptionCreationErrorZ*)untag_ptr(orig);
- LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ");
- *ret_conv = CResult_DescriptionCreationErrorZ_clone(orig_conv);
- return tag_ptr(ret_conv, true);
-}
-
-uint64_t __attribute__((export_name("TS_CResult_PrivateRouteCreationErrorZ_ok"))) TS_CResult_PrivateRouteCreationErrorZ_ok(uint64_t o) {
- LDKPrivateRoute o_conv;
- o_conv.inner = untag_ptr(o);
- o_conv.is_owned = ptr_is_owned(o);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
- o_conv = PrivateRoute_clone(&o_conv);
- LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ");
- *ret_conv = CResult_PrivateRouteCreationErrorZ_ok(o_conv);
- return tag_ptr(ret_conv, true);
-}
-
-uint64_t __attribute__((export_name("TS_CResult_PrivateRouteCreationErrorZ_err"))) TS_CResult_PrivateRouteCreationErrorZ_err(uint32_t e) {
- LDKCreationError e_conv = LDKCreationError_from_js(e);
- LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ");
- *ret_conv = CResult_PrivateRouteCreationErrorZ_err(e_conv);
- return tag_ptr(ret_conv, true);
-}
-
-jboolean __attribute__((export_name("TS_CResult_PrivateRouteCreationErrorZ_is_ok"))) TS_CResult_PrivateRouteCreationErrorZ_is_ok(uint64_t o) {
- LDKCResult_PrivateRouteCreationErrorZ* o_conv = (LDKCResult_PrivateRouteCreationErrorZ*)untag_ptr(o);
- jboolean ret_conv = CResult_PrivateRouteCreationErrorZ_is_ok(o_conv);
- return ret_conv;
-}
-
-void __attribute__((export_name("TS_CResult_PrivateRouteCreationErrorZ_free"))) TS_CResult_PrivateRouteCreationErrorZ_free(uint64_t _res) {
- if (!ptr_is_owned(_res)) return;
- void* _res_ptr = untag_ptr(_res);
- CHECK_ACCESS(_res_ptr);
- LDKCResult_PrivateRouteCreationErrorZ _res_conv = *(LDKCResult_PrivateRouteCreationErrorZ*)(_res_ptr);
- FREE(untag_ptr(_res));
- CResult_PrivateRouteCreationErrorZ_free(_res_conv);
-}
-
-static inline uint64_t CResult_PrivateRouteCreationErrorZ_clone_ptr(LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR arg) {
- LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ");
- *ret_conv = CResult_PrivateRouteCreationErrorZ_clone(arg);
- return tag_ptr(ret_conv, true);
-}
-int64_t __attribute__((export_name("TS_CResult_PrivateRouteCreationErrorZ_clone_ptr"))) TS_CResult_PrivateRouteCreationErrorZ_clone_ptr(uint64_t arg) {
- LDKCResult_PrivateRouteCreationErrorZ* arg_conv = (LDKCResult_PrivateRouteCreationErrorZ*)untag_ptr(arg);
- int64_t ret_conv = CResult_PrivateRouteCreationErrorZ_clone_ptr(arg_conv);
- return ret_conv;
-}
-
-uint64_t __attribute__((export_name("TS_CResult_PrivateRouteCreationErrorZ_clone"))) TS_CResult_PrivateRouteCreationErrorZ_clone(uint64_t orig) {
- LDKCResult_PrivateRouteCreationErrorZ* orig_conv = (LDKCResult_PrivateRouteCreationErrorZ*)untag_ptr(orig);
- LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ");
- *ret_conv = CResult_PrivateRouteCreationErrorZ_clone(orig_conv);
- return tag_ptr(ret_conv, true);
-}
-
-uint64_t __attribute__((export_name("TS_CResult_StringErrorZ_ok"))) TS_CResult_StringErrorZ_ok(jstring o) {
- LDKStr o_conv = str_ref_to_owned_c(o);
- LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ");
- *ret_conv = CResult_StringErrorZ_ok(o_conv);
- return tag_ptr(ret_conv, true);
-}
-
-uint64_t __attribute__((export_name("TS_CResult_StringErrorZ_err"))) TS_CResult_StringErrorZ_err(uint32_t e) {
- LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_js(e);
- LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ");
- *ret_conv = CResult_StringErrorZ_err(e_conv);
- return tag_ptr(ret_conv, true);
-}
-
-jboolean __attribute__((export_name("TS_CResult_StringErrorZ_is_ok"))) TS_CResult_StringErrorZ_is_ok(uint64_t o) {
- LDKCResult_StringErrorZ* o_conv = (LDKCResult_StringErrorZ*)untag_ptr(o);
- jboolean ret_conv = CResult_StringErrorZ_is_ok(o_conv);
- return ret_conv;
-}
-
-void __attribute__((export_name("TS_CResult_StringErrorZ_free"))) TS_CResult_StringErrorZ_free(uint64_t _res) {
- if (!ptr_is_owned(_res)) return;
- void* _res_ptr = untag_ptr(_res);
- CHECK_ACCESS(_res_ptr);
- LDKCResult_StringErrorZ _res_conv = *(LDKCResult_StringErrorZ*)(_res_ptr);
- FREE(untag_ptr(_res));
- CResult_StringErrorZ_free(_res_conv);
-}
-
-static inline uint64_t CResult_StringErrorZ_clone_ptr(LDKCResult_StringErrorZ *NONNULL_PTR arg) {
- LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ");
- *ret_conv = CResult_StringErrorZ_clone(arg);
- return tag_ptr(ret_conv, true);
-}
-int64_t __attribute__((export_name("TS_CResult_StringErrorZ_clone_ptr"))) TS_CResult_StringErrorZ_clone_ptr(uint64_t arg) {
- LDKCResult_StringErrorZ* arg_conv = (LDKCResult_StringErrorZ*)untag_ptr(arg);
- int64_t ret_conv = CResult_StringErrorZ_clone_ptr(arg_conv);
- return ret_conv;
-}
-
-uint64_t __attribute__((export_name("TS_CResult_StringErrorZ_clone"))) TS_CResult_StringErrorZ_clone(uint64_t orig) {
- LDKCResult_StringErrorZ* orig_conv = (LDKCResult_StringErrorZ*)untag_ptr(orig);
- LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ");
- *ret_conv = CResult_StringErrorZ_clone(orig_conv);
- return tag_ptr(ret_conv, true);
-}
-
-uint64_t __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeErrorZ_ok"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_ok(uint64_t o) {
- LDKChannelMonitorUpdate o_conv;
- o_conv.inner = untag_ptr(o);
- o_conv.is_owned = ptr_is_owned(o);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
- o_conv = ChannelMonitorUpdate_clone(&o_conv);
- LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ");
- *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_ok(o_conv);
- return tag_ptr(ret_conv, true);
-}
-
-uint64_t __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeErrorZ_err"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
- LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ");
- *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_err(e_conv);
- return tag_ptr(ret_conv, true);
-}
-
-jboolean __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok(uint64_t o) {
- LDKCResult_ChannelMonitorUpdateDecodeErrorZ* o_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)untag_ptr(o);
- jboolean ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok(o_conv);
- return ret_conv;
-}
-
-void __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeErrorZ_free"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_free(uint64_t _res) {
- if (!ptr_is_owned(_res)) return;
- void* _res_ptr = untag_ptr(_res);
- CHECK_ACCESS(_res_ptr);
- LDKCResult_ChannelMonitorUpdateDecodeErrorZ _res_conv = *(LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)(_res_ptr);
- FREE(untag_ptr(_res));
- CResult_ChannelMonitorUpdateDecodeErrorZ_free(_res_conv);
-}
-
-static inline uint64_t CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr(LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR arg) {
- LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ");
- *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_clone(arg);
- return tag_ptr(ret_conv, true);
-}
-int64_t __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr(uint64_t arg) {
- LDKCResult_ChannelMonitorUpdateDecodeErrorZ* arg_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)untag_ptr(arg);
- int64_t ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr(arg_conv);
- return ret_conv;
-}
-
-uint64_t __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeErrorZ_clone"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_clone(uint64_t orig) {
- LDKCResult_ChannelMonitorUpdateDecodeErrorZ* orig_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)untag_ptr(orig);
- LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ");
- *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_clone(orig_conv);
- return tag_ptr(ret_conv, true);
-}
-
-uint64_t __attribute__((export_name("TS_COption_MonitorEventZ_some"))) TS_COption_MonitorEventZ_some(uint64_t o) {
- void* o_ptr = untag_ptr(o);
- CHECK_ACCESS(o_ptr);
- LDKMonitorEvent o_conv = *(LDKMonitorEvent*)(o_ptr);
- o_conv = MonitorEvent_clone((LDKMonitorEvent*)untag_ptr(o));
- LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ");
- *ret_copy = COption_MonitorEventZ_some(o_conv);
- uint64_t ret_ref = tag_ptr(ret_copy, true);
- return ret_ref;
-}
-
-uint64_t __attribute__((export_name("TS_COption_MonitorEventZ_none"))) TS_COption_MonitorEventZ_none() {
- LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ");
- *ret_copy = COption_MonitorEventZ_none();
- uint64_t ret_ref = tag_ptr(ret_copy, true);
- return ret_ref;
-}
-
-void __attribute__((export_name("TS_COption_MonitorEventZ_free"))) TS_COption_MonitorEventZ_free(uint64_t _res) {
- if (!ptr_is_owned(_res)) return;
- void* _res_ptr = untag_ptr(_res);
- CHECK_ACCESS(_res_ptr);
- LDKCOption_MonitorEventZ _res_conv = *(LDKCOption_MonitorEventZ*)(_res_ptr);
- FREE(untag_ptr(_res));
- COption_MonitorEventZ_free(_res_conv);
-}
-
-static inline uint64_t COption_MonitorEventZ_clone_ptr(LDKCOption_MonitorEventZ *NONNULL_PTR arg) {
- LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ");
- *ret_copy = COption_MonitorEventZ_clone(arg);
- uint64_t ret_ref = tag_ptr(ret_copy, true);
- return ret_ref;
-}
-int64_t __attribute__((export_name("TS_COption_MonitorEventZ_clone_ptr"))) TS_COption_MonitorEventZ_clone_ptr(uint64_t arg) {
- LDKCOption_MonitorEventZ* arg_conv = (LDKCOption_MonitorEventZ*)untag_ptr(arg);
- int64_t ret_conv = COption_MonitorEventZ_clone_ptr(arg_conv);
- return ret_conv;
-}
-
-uint64_t __attribute__((export_name("TS_COption_MonitorEventZ_clone"))) TS_COption_MonitorEventZ_clone(uint64_t orig) {
- LDKCOption_MonitorEventZ* orig_conv = (LDKCOption_MonitorEventZ*)untag_ptr(orig);
- LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ");
- *ret_copy = COption_MonitorEventZ_clone(orig_conv);
- uint64_t ret_ref = tag_ptr(ret_copy, true);
- return ret_ref;
-}
-
-uint64_t __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErrorZ_ok"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_ok(uint64_t o) {
- void* o_ptr = untag_ptr(o);
- CHECK_ACCESS(o_ptr);
- LDKCOption_MonitorEventZ o_conv = *(LDKCOption_MonitorEventZ*)(o_ptr);
- o_conv = COption_MonitorEventZ_clone((LDKCOption_MonitorEventZ*)untag_ptr(o));
- LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ");
- *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_ok(o_conv);
- return tag_ptr(ret_conv, true);
-}
-
-uint64_t __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErrorZ_err"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
- LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ");
- *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_err(e_conv);
- return tag_ptr(ret_conv, true);
-}
-
-jboolean __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErrorZ_is_ok"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_is_ok(uint64_t o) {
- LDKCResult_COption_MonitorEventZDecodeErrorZ* o_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)untag_ptr(o);
- jboolean ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_is_ok(o_conv);
- return ret_conv;
-}
-
-void __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErrorZ_free"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_free(uint64_t _res) {
- if (!ptr_is_owned(_res)) return;
- void* _res_ptr = untag_ptr(_res);
- CHECK_ACCESS(_res_ptr);
- LDKCResult_COption_MonitorEventZDecodeErrorZ _res_conv = *(LDKCResult_COption_MonitorEventZDecodeErrorZ*)(_res_ptr);
- FREE(untag_ptr(_res));
- CResult_COption_MonitorEventZDecodeErrorZ_free(_res_conv);
-}
-
-static inline uint64_t CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr(LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR arg) {
- LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ");
- *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_clone(arg);
- return tag_ptr(ret_conv, true);
-}
-int64_t __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr(uint64_t arg) {
- LDKCResult_COption_MonitorEventZDecodeErrorZ* arg_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)untag_ptr(arg);
- int64_t ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr(arg_conv);
- return ret_conv;
-}
-
-uint64_t __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErrorZ_clone"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_clone(uint64_t orig) {
- LDKCResult_COption_MonitorEventZDecodeErrorZ* orig_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)untag_ptr(orig);
- LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ");
- *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_clone(orig_conv);
- return tag_ptr(ret_conv, true);
-}
-
-uint64_t __attribute__((export_name("TS_CResult_HTLCUpdateDecodeErrorZ_ok"))) TS_CResult_HTLCUpdateDecodeErrorZ_ok(uint64_t o) {
- LDKHTLCUpdate o_conv;
- o_conv.inner = untag_ptr(o);
- o_conv.is_owned = ptr_is_owned(o);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
- o_conv = HTLCUpdate_clone(&o_conv);
- LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ");
- *ret_conv = CResult_HTLCUpdateDecodeErrorZ_ok(o_conv);
- return tag_ptr(ret_conv, true);
-}
-
-uint64_t __attribute__((export_name("TS_CResult_HTLCUpdateDecodeErrorZ_err"))) TS_CResult_HTLCUpdateDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
- LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ");
- *ret_conv = CResult_HTLCUpdateDecodeErrorZ_err(e_conv);
+uint64_t __attribute__((export_name("TS_CResult_HTLCUpdateDecodeErrorZ_err"))) TS_CResult_HTLCUpdateDecodeErrorZ_err(uint64_t e) {
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
+ LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ");
+ *ret_conv = CResult_HTLCUpdateDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
}
uint64_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err"))) TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ");
*ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
return ret_conv;
}
-uint64_t __attribute__((export_name("TS_C2Tuple_PublicKeyTypeZ_clone"))) TS_C2Tuple_PublicKeyTypeZ_clone(uint64_t orig) {
- LDKC2Tuple_PublicKeyTypeZ* orig_conv = (LDKC2Tuple_PublicKeyTypeZ*)untag_ptr(orig);
- LDKC2Tuple_PublicKeyTypeZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKC2Tuple_PublicKeyTypeZ");
- *ret_conv = C2Tuple_PublicKeyTypeZ_clone(orig_conv);
+uint64_t __attribute__((export_name("TS_C2Tuple_PublicKeyTypeZ_clone"))) TS_C2Tuple_PublicKeyTypeZ_clone(uint64_t orig) {
+ LDKC2Tuple_PublicKeyTypeZ* orig_conv = (LDKC2Tuple_PublicKeyTypeZ*)untag_ptr(orig);
+ LDKC2Tuple_PublicKeyTypeZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKC2Tuple_PublicKeyTypeZ");
+ *ret_conv = C2Tuple_PublicKeyTypeZ_clone(orig_conv);
+ return tag_ptr(ret_conv, true);
+}
+
+uint64_t __attribute__((export_name("TS_C2Tuple_PublicKeyTypeZ_new"))) TS_C2Tuple_PublicKeyTypeZ_new(int8_tArray a, uint64_t b) {
+ LDKPublicKey a_ref;
+ CHECK(a->arr_len == 33);
+ memcpy(a_ref.compressed_form, a->elems, 33); FREE(a);
+ void* b_ptr = untag_ptr(b);
+ CHECK_ACCESS(b_ptr);
+ LDKType b_conv = *(LDKType*)(b_ptr);
+ if (b_conv.free == LDKType_JCalls_free) {
+ // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
+ LDKType_JCalls_cloned(&b_conv);
+ }
+ LDKC2Tuple_PublicKeyTypeZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKC2Tuple_PublicKeyTypeZ");
+ *ret_conv = C2Tuple_PublicKeyTypeZ_new(a_ref, b_conv);
+ return tag_ptr(ret_conv, true);
+}
+
+void __attribute__((export_name("TS_C2Tuple_PublicKeyTypeZ_free"))) TS_C2Tuple_PublicKeyTypeZ_free(uint64_t _res) {
+ if (!ptr_is_owned(_res)) return;
+ void* _res_ptr = untag_ptr(_res);
+ CHECK_ACCESS(_res_ptr);
+ LDKC2Tuple_PublicKeyTypeZ _res_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(_res_ptr);
+ FREE(untag_ptr(_res));
+ C2Tuple_PublicKeyTypeZ_free(_res_conv);
+}
+
+void __attribute__((export_name("TS_CVec_C2Tuple_PublicKeyTypeZZ_free"))) TS_CVec_C2Tuple_PublicKeyTypeZZ_free(uint64_tArray _res) {
+ LDKCVec_C2Tuple_PublicKeyTypeZZ _res_constr;
+ _res_constr.datalen = _res->arr_len;
+ if (_res_constr.datalen > 0)
+ _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKCVec_C2Tuple_PublicKeyTypeZZ Elements");
+ else
+ _res_constr.data = NULL;
+ uint64_t* _res_vals = _res->elems;
+ for (size_t z = 0; z < _res_constr.datalen; z++) {
+ uint64_t _res_conv_25 = _res_vals[z];
+ void* _res_conv_25_ptr = untag_ptr(_res_conv_25);
+ CHECK_ACCESS(_res_conv_25_ptr);
+ LDKC2Tuple_PublicKeyTypeZ _res_conv_25_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(_res_conv_25_ptr);
+ FREE(untag_ptr(_res_conv_25));
+ _res_constr.data[z] = _res_conv_25_conv;
+ }
+ FREE(_res);
+ CVec_C2Tuple_PublicKeyTypeZZ_free(_res_constr);
+}
+
+uint64_t __attribute__((export_name("TS_COption_CustomOnionMessageContentsZ_some"))) TS_COption_CustomOnionMessageContentsZ_some(uint64_t o) {
+ void* o_ptr = untag_ptr(o);
+ CHECK_ACCESS(o_ptr);
+ LDKCustomOnionMessageContents o_conv = *(LDKCustomOnionMessageContents*)(o_ptr);
+ if (o_conv.free == LDKCustomOnionMessageContents_JCalls_free) {
+ // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
+ LDKCustomOnionMessageContents_JCalls_cloned(&o_conv);
+ }
+ LDKCOption_CustomOnionMessageContentsZ *ret_copy = MALLOC(sizeof(LDKCOption_CustomOnionMessageContentsZ), "LDKCOption_CustomOnionMessageContentsZ");
+ *ret_copy = COption_CustomOnionMessageContentsZ_some(o_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+uint64_t __attribute__((export_name("TS_COption_CustomOnionMessageContentsZ_none"))) TS_COption_CustomOnionMessageContentsZ_none() {
+ LDKCOption_CustomOnionMessageContentsZ *ret_copy = MALLOC(sizeof(LDKCOption_CustomOnionMessageContentsZ), "LDKCOption_CustomOnionMessageContentsZ");
+ *ret_copy = COption_CustomOnionMessageContentsZ_none();
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+void __attribute__((export_name("TS_COption_CustomOnionMessageContentsZ_free"))) TS_COption_CustomOnionMessageContentsZ_free(uint64_t _res) {
+ if (!ptr_is_owned(_res)) return;
+ void* _res_ptr = untag_ptr(_res);
+ CHECK_ACCESS(_res_ptr);
+ LDKCOption_CustomOnionMessageContentsZ _res_conv = *(LDKCOption_CustomOnionMessageContentsZ*)(_res_ptr);
+ FREE(untag_ptr(_res));
+ COption_CustomOnionMessageContentsZ_free(_res_conv);
+}
+
+static inline uint64_t COption_CustomOnionMessageContentsZ_clone_ptr(LDKCOption_CustomOnionMessageContentsZ *NONNULL_PTR arg) {
+ LDKCOption_CustomOnionMessageContentsZ *ret_copy = MALLOC(sizeof(LDKCOption_CustomOnionMessageContentsZ), "LDKCOption_CustomOnionMessageContentsZ");
+ *ret_copy = COption_CustomOnionMessageContentsZ_clone(arg);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+int64_t __attribute__((export_name("TS_COption_CustomOnionMessageContentsZ_clone_ptr"))) TS_COption_CustomOnionMessageContentsZ_clone_ptr(uint64_t arg) {
+ LDKCOption_CustomOnionMessageContentsZ* arg_conv = (LDKCOption_CustomOnionMessageContentsZ*)untag_ptr(arg);
+ int64_t ret_conv = COption_CustomOnionMessageContentsZ_clone_ptr(arg_conv);
+ return ret_conv;
+}
+
+uint64_t __attribute__((export_name("TS_COption_CustomOnionMessageContentsZ_clone"))) TS_COption_CustomOnionMessageContentsZ_clone(uint64_t orig) {
+ LDKCOption_CustomOnionMessageContentsZ* orig_conv = (LDKCOption_CustomOnionMessageContentsZ*)untag_ptr(orig);
+ LDKCOption_CustomOnionMessageContentsZ *ret_copy = MALLOC(sizeof(LDKCOption_CustomOnionMessageContentsZ), "LDKCOption_CustomOnionMessageContentsZ");
+ *ret_copy = COption_CustomOnionMessageContentsZ_clone(orig_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+uint64_t __attribute__((export_name("TS_CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_ok"))) TS_CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_ok(uint64_t o) {
+ void* o_ptr = untag_ptr(o);
+ CHECK_ACCESS(o_ptr);
+ LDKCOption_CustomOnionMessageContentsZ o_conv = *(LDKCOption_CustomOnionMessageContentsZ*)(o_ptr);
+ o_conv = COption_CustomOnionMessageContentsZ_clone((LDKCOption_CustomOnionMessageContentsZ*)untag_ptr(o));
+ LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ), "LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ");
+ *ret_conv = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_ok(o_conv);
+ return tag_ptr(ret_conv, true);
+}
+
+uint64_t __attribute__((export_name("TS_CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_err"))) TS_CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_err(uint64_t e) {
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
+ LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ), "LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ");
+ *ret_conv = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_err(e_conv);
+ return tag_ptr(ret_conv, true);
+}
+
+jboolean __attribute__((export_name("TS_CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_is_ok"))) TS_CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_is_ok(uint64_t o) {
+ LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* o_conv = (LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ*)untag_ptr(o);
+ jboolean ret_conv = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_is_ok(o_conv);
+ return ret_conv;
+}
+
+void __attribute__((export_name("TS_CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_free"))) TS_CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_free(uint64_t _res) {
+ if (!ptr_is_owned(_res)) return;
+ void* _res_ptr = untag_ptr(_res);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ _res_conv = *(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ*)(_res_ptr);
+ FREE(untag_ptr(_res));
+ CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_free(_res_conv);
+}
+
+static inline uint64_t CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_clone_ptr(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ *NONNULL_PTR arg) {
+ LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ), "LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ");
+ *ret_conv = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_clone(arg);
+ return tag_ptr(ret_conv, true);
+}
+int64_t __attribute__((export_name("TS_CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_clone_ptr"))) TS_CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_clone_ptr(uint64_t arg) {
+ LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* arg_conv = (LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ*)untag_ptr(arg);
+ int64_t ret_conv = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_clone_ptr(arg_conv);
+ return ret_conv;
+}
+
+uint64_t __attribute__((export_name("TS_CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_clone"))) TS_CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_clone(uint64_t orig) {
+ LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* orig_conv = (LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ*)untag_ptr(orig);
+ LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ), "LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ");
+ *ret_conv = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_clone(orig_conv);
+ return tag_ptr(ret_conv, true);
+}
+
+uint64_t __attribute__((export_name("TS_COption_NetAddressZ_some"))) TS_COption_NetAddressZ_some(uint64_t o) {
+ void* o_ptr = untag_ptr(o);
+ CHECK_ACCESS(o_ptr);
+ LDKNetAddress o_conv = *(LDKNetAddress*)(o_ptr);
+ o_conv = NetAddress_clone((LDKNetAddress*)untag_ptr(o));
+ LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ");
+ *ret_copy = COption_NetAddressZ_some(o_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+uint64_t __attribute__((export_name("TS_COption_NetAddressZ_none"))) TS_COption_NetAddressZ_none() {
+ LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ");
+ *ret_copy = COption_NetAddressZ_none();
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+void __attribute__((export_name("TS_COption_NetAddressZ_free"))) TS_COption_NetAddressZ_free(uint64_t _res) {
+ if (!ptr_is_owned(_res)) return;
+ void* _res_ptr = untag_ptr(_res);
+ CHECK_ACCESS(_res_ptr);
+ LDKCOption_NetAddressZ _res_conv = *(LDKCOption_NetAddressZ*)(_res_ptr);
+ FREE(untag_ptr(_res));
+ COption_NetAddressZ_free(_res_conv);
+}
+
+static inline uint64_t COption_NetAddressZ_clone_ptr(LDKCOption_NetAddressZ *NONNULL_PTR arg) {
+ LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ");
+ *ret_copy = COption_NetAddressZ_clone(arg);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+int64_t __attribute__((export_name("TS_COption_NetAddressZ_clone_ptr"))) TS_COption_NetAddressZ_clone_ptr(uint64_t arg) {
+ LDKCOption_NetAddressZ* arg_conv = (LDKCOption_NetAddressZ*)untag_ptr(arg);
+ int64_t ret_conv = COption_NetAddressZ_clone_ptr(arg_conv);
+ return ret_conv;
+}
+
+uint64_t __attribute__((export_name("TS_COption_NetAddressZ_clone"))) TS_COption_NetAddressZ_clone(uint64_t orig) {
+ LDKCOption_NetAddressZ* orig_conv = (LDKCOption_NetAddressZ*)untag_ptr(orig);
+ LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ");
+ *ret_copy = COption_NetAddressZ_clone(orig_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+static inline uint64_t C2Tuple_PublicKeyCOption_NetAddressZZ_clone_ptr(LDKC2Tuple_PublicKeyCOption_NetAddressZZ *NONNULL_PTR arg) {
+ LDKC2Tuple_PublicKeyCOption_NetAddressZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyCOption_NetAddressZZ), "LDKC2Tuple_PublicKeyCOption_NetAddressZZ");
+ *ret_conv = C2Tuple_PublicKeyCOption_NetAddressZZ_clone(arg);
+ return tag_ptr(ret_conv, true);
+}
+int64_t __attribute__((export_name("TS_C2Tuple_PublicKeyCOption_NetAddressZZ_clone_ptr"))) TS_C2Tuple_PublicKeyCOption_NetAddressZZ_clone_ptr(uint64_t arg) {
+ LDKC2Tuple_PublicKeyCOption_NetAddressZZ* arg_conv = (LDKC2Tuple_PublicKeyCOption_NetAddressZZ*)untag_ptr(arg);
+ int64_t ret_conv = C2Tuple_PublicKeyCOption_NetAddressZZ_clone_ptr(arg_conv);
+ return ret_conv;
+}
+
+uint64_t __attribute__((export_name("TS_C2Tuple_PublicKeyCOption_NetAddressZZ_clone"))) TS_C2Tuple_PublicKeyCOption_NetAddressZZ_clone(uint64_t orig) {
+ LDKC2Tuple_PublicKeyCOption_NetAddressZZ* orig_conv = (LDKC2Tuple_PublicKeyCOption_NetAddressZZ*)untag_ptr(orig);
+ LDKC2Tuple_PublicKeyCOption_NetAddressZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyCOption_NetAddressZZ), "LDKC2Tuple_PublicKeyCOption_NetAddressZZ");
+ *ret_conv = C2Tuple_PublicKeyCOption_NetAddressZZ_clone(orig_conv);
+ return tag_ptr(ret_conv, true);
+}
+
+uint64_t __attribute__((export_name("TS_C2Tuple_PublicKeyCOption_NetAddressZZ_new"))) TS_C2Tuple_PublicKeyCOption_NetAddressZZ_new(int8_tArray a, uint64_t b) {
+ LDKPublicKey a_ref;
+ CHECK(a->arr_len == 33);
+ memcpy(a_ref.compressed_form, a->elems, 33); FREE(a);
+ void* b_ptr = untag_ptr(b);
+ CHECK_ACCESS(b_ptr);
+ LDKCOption_NetAddressZ b_conv = *(LDKCOption_NetAddressZ*)(b_ptr);
+ b_conv = COption_NetAddressZ_clone((LDKCOption_NetAddressZ*)untag_ptr(b));
+ LDKC2Tuple_PublicKeyCOption_NetAddressZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyCOption_NetAddressZZ), "LDKC2Tuple_PublicKeyCOption_NetAddressZZ");
+ *ret_conv = C2Tuple_PublicKeyCOption_NetAddressZZ_new(a_ref, b_conv);
+ return tag_ptr(ret_conv, true);
+}
+
+void __attribute__((export_name("TS_C2Tuple_PublicKeyCOption_NetAddressZZ_free"))) TS_C2Tuple_PublicKeyCOption_NetAddressZZ_free(uint64_t _res) {
+ if (!ptr_is_owned(_res)) return;
+ void* _res_ptr = untag_ptr(_res);
+ CHECK_ACCESS(_res_ptr);
+ LDKC2Tuple_PublicKeyCOption_NetAddressZZ _res_conv = *(LDKC2Tuple_PublicKeyCOption_NetAddressZZ*)(_res_ptr);
+ FREE(untag_ptr(_res));
+ C2Tuple_PublicKeyCOption_NetAddressZZ_free(_res_conv);
+}
+
+void __attribute__((export_name("TS_CVec_C2Tuple_PublicKeyCOption_NetAddressZZZ_free"))) TS_CVec_C2Tuple_PublicKeyCOption_NetAddressZZZ_free(uint64_tArray _res) {
+ LDKCVec_C2Tuple_PublicKeyCOption_NetAddressZZZ _res_constr;
+ _res_constr.datalen = _res->arr_len;
+ if (_res_constr.datalen > 0)
+ _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_PublicKeyCOption_NetAddressZZ), "LDKCVec_C2Tuple_PublicKeyCOption_NetAddressZZZ Elements");
+ else
+ _res_constr.data = NULL;
+ uint64_t* _res_vals = _res->elems;
+ for (size_t o = 0; o < _res_constr.datalen; o++) {
+ uint64_t _res_conv_40 = _res_vals[o];
+ void* _res_conv_40_ptr = untag_ptr(_res_conv_40);
+ CHECK_ACCESS(_res_conv_40_ptr);
+ LDKC2Tuple_PublicKeyCOption_NetAddressZZ _res_conv_40_conv = *(LDKC2Tuple_PublicKeyCOption_NetAddressZZ*)(_res_conv_40_ptr);
+ FREE(untag_ptr(_res_conv_40));
+ _res_constr.data[o] = _res_conv_40_conv;
+ }
+ FREE(_res);
+ CVec_C2Tuple_PublicKeyCOption_NetAddressZZZ_free(_res_constr);
+}
+
+uint64_t __attribute__((export_name("TS_CResult_CVec_u8ZPeerHandleErrorZ_ok"))) TS_CResult_CVec_u8ZPeerHandleErrorZ_ok(int8_tArray o) {
+ LDKCVec_u8Z o_ref;
+ o_ref.datalen = o->arr_len;
+ o_ref.data = MALLOC(o_ref.datalen, "LDKCVec_u8Z Bytes");
+ memcpy(o_ref.data, o->elems, o_ref.datalen); FREE(o);
+ LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
+ *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_ok(o_ref);
+ return tag_ptr(ret_conv, true);
+}
+
+uint64_t __attribute__((export_name("TS_CResult_CVec_u8ZPeerHandleErrorZ_err"))) TS_CResult_CVec_u8ZPeerHandleErrorZ_err(uint64_t e) {
+ LDKPeerHandleError e_conv;
+ e_conv.inner = untag_ptr(e);
+ e_conv.is_owned = ptr_is_owned(e);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
+ e_conv = PeerHandleError_clone(&e_conv);
+ LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
+ *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_err(e_conv);
+ return tag_ptr(ret_conv, true);
+}
+
+jboolean __attribute__((export_name("TS_CResult_CVec_u8ZPeerHandleErrorZ_is_ok"))) TS_CResult_CVec_u8ZPeerHandleErrorZ_is_ok(uint64_t o) {
+ LDKCResult_CVec_u8ZPeerHandleErrorZ* o_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)untag_ptr(o);
+ jboolean ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_is_ok(o_conv);
+ return ret_conv;
+}
+
+void __attribute__((export_name("TS_CResult_CVec_u8ZPeerHandleErrorZ_free"))) TS_CResult_CVec_u8ZPeerHandleErrorZ_free(uint64_t _res) {
+ if (!ptr_is_owned(_res)) return;
+ void* _res_ptr = untag_ptr(_res);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_CVec_u8ZPeerHandleErrorZ _res_conv = *(LDKCResult_CVec_u8ZPeerHandleErrorZ*)(_res_ptr);
+ FREE(untag_ptr(_res));
+ CResult_CVec_u8ZPeerHandleErrorZ_free(_res_conv);
+}
+
+static inline uint64_t CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr(LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR arg) {
+ LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
+ *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_clone(arg);
+ return tag_ptr(ret_conv, true);
+}
+int64_t __attribute__((export_name("TS_CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr"))) TS_CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr(uint64_t arg) {
+ LDKCResult_CVec_u8ZPeerHandleErrorZ* arg_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)untag_ptr(arg);
+ int64_t ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr(arg_conv);
+ return ret_conv;
+}
+
+uint64_t __attribute__((export_name("TS_CResult_CVec_u8ZPeerHandleErrorZ_clone"))) TS_CResult_CVec_u8ZPeerHandleErrorZ_clone(uint64_t orig) {
+ LDKCResult_CVec_u8ZPeerHandleErrorZ* orig_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)untag_ptr(orig);
+ LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
+ *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_clone(orig_conv);
+ return tag_ptr(ret_conv, true);
+}
+
+uint64_t __attribute__((export_name("TS_CResult_NonePeerHandleErrorZ_ok"))) TS_CResult_NonePeerHandleErrorZ_ok() {
+ LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
+ *ret_conv = CResult_NonePeerHandleErrorZ_ok();
+ return tag_ptr(ret_conv, true);
+}
+
+uint64_t __attribute__((export_name("TS_CResult_NonePeerHandleErrorZ_err"))) TS_CResult_NonePeerHandleErrorZ_err(uint64_t e) {
+ LDKPeerHandleError e_conv;
+ e_conv.inner = untag_ptr(e);
+ e_conv.is_owned = ptr_is_owned(e);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
+ e_conv = PeerHandleError_clone(&e_conv);
+ LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
+ *ret_conv = CResult_NonePeerHandleErrorZ_err(e_conv);
+ return tag_ptr(ret_conv, true);
+}
+
+jboolean __attribute__((export_name("TS_CResult_NonePeerHandleErrorZ_is_ok"))) TS_CResult_NonePeerHandleErrorZ_is_ok(uint64_t o) {
+ LDKCResult_NonePeerHandleErrorZ* o_conv = (LDKCResult_NonePeerHandleErrorZ*)untag_ptr(o);
+ jboolean ret_conv = CResult_NonePeerHandleErrorZ_is_ok(o_conv);
+ return ret_conv;
+}
+
+void __attribute__((export_name("TS_CResult_NonePeerHandleErrorZ_free"))) TS_CResult_NonePeerHandleErrorZ_free(uint64_t _res) {
+ if (!ptr_is_owned(_res)) return;
+ void* _res_ptr = untag_ptr(_res);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_NonePeerHandleErrorZ _res_conv = *(LDKCResult_NonePeerHandleErrorZ*)(_res_ptr);
+ FREE(untag_ptr(_res));
+ CResult_NonePeerHandleErrorZ_free(_res_conv);
+}
+
+static inline uint64_t CResult_NonePeerHandleErrorZ_clone_ptr(LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR arg) {
+ LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
+ *ret_conv = CResult_NonePeerHandleErrorZ_clone(arg);
+ return tag_ptr(ret_conv, true);
+}
+int64_t __attribute__((export_name("TS_CResult_NonePeerHandleErrorZ_clone_ptr"))) TS_CResult_NonePeerHandleErrorZ_clone_ptr(uint64_t arg) {
+ LDKCResult_NonePeerHandleErrorZ* arg_conv = (LDKCResult_NonePeerHandleErrorZ*)untag_ptr(arg);
+ int64_t ret_conv = CResult_NonePeerHandleErrorZ_clone_ptr(arg_conv);
+ return ret_conv;
+}
+
+uint64_t __attribute__((export_name("TS_CResult_NonePeerHandleErrorZ_clone"))) TS_CResult_NonePeerHandleErrorZ_clone(uint64_t orig) {
+ LDKCResult_NonePeerHandleErrorZ* orig_conv = (LDKCResult_NonePeerHandleErrorZ*)untag_ptr(orig);
+ LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
+ *ret_conv = CResult_NonePeerHandleErrorZ_clone(orig_conv);
+ return tag_ptr(ret_conv, true);
+}
+
+uint64_t __attribute__((export_name("TS_CResult_boolPeerHandleErrorZ_ok"))) TS_CResult_boolPeerHandleErrorZ_ok(jboolean o) {
+ LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
+ *ret_conv = CResult_boolPeerHandleErrorZ_ok(o);
+ return tag_ptr(ret_conv, true);
+}
+
+uint64_t __attribute__((export_name("TS_CResult_boolPeerHandleErrorZ_err"))) TS_CResult_boolPeerHandleErrorZ_err(uint64_t e) {
+ LDKPeerHandleError e_conv;
+ e_conv.inner = untag_ptr(e);
+ e_conv.is_owned = ptr_is_owned(e);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
+ e_conv = PeerHandleError_clone(&e_conv);
+ LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
+ *ret_conv = CResult_boolPeerHandleErrorZ_err(e_conv);
+ return tag_ptr(ret_conv, true);
+}
+
+jboolean __attribute__((export_name("TS_CResult_boolPeerHandleErrorZ_is_ok"))) TS_CResult_boolPeerHandleErrorZ_is_ok(uint64_t o) {
+ LDKCResult_boolPeerHandleErrorZ* o_conv = (LDKCResult_boolPeerHandleErrorZ*)untag_ptr(o);
+ jboolean ret_conv = CResult_boolPeerHandleErrorZ_is_ok(o_conv);
+ return ret_conv;
+}
+
+void __attribute__((export_name("TS_CResult_boolPeerHandleErrorZ_free"))) TS_CResult_boolPeerHandleErrorZ_free(uint64_t _res) {
+ if (!ptr_is_owned(_res)) return;
+ void* _res_ptr = untag_ptr(_res);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_boolPeerHandleErrorZ _res_conv = *(LDKCResult_boolPeerHandleErrorZ*)(_res_ptr);
+ FREE(untag_ptr(_res));
+ CResult_boolPeerHandleErrorZ_free(_res_conv);
+}
+
+static inline uint64_t CResult_boolPeerHandleErrorZ_clone_ptr(LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR arg) {
+ LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
+ *ret_conv = CResult_boolPeerHandleErrorZ_clone(arg);
+ return tag_ptr(ret_conv, true);
+}
+int64_t __attribute__((export_name("TS_CResult_boolPeerHandleErrorZ_clone_ptr"))) TS_CResult_boolPeerHandleErrorZ_clone_ptr(uint64_t arg) {
+ LDKCResult_boolPeerHandleErrorZ* arg_conv = (LDKCResult_boolPeerHandleErrorZ*)untag_ptr(arg);
+ int64_t ret_conv = CResult_boolPeerHandleErrorZ_clone_ptr(arg_conv);
+ return ret_conv;
+}
+
+uint64_t __attribute__((export_name("TS_CResult_boolPeerHandleErrorZ_clone"))) TS_CResult_boolPeerHandleErrorZ_clone(uint64_t orig) {
+ LDKCResult_boolPeerHandleErrorZ* orig_conv = (LDKCResult_boolPeerHandleErrorZ*)untag_ptr(orig);
+ LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
+ *ret_conv = CResult_boolPeerHandleErrorZ_clone(orig_conv);
+ return tag_ptr(ret_conv, true);
+}
+
+uint64_t __attribute__((export_name("TS_CResult_TxOutUtxoLookupErrorZ_ok"))) TS_CResult_TxOutUtxoLookupErrorZ_ok(uint64_t o) {
+ void* o_ptr = untag_ptr(o);
+ CHECK_ACCESS(o_ptr);
+ LDKTxOut o_conv = *(LDKTxOut*)(o_ptr);
+ o_conv = TxOut_clone((LDKTxOut*)untag_ptr(o));
+ LDKCResult_TxOutUtxoLookupErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutUtxoLookupErrorZ), "LDKCResult_TxOutUtxoLookupErrorZ");
+ *ret_conv = CResult_TxOutUtxoLookupErrorZ_ok(o_conv);
+ return tag_ptr(ret_conv, true);
+}
+
+uint64_t __attribute__((export_name("TS_CResult_TxOutUtxoLookupErrorZ_err"))) TS_CResult_TxOutUtxoLookupErrorZ_err(uint32_t e) {
+ LDKUtxoLookupError e_conv = LDKUtxoLookupError_from_js(e);
+ LDKCResult_TxOutUtxoLookupErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutUtxoLookupErrorZ), "LDKCResult_TxOutUtxoLookupErrorZ");
+ *ret_conv = CResult_TxOutUtxoLookupErrorZ_err(e_conv);
+ return tag_ptr(ret_conv, true);
+}
+
+jboolean __attribute__((export_name("TS_CResult_TxOutUtxoLookupErrorZ_is_ok"))) TS_CResult_TxOutUtxoLookupErrorZ_is_ok(uint64_t o) {
+ LDKCResult_TxOutUtxoLookupErrorZ* o_conv = (LDKCResult_TxOutUtxoLookupErrorZ*)untag_ptr(o);
+ jboolean ret_conv = CResult_TxOutUtxoLookupErrorZ_is_ok(o_conv);
+ return ret_conv;
+}
+
+void __attribute__((export_name("TS_CResult_TxOutUtxoLookupErrorZ_free"))) TS_CResult_TxOutUtxoLookupErrorZ_free(uint64_t _res) {
+ if (!ptr_is_owned(_res)) return;
+ void* _res_ptr = untag_ptr(_res);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_TxOutUtxoLookupErrorZ _res_conv = *(LDKCResult_TxOutUtxoLookupErrorZ*)(_res_ptr);
+ FREE(untag_ptr(_res));
+ CResult_TxOutUtxoLookupErrorZ_free(_res_conv);
+}
+
+static inline uint64_t CResult_TxOutUtxoLookupErrorZ_clone_ptr(LDKCResult_TxOutUtxoLookupErrorZ *NONNULL_PTR arg) {
+ LDKCResult_TxOutUtxoLookupErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutUtxoLookupErrorZ), "LDKCResult_TxOutUtxoLookupErrorZ");
+ *ret_conv = CResult_TxOutUtxoLookupErrorZ_clone(arg);
+ return tag_ptr(ret_conv, true);
+}
+int64_t __attribute__((export_name("TS_CResult_TxOutUtxoLookupErrorZ_clone_ptr"))) TS_CResult_TxOutUtxoLookupErrorZ_clone_ptr(uint64_t arg) {
+ LDKCResult_TxOutUtxoLookupErrorZ* arg_conv = (LDKCResult_TxOutUtxoLookupErrorZ*)untag_ptr(arg);
+ int64_t ret_conv = CResult_TxOutUtxoLookupErrorZ_clone_ptr(arg_conv);
+ return ret_conv;
+}
+
+uint64_t __attribute__((export_name("TS_CResult_TxOutUtxoLookupErrorZ_clone"))) TS_CResult_TxOutUtxoLookupErrorZ_clone(uint64_t orig) {
+ LDKCResult_TxOutUtxoLookupErrorZ* orig_conv = (LDKCResult_TxOutUtxoLookupErrorZ*)untag_ptr(orig);
+ LDKCResult_TxOutUtxoLookupErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutUtxoLookupErrorZ), "LDKCResult_TxOutUtxoLookupErrorZ");
+ *ret_conv = CResult_TxOutUtxoLookupErrorZ_clone(orig_conv);
+ return tag_ptr(ret_conv, true);
+}
+
+uint64_t __attribute__((export_name("TS_CResult_NoneSendErrorZ_ok"))) TS_CResult_NoneSendErrorZ_ok() {
+ LDKCResult_NoneSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSendErrorZ), "LDKCResult_NoneSendErrorZ");
+ *ret_conv = CResult_NoneSendErrorZ_ok();
+ return tag_ptr(ret_conv, true);
+}
+
+uint64_t __attribute__((export_name("TS_CResult_NoneSendErrorZ_err"))) TS_CResult_NoneSendErrorZ_err(uint64_t e) {
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKSendError e_conv = *(LDKSendError*)(e_ptr);
+ e_conv = SendError_clone((LDKSendError*)untag_ptr(e));
+ LDKCResult_NoneSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSendErrorZ), "LDKCResult_NoneSendErrorZ");
+ *ret_conv = CResult_NoneSendErrorZ_err(e_conv);
+ return tag_ptr(ret_conv, true);
+}
+
+jboolean __attribute__((export_name("TS_CResult_NoneSendErrorZ_is_ok"))) TS_CResult_NoneSendErrorZ_is_ok(uint64_t o) {
+ LDKCResult_NoneSendErrorZ* o_conv = (LDKCResult_NoneSendErrorZ*)untag_ptr(o);
+ jboolean ret_conv = CResult_NoneSendErrorZ_is_ok(o_conv);
+ return ret_conv;
+}
+
+void __attribute__((export_name("TS_CResult_NoneSendErrorZ_free"))) TS_CResult_NoneSendErrorZ_free(uint64_t _res) {
+ if (!ptr_is_owned(_res)) return;
+ void* _res_ptr = untag_ptr(_res);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_NoneSendErrorZ _res_conv = *(LDKCResult_NoneSendErrorZ*)(_res_ptr);
+ FREE(untag_ptr(_res));
+ CResult_NoneSendErrorZ_free(_res_conv);
+}
+
+uint64_t __attribute__((export_name("TS_CResult_u32GraphSyncErrorZ_ok"))) TS_CResult_u32GraphSyncErrorZ_ok(int32_t o) {
+ LDKCResult_u32GraphSyncErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_u32GraphSyncErrorZ), "LDKCResult_u32GraphSyncErrorZ");
+ *ret_conv = CResult_u32GraphSyncErrorZ_ok(o);
+ return tag_ptr(ret_conv, true);
+}
+
+uint64_t __attribute__((export_name("TS_CResult_u32GraphSyncErrorZ_err"))) TS_CResult_u32GraphSyncErrorZ_err(uint64_t e) {
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKGraphSyncError e_conv = *(LDKGraphSyncError*)(e_ptr);
+ e_conv = GraphSyncError_clone((LDKGraphSyncError*)untag_ptr(e));
+ LDKCResult_u32GraphSyncErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_u32GraphSyncErrorZ), "LDKCResult_u32GraphSyncErrorZ");
+ *ret_conv = CResult_u32GraphSyncErrorZ_err(e_conv);
+ return tag_ptr(ret_conv, true);
+}
+
+jboolean __attribute__((export_name("TS_CResult_u32GraphSyncErrorZ_is_ok"))) TS_CResult_u32GraphSyncErrorZ_is_ok(uint64_t o) {
+ LDKCResult_u32GraphSyncErrorZ* o_conv = (LDKCResult_u32GraphSyncErrorZ*)untag_ptr(o);
+ jboolean ret_conv = CResult_u32GraphSyncErrorZ_is_ok(o_conv);
+ return ret_conv;
+}
+
+void __attribute__((export_name("TS_CResult_u32GraphSyncErrorZ_free"))) TS_CResult_u32GraphSyncErrorZ_free(uint64_t _res) {
+ if (!ptr_is_owned(_res)) return;
+ void* _res_ptr = untag_ptr(_res);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_u32GraphSyncErrorZ _res_conv = *(LDKCResult_u32GraphSyncErrorZ*)(_res_ptr);
+ FREE(untag_ptr(_res));
+ CResult_u32GraphSyncErrorZ_free(_res_conv);
+}
+
+uint64_t __attribute__((export_name("TS_CResult_SiPrefixParseErrorZ_ok"))) TS_CResult_SiPrefixParseErrorZ_ok(uint32_t o) {
+ LDKSiPrefix o_conv = LDKSiPrefix_from_js(o);
+ LDKCResult_SiPrefixParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixParseErrorZ), "LDKCResult_SiPrefixParseErrorZ");
+ *ret_conv = CResult_SiPrefixParseErrorZ_ok(o_conv);
+ return tag_ptr(ret_conv, true);
+}
+
+uint64_t __attribute__((export_name("TS_CResult_SiPrefixParseErrorZ_err"))) TS_CResult_SiPrefixParseErrorZ_err(uint64_t e) {
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKParseError e_conv = *(LDKParseError*)(e_ptr);
+ e_conv = ParseError_clone((LDKParseError*)untag_ptr(e));
+ LDKCResult_SiPrefixParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixParseErrorZ), "LDKCResult_SiPrefixParseErrorZ");
+ *ret_conv = CResult_SiPrefixParseErrorZ_err(e_conv);
+ return tag_ptr(ret_conv, true);
+}
+
+jboolean __attribute__((export_name("TS_CResult_SiPrefixParseErrorZ_is_ok"))) TS_CResult_SiPrefixParseErrorZ_is_ok(uint64_t o) {
+ LDKCResult_SiPrefixParseErrorZ* o_conv = (LDKCResult_SiPrefixParseErrorZ*)untag_ptr(o);
+ jboolean ret_conv = CResult_SiPrefixParseErrorZ_is_ok(o_conv);
+ return ret_conv;
+}
+
+void __attribute__((export_name("TS_CResult_SiPrefixParseErrorZ_free"))) TS_CResult_SiPrefixParseErrorZ_free(uint64_t _res) {
+ if (!ptr_is_owned(_res)) return;
+ void* _res_ptr = untag_ptr(_res);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_SiPrefixParseErrorZ _res_conv = *(LDKCResult_SiPrefixParseErrorZ*)(_res_ptr);
+ FREE(untag_ptr(_res));
+ CResult_SiPrefixParseErrorZ_free(_res_conv);
+}
+
+static inline uint64_t CResult_SiPrefixParseErrorZ_clone_ptr(LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR arg) {
+ LDKCResult_SiPrefixParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixParseErrorZ), "LDKCResult_SiPrefixParseErrorZ");
+ *ret_conv = CResult_SiPrefixParseErrorZ_clone(arg);
+ return tag_ptr(ret_conv, true);
+}
+int64_t __attribute__((export_name("TS_CResult_SiPrefixParseErrorZ_clone_ptr"))) TS_CResult_SiPrefixParseErrorZ_clone_ptr(uint64_t arg) {
+ LDKCResult_SiPrefixParseErrorZ* arg_conv = (LDKCResult_SiPrefixParseErrorZ*)untag_ptr(arg);
+ int64_t ret_conv = CResult_SiPrefixParseErrorZ_clone_ptr(arg_conv);
+ return ret_conv;
+}
+
+uint64_t __attribute__((export_name("TS_CResult_SiPrefixParseErrorZ_clone"))) TS_CResult_SiPrefixParseErrorZ_clone(uint64_t orig) {
+ LDKCResult_SiPrefixParseErrorZ* orig_conv = (LDKCResult_SiPrefixParseErrorZ*)untag_ptr(orig);
+ LDKCResult_SiPrefixParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixParseErrorZ), "LDKCResult_SiPrefixParseErrorZ");
+ *ret_conv = CResult_SiPrefixParseErrorZ_clone(orig_conv);
+ return tag_ptr(ret_conv, true);
+}
+
+uint64_t __attribute__((export_name("TS_CResult_InvoiceParseOrSemanticErrorZ_ok"))) TS_CResult_InvoiceParseOrSemanticErrorZ_ok(uint64_t o) {
+ LDKInvoice o_conv;
+ o_conv.inner = untag_ptr(o);
+ o_conv.is_owned = ptr_is_owned(o);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
+ o_conv = Invoice_clone(&o_conv);
+ LDKCResult_InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceParseOrSemanticErrorZ), "LDKCResult_InvoiceParseOrSemanticErrorZ");
+ *ret_conv = CResult_InvoiceParseOrSemanticErrorZ_ok(o_conv);
+ return tag_ptr(ret_conv, true);
+}
+
+uint64_t __attribute__((export_name("TS_CResult_InvoiceParseOrSemanticErrorZ_err"))) TS_CResult_InvoiceParseOrSemanticErrorZ_err(uint64_t e) {
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKParseOrSemanticError e_conv = *(LDKParseOrSemanticError*)(e_ptr);
+ e_conv = ParseOrSemanticError_clone((LDKParseOrSemanticError*)untag_ptr(e));
+ LDKCResult_InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceParseOrSemanticErrorZ), "LDKCResult_InvoiceParseOrSemanticErrorZ");
+ *ret_conv = CResult_InvoiceParseOrSemanticErrorZ_err(e_conv);
+ return tag_ptr(ret_conv, true);
+}
+
+jboolean __attribute__((export_name("TS_CResult_InvoiceParseOrSemanticErrorZ_is_ok"))) TS_CResult_InvoiceParseOrSemanticErrorZ_is_ok(uint64_t o) {
+ LDKCResult_InvoiceParseOrSemanticErrorZ* o_conv = (LDKCResult_InvoiceParseOrSemanticErrorZ*)untag_ptr(o);
+ jboolean ret_conv = CResult_InvoiceParseOrSemanticErrorZ_is_ok(o_conv);
+ return ret_conv;
+}
+
+void __attribute__((export_name("TS_CResult_InvoiceParseOrSemanticErrorZ_free"))) TS_CResult_InvoiceParseOrSemanticErrorZ_free(uint64_t _res) {
+ if (!ptr_is_owned(_res)) return;
+ void* _res_ptr = untag_ptr(_res);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_InvoiceParseOrSemanticErrorZ _res_conv = *(LDKCResult_InvoiceParseOrSemanticErrorZ*)(_res_ptr);
+ FREE(untag_ptr(_res));
+ CResult_InvoiceParseOrSemanticErrorZ_free(_res_conv);
+}
+
+static inline uint64_t CResult_InvoiceParseOrSemanticErrorZ_clone_ptr(LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR arg) {
+ LDKCResult_InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceParseOrSemanticErrorZ), "LDKCResult_InvoiceParseOrSemanticErrorZ");
+ *ret_conv = CResult_InvoiceParseOrSemanticErrorZ_clone(arg);
+ return tag_ptr(ret_conv, true);
+}
+int64_t __attribute__((export_name("TS_CResult_InvoiceParseOrSemanticErrorZ_clone_ptr"))) TS_CResult_InvoiceParseOrSemanticErrorZ_clone_ptr(uint64_t arg) {
+ LDKCResult_InvoiceParseOrSemanticErrorZ* arg_conv = (LDKCResult_InvoiceParseOrSemanticErrorZ*)untag_ptr(arg);
+ int64_t ret_conv = CResult_InvoiceParseOrSemanticErrorZ_clone_ptr(arg_conv);
+ return ret_conv;
+}
+
+uint64_t __attribute__((export_name("TS_CResult_InvoiceParseOrSemanticErrorZ_clone"))) TS_CResult_InvoiceParseOrSemanticErrorZ_clone(uint64_t orig) {
+ LDKCResult_InvoiceParseOrSemanticErrorZ* orig_conv = (LDKCResult_InvoiceParseOrSemanticErrorZ*)untag_ptr(orig);
+ LDKCResult_InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceParseOrSemanticErrorZ), "LDKCResult_InvoiceParseOrSemanticErrorZ");
+ *ret_conv = CResult_InvoiceParseOrSemanticErrorZ_clone(orig_conv);
+ return tag_ptr(ret_conv, true);
+}
+
+uint64_t __attribute__((export_name("TS_CResult_SignedRawInvoiceParseErrorZ_ok"))) TS_CResult_SignedRawInvoiceParseErrorZ_ok(uint64_t o) {
+ LDKSignedRawInvoice o_conv;
+ o_conv.inner = untag_ptr(o);
+ o_conv.is_owned = ptr_is_owned(o);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
+ o_conv = SignedRawInvoice_clone(&o_conv);
+ LDKCResult_SignedRawInvoiceParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceParseErrorZ), "LDKCResult_SignedRawInvoiceParseErrorZ");
+ *ret_conv = CResult_SignedRawInvoiceParseErrorZ_ok(o_conv);
+ return tag_ptr(ret_conv, true);
+}
+
+uint64_t __attribute__((export_name("TS_CResult_SignedRawInvoiceParseErrorZ_err"))) TS_CResult_SignedRawInvoiceParseErrorZ_err(uint64_t e) {
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKParseError e_conv = *(LDKParseError*)(e_ptr);
+ e_conv = ParseError_clone((LDKParseError*)untag_ptr(e));
+ LDKCResult_SignedRawInvoiceParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceParseErrorZ), "LDKCResult_SignedRawInvoiceParseErrorZ");
+ *ret_conv = CResult_SignedRawInvoiceParseErrorZ_err(e_conv);
+ return tag_ptr(ret_conv, true);
+}
+
+jboolean __attribute__((export_name("TS_CResult_SignedRawInvoiceParseErrorZ_is_ok"))) TS_CResult_SignedRawInvoiceParseErrorZ_is_ok(uint64_t o) {
+ LDKCResult_SignedRawInvoiceParseErrorZ* o_conv = (LDKCResult_SignedRawInvoiceParseErrorZ*)untag_ptr(o);
+ jboolean ret_conv = CResult_SignedRawInvoiceParseErrorZ_is_ok(o_conv);
+ return ret_conv;
+}
+
+void __attribute__((export_name("TS_CResult_SignedRawInvoiceParseErrorZ_free"))) TS_CResult_SignedRawInvoiceParseErrorZ_free(uint64_t _res) {
+ if (!ptr_is_owned(_res)) return;
+ void* _res_ptr = untag_ptr(_res);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_SignedRawInvoiceParseErrorZ _res_conv = *(LDKCResult_SignedRawInvoiceParseErrorZ*)(_res_ptr);
+ FREE(untag_ptr(_res));
+ CResult_SignedRawInvoiceParseErrorZ_free(_res_conv);
+}
+
+static inline uint64_t CResult_SignedRawInvoiceParseErrorZ_clone_ptr(LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR arg) {
+ LDKCResult_SignedRawInvoiceParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceParseErrorZ), "LDKCResult_SignedRawInvoiceParseErrorZ");
+ *ret_conv = CResult_SignedRawInvoiceParseErrorZ_clone(arg);
+ return tag_ptr(ret_conv, true);
+}
+int64_t __attribute__((export_name("TS_CResult_SignedRawInvoiceParseErrorZ_clone_ptr"))) TS_CResult_SignedRawInvoiceParseErrorZ_clone_ptr(uint64_t arg) {
+ LDKCResult_SignedRawInvoiceParseErrorZ* arg_conv = (LDKCResult_SignedRawInvoiceParseErrorZ*)untag_ptr(arg);
+ int64_t ret_conv = CResult_SignedRawInvoiceParseErrorZ_clone_ptr(arg_conv);
+ return ret_conv;
+}
+
+uint64_t __attribute__((export_name("TS_CResult_SignedRawInvoiceParseErrorZ_clone"))) TS_CResult_SignedRawInvoiceParseErrorZ_clone(uint64_t orig) {
+ LDKCResult_SignedRawInvoiceParseErrorZ* orig_conv = (LDKCResult_SignedRawInvoiceParseErrorZ*)untag_ptr(orig);
+ LDKCResult_SignedRawInvoiceParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceParseErrorZ), "LDKCResult_SignedRawInvoiceParseErrorZ");
+ *ret_conv = CResult_SignedRawInvoiceParseErrorZ_clone(orig_conv);
+ return tag_ptr(ret_conv, true);
+}
+
+static inline uint64_t C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone_ptr(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR arg) {
+ LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ");
+ *ret_conv = C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone(arg);
+ return tag_ptr(ret_conv, true);
+}
+int64_t __attribute__((export_name("TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone_ptr"))) TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone_ptr(uint64_t arg) {
+ LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* arg_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)untag_ptr(arg);
+ int64_t ret_conv = C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone_ptr(arg_conv);
+ return ret_conv;
+}
+
+uint64_t __attribute__((export_name("TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone"))) TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone(uint64_t orig) {
+ LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* orig_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)untag_ptr(orig);
+ LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ");
+ *ret_conv = C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone(orig_conv);
+ return tag_ptr(ret_conv, true);
+}
+
+uint64_t __attribute__((export_name("TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_new"))) TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_new(uint64_t a, int8_tArray b, uint64_t c) {
+ LDKRawInvoice a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv = RawInvoice_clone(&a_conv);
+ LDKThirtyTwoBytes b_ref;
+ CHECK(b->arr_len == 32);
+ memcpy(b_ref.data, b->elems, 32); FREE(b);
+ LDKInvoiceSignature c_conv;
+ c_conv.inner = untag_ptr(c);
+ c_conv.is_owned = ptr_is_owned(c);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(c_conv);
+ c_conv = InvoiceSignature_clone(&c_conv);
+ LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ");
+ *ret_conv = C3Tuple_RawInvoice_u832InvoiceSignatureZ_new(a_conv, b_ref, c_conv);
+ return tag_ptr(ret_conv, true);
+}
+
+void __attribute__((export_name("TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_free"))) TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_free(uint64_t _res) {
+ if (!ptr_is_owned(_res)) return;
+ void* _res_ptr = untag_ptr(_res);
+ CHECK_ACCESS(_res_ptr);
+ LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ _res_conv = *(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)(_res_ptr);
+ FREE(untag_ptr(_res));
+ C3Tuple_RawInvoice_u832InvoiceSignatureZ_free(_res_conv);
+}
+
+uint64_t __attribute__((export_name("TS_CResult_PayeePubKeyErrorZ_ok"))) TS_CResult_PayeePubKeyErrorZ_ok(uint64_t o) {
+ LDKPayeePubKey o_conv;
+ o_conv.inner = untag_ptr(o);
+ o_conv.is_owned = ptr_is_owned(o);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
+ o_conv = PayeePubKey_clone(&o_conv);
+ LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ");
+ *ret_conv = CResult_PayeePubKeyErrorZ_ok(o_conv);
+ return tag_ptr(ret_conv, true);
+}
+
+uint64_t __attribute__((export_name("TS_CResult_PayeePubKeyErrorZ_err"))) TS_CResult_PayeePubKeyErrorZ_err(uint32_t e) {
+ LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_js(e);
+ LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ");
+ *ret_conv = CResult_PayeePubKeyErrorZ_err(e_conv);
+ return tag_ptr(ret_conv, true);
+}
+
+jboolean __attribute__((export_name("TS_CResult_PayeePubKeyErrorZ_is_ok"))) TS_CResult_PayeePubKeyErrorZ_is_ok(uint64_t o) {
+ LDKCResult_PayeePubKeyErrorZ* o_conv = (LDKCResult_PayeePubKeyErrorZ*)untag_ptr(o);
+ jboolean ret_conv = CResult_PayeePubKeyErrorZ_is_ok(o_conv);
+ return ret_conv;
+}
+
+void __attribute__((export_name("TS_CResult_PayeePubKeyErrorZ_free"))) TS_CResult_PayeePubKeyErrorZ_free(uint64_t _res) {
+ if (!ptr_is_owned(_res)) return;
+ void* _res_ptr = untag_ptr(_res);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_PayeePubKeyErrorZ _res_conv = *(LDKCResult_PayeePubKeyErrorZ*)(_res_ptr);
+ FREE(untag_ptr(_res));
+ CResult_PayeePubKeyErrorZ_free(_res_conv);
+}
+
+static inline uint64_t CResult_PayeePubKeyErrorZ_clone_ptr(LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR arg) {
+ LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ");
+ *ret_conv = CResult_PayeePubKeyErrorZ_clone(arg);
+ return tag_ptr(ret_conv, true);
+}
+int64_t __attribute__((export_name("TS_CResult_PayeePubKeyErrorZ_clone_ptr"))) TS_CResult_PayeePubKeyErrorZ_clone_ptr(uint64_t arg) {
+ LDKCResult_PayeePubKeyErrorZ* arg_conv = (LDKCResult_PayeePubKeyErrorZ*)untag_ptr(arg);
+ int64_t ret_conv = CResult_PayeePubKeyErrorZ_clone_ptr(arg_conv);
+ return ret_conv;
+}
+
+uint64_t __attribute__((export_name("TS_CResult_PayeePubKeyErrorZ_clone"))) TS_CResult_PayeePubKeyErrorZ_clone(uint64_t orig) {
+ LDKCResult_PayeePubKeyErrorZ* orig_conv = (LDKCResult_PayeePubKeyErrorZ*)untag_ptr(orig);
+ LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ");
+ *ret_conv = CResult_PayeePubKeyErrorZ_clone(orig_conv);
+ return tag_ptr(ret_conv, true);
+}
+
+void __attribute__((export_name("TS_CVec_PrivateRouteZ_free"))) TS_CVec_PrivateRouteZ_free(uint64_tArray _res) {
+ LDKCVec_PrivateRouteZ _res_constr;
+ _res_constr.datalen = _res->arr_len;
+ if (_res_constr.datalen > 0)
+ _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKPrivateRoute), "LDKCVec_PrivateRouteZ Elements");
+ else
+ _res_constr.data = NULL;
+ uint64_t* _res_vals = _res->elems;
+ for (size_t o = 0; o < _res_constr.datalen; o++) {
+ uint64_t _res_conv_14 = _res_vals[o];
+ LDKPrivateRoute _res_conv_14_conv;
+ _res_conv_14_conv.inner = untag_ptr(_res_conv_14);
+ _res_conv_14_conv.is_owned = ptr_is_owned(_res_conv_14);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_14_conv);
+ _res_constr.data[o] = _res_conv_14_conv;
+ }
+ FREE(_res);
+ CVec_PrivateRouteZ_free(_res_constr);
+}
+
+uint64_t __attribute__((export_name("TS_CResult_PositiveTimestampCreationErrorZ_ok"))) TS_CResult_PositiveTimestampCreationErrorZ_ok(uint64_t o) {
+ LDKPositiveTimestamp o_conv;
+ o_conv.inner = untag_ptr(o);
+ o_conv.is_owned = ptr_is_owned(o);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
+ o_conv = PositiveTimestamp_clone(&o_conv);
+ LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ");
+ *ret_conv = CResult_PositiveTimestampCreationErrorZ_ok(o_conv);
+ return tag_ptr(ret_conv, true);
+}
+
+uint64_t __attribute__((export_name("TS_CResult_PositiveTimestampCreationErrorZ_err"))) TS_CResult_PositiveTimestampCreationErrorZ_err(uint32_t e) {
+ LDKCreationError e_conv = LDKCreationError_from_js(e);
+ LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ");
+ *ret_conv = CResult_PositiveTimestampCreationErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
-uint64_t __attribute__((export_name("TS_C2Tuple_PublicKeyTypeZ_new"))) TS_C2Tuple_PublicKeyTypeZ_new(int8_tArray a, uint64_t b) {
- LDKPublicKey a_ref;
- CHECK(a->arr_len == 33);
- memcpy(a_ref.compressed_form, a->elems, 33); FREE(a);
- void* b_ptr = untag_ptr(b);
- CHECK_ACCESS(b_ptr);
- LDKType b_conv = *(LDKType*)(b_ptr);
- if (b_conv.free == LDKType_JCalls_free) {
- // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
- LDKType_JCalls_cloned(&b_conv);
- }
- LDKC2Tuple_PublicKeyTypeZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKC2Tuple_PublicKeyTypeZ");
- *ret_conv = C2Tuple_PublicKeyTypeZ_new(a_ref, b_conv);
- return tag_ptr(ret_conv, true);
+jboolean __attribute__((export_name("TS_CResult_PositiveTimestampCreationErrorZ_is_ok"))) TS_CResult_PositiveTimestampCreationErrorZ_is_ok(uint64_t o) {
+ LDKCResult_PositiveTimestampCreationErrorZ* o_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)untag_ptr(o);
+ jboolean ret_conv = CResult_PositiveTimestampCreationErrorZ_is_ok(o_conv);
+ return ret_conv;
}
-void __attribute__((export_name("TS_C2Tuple_PublicKeyTypeZ_free"))) TS_C2Tuple_PublicKeyTypeZ_free(uint64_t _res) {
+void __attribute__((export_name("TS_CResult_PositiveTimestampCreationErrorZ_free"))) TS_CResult_PositiveTimestampCreationErrorZ_free(uint64_t _res) {
if (!ptr_is_owned(_res)) return;
void* _res_ptr = untag_ptr(_res);
CHECK_ACCESS(_res_ptr);
- LDKC2Tuple_PublicKeyTypeZ _res_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(_res_ptr);
+ LDKCResult_PositiveTimestampCreationErrorZ _res_conv = *(LDKCResult_PositiveTimestampCreationErrorZ*)(_res_ptr);
FREE(untag_ptr(_res));
- C2Tuple_PublicKeyTypeZ_free(_res_conv);
+ CResult_PositiveTimestampCreationErrorZ_free(_res_conv);
}
-void __attribute__((export_name("TS_CVec_C2Tuple_PublicKeyTypeZZ_free"))) TS_CVec_C2Tuple_PublicKeyTypeZZ_free(uint64_tArray _res) {
- LDKCVec_C2Tuple_PublicKeyTypeZZ _res_constr;
- _res_constr.datalen = _res->arr_len;
- if (_res_constr.datalen > 0)
- _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKCVec_C2Tuple_PublicKeyTypeZZ Elements");
- else
- _res_constr.data = NULL;
- uint64_t* _res_vals = _res->elems;
- for (size_t z = 0; z < _res_constr.datalen; z++) {
- uint64_t _res_conv_25 = _res_vals[z];
- void* _res_conv_25_ptr = untag_ptr(_res_conv_25);
- CHECK_ACCESS(_res_conv_25_ptr);
- LDKC2Tuple_PublicKeyTypeZ _res_conv_25_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(_res_conv_25_ptr);
- FREE(untag_ptr(_res_conv_25));
- _res_constr.data[z] = _res_conv_25_conv;
- }
- FREE(_res);
- CVec_C2Tuple_PublicKeyTypeZZ_free(_res_constr);
+static inline uint64_t CResult_PositiveTimestampCreationErrorZ_clone_ptr(LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR arg) {
+ LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ");
+ *ret_conv = CResult_PositiveTimestampCreationErrorZ_clone(arg);
+ return tag_ptr(ret_conv, true);
+}
+int64_t __attribute__((export_name("TS_CResult_PositiveTimestampCreationErrorZ_clone_ptr"))) TS_CResult_PositiveTimestampCreationErrorZ_clone_ptr(uint64_t arg) {
+ LDKCResult_PositiveTimestampCreationErrorZ* arg_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)untag_ptr(arg);
+ int64_t ret_conv = CResult_PositiveTimestampCreationErrorZ_clone_ptr(arg_conv);
+ return ret_conv;
}
-uint64_t __attribute__((export_name("TS_COption_NetAddressZ_some"))) TS_COption_NetAddressZ_some(uint64_t o) {
- void* o_ptr = untag_ptr(o);
- CHECK_ACCESS(o_ptr);
- LDKNetAddress o_conv = *(LDKNetAddress*)(o_ptr);
- o_conv = NetAddress_clone((LDKNetAddress*)untag_ptr(o));
- LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ");
- *ret_copy = COption_NetAddressZ_some(o_conv);
- uint64_t ret_ref = tag_ptr(ret_copy, true);
- return ret_ref;
+uint64_t __attribute__((export_name("TS_CResult_PositiveTimestampCreationErrorZ_clone"))) TS_CResult_PositiveTimestampCreationErrorZ_clone(uint64_t orig) {
+ LDKCResult_PositiveTimestampCreationErrorZ* orig_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)untag_ptr(orig);
+ LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ");
+ *ret_conv = CResult_PositiveTimestampCreationErrorZ_clone(orig_conv);
+ return tag_ptr(ret_conv, true);
}
-uint64_t __attribute__((export_name("TS_COption_NetAddressZ_none"))) TS_COption_NetAddressZ_none() {
- LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ");
- *ret_copy = COption_NetAddressZ_none();
- uint64_t ret_ref = tag_ptr(ret_copy, true);
- return ret_ref;
+uint64_t __attribute__((export_name("TS_CResult_NoneSemanticErrorZ_ok"))) TS_CResult_NoneSemanticErrorZ_ok() {
+ LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ");
+ *ret_conv = CResult_NoneSemanticErrorZ_ok();
+ return tag_ptr(ret_conv, true);
}
-void __attribute__((export_name("TS_COption_NetAddressZ_free"))) TS_COption_NetAddressZ_free(uint64_t _res) {
+uint64_t __attribute__((export_name("TS_CResult_NoneSemanticErrorZ_err"))) TS_CResult_NoneSemanticErrorZ_err(uint32_t e) {
+ LDKSemanticError e_conv = LDKSemanticError_from_js(e);
+ LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ");
+ *ret_conv = CResult_NoneSemanticErrorZ_err(e_conv);
+ return tag_ptr(ret_conv, true);
+}
+
+jboolean __attribute__((export_name("TS_CResult_NoneSemanticErrorZ_is_ok"))) TS_CResult_NoneSemanticErrorZ_is_ok(uint64_t o) {
+ LDKCResult_NoneSemanticErrorZ* o_conv = (LDKCResult_NoneSemanticErrorZ*)untag_ptr(o);
+ jboolean ret_conv = CResult_NoneSemanticErrorZ_is_ok(o_conv);
+ return ret_conv;
+}
+
+void __attribute__((export_name("TS_CResult_NoneSemanticErrorZ_free"))) TS_CResult_NoneSemanticErrorZ_free(uint64_t _res) {
if (!ptr_is_owned(_res)) return;
void* _res_ptr = untag_ptr(_res);
CHECK_ACCESS(_res_ptr);
- LDKCOption_NetAddressZ _res_conv = *(LDKCOption_NetAddressZ*)(_res_ptr);
+ LDKCResult_NoneSemanticErrorZ _res_conv = *(LDKCResult_NoneSemanticErrorZ*)(_res_ptr);
FREE(untag_ptr(_res));
- COption_NetAddressZ_free(_res_conv);
+ CResult_NoneSemanticErrorZ_free(_res_conv);
}
-static inline uint64_t COption_NetAddressZ_clone_ptr(LDKCOption_NetAddressZ *NONNULL_PTR arg) {
- LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ");
- *ret_copy = COption_NetAddressZ_clone(arg);
- uint64_t ret_ref = tag_ptr(ret_copy, true);
- return ret_ref;
+static inline uint64_t CResult_NoneSemanticErrorZ_clone_ptr(LDKCResult_NoneSemanticErrorZ *NONNULL_PTR arg) {
+ LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ");
+ *ret_conv = CResult_NoneSemanticErrorZ_clone(arg);
+ return tag_ptr(ret_conv, true);
}
-int64_t __attribute__((export_name("TS_COption_NetAddressZ_clone_ptr"))) TS_COption_NetAddressZ_clone_ptr(uint64_t arg) {
- LDKCOption_NetAddressZ* arg_conv = (LDKCOption_NetAddressZ*)untag_ptr(arg);
- int64_t ret_conv = COption_NetAddressZ_clone_ptr(arg_conv);
+int64_t __attribute__((export_name("TS_CResult_NoneSemanticErrorZ_clone_ptr"))) TS_CResult_NoneSemanticErrorZ_clone_ptr(uint64_t arg) {
+ LDKCResult_NoneSemanticErrorZ* arg_conv = (LDKCResult_NoneSemanticErrorZ*)untag_ptr(arg);
+ int64_t ret_conv = CResult_NoneSemanticErrorZ_clone_ptr(arg_conv);
return ret_conv;
}
-uint64_t __attribute__((export_name("TS_COption_NetAddressZ_clone"))) TS_COption_NetAddressZ_clone(uint64_t orig) {
- LDKCOption_NetAddressZ* orig_conv = (LDKCOption_NetAddressZ*)untag_ptr(orig);
- LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ");
- *ret_copy = COption_NetAddressZ_clone(orig_conv);
- uint64_t ret_ref = tag_ptr(ret_copy, true);
- return ret_ref;
+uint64_t __attribute__((export_name("TS_CResult_NoneSemanticErrorZ_clone"))) TS_CResult_NoneSemanticErrorZ_clone(uint64_t orig) {
+ LDKCResult_NoneSemanticErrorZ* orig_conv = (LDKCResult_NoneSemanticErrorZ*)untag_ptr(orig);
+ LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ");
+ *ret_conv = CResult_NoneSemanticErrorZ_clone(orig_conv);
+ return tag_ptr(ret_conv, true);
}
-uint64_t __attribute__((export_name("TS_CResult_CVec_u8ZPeerHandleErrorZ_ok"))) TS_CResult_CVec_u8ZPeerHandleErrorZ_ok(int8_tArray o) {
- LDKCVec_u8Z o_ref;
- o_ref.datalen = o->arr_len;
- o_ref.data = MALLOC(o_ref.datalen, "LDKCVec_u8Z Bytes");
- memcpy(o_ref.data, o->elems, o_ref.datalen); FREE(o);
- LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
- *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_ok(o_ref);
+uint64_t __attribute__((export_name("TS_CResult_InvoiceSemanticErrorZ_ok"))) TS_CResult_InvoiceSemanticErrorZ_ok(uint64_t o) {
+ LDKInvoice o_conv;
+ o_conv.inner = untag_ptr(o);
+ o_conv.is_owned = ptr_is_owned(o);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
+ o_conv = Invoice_clone(&o_conv);
+ LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ");
+ *ret_conv = CResult_InvoiceSemanticErrorZ_ok(o_conv);
return tag_ptr(ret_conv, true);
}
-uint64_t __attribute__((export_name("TS_CResult_CVec_u8ZPeerHandleErrorZ_err"))) TS_CResult_CVec_u8ZPeerHandleErrorZ_err(uint64_t e) {
- LDKPeerHandleError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = PeerHandleError_clone(&e_conv);
- LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
- *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_err(e_conv);
+uint64_t __attribute__((export_name("TS_CResult_InvoiceSemanticErrorZ_err"))) TS_CResult_InvoiceSemanticErrorZ_err(uint32_t e) {
+ LDKSemanticError e_conv = LDKSemanticError_from_js(e);
+ LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ");
+ *ret_conv = CResult_InvoiceSemanticErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
-jboolean __attribute__((export_name("TS_CResult_CVec_u8ZPeerHandleErrorZ_is_ok"))) TS_CResult_CVec_u8ZPeerHandleErrorZ_is_ok(uint64_t o) {
- LDKCResult_CVec_u8ZPeerHandleErrorZ* o_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)untag_ptr(o);
- jboolean ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_is_ok(o_conv);
+jboolean __attribute__((export_name("TS_CResult_InvoiceSemanticErrorZ_is_ok"))) TS_CResult_InvoiceSemanticErrorZ_is_ok(uint64_t o) {
+ LDKCResult_InvoiceSemanticErrorZ* o_conv = (LDKCResult_InvoiceSemanticErrorZ*)untag_ptr(o);
+ jboolean ret_conv = CResult_InvoiceSemanticErrorZ_is_ok(o_conv);
return ret_conv;
}
-void __attribute__((export_name("TS_CResult_CVec_u8ZPeerHandleErrorZ_free"))) TS_CResult_CVec_u8ZPeerHandleErrorZ_free(uint64_t _res) {
+void __attribute__((export_name("TS_CResult_InvoiceSemanticErrorZ_free"))) TS_CResult_InvoiceSemanticErrorZ_free(uint64_t _res) {
if (!ptr_is_owned(_res)) return;
void* _res_ptr = untag_ptr(_res);
CHECK_ACCESS(_res_ptr);
- LDKCResult_CVec_u8ZPeerHandleErrorZ _res_conv = *(LDKCResult_CVec_u8ZPeerHandleErrorZ*)(_res_ptr);
+ LDKCResult_InvoiceSemanticErrorZ _res_conv = *(LDKCResult_InvoiceSemanticErrorZ*)(_res_ptr);
FREE(untag_ptr(_res));
- CResult_CVec_u8ZPeerHandleErrorZ_free(_res_conv);
+ CResult_InvoiceSemanticErrorZ_free(_res_conv);
}
-static inline uint64_t CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr(LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR arg) {
- LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
- *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_clone(arg);
+static inline uint64_t CResult_InvoiceSemanticErrorZ_clone_ptr(LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR arg) {
+ LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ");
+ *ret_conv = CResult_InvoiceSemanticErrorZ_clone(arg);
return tag_ptr(ret_conv, true);
}
-int64_t __attribute__((export_name("TS_CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr"))) TS_CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr(uint64_t arg) {
- LDKCResult_CVec_u8ZPeerHandleErrorZ* arg_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)untag_ptr(arg);
- int64_t ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr(arg_conv);
+int64_t __attribute__((export_name("TS_CResult_InvoiceSemanticErrorZ_clone_ptr"))) TS_CResult_InvoiceSemanticErrorZ_clone_ptr(uint64_t arg) {
+ LDKCResult_InvoiceSemanticErrorZ* arg_conv = (LDKCResult_InvoiceSemanticErrorZ*)untag_ptr(arg);
+ int64_t ret_conv = CResult_InvoiceSemanticErrorZ_clone_ptr(arg_conv);
return ret_conv;
}
-uint64_t __attribute__((export_name("TS_CResult_CVec_u8ZPeerHandleErrorZ_clone"))) TS_CResult_CVec_u8ZPeerHandleErrorZ_clone(uint64_t orig) {
- LDKCResult_CVec_u8ZPeerHandleErrorZ* orig_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)untag_ptr(orig);
- LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
- *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_clone(orig_conv);
+uint64_t __attribute__((export_name("TS_CResult_InvoiceSemanticErrorZ_clone"))) TS_CResult_InvoiceSemanticErrorZ_clone(uint64_t orig) {
+ LDKCResult_InvoiceSemanticErrorZ* orig_conv = (LDKCResult_InvoiceSemanticErrorZ*)untag_ptr(orig);
+ LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ");
+ *ret_conv = CResult_InvoiceSemanticErrorZ_clone(orig_conv);
return tag_ptr(ret_conv, true);
}
-uint64_t __attribute__((export_name("TS_CResult_NonePeerHandleErrorZ_ok"))) TS_CResult_NonePeerHandleErrorZ_ok() {
- LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
- *ret_conv = CResult_NonePeerHandleErrorZ_ok();
+uint64_t __attribute__((export_name("TS_CResult_DescriptionCreationErrorZ_ok"))) TS_CResult_DescriptionCreationErrorZ_ok(uint64_t o) {
+ LDKDescription o_conv;
+ o_conv.inner = untag_ptr(o);
+ o_conv.is_owned = ptr_is_owned(o);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
+ o_conv = Description_clone(&o_conv);
+ LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ");
+ *ret_conv = CResult_DescriptionCreationErrorZ_ok(o_conv);
return tag_ptr(ret_conv, true);
}
-uint64_t __attribute__((export_name("TS_CResult_NonePeerHandleErrorZ_err"))) TS_CResult_NonePeerHandleErrorZ_err(uint64_t e) {
- LDKPeerHandleError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = PeerHandleError_clone(&e_conv);
- LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
- *ret_conv = CResult_NonePeerHandleErrorZ_err(e_conv);
+uint64_t __attribute__((export_name("TS_CResult_DescriptionCreationErrorZ_err"))) TS_CResult_DescriptionCreationErrorZ_err(uint32_t e) {
+ LDKCreationError e_conv = LDKCreationError_from_js(e);
+ LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ");
+ *ret_conv = CResult_DescriptionCreationErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
-jboolean __attribute__((export_name("TS_CResult_NonePeerHandleErrorZ_is_ok"))) TS_CResult_NonePeerHandleErrorZ_is_ok(uint64_t o) {
- LDKCResult_NonePeerHandleErrorZ* o_conv = (LDKCResult_NonePeerHandleErrorZ*)untag_ptr(o);
- jboolean ret_conv = CResult_NonePeerHandleErrorZ_is_ok(o_conv);
+jboolean __attribute__((export_name("TS_CResult_DescriptionCreationErrorZ_is_ok"))) TS_CResult_DescriptionCreationErrorZ_is_ok(uint64_t o) {
+ LDKCResult_DescriptionCreationErrorZ* o_conv = (LDKCResult_DescriptionCreationErrorZ*)untag_ptr(o);
+ jboolean ret_conv = CResult_DescriptionCreationErrorZ_is_ok(o_conv);
return ret_conv;
}
-void __attribute__((export_name("TS_CResult_NonePeerHandleErrorZ_free"))) TS_CResult_NonePeerHandleErrorZ_free(uint64_t _res) {
+void __attribute__((export_name("TS_CResult_DescriptionCreationErrorZ_free"))) TS_CResult_DescriptionCreationErrorZ_free(uint64_t _res) {
if (!ptr_is_owned(_res)) return;
void* _res_ptr = untag_ptr(_res);
CHECK_ACCESS(_res_ptr);
- LDKCResult_NonePeerHandleErrorZ _res_conv = *(LDKCResult_NonePeerHandleErrorZ*)(_res_ptr);
+ LDKCResult_DescriptionCreationErrorZ _res_conv = *(LDKCResult_DescriptionCreationErrorZ*)(_res_ptr);
FREE(untag_ptr(_res));
- CResult_NonePeerHandleErrorZ_free(_res_conv);
+ CResult_DescriptionCreationErrorZ_free(_res_conv);
}
-static inline uint64_t CResult_NonePeerHandleErrorZ_clone_ptr(LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR arg) {
- LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
- *ret_conv = CResult_NonePeerHandleErrorZ_clone(arg);
+static inline uint64_t CResult_DescriptionCreationErrorZ_clone_ptr(LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR arg) {
+ LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ");
+ *ret_conv = CResult_DescriptionCreationErrorZ_clone(arg);
return tag_ptr(ret_conv, true);
}
-int64_t __attribute__((export_name("TS_CResult_NonePeerHandleErrorZ_clone_ptr"))) TS_CResult_NonePeerHandleErrorZ_clone_ptr(uint64_t arg) {
- LDKCResult_NonePeerHandleErrorZ* arg_conv = (LDKCResult_NonePeerHandleErrorZ*)untag_ptr(arg);
- int64_t ret_conv = CResult_NonePeerHandleErrorZ_clone_ptr(arg_conv);
+int64_t __attribute__((export_name("TS_CResult_DescriptionCreationErrorZ_clone_ptr"))) TS_CResult_DescriptionCreationErrorZ_clone_ptr(uint64_t arg) {
+ LDKCResult_DescriptionCreationErrorZ* arg_conv = (LDKCResult_DescriptionCreationErrorZ*)untag_ptr(arg);
+ int64_t ret_conv = CResult_DescriptionCreationErrorZ_clone_ptr(arg_conv);
return ret_conv;
}
-uint64_t __attribute__((export_name("TS_CResult_NonePeerHandleErrorZ_clone"))) TS_CResult_NonePeerHandleErrorZ_clone(uint64_t orig) {
- LDKCResult_NonePeerHandleErrorZ* orig_conv = (LDKCResult_NonePeerHandleErrorZ*)untag_ptr(orig);
- LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
- *ret_conv = CResult_NonePeerHandleErrorZ_clone(orig_conv);
+uint64_t __attribute__((export_name("TS_CResult_DescriptionCreationErrorZ_clone"))) TS_CResult_DescriptionCreationErrorZ_clone(uint64_t orig) {
+ LDKCResult_DescriptionCreationErrorZ* orig_conv = (LDKCResult_DescriptionCreationErrorZ*)untag_ptr(orig);
+ LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ");
+ *ret_conv = CResult_DescriptionCreationErrorZ_clone(orig_conv);
return tag_ptr(ret_conv, true);
}
-uint64_t __attribute__((export_name("TS_CResult_boolPeerHandleErrorZ_ok"))) TS_CResult_boolPeerHandleErrorZ_ok(jboolean o) {
- LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
- *ret_conv = CResult_boolPeerHandleErrorZ_ok(o);
+uint64_t __attribute__((export_name("TS_CResult_PrivateRouteCreationErrorZ_ok"))) TS_CResult_PrivateRouteCreationErrorZ_ok(uint64_t o) {
+ LDKPrivateRoute o_conv;
+ o_conv.inner = untag_ptr(o);
+ o_conv.is_owned = ptr_is_owned(o);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
+ o_conv = PrivateRoute_clone(&o_conv);
+ LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ");
+ *ret_conv = CResult_PrivateRouteCreationErrorZ_ok(o_conv);
return tag_ptr(ret_conv, true);
}
-uint64_t __attribute__((export_name("TS_CResult_boolPeerHandleErrorZ_err"))) TS_CResult_boolPeerHandleErrorZ_err(uint64_t e) {
- LDKPeerHandleError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = PeerHandleError_clone(&e_conv);
- LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
- *ret_conv = CResult_boolPeerHandleErrorZ_err(e_conv);
+uint64_t __attribute__((export_name("TS_CResult_PrivateRouteCreationErrorZ_err"))) TS_CResult_PrivateRouteCreationErrorZ_err(uint32_t e) {
+ LDKCreationError e_conv = LDKCreationError_from_js(e);
+ LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ");
+ *ret_conv = CResult_PrivateRouteCreationErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
-jboolean __attribute__((export_name("TS_CResult_boolPeerHandleErrorZ_is_ok"))) TS_CResult_boolPeerHandleErrorZ_is_ok(uint64_t o) {
- LDKCResult_boolPeerHandleErrorZ* o_conv = (LDKCResult_boolPeerHandleErrorZ*)untag_ptr(o);
- jboolean ret_conv = CResult_boolPeerHandleErrorZ_is_ok(o_conv);
+jboolean __attribute__((export_name("TS_CResult_PrivateRouteCreationErrorZ_is_ok"))) TS_CResult_PrivateRouteCreationErrorZ_is_ok(uint64_t o) {
+ LDKCResult_PrivateRouteCreationErrorZ* o_conv = (LDKCResult_PrivateRouteCreationErrorZ*)untag_ptr(o);
+ jboolean ret_conv = CResult_PrivateRouteCreationErrorZ_is_ok(o_conv);
return ret_conv;
}
-void __attribute__((export_name("TS_CResult_boolPeerHandleErrorZ_free"))) TS_CResult_boolPeerHandleErrorZ_free(uint64_t _res) {
+void __attribute__((export_name("TS_CResult_PrivateRouteCreationErrorZ_free"))) TS_CResult_PrivateRouteCreationErrorZ_free(uint64_t _res) {
if (!ptr_is_owned(_res)) return;
void* _res_ptr = untag_ptr(_res);
CHECK_ACCESS(_res_ptr);
- LDKCResult_boolPeerHandleErrorZ _res_conv = *(LDKCResult_boolPeerHandleErrorZ*)(_res_ptr);
+ LDKCResult_PrivateRouteCreationErrorZ _res_conv = *(LDKCResult_PrivateRouteCreationErrorZ*)(_res_ptr);
FREE(untag_ptr(_res));
- CResult_boolPeerHandleErrorZ_free(_res_conv);
+ CResult_PrivateRouteCreationErrorZ_free(_res_conv);
}
-static inline uint64_t CResult_boolPeerHandleErrorZ_clone_ptr(LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR arg) {
- LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
- *ret_conv = CResult_boolPeerHandleErrorZ_clone(arg);
+static inline uint64_t CResult_PrivateRouteCreationErrorZ_clone_ptr(LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR arg) {
+ LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ");
+ *ret_conv = CResult_PrivateRouteCreationErrorZ_clone(arg);
return tag_ptr(ret_conv, true);
}
-int64_t __attribute__((export_name("TS_CResult_boolPeerHandleErrorZ_clone_ptr"))) TS_CResult_boolPeerHandleErrorZ_clone_ptr(uint64_t arg) {
- LDKCResult_boolPeerHandleErrorZ* arg_conv = (LDKCResult_boolPeerHandleErrorZ*)untag_ptr(arg);
- int64_t ret_conv = CResult_boolPeerHandleErrorZ_clone_ptr(arg_conv);
+int64_t __attribute__((export_name("TS_CResult_PrivateRouteCreationErrorZ_clone_ptr"))) TS_CResult_PrivateRouteCreationErrorZ_clone_ptr(uint64_t arg) {
+ LDKCResult_PrivateRouteCreationErrorZ* arg_conv = (LDKCResult_PrivateRouteCreationErrorZ*)untag_ptr(arg);
+ int64_t ret_conv = CResult_PrivateRouteCreationErrorZ_clone_ptr(arg_conv);
return ret_conv;
}
-uint64_t __attribute__((export_name("TS_CResult_boolPeerHandleErrorZ_clone"))) TS_CResult_boolPeerHandleErrorZ_clone(uint64_t orig) {
- LDKCResult_boolPeerHandleErrorZ* orig_conv = (LDKCResult_boolPeerHandleErrorZ*)untag_ptr(orig);
- LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
- *ret_conv = CResult_boolPeerHandleErrorZ_clone(orig_conv);
+uint64_t __attribute__((export_name("TS_CResult_PrivateRouteCreationErrorZ_clone"))) TS_CResult_PrivateRouteCreationErrorZ_clone(uint64_t orig) {
+ LDKCResult_PrivateRouteCreationErrorZ* orig_conv = (LDKCResult_PrivateRouteCreationErrorZ*)untag_ptr(orig);
+ LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ");
+ *ret_conv = CResult_PrivateRouteCreationErrorZ_clone(orig_conv);
return tag_ptr(ret_conv, true);
}
}
uint64_t __attribute__((export_name("TS_CResult_NetAddressDecodeErrorZ_err"))) TS_CResult_NetAddressDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ");
*ret_conv = CResult_NetAddressDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
uint64_t __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_err"))) TS_CResult_AcceptChannelDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ");
*ret_conv = CResult_AcceptChannelDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
uint64_t __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErrorZ_err"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ");
*ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
uint64_t __attribute__((export_name("TS_CResult_ChannelReestablishDecodeErrorZ_err"))) TS_CResult_ChannelReestablishDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ");
*ret_conv = CResult_ChannelReestablishDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
uint64_t __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_err"))) TS_CResult_ClosingSignedDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ");
*ret_conv = CResult_ClosingSignedDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
uint64_t __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_err"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ");
*ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
uint64_t __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_err"))) TS_CResult_CommitmentSignedDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ");
*ret_conv = CResult_CommitmentSignedDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
uint64_t __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_err"))) TS_CResult_FundingCreatedDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ");
*ret_conv = CResult_FundingCreatedDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
uint64_t __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_err"))) TS_CResult_FundingSignedDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ");
*ret_conv = CResult_FundingSignedDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
uint64_t __attribute__((export_name("TS_CResult_ChannelReadyDecodeErrorZ_err"))) TS_CResult_ChannelReadyDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_ChannelReadyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReadyDecodeErrorZ), "LDKCResult_ChannelReadyDecodeErrorZ");
*ret_conv = CResult_ChannelReadyDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
uint64_t __attribute__((export_name("TS_CResult_InitDecodeErrorZ_err"))) TS_CResult_InitDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ");
*ret_conv = CResult_InitDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
uint64_t __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_err"))) TS_CResult_OpenChannelDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ");
*ret_conv = CResult_OpenChannelDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
uint64_t __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_err"))) TS_CResult_RevokeAndACKDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ");
*ret_conv = CResult_RevokeAndACKDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
uint64_t __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_err"))) TS_CResult_ShutdownDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ");
*ret_conv = CResult_ShutdownDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
uint64_t __attribute__((export_name("TS_CResult_UpdateFailHTLCDecodeErrorZ_err"))) TS_CResult_UpdateFailHTLCDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ");
*ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
uint64_t __attribute__((export_name("TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_err"))) TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ");
*ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
uint64_t __attribute__((export_name("TS_CResult_UpdateFeeDecodeErrorZ_err"))) TS_CResult_UpdateFeeDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ");
*ret_conv = CResult_UpdateFeeDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
uint64_t __attribute__((export_name("TS_CResult_UpdateFulfillHTLCDecodeErrorZ_err"))) TS_CResult_UpdateFulfillHTLCDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ");
*ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
uint64_t __attribute__((export_name("TS_CResult_UpdateAddHTLCDecodeErrorZ_err"))) TS_CResult_UpdateAddHTLCDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ");
*ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
return tag_ptr(ret_conv, true);
}
+uint64_t __attribute__((export_name("TS_CResult_OnionMessageDecodeErrorZ_ok"))) TS_CResult_OnionMessageDecodeErrorZ_ok(uint64_t o) {
+ LDKOnionMessage o_conv;
+ o_conv.inner = untag_ptr(o);
+ o_conv.is_owned = ptr_is_owned(o);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
+ o_conv = OnionMessage_clone(&o_conv);
+ LDKCResult_OnionMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OnionMessageDecodeErrorZ), "LDKCResult_OnionMessageDecodeErrorZ");
+ *ret_conv = CResult_OnionMessageDecodeErrorZ_ok(o_conv);
+ return tag_ptr(ret_conv, true);
+}
+
+uint64_t __attribute__((export_name("TS_CResult_OnionMessageDecodeErrorZ_err"))) TS_CResult_OnionMessageDecodeErrorZ_err(uint64_t e) {
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
+ LDKCResult_OnionMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OnionMessageDecodeErrorZ), "LDKCResult_OnionMessageDecodeErrorZ");
+ *ret_conv = CResult_OnionMessageDecodeErrorZ_err(e_conv);
+ return tag_ptr(ret_conv, true);
+}
+
+jboolean __attribute__((export_name("TS_CResult_OnionMessageDecodeErrorZ_is_ok"))) TS_CResult_OnionMessageDecodeErrorZ_is_ok(uint64_t o) {
+ LDKCResult_OnionMessageDecodeErrorZ* o_conv = (LDKCResult_OnionMessageDecodeErrorZ*)untag_ptr(o);
+ jboolean ret_conv = CResult_OnionMessageDecodeErrorZ_is_ok(o_conv);
+ return ret_conv;
+}
+
+void __attribute__((export_name("TS_CResult_OnionMessageDecodeErrorZ_free"))) TS_CResult_OnionMessageDecodeErrorZ_free(uint64_t _res) {
+ if (!ptr_is_owned(_res)) return;
+ void* _res_ptr = untag_ptr(_res);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_OnionMessageDecodeErrorZ _res_conv = *(LDKCResult_OnionMessageDecodeErrorZ*)(_res_ptr);
+ FREE(untag_ptr(_res));
+ CResult_OnionMessageDecodeErrorZ_free(_res_conv);
+}
+
+static inline uint64_t CResult_OnionMessageDecodeErrorZ_clone_ptr(LDKCResult_OnionMessageDecodeErrorZ *NONNULL_PTR arg) {
+ LDKCResult_OnionMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OnionMessageDecodeErrorZ), "LDKCResult_OnionMessageDecodeErrorZ");
+ *ret_conv = CResult_OnionMessageDecodeErrorZ_clone(arg);
+ return tag_ptr(ret_conv, true);
+}
+int64_t __attribute__((export_name("TS_CResult_OnionMessageDecodeErrorZ_clone_ptr"))) TS_CResult_OnionMessageDecodeErrorZ_clone_ptr(uint64_t arg) {
+ LDKCResult_OnionMessageDecodeErrorZ* arg_conv = (LDKCResult_OnionMessageDecodeErrorZ*)untag_ptr(arg);
+ int64_t ret_conv = CResult_OnionMessageDecodeErrorZ_clone_ptr(arg_conv);
+ return ret_conv;
+}
+
+uint64_t __attribute__((export_name("TS_CResult_OnionMessageDecodeErrorZ_clone"))) TS_CResult_OnionMessageDecodeErrorZ_clone(uint64_t orig) {
+ LDKCResult_OnionMessageDecodeErrorZ* orig_conv = (LDKCResult_OnionMessageDecodeErrorZ*)untag_ptr(orig);
+ LDKCResult_OnionMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OnionMessageDecodeErrorZ), "LDKCResult_OnionMessageDecodeErrorZ");
+ *ret_conv = CResult_OnionMessageDecodeErrorZ_clone(orig_conv);
+ return tag_ptr(ret_conv, true);
+}
+
uint64_t __attribute__((export_name("TS_CResult_PingDecodeErrorZ_ok"))) TS_CResult_PingDecodeErrorZ_ok(uint64_t o) {
LDKPing o_conv;
o_conv.inner = untag_ptr(o);
}
uint64_t __attribute__((export_name("TS_CResult_PingDecodeErrorZ_err"))) TS_CResult_PingDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ");
*ret_conv = CResult_PingDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
uint64_t __attribute__((export_name("TS_CResult_PongDecodeErrorZ_err"))) TS_CResult_PongDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ");
*ret_conv = CResult_PongDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
uint64_t __attribute__((export_name("TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_err"))) TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ");
*ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
uint64_t __attribute__((export_name("TS_CResult_ChannelAnnouncementDecodeErrorZ_err"))) TS_CResult_ChannelAnnouncementDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ");
*ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
uint64_t __attribute__((export_name("TS_CResult_UnsignedChannelUpdateDecodeErrorZ_err"))) TS_CResult_UnsignedChannelUpdateDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ");
*ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
uint64_t __attribute__((export_name("TS_CResult_ChannelUpdateDecodeErrorZ_err"))) TS_CResult_ChannelUpdateDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ");
*ret_conv = CResult_ChannelUpdateDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
uint64_t __attribute__((export_name("TS_CResult_ErrorMessageDecodeErrorZ_err"))) TS_CResult_ErrorMessageDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ");
*ret_conv = CResult_ErrorMessageDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
uint64_t __attribute__((export_name("TS_CResult_WarningMessageDecodeErrorZ_err"))) TS_CResult_WarningMessageDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_WarningMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WarningMessageDecodeErrorZ), "LDKCResult_WarningMessageDecodeErrorZ");
*ret_conv = CResult_WarningMessageDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
uint64_t __attribute__((export_name("TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_err"))) TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ");
*ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
uint64_t __attribute__((export_name("TS_CResult_NodeAnnouncementDecodeErrorZ_err"))) TS_CResult_NodeAnnouncementDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ");
*ret_conv = CResult_NodeAnnouncementDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
uint64_t __attribute__((export_name("TS_CResult_QueryShortChannelIdsDecodeErrorZ_err"))) TS_CResult_QueryShortChannelIdsDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ");
*ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
uint64_t __attribute__((export_name("TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_err"))) TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ");
*ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
uint64_t __attribute__((export_name("TS_CResult_QueryChannelRangeDecodeErrorZ_err"))) TS_CResult_QueryChannelRangeDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ");
*ret_conv = CResult_QueryChannelRangeDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
uint64_t __attribute__((export_name("TS_CResult_ReplyChannelRangeDecodeErrorZ_err"))) TS_CResult_ReplyChannelRangeDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ");
*ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
uint64_t __attribute__((export_name("TS_CResult_GossipTimestampFilterDecodeErrorZ_err"))) TS_CResult_GossipTimestampFilterDecodeErrorZ_err(uint64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ");
*ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
return tag_ptr(ret_conv, true);
}
+void __attribute__((export_name("TS_CVec_PhantomRouteHintsZ_free"))) TS_CVec_PhantomRouteHintsZ_free(uint64_tArray _res) {
+ LDKCVec_PhantomRouteHintsZ _res_constr;
+ _res_constr.datalen = _res->arr_len;
+ if (_res_constr.datalen > 0)
+ _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKPhantomRouteHints), "LDKCVec_PhantomRouteHintsZ Elements");
+ else
+ _res_constr.data = NULL;
+ uint64_t* _res_vals = _res->elems;
+ for (size_t t = 0; t < _res_constr.datalen; t++) {
+ uint64_t _res_conv_19 = _res_vals[t];
+ LDKPhantomRouteHints _res_conv_19_conv;
+ _res_conv_19_conv.inner = untag_ptr(_res_conv_19);
+ _res_conv_19_conv.is_owned = ptr_is_owned(_res_conv_19);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_19_conv);
+ _res_constr.data[t] = _res_conv_19_conv;
+ }
+ FREE(_res);
+ CVec_PhantomRouteHintsZ_free(_res_constr);
+}
+
uint64_t __attribute__((export_name("TS_CResult_InvoiceSignOrCreationErrorZ_ok"))) TS_CResult_InvoiceSignOrCreationErrorZ_ok(uint64_t o) {
LDKInvoice o_conv;
o_conv.inner = untag_ptr(o);
CVec_OutPointZ_free(_res_constr);
}
+void __attribute__((export_name("TS_CVec_MonitorUpdateIdZ_free"))) TS_CVec_MonitorUpdateIdZ_free(uint64_tArray _res) {
+ LDKCVec_MonitorUpdateIdZ _res_constr;
+ _res_constr.datalen = _res->arr_len;
+ if (_res_constr.datalen > 0)
+ _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKMonitorUpdateId), "LDKCVec_MonitorUpdateIdZ Elements");
+ else
+ _res_constr.data = NULL;
+ uint64_t* _res_vals = _res->elems;
+ for (size_t r = 0; r < _res_constr.datalen; r++) {
+ uint64_t _res_conv_17 = _res_vals[r];
+ LDKMonitorUpdateId _res_conv_17_conv;
+ _res_conv_17_conv.inner = untag_ptr(_res_conv_17);
+ _res_conv_17_conv.is_owned = ptr_is_owned(_res_conv_17);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_17_conv);
+ _res_constr.data[r] = _res_conv_17_conv;
+ }
+ FREE(_res);
+ CVec_MonitorUpdateIdZ_free(_res_constr);
+}
+
+static inline uint64_t C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone_ptr(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *NONNULL_PTR arg) {
+ LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ), "LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ");
+ *ret_conv = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone(arg);
+ return tag_ptr(ret_conv, true);
+}
+int64_t __attribute__((export_name("TS_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone_ptr"))) TS_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone_ptr(uint64_t arg) {
+ LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* arg_conv = (LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ*)untag_ptr(arg);
+ int64_t ret_conv = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone_ptr(arg_conv);
+ return ret_conv;
+}
+
+uint64_t __attribute__((export_name("TS_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone"))) TS_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone(uint64_t orig) {
+ LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* orig_conv = (LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ*)untag_ptr(orig);
+ LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ), "LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ");
+ *ret_conv = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone(orig_conv);
+ return tag_ptr(ret_conv, true);
+}
+
+uint64_t __attribute__((export_name("TS_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_new"))) TS_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_new(uint64_t a, uint64_tArray b) {
+ LDKOutPoint a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv = OutPoint_clone(&a_conv);
+ LDKCVec_MonitorUpdateIdZ b_constr;
+ b_constr.datalen = b->arr_len;
+ if (b_constr.datalen > 0)
+ b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKMonitorUpdateId), "LDKCVec_MonitorUpdateIdZ Elements");
+ else
+ b_constr.data = NULL;
+ uint64_t* b_vals = b->elems;
+ for (size_t r = 0; r < b_constr.datalen; r++) {
+ uint64_t b_conv_17 = b_vals[r];
+ LDKMonitorUpdateId b_conv_17_conv;
+ b_conv_17_conv.inner = untag_ptr(b_conv_17);
+ b_conv_17_conv.is_owned = ptr_is_owned(b_conv_17);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv_17_conv);
+ b_conv_17_conv = MonitorUpdateId_clone(&b_conv_17_conv);
+ b_constr.data[r] = b_conv_17_conv;
+ }
+ FREE(b);
+ LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ), "LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ");
+ *ret_conv = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_new(a_conv, b_constr);
+ return tag_ptr(ret_conv, true);
+}
+
+void __attribute__((export_name("TS_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_free"))) TS_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_free(uint64_t _res) {
+ if (!ptr_is_owned(_res)) return;
+ void* _res_ptr = untag_ptr(_res);
+ CHECK_ACCESS(_res_ptr);
+ LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ _res_conv = *(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ*)(_res_ptr);
+ FREE(untag_ptr(_res));
+ C2Tuple_OutPointCVec_MonitorUpdateIdZZ_free(_res_conv);
+}
+
+void __attribute__((export_name("TS_CVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ_free"))) TS_CVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ_free(uint64_tArray _res) {
+ LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ _res_constr;
+ _res_constr.datalen = _res->arr_len;
+ if (_res_constr.datalen > 0)
+ _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ), "LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ Elements");
+ else
+ _res_constr.data = NULL;
+ uint64_t* _res_vals = _res->elems;
+ for (size_t p = 0; p < _res_constr.datalen; p++) {
+ uint64_t _res_conv_41 = _res_vals[p];
+ void* _res_conv_41_ptr = untag_ptr(_res_conv_41);
+ CHECK_ACCESS(_res_conv_41_ptr);
+ LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ _res_conv_41_conv = *(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ*)(_res_conv_41_ptr);
+ FREE(untag_ptr(_res_conv_41));
+ _res_constr.data[p] = _res_conv_41_conv;
+ }
+ FREE(_res);
+ CVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ_free(_res_constr);
+}
+
void __attribute__((export_name("TS_PaymentPurpose_free"))) TS_PaymentPurpose_free(uint64_t this_ptr) {
if (!ptr_is_owned(this_ptr)) return;
void* this_ptr_ptr = untag_ptr(this_ptr);
return ret_ref;
}
+jboolean __attribute__((export_name("TS_PaymentPurpose_eq"))) TS_PaymentPurpose_eq(uint64_t a, uint64_t b) {
+ LDKPaymentPurpose* a_conv = (LDKPaymentPurpose*)untag_ptr(a);
+ LDKPaymentPurpose* b_conv = (LDKPaymentPurpose*)untag_ptr(b);
+ jboolean ret_conv = PaymentPurpose_eq(a_conv, b_conv);
+ return ret_conv;
+}
+
int8_tArray __attribute__((export_name("TS_PaymentPurpose_write"))) TS_PaymentPurpose_write(uint64_t obj) {
LDKPaymentPurpose* obj_conv = (LDKPaymentPurpose*)untag_ptr(obj);
LDKCVec_u8Z ret_var = PaymentPurpose_write(obj_conv);
return tag_ptr(ret_conv, true);
}
+void __attribute__((export_name("TS_PathFailure_free"))) TS_PathFailure_free(uint64_t this_ptr) {
+ if (!ptr_is_owned(this_ptr)) return;
+ void* this_ptr_ptr = untag_ptr(this_ptr);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKPathFailure this_ptr_conv = *(LDKPathFailure*)(this_ptr_ptr);
+ FREE(untag_ptr(this_ptr));
+ PathFailure_free(this_ptr_conv);
+}
+
+static inline uint64_t PathFailure_clone_ptr(LDKPathFailure *NONNULL_PTR arg) {
+ LDKPathFailure *ret_copy = MALLOC(sizeof(LDKPathFailure), "LDKPathFailure");
+ *ret_copy = PathFailure_clone(arg);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+int64_t __attribute__((export_name("TS_PathFailure_clone_ptr"))) TS_PathFailure_clone_ptr(uint64_t arg) {
+ LDKPathFailure* arg_conv = (LDKPathFailure*)untag_ptr(arg);
+ int64_t ret_conv = PathFailure_clone_ptr(arg_conv);
+ return ret_conv;
+}
+
+uint64_t __attribute__((export_name("TS_PathFailure_clone"))) TS_PathFailure_clone(uint64_t orig) {
+ LDKPathFailure* orig_conv = (LDKPathFailure*)untag_ptr(orig);
+ LDKPathFailure *ret_copy = MALLOC(sizeof(LDKPathFailure), "LDKPathFailure");
+ *ret_copy = PathFailure_clone(orig_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+uint64_t __attribute__((export_name("TS_PathFailure_initial_send"))) TS_PathFailure_initial_send(uint64_t err) {
+ void* err_ptr = untag_ptr(err);
+ CHECK_ACCESS(err_ptr);
+ LDKAPIError err_conv = *(LDKAPIError*)(err_ptr);
+ err_conv = APIError_clone((LDKAPIError*)untag_ptr(err));
+ LDKPathFailure *ret_copy = MALLOC(sizeof(LDKPathFailure), "LDKPathFailure");
+ *ret_copy = PathFailure_initial_send(err_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+uint64_t __attribute__((export_name("TS_PathFailure_on_path"))) TS_PathFailure_on_path(uint64_t network_update) {
+ void* network_update_ptr = untag_ptr(network_update);
+ CHECK_ACCESS(network_update_ptr);
+ LDKCOption_NetworkUpdateZ network_update_conv = *(LDKCOption_NetworkUpdateZ*)(network_update_ptr);
+ network_update_conv = COption_NetworkUpdateZ_clone((LDKCOption_NetworkUpdateZ*)untag_ptr(network_update));
+ LDKPathFailure *ret_copy = MALLOC(sizeof(LDKPathFailure), "LDKPathFailure");
+ *ret_copy = PathFailure_on_path(network_update_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+jboolean __attribute__((export_name("TS_PathFailure_eq"))) TS_PathFailure_eq(uint64_t a, uint64_t b) {
+ LDKPathFailure* a_conv = (LDKPathFailure*)untag_ptr(a);
+ LDKPathFailure* b_conv = (LDKPathFailure*)untag_ptr(b);
+ jboolean ret_conv = PathFailure_eq(a_conv, b_conv);
+ return ret_conv;
+}
+
+int8_tArray __attribute__((export_name("TS_PathFailure_write"))) TS_PathFailure_write(uint64_t obj) {
+ LDKPathFailure* obj_conv = (LDKPathFailure*)untag_ptr(obj);
+ LDKCVec_u8Z ret_var = PathFailure_write(obj_conv);
+ int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
+ memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
+}
+
+uint64_t __attribute__((export_name("TS_PathFailure_read"))) TS_PathFailure_read(int8_tArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.datalen = ser->arr_len;
+ ser_ref.data = ser->elems;
+ LDKCResult_COption_PathFailureZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_PathFailureZDecodeErrorZ), "LDKCResult_COption_PathFailureZDecodeErrorZ");
+ *ret_conv = PathFailure_read(ser_ref);
+ FREE(ser);
+ return tag_ptr(ret_conv, true);
+}
+
void __attribute__((export_name("TS_ClosureReason_free"))) TS_ClosureReason_free(uint64_t this_ptr) {
if (!ptr_is_owned(this_ptr)) return;
void* this_ptr_ptr = untag_ptr(this_ptr);
return ret_ref;
}
+jboolean __attribute__((export_name("TS_ClosureReason_eq"))) TS_ClosureReason_eq(uint64_t a, uint64_t b) {
+ LDKClosureReason* a_conv = (LDKClosureReason*)untag_ptr(a);
+ LDKClosureReason* b_conv = (LDKClosureReason*)untag_ptr(b);
+ jboolean ret_conv = ClosureReason_eq(a_conv, b_conv);
+ return ret_conv;
+}
+
int8_tArray __attribute__((export_name("TS_ClosureReason_write"))) TS_ClosureReason_write(uint64_t obj) {
LDKClosureReason* obj_conv = (LDKClosureReason*)untag_ptr(obj);
LDKCVec_u8Z ret_var = ClosureReason_write(obj_conv);
return ret_ref;
}
+uint64_t __attribute__((export_name("TS_HTLCDestination_invalid_forward"))) TS_HTLCDestination_invalid_forward(int64_t requested_forward_scid) {
+ LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination");
+ *ret_copy = HTLCDestination_invalid_forward(requested_forward_scid);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
uint64_t __attribute__((export_name("TS_HTLCDestination_failed_payment"))) TS_HTLCDestination_failed_payment(int8_tArray payment_hash) {
LDKThirtyTwoBytes payment_hash_ref;
CHECK(payment_hash->arr_len == 32);
return ret_ref;
}
+jboolean __attribute__((export_name("TS_HTLCDestination_eq"))) TS_HTLCDestination_eq(uint64_t a, uint64_t b) {
+ LDKHTLCDestination* a_conv = (LDKHTLCDestination*)untag_ptr(a);
+ LDKHTLCDestination* b_conv = (LDKHTLCDestination*)untag_ptr(b);
+ jboolean ret_conv = HTLCDestination_eq(a_conv, b_conv);
+ return ret_conv;
+}
+
int8_tArray __attribute__((export_name("TS_HTLCDestination_write"))) TS_HTLCDestination_write(uint64_t obj) {
LDKHTLCDestination* obj_conv = (LDKHTLCDestination*)untag_ptr(obj);
LDKCVec_u8Z ret_var = HTLCDestination_write(obj_conv);
return ret_ref;
}
-uint64_t __attribute__((export_name("TS_Event_funding_generation_ready"))) TS_Event_funding_generation_ready(int8_tArray temporary_channel_id, int8_tArray counterparty_node_id, int64_t channel_value_satoshis, int8_tArray output_script, int64_t user_channel_id) {
+uint64_t __attribute__((export_name("TS_Event_funding_generation_ready"))) TS_Event_funding_generation_ready(int8_tArray temporary_channel_id, int8_tArray counterparty_node_id, int64_t channel_value_satoshis, int8_tArray output_script, int8_tArray user_channel_id) {
LDKThirtyTwoBytes temporary_channel_id_ref;
CHECK(temporary_channel_id->arr_len == 32);
memcpy(temporary_channel_id_ref.data, temporary_channel_id->elems, 32); FREE(temporary_channel_id);
output_script_ref.datalen = output_script->arr_len;
output_script_ref.data = MALLOC(output_script_ref.datalen, "LDKCVec_u8Z Bytes");
memcpy(output_script_ref.data, output_script->elems, output_script_ref.datalen); FREE(output_script);
+ LDKU128 user_channel_id_ref;
+ CHECK(user_channel_id->arr_len == 16);
+ memcpy(user_channel_id_ref.le_bytes, user_channel_id->elems, 16); FREE(user_channel_id);
LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
- *ret_copy = Event_funding_generation_ready(temporary_channel_id_ref, counterparty_node_id_ref, channel_value_satoshis, output_script_ref, user_channel_id);
+ *ret_copy = Event_funding_generation_ready(temporary_channel_id_ref, counterparty_node_id_ref, channel_value_satoshis, output_script_ref, user_channel_id_ref);
uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
-uint64_t __attribute__((export_name("TS_Event_payment_received"))) TS_Event_payment_received(int8_tArray payment_hash, int64_t amount_msat, uint64_t purpose) {
+uint64_t __attribute__((export_name("TS_Event_payment_claimable"))) TS_Event_payment_claimable(int8_tArray receiver_node_id, int8_tArray payment_hash, int64_t amount_msat, uint64_t purpose, int8_tArray via_channel_id, uint64_t via_user_channel_id) {
+ LDKPublicKey receiver_node_id_ref;
+ CHECK(receiver_node_id->arr_len == 33);
+ memcpy(receiver_node_id_ref.compressed_form, receiver_node_id->elems, 33); FREE(receiver_node_id);
LDKThirtyTwoBytes payment_hash_ref;
CHECK(payment_hash->arr_len == 32);
memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
CHECK_ACCESS(purpose_ptr);
LDKPaymentPurpose purpose_conv = *(LDKPaymentPurpose*)(purpose_ptr);
purpose_conv = PaymentPurpose_clone((LDKPaymentPurpose*)untag_ptr(purpose));
+ LDKThirtyTwoBytes via_channel_id_ref;
+ CHECK(via_channel_id->arr_len == 32);
+ memcpy(via_channel_id_ref.data, via_channel_id->elems, 32); FREE(via_channel_id);
+ void* via_user_channel_id_ptr = untag_ptr(via_user_channel_id);
+ CHECK_ACCESS(via_user_channel_id_ptr);
+ LDKCOption_u128Z via_user_channel_id_conv = *(LDKCOption_u128Z*)(via_user_channel_id_ptr);
+ via_user_channel_id_conv = COption_u128Z_clone((LDKCOption_u128Z*)untag_ptr(via_user_channel_id));
LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
- *ret_copy = Event_payment_received(payment_hash_ref, amount_msat, purpose_conv);
+ *ret_copy = Event_payment_claimable(receiver_node_id_ref, payment_hash_ref, amount_msat, purpose_conv, via_channel_id_ref, via_user_channel_id_conv);
uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
-uint64_t __attribute__((export_name("TS_Event_payment_claimed"))) TS_Event_payment_claimed(int8_tArray payment_hash, int64_t amount_msat, uint64_t purpose) {
+uint64_t __attribute__((export_name("TS_Event_payment_claimed"))) TS_Event_payment_claimed(int8_tArray receiver_node_id, int8_tArray payment_hash, int64_t amount_msat, uint64_t purpose) {
+ LDKPublicKey receiver_node_id_ref;
+ CHECK(receiver_node_id->arr_len == 33);
+ memcpy(receiver_node_id_ref.compressed_form, receiver_node_id->elems, 33); FREE(receiver_node_id);
LDKThirtyTwoBytes payment_hash_ref;
CHECK(payment_hash->arr_len == 32);
memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
LDKPaymentPurpose purpose_conv = *(LDKPaymentPurpose*)(purpose_ptr);
purpose_conv = PaymentPurpose_clone((LDKPaymentPurpose*)untag_ptr(purpose));
LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
- *ret_copy = Event_payment_claimed(payment_hash_ref, amount_msat, purpose_conv);
+ *ret_copy = Event_payment_claimed(receiver_node_id_ref, payment_hash_ref, amount_msat, purpose_conv);
uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
return ret_ref;
}
-uint64_t __attribute__((export_name("TS_Event_payment_path_failed"))) TS_Event_payment_path_failed(int8_tArray payment_id, int8_tArray payment_hash, jboolean rejected_by_dest, uint64_t network_update, jboolean all_paths_failed, uint64_tArray path, uint64_t short_channel_id, uint64_t retry) {
+uint64_t __attribute__((export_name("TS_Event_payment_path_failed"))) TS_Event_payment_path_failed(int8_tArray payment_id, int8_tArray payment_hash, jboolean payment_failed_permanently, uint64_t failure, uint64_tArray path, uint64_t short_channel_id, uint64_t retry) {
LDKThirtyTwoBytes payment_id_ref;
CHECK(payment_id->arr_len == 32);
memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id);
LDKThirtyTwoBytes payment_hash_ref;
CHECK(payment_hash->arr_len == 32);
memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
- void* network_update_ptr = untag_ptr(network_update);
- CHECK_ACCESS(network_update_ptr);
- LDKCOption_NetworkUpdateZ network_update_conv = *(LDKCOption_NetworkUpdateZ*)(network_update_ptr);
- network_update_conv = COption_NetworkUpdateZ_clone((LDKCOption_NetworkUpdateZ*)untag_ptr(network_update));
+ void* failure_ptr = untag_ptr(failure);
+ CHECK_ACCESS(failure_ptr);
+ LDKPathFailure failure_conv = *(LDKPathFailure*)(failure_ptr);
+ failure_conv = PathFailure_clone((LDKPathFailure*)untag_ptr(failure));
LDKCVec_RouteHopZ path_constr;
path_constr.datalen = path->arr_len;
if (path_constr.datalen > 0)
CHECK_INNER_FIELD_ACCESS_OR_NULL(retry_conv);
retry_conv = RouteParameters_clone(&retry_conv);
LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
- *ret_copy = Event_payment_path_failed(payment_id_ref, payment_hash_ref, rejected_by_dest, network_update_conv, all_paths_failed, path_constr, short_channel_id_conv, retry_conv);
+ *ret_copy = Event_payment_path_failed(payment_id_ref, payment_hash_ref, payment_failed_permanently, failure_conv, path_constr, short_channel_id_conv, retry_conv);
uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
return ret_ref;
}
+uint64_t __attribute__((export_name("TS_Event_htlcintercepted"))) TS_Event_htlcintercepted(int8_tArray intercept_id, int64_t requested_next_hop_scid, int8_tArray payment_hash, int64_t inbound_amount_msat, int64_t expected_outbound_amount_msat) {
+ LDKThirtyTwoBytes intercept_id_ref;
+ CHECK(intercept_id->arr_len == 32);
+ memcpy(intercept_id_ref.data, intercept_id->elems, 32); FREE(intercept_id);
+ LDKThirtyTwoBytes payment_hash_ref;
+ CHECK(payment_hash->arr_len == 32);
+ memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
+ LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
+ *ret_copy = Event_htlcintercepted(intercept_id_ref, requested_next_hop_scid, payment_hash_ref, inbound_amount_msat, expected_outbound_amount_msat);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
uint64_t __attribute__((export_name("TS_Event_spendable_outputs"))) TS_Event_spendable_outputs(uint64_tArray outputs) {
LDKCVec_SpendableOutputDescriptorZ outputs_constr;
outputs_constr.datalen = outputs->arr_len;
return ret_ref;
}
-uint64_t __attribute__((export_name("TS_Event_channel_closed"))) TS_Event_channel_closed(int8_tArray channel_id, int64_t user_channel_id, uint64_t reason) {
+uint64_t __attribute__((export_name("TS_Event_channel_ready"))) TS_Event_channel_ready(int8_tArray channel_id, int8_tArray user_channel_id, int8_tArray counterparty_node_id, uint64_t channel_type) {
+ LDKThirtyTwoBytes channel_id_ref;
+ CHECK(channel_id->arr_len == 32);
+ memcpy(channel_id_ref.data, channel_id->elems, 32); FREE(channel_id);
+ LDKU128 user_channel_id_ref;
+ CHECK(user_channel_id->arr_len == 16);
+ memcpy(user_channel_id_ref.le_bytes, user_channel_id->elems, 16); FREE(user_channel_id);
+ LDKPublicKey counterparty_node_id_ref;
+ CHECK(counterparty_node_id->arr_len == 33);
+ memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id);
+ LDKChannelTypeFeatures channel_type_conv;
+ channel_type_conv.inner = untag_ptr(channel_type);
+ channel_type_conv.is_owned = ptr_is_owned(channel_type);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_conv);
+ channel_type_conv = ChannelTypeFeatures_clone(&channel_type_conv);
+ LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
+ *ret_copy = Event_channel_ready(channel_id_ref, user_channel_id_ref, counterparty_node_id_ref, channel_type_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+uint64_t __attribute__((export_name("TS_Event_channel_closed"))) TS_Event_channel_closed(int8_tArray channel_id, int8_tArray user_channel_id, uint64_t reason) {
LDKThirtyTwoBytes channel_id_ref;
CHECK(channel_id->arr_len == 32);
memcpy(channel_id_ref.data, channel_id->elems, 32); FREE(channel_id);
+ LDKU128 user_channel_id_ref;
+ CHECK(user_channel_id->arr_len == 16);
+ memcpy(user_channel_id_ref.le_bytes, user_channel_id->elems, 16); FREE(user_channel_id);
void* reason_ptr = untag_ptr(reason);
CHECK_ACCESS(reason_ptr);
LDKClosureReason reason_conv = *(LDKClosureReason*)(reason_ptr);
reason_conv = ClosureReason_clone((LDKClosureReason*)untag_ptr(reason));
LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
- *ret_copy = Event_channel_closed(channel_id_ref, user_channel_id, reason_conv);
+ *ret_copy = Event_channel_closed(channel_id_ref, user_channel_id_ref, reason_conv);
uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
return ret_ref;
}
+jboolean __attribute__((export_name("TS_Event_eq"))) TS_Event_eq(uint64_t a, uint64_t b) {
+ LDKEvent* a_conv = (LDKEvent*)untag_ptr(a);
+ LDKEvent* b_conv = (LDKEvent*)untag_ptr(b);
+ jboolean ret_conv = Event_eq(a_conv, b_conv);
+ return ret_conv;
+}
+
int8_tArray __attribute__((export_name("TS_Event_write"))) TS_Event_write(uint64_t obj) {
LDKEvent* obj_conv = (LDKEvent*)untag_ptr(obj);
LDKCVec_u8Z ret_var = Event_write(obj_conv);
return ret_ref;
}
-uint64_t __attribute__((export_name("TS_MessageSendEvent_broadcast_channel_announcement"))) TS_MessageSendEvent_broadcast_channel_announcement(uint64_t msg, uint64_t update_msg) {
+uint64_t __attribute__((export_name("TS_MessageSendEvent_send_channel_announcement"))) TS_MessageSendEvent_send_channel_announcement(int8_tArray node_id, uint64_t msg, uint64_t update_msg) {
+ LDKPublicKey node_id_ref;
+ CHECK(node_id->arr_len == 33);
+ memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
LDKChannelAnnouncement msg_conv;
msg_conv.inner = untag_ptr(msg);
msg_conv.is_owned = ptr_is_owned(msg);
CHECK_INNER_FIELD_ACCESS_OR_NULL(update_msg_conv);
update_msg_conv = ChannelUpdate_clone(&update_msg_conv);
LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
- *ret_copy = MessageSendEvent_broadcast_channel_announcement(msg_conv, update_msg_conv);
+ *ret_copy = MessageSendEvent_send_channel_announcement(node_id_ref, msg_conv, update_msg_conv);
uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
-uint64_t __attribute__((export_name("TS_MessageSendEvent_broadcast_node_announcement"))) TS_MessageSendEvent_broadcast_node_announcement(uint64_t msg) {
- LDKNodeAnnouncement msg_conv;
+uint64_t __attribute__((export_name("TS_MessageSendEvent_broadcast_channel_announcement"))) TS_MessageSendEvent_broadcast_channel_announcement(uint64_t msg, uint64_t update_msg) {
+ LDKChannelAnnouncement msg_conv;
msg_conv.inner = untag_ptr(msg);
msg_conv.is_owned = ptr_is_owned(msg);
CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
- msg_conv = NodeAnnouncement_clone(&msg_conv);
+ msg_conv = ChannelAnnouncement_clone(&msg_conv);
+ LDKChannelUpdate update_msg_conv;
+ update_msg_conv.inner = untag_ptr(update_msg);
+ update_msg_conv.is_owned = ptr_is_owned(update_msg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(update_msg_conv);
+ update_msg_conv = ChannelUpdate_clone(&update_msg_conv);
LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
- *ret_copy = MessageSendEvent_broadcast_node_announcement(msg_conv);
+ *ret_copy = MessageSendEvent_broadcast_channel_announcement(msg_conv, update_msg_conv);
uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
return ret_ref;
}
+uint64_t __attribute__((export_name("TS_MessageSendEvent_broadcast_node_announcement"))) TS_MessageSendEvent_broadcast_node_announcement(uint64_t msg) {
+ LDKNodeAnnouncement msg_conv;
+ msg_conv.inner = untag_ptr(msg);
+ msg_conv.is_owned = ptr_is_owned(msg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
+ msg_conv = NodeAnnouncement_clone(&msg_conv);
+ LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+ *ret_copy = MessageSendEvent_broadcast_node_announcement(msg_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
uint64_t __attribute__((export_name("TS_MessageSendEvent_send_channel_update"))) TS_MessageSendEvent_send_channel_update(int8_tArray node_id, uint64_t msg) {
LDKPublicKey node_id_ref;
CHECK(node_id->arr_len == 33);
MessageSendEventsProvider_free(this_ptr_conv);
}
+void __attribute__((export_name("TS_OnionMessageProvider_free"))) TS_OnionMessageProvider_free(uint64_t this_ptr) {
+ if (!ptr_is_owned(this_ptr)) return;
+ void* this_ptr_ptr = untag_ptr(this_ptr);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKOnionMessageProvider this_ptr_conv = *(LDKOnionMessageProvider*)(this_ptr_ptr);
+ FREE(untag_ptr(this_ptr));
+ OnionMessageProvider_free(this_ptr_conv);
+}
+
void __attribute__((export_name("TS_EventsProvider_free"))) TS_EventsProvider_free(uint64_t this_ptr) {
if (!ptr_is_owned(this_ptr)) return;
void* this_ptr_ptr = untag_ptr(this_ptr);
return ret_ref;
}
-uint64_t __attribute__((export_name("TS_APIError_route_error"))) TS_APIError_route_error(jstring err) {
+uint64_t __attribute__((export_name("TS_APIError_invalid_route"))) TS_APIError_invalid_route(jstring err) {
LDKStr err_conv = str_ref_to_owned_c(err);
LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
- *ret_copy = APIError_route_error(err_conv);
+ *ret_copy = APIError_invalid_route(err_conv);
uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
return ret_ref;
}
-uint64_t __attribute__((export_name("TS_APIError_monitor_update_failed"))) TS_APIError_monitor_update_failed() {
+uint64_t __attribute__((export_name("TS_APIError_monitor_update_in_progress"))) TS_APIError_monitor_update_in_progress() {
LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
- *ret_copy = APIError_monitor_update_failed();
+ *ret_copy = APIError_monitor_update_in_progress();
uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
return ret_ref;
}
+jboolean __attribute__((export_name("TS_APIError_eq"))) TS_APIError_eq(uint64_t a, uint64_t b) {
+ LDKAPIError* a_conv = (LDKAPIError*)untag_ptr(a);
+ LDKAPIError* b_conv = (LDKAPIError*)untag_ptr(b);
+ jboolean ret_conv = APIError_eq(a_conv, b_conv);
+ return ret_conv;
+}
+
+int8_tArray __attribute__((export_name("TS_APIError_write"))) TS_APIError_write(uint64_t obj) {
+ LDKAPIError* obj_conv = (LDKAPIError*)untag_ptr(obj);
+ LDKCVec_u8Z ret_var = APIError_write(obj_conv);
+ int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
+ memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
+}
+
+uint64_t __attribute__((export_name("TS_APIError_read"))) TS_APIError_read(int8_tArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.datalen = ser->arr_len;
+ ser_ref.data = ser->elems;
+ LDKCResult_COption_APIErrorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_APIErrorZDecodeErrorZ), "LDKCResult_COption_APIErrorZDecodeErrorZ");
+ *ret_conv = APIError_read(ser_ref);
+ FREE(ser);
+ return tag_ptr(ret_conv, true);
+}
+
void __attribute__((export_name("TS_BigSize_free"))) TS_BigSize_free(uint64_t this_obj) {
LDKBigSize this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+jboolean __attribute__((export_name("TS_Hostname_eq"))) TS_Hostname_eq(uint64_t a, uint64_t b) {
+ LDKHostname a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKHostname b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = Hostname_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
int8_t __attribute__((export_name("TS_Hostname_len"))) TS_Hostname_len(uint64_t this_arg) {
LDKHostname this_arg_conv;
this_arg_conv.inner = untag_ptr(this_arg);
LDKu8slice msg_ref;
msg_ref.datalen = msg->arr_len;
msg_ref.data = msg->elems;
- unsigned char sk_arr[32];
+ uint8_t sk_arr[32];
CHECK(sk->arr_len == 32);
memcpy(sk_arr, sk->elems, 32); FREE(sk);
- unsigned char (*sk_ref)[32] = &sk_arr;
+ uint8_t (*sk_ref)[32] = &sk_arr;
LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ");
*ret_conv = sign(msg_ref, sk_ref);
FREE(msg);
LDKu8slice hrp_bytes_ref;
hrp_bytes_ref.datalen = hrp_bytes->arr_len;
hrp_bytes_ref.data = hrp_bytes->elems;
- LDKCVec_u5Z data_without_signature_constr;
+ LDKCVec_U5Z data_without_signature_constr;
data_without_signature_constr.datalen = data_without_signature->arr_len;
if (data_without_signature_constr.datalen > 0)
- data_without_signature_constr.data = MALLOC(data_without_signature_constr.datalen * sizeof(LDKu5), "LDKCVec_u5Z Elements");
+ data_without_signature_constr.data = MALLOC(data_without_signature_constr.datalen * sizeof(LDKU5), "LDKCVec_U5Z Elements");
else
data_without_signature_constr.data = NULL;
int8_t* data_without_signature_vals = (void*) data_without_signature->elems;
for (size_t h = 0; h < data_without_signature_constr.datalen; h++) {
int8_t data_without_signature_conv_7 = data_without_signature_vals[h];
- data_without_signature_constr.data[h] = (LDKu5){ ._0 = data_without_signature_conv_7 };
+ data_without_signature_constr.data[h] = (LDKU5){ ._0 = data_without_signature_conv_7 };
}
FREE(data_without_signature);
LDKCVec_u8Z ret_var = construct_invoice_preimage(hrp_bytes_ref, data_without_signature_constr);
Persister_free(this_ptr_conv);
}
+void __attribute__((export_name("TS_PrintableString_free"))) TS_PrintableString_free(uint64_t this_obj) {
+ LDKPrintableString this_obj_conv;
+ this_obj_conv.inner = untag_ptr(this_obj);
+ this_obj_conv.is_owned = ptr_is_owned(this_obj);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
+ PrintableString_free(this_obj_conv);
+}
+
+jstring __attribute__((export_name("TS_PrintableString_get_a"))) TS_PrintableString_get_a(uint64_t this_ptr) {
+ LDKPrintableString this_ptr_conv;
+ this_ptr_conv.inner = untag_ptr(this_ptr);
+ this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ this_ptr_conv.is_owned = false;
+ LDKStr ret_str = PrintableString_get_a(&this_ptr_conv);
+ jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
+ Str_free(ret_str);
+ return ret_conv;
+}
+
+void __attribute__((export_name("TS_PrintableString_set_a"))) TS_PrintableString_set_a(uint64_t this_ptr, jstring val) {
+ LDKPrintableString this_ptr_conv;
+ this_ptr_conv.inner = untag_ptr(this_ptr);
+ this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ this_ptr_conv.is_owned = false;
+ LDKStr val_conv = str_ref_to_owned_c(val);
+ PrintableString_set_a(&this_ptr_conv, val_conv);
+}
+
+uint64_t __attribute__((export_name("TS_PrintableString_new"))) TS_PrintableString_new(jstring a_arg) {
+ LDKStr a_arg_conv = str_ref_to_owned_c(a_arg);
+ LDKPrintableString ret_var = PrintableString_new(a_arg_conv);
+ uint64_t ret_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ return ret_ref;
+}
+
+void __attribute__((export_name("TS_FutureCallback_free"))) TS_FutureCallback_free(uint64_t this_ptr) {
+ if (!ptr_is_owned(this_ptr)) return;
+ void* this_ptr_ptr = untag_ptr(this_ptr);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKFutureCallback this_ptr_conv = *(LDKFutureCallback*)(this_ptr_ptr);
+ FREE(untag_ptr(this_ptr));
+ FutureCallback_free(this_ptr_conv);
+}
+
+void __attribute__((export_name("TS_Future_free"))) TS_Future_free(uint64_t this_obj) {
+ LDKFuture this_obj_conv;
+ this_obj_conv.inner = untag_ptr(this_obj);
+ this_obj_conv.is_owned = ptr_is_owned(this_obj);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
+ Future_free(this_obj_conv);
+}
+
+void __attribute__((export_name("TS_Future_register_callback_fn"))) TS_Future_register_callback_fn(uint64_t this_arg, uint64_t callback) {
+ LDKFuture this_arg_conv;
+ this_arg_conv.inner = untag_ptr(this_arg);
+ this_arg_conv.is_owned = ptr_is_owned(this_arg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ this_arg_conv.is_owned = false;
+ void* callback_ptr = untag_ptr(callback);
+ CHECK_ACCESS(callback_ptr);
+ LDKFutureCallback callback_conv = *(LDKFutureCallback*)(callback_ptr);
+ if (callback_conv.free == LDKFutureCallback_JCalls_free) {
+ // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
+ LDKFutureCallback_JCalls_cloned(&callback_conv);
+ }
+ Future_register_callback_fn(&this_arg_conv, callback_conv);
+}
+
uint32_t __attribute__((export_name("TS_Level_clone"))) TS_Level_clone(uint64_t orig) {
LDKLevel* orig_conv = (LDKLevel*)untag_ptr(orig);
uint32_t ret_conv = LDKLevel_to_js(Level_clone(orig_conv));
ChannelHandshakeConfig_set_commit_upfront_shutdown_pubkey(&this_ptr_conv, val);
}
-uint64_t __attribute__((export_name("TS_ChannelHandshakeConfig_new"))) TS_ChannelHandshakeConfig_new(int32_t minimum_depth_arg, int16_t our_to_self_delay_arg, int64_t our_htlc_minimum_msat_arg, int8_t max_inbound_htlc_value_in_flight_percent_of_channel_arg, jboolean negotiate_scid_privacy_arg, jboolean announced_channel_arg, jboolean commit_upfront_shutdown_pubkey_arg) {
- LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_new(minimum_depth_arg, our_to_self_delay_arg, our_htlc_minimum_msat_arg, max_inbound_htlc_value_in_flight_percent_of_channel_arg, negotiate_scid_privacy_arg, announced_channel_arg, commit_upfront_shutdown_pubkey_arg);
+int32_t __attribute__((export_name("TS_ChannelHandshakeConfig_get_their_channel_reserve_proportional_millionths"))) TS_ChannelHandshakeConfig_get_their_channel_reserve_proportional_millionths(uint64_t this_ptr) {
+ LDKChannelHandshakeConfig this_ptr_conv;
+ this_ptr_conv.inner = untag_ptr(this_ptr);
+ this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ this_ptr_conv.is_owned = false;
+ int32_t ret_conv = ChannelHandshakeConfig_get_their_channel_reserve_proportional_millionths(&this_ptr_conv);
+ return ret_conv;
+}
+
+void __attribute__((export_name("TS_ChannelHandshakeConfig_set_their_channel_reserve_proportional_millionths"))) TS_ChannelHandshakeConfig_set_their_channel_reserve_proportional_millionths(uint64_t this_ptr, int32_t val) {
+ LDKChannelHandshakeConfig this_ptr_conv;
+ this_ptr_conv.inner = untag_ptr(this_ptr);
+ this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ this_ptr_conv.is_owned = false;
+ ChannelHandshakeConfig_set_their_channel_reserve_proportional_millionths(&this_ptr_conv, val);
+}
+
+uint64_t __attribute__((export_name("TS_ChannelHandshakeConfig_new"))) TS_ChannelHandshakeConfig_new(int32_t minimum_depth_arg, int16_t our_to_self_delay_arg, int64_t our_htlc_minimum_msat_arg, int8_t max_inbound_htlc_value_in_flight_percent_of_channel_arg, jboolean negotiate_scid_privacy_arg, jboolean announced_channel_arg, jboolean commit_upfront_shutdown_pubkey_arg, int32_t their_channel_reserve_proportional_millionths_arg) {
+ LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_new(minimum_depth_arg, our_to_self_delay_arg, our_htlc_minimum_msat_arg, max_inbound_htlc_value_in_flight_percent_of_channel_arg, negotiate_scid_privacy_arg, announced_channel_arg, commit_upfront_shutdown_pubkey_arg, their_channel_reserve_proportional_millionths_arg);
uint64_t ret_ref = 0;
CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
return ret_ref;
}
+jboolean __attribute__((export_name("TS_ChannelConfig_eq"))) TS_ChannelConfig_eq(uint64_t a, uint64_t b) {
+ LDKChannelConfig a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKChannelConfig b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = ChannelConfig_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
uint64_t __attribute__((export_name("TS_ChannelConfig_default"))) TS_ChannelConfig_default() {
LDKChannelConfig ret_var = ChannelConfig_default();
uint64_t ret_ref = 0;
UserConfig_set_manually_accept_inbound_channels(&this_ptr_conv, val);
}
-uint64_t __attribute__((export_name("TS_UserConfig_new"))) TS_UserConfig_new(uint64_t channel_handshake_config_arg, uint64_t channel_handshake_limits_arg, uint64_t channel_config_arg, jboolean accept_forwards_to_priv_channels_arg, jboolean accept_inbound_channels_arg, jboolean manually_accept_inbound_channels_arg) {
+jboolean __attribute__((export_name("TS_UserConfig_get_accept_intercept_htlcs"))) TS_UserConfig_get_accept_intercept_htlcs(uint64_t this_ptr) {
+ LDKUserConfig this_ptr_conv;
+ this_ptr_conv.inner = untag_ptr(this_ptr);
+ this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ this_ptr_conv.is_owned = false;
+ jboolean ret_conv = UserConfig_get_accept_intercept_htlcs(&this_ptr_conv);
+ return ret_conv;
+}
+
+void __attribute__((export_name("TS_UserConfig_set_accept_intercept_htlcs"))) TS_UserConfig_set_accept_intercept_htlcs(uint64_t this_ptr, jboolean val) {
+ LDKUserConfig this_ptr_conv;
+ this_ptr_conv.inner = untag_ptr(this_ptr);
+ this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ this_ptr_conv.is_owned = false;
+ UserConfig_set_accept_intercept_htlcs(&this_ptr_conv, val);
+}
+
+uint64_t __attribute__((export_name("TS_UserConfig_new"))) TS_UserConfig_new(uint64_t channel_handshake_config_arg, uint64_t channel_handshake_limits_arg, uint64_t channel_config_arg, jboolean accept_forwards_to_priv_channels_arg, jboolean accept_inbound_channels_arg, jboolean manually_accept_inbound_channels_arg, jboolean accept_intercept_htlcs_arg) {
LDKChannelHandshakeConfig channel_handshake_config_arg_conv;
channel_handshake_config_arg_conv.inner = untag_ptr(channel_handshake_config_arg);
channel_handshake_config_arg_conv.is_owned = ptr_is_owned(channel_handshake_config_arg);
channel_config_arg_conv.is_owned = ptr_is_owned(channel_config_arg);
CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_config_arg_conv);
channel_config_arg_conv = ChannelConfig_clone(&channel_config_arg_conv);
- LDKUserConfig ret_var = UserConfig_new(channel_handshake_config_arg_conv, channel_handshake_limits_arg_conv, channel_config_arg_conv, accept_forwards_to_priv_channels_arg, accept_inbound_channels_arg, manually_accept_inbound_channels_arg);
+ LDKUserConfig ret_var = UserConfig_new(channel_handshake_config_arg_conv, channel_handshake_limits_arg_conv, channel_config_arg_conv, accept_forwards_to_priv_channels_arg, accept_inbound_channels_arg, manually_accept_inbound_channels_arg, accept_intercept_htlcs_arg);
uint64_t ret_ref = 0;
CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
return ret_ref;
}
-uint64_t __attribute__((export_name("TS_BestBlock_from_genesis"))) TS_BestBlock_from_genesis(uint32_t network) {
+jboolean __attribute__((export_name("TS_BestBlock_eq"))) TS_BestBlock_eq(uint64_t a, uint64_t b) {
+ LDKBestBlock a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKBestBlock b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = BestBlock_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
+uint64_t __attribute__((export_name("TS_BestBlock_from_network"))) TS_BestBlock_from_network(uint32_t network) {
LDKNetwork network_conv = LDKNetwork_from_js(network);
- LDKBestBlock ret_var = BestBlock_from_genesis(network_conv);
+ LDKBestBlock ret_var = BestBlock_from_network(network_conv);
uint64_t ret_ref = 0;
CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
return ret_conv;
}
-uint32_t __attribute__((export_name("TS_AccessError_clone"))) TS_AccessError_clone(uint64_t orig) {
- LDKAccessError* orig_conv = (LDKAccessError*)untag_ptr(orig);
- uint32_t ret_conv = LDKAccessError_to_js(AccessError_clone(orig_conv));
- return ret_conv;
-}
-
-uint32_t __attribute__((export_name("TS_AccessError_unknown_chain"))) TS_AccessError_unknown_chain() {
- uint32_t ret_conv = LDKAccessError_to_js(AccessError_unknown_chain());
- return ret_conv;
-}
-
-uint32_t __attribute__((export_name("TS_AccessError_unknown_tx"))) TS_AccessError_unknown_tx() {
- uint32_t ret_conv = LDKAccessError_to_js(AccessError_unknown_tx());
- return ret_conv;
-}
-
-void __attribute__((export_name("TS_Access_free"))) TS_Access_free(uint64_t this_ptr) {
- if (!ptr_is_owned(this_ptr)) return;
- void* this_ptr_ptr = untag_ptr(this_ptr);
- CHECK_ACCESS(this_ptr_ptr);
- LDKAccess this_ptr_conv = *(LDKAccess*)(this_ptr_ptr);
- FREE(untag_ptr(this_ptr));
- Access_free(this_ptr_conv);
-}
-
void __attribute__((export_name("TS_Listen_free"))) TS_Listen_free(uint64_t this_ptr) {
if (!ptr_is_owned(this_ptr)) return;
void* this_ptr_ptr = untag_ptr(this_ptr);
Confirm_free(this_ptr_conv);
}
-uint32_t __attribute__((export_name("TS_ChannelMonitorUpdateErr_clone"))) TS_ChannelMonitorUpdateErr_clone(uint64_t orig) {
- LDKChannelMonitorUpdateErr* orig_conv = (LDKChannelMonitorUpdateErr*)untag_ptr(orig);
- uint32_t ret_conv = LDKChannelMonitorUpdateErr_to_js(ChannelMonitorUpdateErr_clone(orig_conv));
+uint32_t __attribute__((export_name("TS_ChannelMonitorUpdateStatus_clone"))) TS_ChannelMonitorUpdateStatus_clone(uint64_t orig) {
+ LDKChannelMonitorUpdateStatus* orig_conv = (LDKChannelMonitorUpdateStatus*)untag_ptr(orig);
+ uint32_t ret_conv = LDKChannelMonitorUpdateStatus_to_js(ChannelMonitorUpdateStatus_clone(orig_conv));
return ret_conv;
}
-uint32_t __attribute__((export_name("TS_ChannelMonitorUpdateErr_temporary_failure"))) TS_ChannelMonitorUpdateErr_temporary_failure() {
- uint32_t ret_conv = LDKChannelMonitorUpdateErr_to_js(ChannelMonitorUpdateErr_temporary_failure());
+uint32_t __attribute__((export_name("TS_ChannelMonitorUpdateStatus_completed"))) TS_ChannelMonitorUpdateStatus_completed() {
+ uint32_t ret_conv = LDKChannelMonitorUpdateStatus_to_js(ChannelMonitorUpdateStatus_completed());
return ret_conv;
}
-uint32_t __attribute__((export_name("TS_ChannelMonitorUpdateErr_permanent_failure"))) TS_ChannelMonitorUpdateErr_permanent_failure() {
- uint32_t ret_conv = LDKChannelMonitorUpdateErr_to_js(ChannelMonitorUpdateErr_permanent_failure());
+uint32_t __attribute__((export_name("TS_ChannelMonitorUpdateStatus_in_progress"))) TS_ChannelMonitorUpdateStatus_in_progress() {
+ uint32_t ret_conv = LDKChannelMonitorUpdateStatus_to_js(ChannelMonitorUpdateStatus_in_progress());
+ return ret_conv;
+}
+
+uint32_t __attribute__((export_name("TS_ChannelMonitorUpdateStatus_permanent_failure"))) TS_ChannelMonitorUpdateStatus_permanent_failure() {
+ uint32_t ret_conv = LDKChannelMonitorUpdateStatus_to_js(ChannelMonitorUpdateStatus_permanent_failure());
+ return ret_conv;
+}
+
+jboolean __attribute__((export_name("TS_ChannelMonitorUpdateStatus_eq"))) TS_ChannelMonitorUpdateStatus_eq(uint64_t a, uint64_t b) {
+ LDKChannelMonitorUpdateStatus* a_conv = (LDKChannelMonitorUpdateStatus*)untag_ptr(a);
+ LDKChannelMonitorUpdateStatus* b_conv = (LDKChannelMonitorUpdateStatus*)untag_ptr(b);
+ jboolean ret_conv = ChannelMonitorUpdateStatus_eq(a_conv, b_conv);
return ret_conv;
}
return ret_ref;
}
+jboolean __attribute__((export_name("TS_WatchedOutput_eq"))) TS_WatchedOutput_eq(uint64_t a, uint64_t b) {
+ LDKWatchedOutput a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKWatchedOutput b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = WatchedOutput_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
int64_t __attribute__((export_name("TS_WatchedOutput_hash"))) TS_WatchedOutput_hash(uint64_t o) {
LDKWatchedOutput o_conv;
o_conv.inner = untag_ptr(o);
return ret_conv;
}
+int64_t __attribute__((export_name("TS_ConfirmationTarget_hash"))) TS_ConfirmationTarget_hash(uint64_t o) {
+ LDKConfirmationTarget* o_conv = (LDKConfirmationTarget*)untag_ptr(o);
+ int64_t ret_conv = ConfirmationTarget_hash(o_conv);
+ return ret_conv;
+}
+
jboolean __attribute__((export_name("TS_ConfirmationTarget_eq"))) TS_ConfirmationTarget_eq(uint64_t a, uint64_t b) {
LDKConfirmationTarget* a_conv = (LDKConfirmationTarget*)untag_ptr(a);
LDKConfirmationTarget* b_conv = (LDKConfirmationTarget*)untag_ptr(b);
return ret_arr;
}
+uint64_tArray __attribute__((export_name("TS_ChainMonitor_list_pending_monitor_updates"))) TS_ChainMonitor_list_pending_monitor_updates(uint64_t this_arg) {
+ LDKChainMonitor this_arg_conv;
+ this_arg_conv.inner = untag_ptr(this_arg);
+ this_arg_conv.is_owned = ptr_is_owned(this_arg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ this_arg_conv.is_owned = false;
+ LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ ret_var = ChainMonitor_list_pending_monitor_updates(&this_arg_conv);
+ uint64_tArray ret_arr = NULL;
+ ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
+ uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
+ for (size_t p = 0; p < ret_var.datalen; p++) {
+ LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* ret_conv_41_conv = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ), "LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ");
+ *ret_conv_41_conv = ret_var.data[p];
+ ret_arr_ptr[p] = tag_ptr(ret_conv_41_conv, true);
+ }
+
+ FREE(ret_var.data);
+ return ret_arr;
+}
+
uint64_t __attribute__((export_name("TS_ChainMonitor_channel_monitor_updated"))) TS_ChainMonitor_channel_monitor_updated(uint64_t this_arg, uint64_t funding_txo, uint64_t completed_update_id) {
LDKChainMonitor this_arg_conv;
this_arg_conv.inner = untag_ptr(this_arg);
return ret_ref;
}
-uint64_t __attribute__((export_name("TS_MonitorEvent_update_completed"))) TS_MonitorEvent_update_completed(uint64_t funding_txo, int64_t monitor_update_id) {
+uint64_t __attribute__((export_name("TS_MonitorEvent_completed"))) TS_MonitorEvent_completed(uint64_t funding_txo, int64_t monitor_update_id) {
LDKOutPoint funding_txo_conv;
funding_txo_conv.inner = untag_ptr(funding_txo);
funding_txo_conv.is_owned = ptr_is_owned(funding_txo);
CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv);
funding_txo_conv = OutPoint_clone(&funding_txo_conv);
LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
- *ret_copy = MonitorEvent_update_completed(funding_txo_conv, monitor_update_id);
+ *ret_copy = MonitorEvent_completed(funding_txo_conv, monitor_update_id);
uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
return ret_ref;
}
+jboolean __attribute__((export_name("TS_MonitorEvent_eq"))) TS_MonitorEvent_eq(uint64_t a, uint64_t b) {
+ LDKMonitorEvent* a_conv = (LDKMonitorEvent*)untag_ptr(a);
+ LDKMonitorEvent* b_conv = (LDKMonitorEvent*)untag_ptr(b);
+ jboolean ret_conv = MonitorEvent_eq(a_conv, b_conv);
+ return ret_conv;
+}
+
int8_tArray __attribute__((export_name("TS_MonitorEvent_write"))) TS_MonitorEvent_write(uint64_t obj) {
LDKMonitorEvent* obj_conv = (LDKMonitorEvent*)untag_ptr(obj);
LDKCVec_u8Z ret_var = MonitorEvent_write(obj_conv);
return ret_ref;
}
+jboolean __attribute__((export_name("TS_HTLCUpdate_eq"))) TS_HTLCUpdate_eq(uint64_t a, uint64_t b) {
+ LDKHTLCUpdate a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKHTLCUpdate b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = HTLCUpdate_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
int8_tArray __attribute__((export_name("TS_HTLCUpdate_write"))) TS_HTLCUpdate_write(uint64_t obj) {
LDKHTLCUpdate obj_conv;
obj_conv.inner = untag_ptr(obj);
return ret_ref;
}
-uint64_t __attribute__((export_name("TS_Balance_maybe_claimable_htlcawaiting_timeout"))) TS_Balance_maybe_claimable_htlcawaiting_timeout(int64_t claimable_amount_satoshis, int32_t claimable_height) {
+uint64_t __attribute__((export_name("TS_Balance_maybe_timeout_claimable_htlc"))) TS_Balance_maybe_timeout_claimable_htlc(int64_t claimable_amount_satoshis, int32_t claimable_height) {
LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
- *ret_copy = Balance_maybe_claimable_htlcawaiting_timeout(claimable_amount_satoshis, claimable_height);
+ *ret_copy = Balance_maybe_timeout_claimable_htlc(claimable_amount_satoshis, claimable_height);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+uint64_t __attribute__((export_name("TS_Balance_maybe_preimage_claimable_htlc"))) TS_Balance_maybe_preimage_claimable_htlc(int64_t claimable_amount_satoshis, int32_t expiry_height) {
+ LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
+ *ret_copy = Balance_maybe_preimage_claimable_htlc(claimable_amount_satoshis, expiry_height);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+uint64_t __attribute__((export_name("TS_Balance_counterparty_revoked_output_claimable"))) TS_Balance_counterparty_revoked_output_claimable(int64_t claimable_amount_satoshis) {
+ LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
+ *ret_copy = Balance_counterparty_revoked_output_claimable(claimable_amount_satoshis);
uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
this_arg_conv.is_owned = ptr_is_owned(this_arg);
CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
this_arg_conv.is_owned = false;
- unsigned char header_arr[80];
+ uint8_t header_arr[80];
CHECK(header->arr_len == 80);
memcpy(header_arr, header->elems, 80); FREE(header);
- unsigned char (*header_ref)[80] = &header_arr;
+ uint8_t (*header_ref)[80] = &header_arr;
LDKCVec_C2Tuple_usizeTransactionZZ txdata_constr;
txdata_constr.datalen = txdata->arr_len;
if (txdata_constr.datalen > 0)
this_arg_conv.is_owned = ptr_is_owned(this_arg);
CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
this_arg_conv.is_owned = false;
- unsigned char header_arr[80];
+ uint8_t header_arr[80];
CHECK(header->arr_len == 80);
memcpy(header_arr, header->elems, 80); FREE(header);
- unsigned char (*header_ref)[80] = &header_arr;
+ uint8_t (*header_ref)[80] = &header_arr;
void* broadcaster_ptr = untag_ptr(broadcaster);
CHECK_ACCESS(broadcaster_ptr);
LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
this_arg_conv.is_owned = ptr_is_owned(this_arg);
CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
this_arg_conv.is_owned = false;
- unsigned char header_arr[80];
+ uint8_t header_arr[80];
CHECK(header->arr_len == 80);
memcpy(header_arr, header->elems, 80); FREE(header);
- unsigned char (*header_ref)[80] = &header_arr;
+ uint8_t (*header_ref)[80] = &header_arr;
LDKCVec_C2Tuple_usizeTransactionZZ txdata_constr;
txdata_constr.datalen = txdata->arr_len;
if (txdata_constr.datalen > 0)
this_arg_conv.is_owned = ptr_is_owned(this_arg);
CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
this_arg_conv.is_owned = false;
- unsigned char txid_arr[32];
+ uint8_t txid_arr[32];
CHECK(txid->arr_len == 32);
memcpy(txid_arr, txid->elems, 32); FREE(txid);
- unsigned char (*txid_ref)[32] = &txid_arr;
+ uint8_t (*txid_ref)[32] = &txid_arr;
void* broadcaster_ptr = untag_ptr(broadcaster);
CHECK_ACCESS(broadcaster_ptr);
LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
this_arg_conv.is_owned = ptr_is_owned(this_arg);
CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
this_arg_conv.is_owned = false;
- unsigned char header_arr[80];
+ uint8_t header_arr[80];
CHECK(header->arr_len == 80);
memcpy(header_arr, header->elems, 80); FREE(header);
- unsigned char (*header_ref)[80] = &header_arr;
+ uint8_t (*header_ref)[80] = &header_arr;
void* broadcaster_ptr = untag_ptr(broadcaster);
CHECK_ACCESS(broadcaster_ptr);
LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
return ret_arr;
}
-ptrArray __attribute__((export_name("TS_ChannelMonitor_get_relevant_txids"))) TS_ChannelMonitor_get_relevant_txids(uint64_t this_arg) {
+uint64_tArray __attribute__((export_name("TS_ChannelMonitor_get_relevant_txids"))) TS_ChannelMonitor_get_relevant_txids(uint64_t this_arg) {
LDKChannelMonitor this_arg_conv;
this_arg_conv.inner = untag_ptr(this_arg);
this_arg_conv.is_owned = ptr_is_owned(this_arg);
CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
this_arg_conv.is_owned = false;
- LDKCVec_TxidZ ret_var = ChannelMonitor_get_relevant_txids(&this_arg_conv);
- ptrArray ret_arr = NULL;
- ret_arr = init_ptrArray(ret_var.datalen, __LINE__);
- int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 8);
- for (size_t m = 0; m < ret_var.datalen; m++) {
- int8_tArray ret_conv_12_arr = init_int8_tArray(32, __LINE__);
- memcpy(ret_conv_12_arr->elems, ret_var.data[m].data, 32);
- ret_arr_ptr[m] = ret_conv_12_arr;
+ LDKCVec_C2Tuple_TxidBlockHashZZ ret_var = ChannelMonitor_get_relevant_txids(&this_arg_conv);
+ uint64_tArray ret_arr = NULL;
+ ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
+ uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
+ for (size_t z = 0; z < ret_var.datalen; z++) {
+ LDKC2Tuple_TxidBlockHashZ* ret_conv_25_conv = MALLOC(sizeof(LDKC2Tuple_TxidBlockHashZ), "LDKC2Tuple_TxidBlockHashZ");
+ *ret_conv_25_conv = ret_var.data[z];
+ ret_arr_ptr[z] = tag_ptr(ret_conv_25_conv, true);
}
FREE(ret_var.data);
return ret_arr;
}
-uint64_t __attribute__((export_name("TS_C2Tuple_BlockHashChannelMonitorZ_read"))) TS_C2Tuple_BlockHashChannelMonitorZ_read(int8_tArray ser, uint64_t arg) {
+uint64_t __attribute__((export_name("TS_C2Tuple_BlockHashChannelMonitorZ_read"))) TS_C2Tuple_BlockHashChannelMonitorZ_read(int8_tArray ser, uint64_t arg_a, uint64_t arg_b) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
ser_ref.data = ser->elems;
- void* arg_ptr = untag_ptr(arg);
- if (ptr_is_owned(arg)) { CHECK_ACCESS(arg_ptr); }
- LDKKeysInterface* arg_conv = (LDKKeysInterface*)arg_ptr;
+ void* arg_a_ptr = untag_ptr(arg_a);
+ if (ptr_is_owned(arg_a)) { CHECK_ACCESS(arg_a_ptr); }
+ LDKEntropySource* arg_a_conv = (LDKEntropySource*)arg_a_ptr;
+ void* arg_b_ptr = untag_ptr(arg_b);
+ if (ptr_is_owned(arg_b)) { CHECK_ACCESS(arg_b_ptr); }
+ LDKSignerProvider* arg_b_conv = (LDKSignerProvider*)arg_b_ptr;
LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ");
- *ret_conv = C2Tuple_BlockHashChannelMonitorZ_read(ser_ref, arg_conv);
+ *ret_conv = C2Tuple_BlockHashChannelMonitorZ_read(ser_ref, arg_a_conv, arg_b_conv);
FREE(ser);
return tag_ptr(ret_conv, true);
}
return ret_ref;
}
+jboolean __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_eq"))) TS_DelayedPaymentOutputDescriptor_eq(uint64_t a, uint64_t b) {
+ LDKDelayedPaymentOutputDescriptor a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKDelayedPaymentOutputDescriptor b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = DelayedPaymentOutputDescriptor_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
int8_tArray __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_write"))) TS_DelayedPaymentOutputDescriptor_write(uint64_t obj) {
LDKDelayedPaymentOutputDescriptor obj_conv;
obj_conv.inner = untag_ptr(obj);
return ret_ref;
}
+jboolean __attribute__((export_name("TS_StaticPaymentOutputDescriptor_eq"))) TS_StaticPaymentOutputDescriptor_eq(uint64_t a, uint64_t b) {
+ LDKStaticPaymentOutputDescriptor a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKStaticPaymentOutputDescriptor b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = StaticPaymentOutputDescriptor_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
int8_tArray __attribute__((export_name("TS_StaticPaymentOutputDescriptor_write"))) TS_StaticPaymentOutputDescriptor_write(uint64_t obj) {
LDKStaticPaymentOutputDescriptor obj_conv;
obj_conv.inner = untag_ptr(obj);
return ret_ref;
}
+jboolean __attribute__((export_name("TS_SpendableOutputDescriptor_eq"))) TS_SpendableOutputDescriptor_eq(uint64_t a, uint64_t b) {
+ LDKSpendableOutputDescriptor* a_conv = (LDKSpendableOutputDescriptor*)untag_ptr(a);
+ LDKSpendableOutputDescriptor* b_conv = (LDKSpendableOutputDescriptor*)untag_ptr(b);
+ jboolean ret_conv = SpendableOutputDescriptor_eq(a_conv, b_conv);
+ return ret_conv;
+}
+
int8_tArray __attribute__((export_name("TS_SpendableOutputDescriptor_write"))) TS_SpendableOutputDescriptor_write(uint64_t obj) {
LDKSpendableOutputDescriptor* obj_conv = (LDKSpendableOutputDescriptor*)untag_ptr(obj);
LDKCVec_u8Z ret_var = SpendableOutputDescriptor_write(obj_conv);
return tag_ptr(ret_conv, true);
}
-void __attribute__((export_name("TS_BaseSign_free"))) TS_BaseSign_free(uint64_t this_ptr) {
+void __attribute__((export_name("TS_ChannelSigner_free"))) TS_ChannelSigner_free(uint64_t this_ptr) {
+ if (!ptr_is_owned(this_ptr)) return;
+ void* this_ptr_ptr = untag_ptr(this_ptr);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKChannelSigner this_ptr_conv = *(LDKChannelSigner*)(this_ptr_ptr);
+ FREE(untag_ptr(this_ptr));
+ ChannelSigner_free(this_ptr_conv);
+}
+
+void __attribute__((export_name("TS_EcdsaChannelSigner_free"))) TS_EcdsaChannelSigner_free(uint64_t this_ptr) {
if (!ptr_is_owned(this_ptr)) return;
void* this_ptr_ptr = untag_ptr(this_ptr);
CHECK_ACCESS(this_ptr_ptr);
- LDKBaseSign this_ptr_conv = *(LDKBaseSign*)(this_ptr_ptr);
+ LDKEcdsaChannelSigner this_ptr_conv = *(LDKEcdsaChannelSigner*)(this_ptr_ptr);
FREE(untag_ptr(this_ptr));
- BaseSign_free(this_ptr_conv);
+ EcdsaChannelSigner_free(this_ptr_conv);
}
-static inline uint64_t Sign_clone_ptr(LDKSign *NONNULL_PTR arg) {
- LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign");
- *ret_ret = Sign_clone(arg);
+static inline uint64_t WriteableEcdsaChannelSigner_clone_ptr(LDKWriteableEcdsaChannelSigner *NONNULL_PTR arg) {
+ LDKWriteableEcdsaChannelSigner* ret_ret = MALLOC(sizeof(LDKWriteableEcdsaChannelSigner), "LDKWriteableEcdsaChannelSigner");
+ *ret_ret = WriteableEcdsaChannelSigner_clone(arg);
return tag_ptr(ret_ret, true);
}
-int64_t __attribute__((export_name("TS_Sign_clone_ptr"))) TS_Sign_clone_ptr(uint64_t arg) {
+int64_t __attribute__((export_name("TS_WriteableEcdsaChannelSigner_clone_ptr"))) TS_WriteableEcdsaChannelSigner_clone_ptr(uint64_t arg) {
void* arg_ptr = untag_ptr(arg);
if (ptr_is_owned(arg)) { CHECK_ACCESS(arg_ptr); }
- LDKSign* arg_conv = (LDKSign*)arg_ptr;
- int64_t ret_conv = Sign_clone_ptr(arg_conv);
+ LDKWriteableEcdsaChannelSigner* arg_conv = (LDKWriteableEcdsaChannelSigner*)arg_ptr;
+ int64_t ret_conv = WriteableEcdsaChannelSigner_clone_ptr(arg_conv);
return ret_conv;
}
-uint64_t __attribute__((export_name("TS_Sign_clone"))) TS_Sign_clone(uint64_t orig) {
+uint64_t __attribute__((export_name("TS_WriteableEcdsaChannelSigner_clone"))) TS_WriteableEcdsaChannelSigner_clone(uint64_t orig) {
void* orig_ptr = untag_ptr(orig);
if (ptr_is_owned(orig)) { CHECK_ACCESS(orig_ptr); }
- LDKSign* orig_conv = (LDKSign*)orig_ptr;
- LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign");
- *ret_ret = Sign_clone(orig_conv);
+ LDKWriteableEcdsaChannelSigner* orig_conv = (LDKWriteableEcdsaChannelSigner*)orig_ptr;
+ LDKWriteableEcdsaChannelSigner* ret_ret = MALLOC(sizeof(LDKWriteableEcdsaChannelSigner), "LDKWriteableEcdsaChannelSigner");
+ *ret_ret = WriteableEcdsaChannelSigner_clone(orig_conv);
return tag_ptr(ret_ret, true);
}
-void __attribute__((export_name("TS_Sign_free"))) TS_Sign_free(uint64_t this_ptr) {
+void __attribute__((export_name("TS_WriteableEcdsaChannelSigner_free"))) TS_WriteableEcdsaChannelSigner_free(uint64_t this_ptr) {
if (!ptr_is_owned(this_ptr)) return;
void* this_ptr_ptr = untag_ptr(this_ptr);
CHECK_ACCESS(this_ptr_ptr);
- LDKSign this_ptr_conv = *(LDKSign*)(this_ptr_ptr);
+ LDKWriteableEcdsaChannelSigner this_ptr_conv = *(LDKWriteableEcdsaChannelSigner*)(this_ptr_ptr);
FREE(untag_ptr(this_ptr));
- Sign_free(this_ptr_conv);
+ WriteableEcdsaChannelSigner_free(this_ptr_conv);
}
uint32_t __attribute__((export_name("TS_Recipient_clone"))) TS_Recipient_clone(uint64_t orig) {
return ret_conv;
}
-void __attribute__((export_name("TS_KeysInterface_free"))) TS_KeysInterface_free(uint64_t this_ptr) {
+void __attribute__((export_name("TS_EntropySource_free"))) TS_EntropySource_free(uint64_t this_ptr) {
if (!ptr_is_owned(this_ptr)) return;
void* this_ptr_ptr = untag_ptr(this_ptr);
CHECK_ACCESS(this_ptr_ptr);
- LDKKeysInterface this_ptr_conv = *(LDKKeysInterface*)(this_ptr_ptr);
+ LDKEntropySource this_ptr_conv = *(LDKEntropySource*)(this_ptr_ptr);
FREE(untag_ptr(this_ptr));
- KeysInterface_free(this_ptr_conv);
+ EntropySource_free(this_ptr_conv);
+}
+
+void __attribute__((export_name("TS_NodeSigner_free"))) TS_NodeSigner_free(uint64_t this_ptr) {
+ if (!ptr_is_owned(this_ptr)) return;
+ void* this_ptr_ptr = untag_ptr(this_ptr);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKNodeSigner this_ptr_conv = *(LDKNodeSigner*)(this_ptr_ptr);
+ FREE(untag_ptr(this_ptr));
+ NodeSigner_free(this_ptr_conv);
+}
+
+void __attribute__((export_name("TS_SignerProvider_free"))) TS_SignerProvider_free(uint64_t this_ptr) {
+ if (!ptr_is_owned(this_ptr)) return;
+ void* this_ptr_ptr = untag_ptr(this_ptr);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKSignerProvider this_ptr_conv = *(LDKSignerProvider*)(this_ptr_ptr);
+ FREE(untag_ptr(this_ptr));
+ SignerProvider_free(this_ptr_conv);
}
void __attribute__((export_name("TS_InMemorySigner_free"))) TS_InMemorySigner_free(uint64_t this_obj) {
return ret_ref;
}
-uint64_t __attribute__((export_name("TS_InMemorySigner_new"))) TS_InMemorySigner_new(int8_tArray node_secret, int8_tArray funding_key, int8_tArray revocation_base_key, int8_tArray payment_key, int8_tArray delayed_payment_base_key, int8_tArray htlc_base_key, int8_tArray commitment_seed, int64_t channel_value_satoshis, int8_tArray channel_keys_id) {
- LDKSecretKey node_secret_ref;
- CHECK(node_secret->arr_len == 32);
- memcpy(node_secret_ref.bytes, node_secret->elems, 32); FREE(node_secret);
+uint64_t __attribute__((export_name("TS_InMemorySigner_new"))) TS_InMemorySigner_new(int8_tArray funding_key, int8_tArray revocation_base_key, int8_tArray payment_key, int8_tArray delayed_payment_base_key, int8_tArray htlc_base_key, int8_tArray commitment_seed, int64_t channel_value_satoshis, int8_tArray channel_keys_id) {
LDKSecretKey funding_key_ref;
CHECK(funding_key->arr_len == 32);
memcpy(funding_key_ref.bytes, funding_key->elems, 32); FREE(funding_key);
LDKThirtyTwoBytes channel_keys_id_ref;
CHECK(channel_keys_id->arr_len == 32);
memcpy(channel_keys_id_ref.data, channel_keys_id->elems, 32); FREE(channel_keys_id);
- LDKInMemorySigner ret_var = InMemorySigner_new(node_secret_ref, funding_key_ref, revocation_base_key_ref, payment_key_ref, delayed_payment_base_key_ref, htlc_base_key_ref, commitment_seed_ref, channel_value_satoshis, channel_keys_id_ref);
+ LDKInMemorySigner ret_var = InMemorySigner_new(funding_key_ref, revocation_base_key_ref, payment_key_ref, delayed_payment_base_key_ref, htlc_base_key_ref, commitment_seed_ref, channel_value_satoshis, channel_keys_id_ref);
uint64_t ret_ref = 0;
CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
return tag_ptr(ret_conv, true);
}
-uint64_t __attribute__((export_name("TS_InMemorySigner_as_BaseSign"))) TS_InMemorySigner_as_BaseSign(uint64_t this_arg) {
+uint64_t __attribute__((export_name("TS_InMemorySigner_as_ChannelSigner"))) TS_InMemorySigner_as_ChannelSigner(uint64_t this_arg) {
LDKInMemorySigner this_arg_conv;
this_arg_conv.inner = untag_ptr(this_arg);
this_arg_conv.is_owned = ptr_is_owned(this_arg);
CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
this_arg_conv.is_owned = false;
- LDKBaseSign* ret_ret = MALLOC(sizeof(LDKBaseSign), "LDKBaseSign");
- *ret_ret = InMemorySigner_as_BaseSign(&this_arg_conv);
+ LDKChannelSigner* ret_ret = MALLOC(sizeof(LDKChannelSigner), "LDKChannelSigner");
+ *ret_ret = InMemorySigner_as_ChannelSigner(&this_arg_conv);
return tag_ptr(ret_ret, true);
}
-uint64_t __attribute__((export_name("TS_InMemorySigner_as_Sign"))) TS_InMemorySigner_as_Sign(uint64_t this_arg) {
+uint64_t __attribute__((export_name("TS_InMemorySigner_as_EcdsaChannelSigner"))) TS_InMemorySigner_as_EcdsaChannelSigner(uint64_t this_arg) {
LDKInMemorySigner this_arg_conv;
this_arg_conv.inner = untag_ptr(this_arg);
this_arg_conv.is_owned = ptr_is_owned(this_arg);
CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
this_arg_conv.is_owned = false;
- LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign");
- *ret_ret = InMemorySigner_as_Sign(&this_arg_conv);
+ LDKEcdsaChannelSigner* ret_ret = MALLOC(sizeof(LDKEcdsaChannelSigner), "LDKEcdsaChannelSigner");
+ *ret_ret = InMemorySigner_as_EcdsaChannelSigner(&this_arg_conv);
+ return tag_ptr(ret_ret, true);
+}
+
+uint64_t __attribute__((export_name("TS_InMemorySigner_as_WriteableEcdsaChannelSigner"))) TS_InMemorySigner_as_WriteableEcdsaChannelSigner(uint64_t this_arg) {
+ LDKInMemorySigner this_arg_conv;
+ this_arg_conv.inner = untag_ptr(this_arg);
+ this_arg_conv.is_owned = ptr_is_owned(this_arg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ this_arg_conv.is_owned = false;
+ LDKWriteableEcdsaChannelSigner* ret_ret = MALLOC(sizeof(LDKWriteableEcdsaChannelSigner), "LDKWriteableEcdsaChannelSigner");
+ *ret_ret = InMemorySigner_as_WriteableEcdsaChannelSigner(&this_arg_conv);
return tag_ptr(ret_ret, true);
}
return ret_arr;
}
-uint64_t __attribute__((export_name("TS_InMemorySigner_read"))) TS_InMemorySigner_read(int8_tArray ser, int8_tArray arg) {
+uint64_t __attribute__((export_name("TS_InMemorySigner_read"))) TS_InMemorySigner_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
ser_ref.data = ser->elems;
- LDKSecretKey arg_ref;
- CHECK(arg->arr_len == 32);
- memcpy(arg_ref.bytes, arg->elems, 32); FREE(arg);
LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ");
- *ret_conv = InMemorySigner_read(ser_ref, arg_ref);
+ *ret_conv = InMemorySigner_read(ser_ref);
FREE(ser);
return tag_ptr(ret_conv, true);
}
}
uint64_t __attribute__((export_name("TS_KeysManager_new"))) TS_KeysManager_new(int8_tArray seed, int64_t starting_time_secs, int32_t starting_time_nanos) {
- unsigned char seed_arr[32];
+ uint8_t seed_arr[32];
CHECK(seed->arr_len == 32);
memcpy(seed_arr, seed->elems, 32); FREE(seed);
- unsigned char (*seed_ref)[32] = &seed_arr;
+ uint8_t (*seed_ref)[32] = &seed_arr;
LDKKeysManager ret_var = KeysManager_new(seed_ref, starting_time_secs, starting_time_nanos);
uint64_t ret_ref = 0;
CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
return ret_ref;
}
+int8_tArray __attribute__((export_name("TS_KeysManager_get_node_secret_key"))) TS_KeysManager_get_node_secret_key(uint64_t this_arg) {
+ LDKKeysManager this_arg_conv;
+ this_arg_conv.inner = untag_ptr(this_arg);
+ this_arg_conv.is_owned = ptr_is_owned(this_arg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ this_arg_conv.is_owned = false;
+ int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
+ memcpy(ret_arr->elems, KeysManager_get_node_secret_key(&this_arg_conv).bytes, 32);
+ return ret_arr;
+}
+
uint64_t __attribute__((export_name("TS_KeysManager_derive_channel_keys"))) TS_KeysManager_derive_channel_keys(uint64_t this_arg, int64_t channel_value_satoshis, int8_tArray params) {
LDKKeysManager this_arg_conv;
this_arg_conv.inner = untag_ptr(this_arg);
this_arg_conv.is_owned = ptr_is_owned(this_arg);
CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
this_arg_conv.is_owned = false;
- unsigned char params_arr[32];
+ uint8_t params_arr[32];
CHECK(params->arr_len == 32);
memcpy(params_arr, params->elems, 32); FREE(params);
- unsigned char (*params_ref)[32] = ¶ms_arr;
+ uint8_t (*params_ref)[32] = ¶ms_arr;
LDKInMemorySigner ret_var = KeysManager_derive_channel_keys(&this_arg_conv, channel_value_satoshis, params_ref);
uint64_t ret_ref = 0;
CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
return tag_ptr(ret_conv, true);
}
-uint64_t __attribute__((export_name("TS_KeysManager_as_KeysInterface"))) TS_KeysManager_as_KeysInterface(uint64_t this_arg) {
+uint64_t __attribute__((export_name("TS_KeysManager_as_EntropySource"))) TS_KeysManager_as_EntropySource(uint64_t this_arg) {
+ LDKKeysManager this_arg_conv;
+ this_arg_conv.inner = untag_ptr(this_arg);
+ this_arg_conv.is_owned = ptr_is_owned(this_arg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ this_arg_conv.is_owned = false;
+ LDKEntropySource* ret_ret = MALLOC(sizeof(LDKEntropySource), "LDKEntropySource");
+ *ret_ret = KeysManager_as_EntropySource(&this_arg_conv);
+ return tag_ptr(ret_ret, true);
+}
+
+uint64_t __attribute__((export_name("TS_KeysManager_as_NodeSigner"))) TS_KeysManager_as_NodeSigner(uint64_t this_arg) {
+ LDKKeysManager this_arg_conv;
+ this_arg_conv.inner = untag_ptr(this_arg);
+ this_arg_conv.is_owned = ptr_is_owned(this_arg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ this_arg_conv.is_owned = false;
+ LDKNodeSigner* ret_ret = MALLOC(sizeof(LDKNodeSigner), "LDKNodeSigner");
+ *ret_ret = KeysManager_as_NodeSigner(&this_arg_conv);
+ return tag_ptr(ret_ret, true);
+}
+
+uint64_t __attribute__((export_name("TS_KeysManager_as_SignerProvider"))) TS_KeysManager_as_SignerProvider(uint64_t this_arg) {
LDKKeysManager this_arg_conv;
this_arg_conv.inner = untag_ptr(this_arg);
this_arg_conv.is_owned = ptr_is_owned(this_arg);
CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
this_arg_conv.is_owned = false;
- LDKKeysInterface* ret_ret = MALLOC(sizeof(LDKKeysInterface), "LDKKeysInterface");
- *ret_ret = KeysManager_as_KeysInterface(&this_arg_conv);
+ LDKSignerProvider* ret_ret = MALLOC(sizeof(LDKSignerProvider), "LDKSignerProvider");
+ *ret_ret = KeysManager_as_SignerProvider(&this_arg_conv);
return tag_ptr(ret_ret, true);
}
PhantomKeysManager_free(this_obj_conv);
}
-uint64_t __attribute__((export_name("TS_PhantomKeysManager_as_KeysInterface"))) TS_PhantomKeysManager_as_KeysInterface(uint64_t this_arg) {
+uint64_t __attribute__((export_name("TS_PhantomKeysManager_as_EntropySource"))) TS_PhantomKeysManager_as_EntropySource(uint64_t this_arg) {
+ LDKPhantomKeysManager this_arg_conv;
+ this_arg_conv.inner = untag_ptr(this_arg);
+ this_arg_conv.is_owned = ptr_is_owned(this_arg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ this_arg_conv.is_owned = false;
+ LDKEntropySource* ret_ret = MALLOC(sizeof(LDKEntropySource), "LDKEntropySource");
+ *ret_ret = PhantomKeysManager_as_EntropySource(&this_arg_conv);
+ return tag_ptr(ret_ret, true);
+}
+
+uint64_t __attribute__((export_name("TS_PhantomKeysManager_as_NodeSigner"))) TS_PhantomKeysManager_as_NodeSigner(uint64_t this_arg) {
LDKPhantomKeysManager this_arg_conv;
this_arg_conv.inner = untag_ptr(this_arg);
this_arg_conv.is_owned = ptr_is_owned(this_arg);
CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
this_arg_conv.is_owned = false;
- LDKKeysInterface* ret_ret = MALLOC(sizeof(LDKKeysInterface), "LDKKeysInterface");
- *ret_ret = PhantomKeysManager_as_KeysInterface(&this_arg_conv);
+ LDKNodeSigner* ret_ret = MALLOC(sizeof(LDKNodeSigner), "LDKNodeSigner");
+ *ret_ret = PhantomKeysManager_as_NodeSigner(&this_arg_conv);
+ return tag_ptr(ret_ret, true);
+}
+
+uint64_t __attribute__((export_name("TS_PhantomKeysManager_as_SignerProvider"))) TS_PhantomKeysManager_as_SignerProvider(uint64_t this_arg) {
+ LDKPhantomKeysManager this_arg_conv;
+ this_arg_conv.inner = untag_ptr(this_arg);
+ this_arg_conv.is_owned = ptr_is_owned(this_arg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ this_arg_conv.is_owned = false;
+ LDKSignerProvider* ret_ret = MALLOC(sizeof(LDKSignerProvider), "LDKSignerProvider");
+ *ret_ret = PhantomKeysManager_as_SignerProvider(&this_arg_conv);
return tag_ptr(ret_ret, true);
}
uint64_t __attribute__((export_name("TS_PhantomKeysManager_new"))) TS_PhantomKeysManager_new(int8_tArray seed, int64_t starting_time_secs, int32_t starting_time_nanos, int8_tArray cross_node_seed) {
- unsigned char seed_arr[32];
+ uint8_t seed_arr[32];
CHECK(seed->arr_len == 32);
memcpy(seed_arr, seed->elems, 32); FREE(seed);
- unsigned char (*seed_ref)[32] = &seed_arr;
- unsigned char cross_node_seed_arr[32];
+ uint8_t (*seed_ref)[32] = &seed_arr;
+ uint8_t cross_node_seed_arr[32];
CHECK(cross_node_seed->arr_len == 32);
memcpy(cross_node_seed_arr, cross_node_seed->elems, 32); FREE(cross_node_seed);
- unsigned char (*cross_node_seed_ref)[32] = &cross_node_seed_arr;
+ uint8_t (*cross_node_seed_ref)[32] = &cross_node_seed_arr;
LDKPhantomKeysManager ret_var = PhantomKeysManager_new(seed_ref, starting_time_secs, starting_time_nanos, cross_node_seed_ref);
uint64_t ret_ref = 0;
CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
this_arg_conv.is_owned = ptr_is_owned(this_arg);
CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
this_arg_conv.is_owned = false;
- unsigned char params_arr[32];
+ uint8_t params_arr[32];
CHECK(params->arr_len == 32);
memcpy(params_arr, params->elems, 32); FREE(params);
- unsigned char (*params_ref)[32] = ¶ms_arr;
+ uint8_t (*params_ref)[32] = ¶ms_arr;
LDKInMemorySigner ret_var = PhantomKeysManager_derive_channel_keys(&this_arg_conv, channel_value_satoshis, params_ref);
uint64_t ret_ref = 0;
CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
return ret_ref;
}
+int8_tArray __attribute__((export_name("TS_PhantomKeysManager_get_node_secret_key"))) TS_PhantomKeysManager_get_node_secret_key(uint64_t this_arg) {
+ LDKPhantomKeysManager this_arg_conv;
+ this_arg_conv.inner = untag_ptr(this_arg);
+ this_arg_conv.is_owned = ptr_is_owned(this_arg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ this_arg_conv.is_owned = false;
+ int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
+ memcpy(ret_arr->elems, PhantomKeysManager_get_node_secret_key(&this_arg_conv).bytes, 32);
+ return ret_arr;
+}
+
+int8_tArray __attribute__((export_name("TS_PhantomKeysManager_get_phantom_node_secret_key"))) TS_PhantomKeysManager_get_phantom_node_secret_key(uint64_t this_arg) {
+ LDKPhantomKeysManager this_arg_conv;
+ this_arg_conv.inner = untag_ptr(this_arg);
+ this_arg_conv.is_owned = ptr_is_owned(this_arg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ this_arg_conv.is_owned = false;
+ int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
+ memcpy(ret_arr->elems, PhantomKeysManager_get_phantom_node_secret_key(&this_arg_conv).bytes, 32);
+ return ret_arr;
+}
+
+uint32_t __attribute__((export_name("TS_FailureCode_clone"))) TS_FailureCode_clone(uint64_t orig) {
+ LDKFailureCode* orig_conv = (LDKFailureCode*)untag_ptr(orig);
+ uint32_t ret_conv = LDKFailureCode_to_js(FailureCode_clone(orig_conv));
+ return ret_conv;
+}
+
+uint32_t __attribute__((export_name("TS_FailureCode_temporary_node_failure"))) TS_FailureCode_temporary_node_failure() {
+ uint32_t ret_conv = LDKFailureCode_to_js(FailureCode_temporary_node_failure());
+ return ret_conv;
+}
+
+uint32_t __attribute__((export_name("TS_FailureCode_required_node_feature_missing"))) TS_FailureCode_required_node_feature_missing() {
+ uint32_t ret_conv = LDKFailureCode_to_js(FailureCode_required_node_feature_missing());
+ return ret_conv;
+}
+
+uint32_t __attribute__((export_name("TS_FailureCode_incorrect_or_unknown_payment_details"))) TS_FailureCode_incorrect_or_unknown_payment_details() {
+ uint32_t ret_conv = LDKFailureCode_to_js(FailureCode_incorrect_or_unknown_payment_details());
+ return ret_conv;
+}
+
void __attribute__((export_name("TS_ChannelManager_free"))) TS_ChannelManager_free(uint64_t this_obj) {
LDKChannelManager this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
ChannelDetails_set_unspendable_punishment_reserve(&this_ptr_conv, val_conv);
}
-int64_t __attribute__((export_name("TS_ChannelDetails_get_user_channel_id"))) TS_ChannelDetails_get_user_channel_id(uint64_t this_ptr) {
+int8_tArray __attribute__((export_name("TS_ChannelDetails_get_user_channel_id"))) TS_ChannelDetails_get_user_channel_id(uint64_t this_ptr) {
LDKChannelDetails this_ptr_conv;
this_ptr_conv.inner = untag_ptr(this_ptr);
this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
this_ptr_conv.is_owned = false;
- int64_t ret_conv = ChannelDetails_get_user_channel_id(&this_ptr_conv);
- return ret_conv;
+ int8_tArray ret_arr = init_int8_tArray(16, __LINE__);
+ memcpy(ret_arr->elems, ChannelDetails_get_user_channel_id(&this_ptr_conv).le_bytes, 16);
+ return ret_arr;
}
-void __attribute__((export_name("TS_ChannelDetails_set_user_channel_id"))) TS_ChannelDetails_set_user_channel_id(uint64_t this_ptr, int64_t val) {
+void __attribute__((export_name("TS_ChannelDetails_set_user_channel_id"))) TS_ChannelDetails_set_user_channel_id(uint64_t this_ptr, int8_tArray val) {
LDKChannelDetails this_ptr_conv;
this_ptr_conv.inner = untag_ptr(this_ptr);
this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
this_ptr_conv.is_owned = false;
- ChannelDetails_set_user_channel_id(&this_ptr_conv, val);
+ LDKU128 val_ref;
+ CHECK(val->arr_len == 16);
+ memcpy(val_ref.le_bytes, val->elems, 16); FREE(val);
+ ChannelDetails_set_user_channel_id(&this_ptr_conv, val_ref);
}
int64_t __attribute__((export_name("TS_ChannelDetails_get_balance_msat"))) TS_ChannelDetails_get_balance_msat(uint64_t this_ptr) {
ChannelDetails_set_confirmations_required(&this_ptr_conv, val_conv);
}
+uint64_t __attribute__((export_name("TS_ChannelDetails_get_confirmations"))) TS_ChannelDetails_get_confirmations(uint64_t this_ptr) {
+ LDKChannelDetails this_ptr_conv;
+ this_ptr_conv.inner = untag_ptr(this_ptr);
+ this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ this_ptr_conv.is_owned = false;
+ LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z");
+ *ret_copy = ChannelDetails_get_confirmations(&this_ptr_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+void __attribute__((export_name("TS_ChannelDetails_set_confirmations"))) TS_ChannelDetails_set_confirmations(uint64_t this_ptr, uint64_t val) {
+ LDKChannelDetails this_ptr_conv;
+ this_ptr_conv.inner = untag_ptr(this_ptr);
+ this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ this_ptr_conv.is_owned = false;
+ void* val_ptr = untag_ptr(val);
+ CHECK_ACCESS(val_ptr);
+ LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr);
+ val_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(val));
+ ChannelDetails_set_confirmations(&this_ptr_conv, val_conv);
+}
+
uint64_t __attribute__((export_name("TS_ChannelDetails_get_force_close_spend_delay"))) TS_ChannelDetails_get_force_close_spend_delay(uint64_t this_ptr) {
LDKChannelDetails this_ptr_conv;
this_ptr_conv.inner = untag_ptr(this_ptr);
ChannelDetails_set_config(&this_ptr_conv, val_conv);
}
-uint64_t __attribute__((export_name("TS_ChannelDetails_new"))) TS_ChannelDetails_new(int8_tArray channel_id_arg, uint64_t counterparty_arg, uint64_t funding_txo_arg, uint64_t channel_type_arg, uint64_t short_channel_id_arg, uint64_t outbound_scid_alias_arg, uint64_t inbound_scid_alias_arg, int64_t channel_value_satoshis_arg, uint64_t unspendable_punishment_reserve_arg, int64_t user_channel_id_arg, int64_t balance_msat_arg, int64_t outbound_capacity_msat_arg, int64_t next_outbound_htlc_limit_msat_arg, int64_t inbound_capacity_msat_arg, uint64_t confirmations_required_arg, uint64_t force_close_spend_delay_arg, jboolean is_outbound_arg, jboolean is_channel_ready_arg, jboolean is_usable_arg, jboolean is_public_arg, uint64_t inbound_htlc_minimum_msat_arg, uint64_t inbound_htlc_maximum_msat_arg, uint64_t config_arg) {
+uint64_t __attribute__((export_name("TS_ChannelDetails_new"))) TS_ChannelDetails_new(int8_tArray channel_id_arg, uint64_t counterparty_arg, uint64_t funding_txo_arg, uint64_t channel_type_arg, uint64_t short_channel_id_arg, uint64_t outbound_scid_alias_arg, uint64_t inbound_scid_alias_arg, int64_t channel_value_satoshis_arg, uint64_t unspendable_punishment_reserve_arg, int8_tArray user_channel_id_arg, int64_t balance_msat_arg, int64_t outbound_capacity_msat_arg, int64_t next_outbound_htlc_limit_msat_arg, int64_t inbound_capacity_msat_arg, uint64_t confirmations_required_arg, uint64_t confirmations_arg, uint64_t force_close_spend_delay_arg, jboolean is_outbound_arg, jboolean is_channel_ready_arg, jboolean is_usable_arg, jboolean is_public_arg, uint64_t inbound_htlc_minimum_msat_arg, uint64_t inbound_htlc_maximum_msat_arg, uint64_t config_arg) {
LDKThirtyTwoBytes channel_id_arg_ref;
CHECK(channel_id_arg->arr_len == 32);
memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg);
void* unspendable_punishment_reserve_arg_ptr = untag_ptr(unspendable_punishment_reserve_arg);
CHECK_ACCESS(unspendable_punishment_reserve_arg_ptr);
LDKCOption_u64Z unspendable_punishment_reserve_arg_conv = *(LDKCOption_u64Z*)(unspendable_punishment_reserve_arg_ptr);
+ LDKU128 user_channel_id_arg_ref;
+ CHECK(user_channel_id_arg->arr_len == 16);
+ memcpy(user_channel_id_arg_ref.le_bytes, user_channel_id_arg->elems, 16); FREE(user_channel_id_arg);
void* confirmations_required_arg_ptr = untag_ptr(confirmations_required_arg);
CHECK_ACCESS(confirmations_required_arg_ptr);
LDKCOption_u32Z confirmations_required_arg_conv = *(LDKCOption_u32Z*)(confirmations_required_arg_ptr);
confirmations_required_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(confirmations_required_arg));
+ void* confirmations_arg_ptr = untag_ptr(confirmations_arg);
+ CHECK_ACCESS(confirmations_arg_ptr);
+ LDKCOption_u32Z confirmations_arg_conv = *(LDKCOption_u32Z*)(confirmations_arg_ptr);
+ confirmations_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(confirmations_arg));
void* force_close_spend_delay_arg_ptr = untag_ptr(force_close_spend_delay_arg);
CHECK_ACCESS(force_close_spend_delay_arg_ptr);
LDKCOption_u16Z force_close_spend_delay_arg_conv = *(LDKCOption_u16Z*)(force_close_spend_delay_arg_ptr);
config_arg_conv.is_owned = ptr_is_owned(config_arg);
CHECK_INNER_FIELD_ACCESS_OR_NULL(config_arg_conv);
config_arg_conv = ChannelConfig_clone(&config_arg_conv);
- LDKChannelDetails ret_var = ChannelDetails_new(channel_id_arg_ref, counterparty_arg_conv, funding_txo_arg_conv, channel_type_arg_conv, short_channel_id_arg_conv, outbound_scid_alias_arg_conv, inbound_scid_alias_arg_conv, channel_value_satoshis_arg, unspendable_punishment_reserve_arg_conv, user_channel_id_arg, balance_msat_arg, outbound_capacity_msat_arg, next_outbound_htlc_limit_msat_arg, inbound_capacity_msat_arg, confirmations_required_arg_conv, force_close_spend_delay_arg_conv, is_outbound_arg, is_channel_ready_arg, is_usable_arg, is_public_arg, inbound_htlc_minimum_msat_arg_conv, inbound_htlc_maximum_msat_arg_conv, config_arg_conv);
+ LDKChannelDetails ret_var = ChannelDetails_new(channel_id_arg_ref, counterparty_arg_conv, funding_txo_arg_conv, channel_type_arg_conv, short_channel_id_arg_conv, outbound_scid_alias_arg_conv, inbound_scid_alias_arg_conv, channel_value_satoshis_arg, unspendable_punishment_reserve_arg_conv, user_channel_id_arg_ref, balance_msat_arg, outbound_capacity_msat_arg, next_outbound_htlc_limit_msat_arg, inbound_capacity_msat_arg, confirmations_required_arg_conv, confirmations_arg_conv, force_close_spend_delay_arg_conv, is_outbound_arg, is_channel_ready_arg, is_usable_arg, is_public_arg, inbound_htlc_minimum_msat_arg_conv, inbound_htlc_maximum_msat_arg_conv, config_arg_conv);
uint64_t ret_ref = 0;
CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
return ret_ref;
}
-void __attribute__((export_name("TS_PaymentSendFailure_free"))) TS_PaymentSendFailure_free(uint64_t this_ptr) {
+void __attribute__((export_name("TS_RecentPaymentDetails_free"))) TS_RecentPaymentDetails_free(uint64_t this_ptr) {
if (!ptr_is_owned(this_ptr)) return;
void* this_ptr_ptr = untag_ptr(this_ptr);
CHECK_ACCESS(this_ptr_ptr);
- LDKPaymentSendFailure this_ptr_conv = *(LDKPaymentSendFailure*)(this_ptr_ptr);
+ LDKRecentPaymentDetails this_ptr_conv = *(LDKRecentPaymentDetails*)(this_ptr_ptr);
FREE(untag_ptr(this_ptr));
- PaymentSendFailure_free(this_ptr_conv);
+ RecentPaymentDetails_free(this_ptr_conv);
}
-static inline uint64_t PaymentSendFailure_clone_ptr(LDKPaymentSendFailure *NONNULL_PTR arg) {
- LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
- *ret_copy = PaymentSendFailure_clone(arg);
+static inline uint64_t RecentPaymentDetails_clone_ptr(LDKRecentPaymentDetails *NONNULL_PTR arg) {
+ LDKRecentPaymentDetails *ret_copy = MALLOC(sizeof(LDKRecentPaymentDetails), "LDKRecentPaymentDetails");
+ *ret_copy = RecentPaymentDetails_clone(arg);
uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
-int64_t __attribute__((export_name("TS_PaymentSendFailure_clone_ptr"))) TS_PaymentSendFailure_clone_ptr(uint64_t arg) {
- LDKPaymentSendFailure* arg_conv = (LDKPaymentSendFailure*)untag_ptr(arg);
- int64_t ret_conv = PaymentSendFailure_clone_ptr(arg_conv);
+int64_t __attribute__((export_name("TS_RecentPaymentDetails_clone_ptr"))) TS_RecentPaymentDetails_clone_ptr(uint64_t arg) {
+ LDKRecentPaymentDetails* arg_conv = (LDKRecentPaymentDetails*)untag_ptr(arg);
+ int64_t ret_conv = RecentPaymentDetails_clone_ptr(arg_conv);
return ret_conv;
}
-uint64_t __attribute__((export_name("TS_PaymentSendFailure_clone"))) TS_PaymentSendFailure_clone(uint64_t orig) {
- LDKPaymentSendFailure* orig_conv = (LDKPaymentSendFailure*)untag_ptr(orig);
- LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
- *ret_copy = PaymentSendFailure_clone(orig_conv);
- uint64_t ret_ref = tag_ptr(ret_copy, true);
- return ret_ref;
-}
-
-uint64_t __attribute__((export_name("TS_PaymentSendFailure_parameter_error"))) TS_PaymentSendFailure_parameter_error(uint64_t a) {
- void* a_ptr = untag_ptr(a);
- CHECK_ACCESS(a_ptr);
- LDKAPIError a_conv = *(LDKAPIError*)(a_ptr);
- a_conv = APIError_clone((LDKAPIError*)untag_ptr(a));
- LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
- *ret_copy = PaymentSendFailure_parameter_error(a_conv);
+uint64_t __attribute__((export_name("TS_RecentPaymentDetails_clone"))) TS_RecentPaymentDetails_clone(uint64_t orig) {
+ LDKRecentPaymentDetails* orig_conv = (LDKRecentPaymentDetails*)untag_ptr(orig);
+ LDKRecentPaymentDetails *ret_copy = MALLOC(sizeof(LDKRecentPaymentDetails), "LDKRecentPaymentDetails");
+ *ret_copy = RecentPaymentDetails_clone(orig_conv);
uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
-uint64_t __attribute__((export_name("TS_PaymentSendFailure_path_parameter_error"))) TS_PaymentSendFailure_path_parameter_error(uint64_tArray a) {
- LDKCVec_CResult_NoneAPIErrorZZ a_constr;
- a_constr.datalen = a->arr_len;
- if (a_constr.datalen > 0)
- a_constr.data = MALLOC(a_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements");
- else
- a_constr.data = NULL;
- uint64_t* a_vals = a->elems;
- for (size_t w = 0; w < a_constr.datalen; w++) {
- uint64_t a_conv_22 = a_vals[w];
- void* a_conv_22_ptr = untag_ptr(a_conv_22);
- CHECK_ACCESS(a_conv_22_ptr);
- LDKCResult_NoneAPIErrorZ a_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(a_conv_22_ptr);
- a_conv_22_conv = CResult_NoneAPIErrorZ_clone((LDKCResult_NoneAPIErrorZ*)untag_ptr(a_conv_22));
- a_constr.data[w] = a_conv_22_conv;
- }
- FREE(a);
- LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
- *ret_copy = PaymentSendFailure_path_parameter_error(a_constr);
+uint64_t __attribute__((export_name("TS_RecentPaymentDetails_pending"))) TS_RecentPaymentDetails_pending(int8_tArray payment_hash, int64_t total_msat) {
+ LDKThirtyTwoBytes payment_hash_ref;
+ CHECK(payment_hash->arr_len == 32);
+ memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
+ LDKRecentPaymentDetails *ret_copy = MALLOC(sizeof(LDKRecentPaymentDetails), "LDKRecentPaymentDetails");
+ *ret_copy = RecentPaymentDetails_pending(payment_hash_ref, total_msat);
uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
-uint64_t __attribute__((export_name("TS_PaymentSendFailure_all_failed_retry_safe"))) TS_PaymentSendFailure_all_failed_retry_safe(uint64_tArray a) {
- LDKCVec_APIErrorZ a_constr;
- a_constr.datalen = a->arr_len;
- if (a_constr.datalen > 0)
- a_constr.data = MALLOC(a_constr.datalen * sizeof(LDKAPIError), "LDKCVec_APIErrorZ Elements");
- else
- a_constr.data = NULL;
- uint64_t* a_vals = a->elems;
- for (size_t k = 0; k < a_constr.datalen; k++) {
- uint64_t a_conv_10 = a_vals[k];
- void* a_conv_10_ptr = untag_ptr(a_conv_10);
- CHECK_ACCESS(a_conv_10_ptr);
- LDKAPIError a_conv_10_conv = *(LDKAPIError*)(a_conv_10_ptr);
- a_conv_10_conv = APIError_clone((LDKAPIError*)untag_ptr(a_conv_10));
- a_constr.data[k] = a_conv_10_conv;
- }
- FREE(a);
- LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
- *ret_copy = PaymentSendFailure_all_failed_retry_safe(a_constr);
+uint64_t __attribute__((export_name("TS_RecentPaymentDetails_fulfilled"))) TS_RecentPaymentDetails_fulfilled(int8_tArray payment_hash) {
+ LDKThirtyTwoBytes payment_hash_ref;
+ CHECK(payment_hash->arr_len == 32);
+ memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
+ LDKRecentPaymentDetails *ret_copy = MALLOC(sizeof(LDKRecentPaymentDetails), "LDKRecentPaymentDetails");
+ *ret_copy = RecentPaymentDetails_fulfilled(payment_hash_ref);
uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
-uint64_t __attribute__((export_name("TS_PaymentSendFailure_partial_failure"))) TS_PaymentSendFailure_partial_failure(uint64_tArray results, uint64_t failed_paths_retry, int8_tArray payment_id) {
- LDKCVec_CResult_NoneAPIErrorZZ results_constr;
- results_constr.datalen = results->arr_len;
- if (results_constr.datalen > 0)
- results_constr.data = MALLOC(results_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements");
- else
- results_constr.data = NULL;
- uint64_t* results_vals = results->elems;
- for (size_t w = 0; w < results_constr.datalen; w++) {
- uint64_t results_conv_22 = results_vals[w];
- void* results_conv_22_ptr = untag_ptr(results_conv_22);
- CHECK_ACCESS(results_conv_22_ptr);
- LDKCResult_NoneAPIErrorZ results_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(results_conv_22_ptr);
- results_constr.data[w] = results_conv_22_conv;
- }
- FREE(results);
- LDKRouteParameters failed_paths_retry_conv;
- failed_paths_retry_conv.inner = untag_ptr(failed_paths_retry);
- failed_paths_retry_conv.is_owned = ptr_is_owned(failed_paths_retry);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(failed_paths_retry_conv);
- failed_paths_retry_conv = RouteParameters_clone(&failed_paths_retry_conv);
- LDKThirtyTwoBytes payment_id_ref;
- CHECK(payment_id->arr_len == 32);
- memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id);
- LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
- *ret_copy = PaymentSendFailure_partial_failure(results_constr, failed_paths_retry_conv, payment_id_ref);
+uint64_t __attribute__((export_name("TS_RecentPaymentDetails_abandoned"))) TS_RecentPaymentDetails_abandoned(int8_tArray payment_hash) {
+ LDKThirtyTwoBytes payment_hash_ref;
+ CHECK(payment_hash->arr_len == 32);
+ memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
+ LDKRecentPaymentDetails *ret_copy = MALLOC(sizeof(LDKRecentPaymentDetails), "LDKRecentPaymentDetails");
+ *ret_copy = RecentPaymentDetails_abandoned(payment_hash_ref);
uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
return ret_ref;
}
-uint64_t __attribute__((export_name("TS_ChannelManager_new"))) TS_ChannelManager_new(uint64_t fee_est, uint64_t chain_monitor, uint64_t tx_broadcaster, uint64_t logger, uint64_t keys_manager, uint64_t config, uint64_t params) {
+uint64_t __attribute__((export_name("TS_ChannelManager_new"))) TS_ChannelManager_new(uint64_t fee_est, uint64_t chain_monitor, uint64_t tx_broadcaster, uint64_t router, uint64_t logger, uint64_t entropy_source, uint64_t node_signer, uint64_t signer_provider, uint64_t config, uint64_t params) {
void* fee_est_ptr = untag_ptr(fee_est);
CHECK_ACCESS(fee_est_ptr);
LDKFeeEstimator fee_est_conv = *(LDKFeeEstimator*)(fee_est_ptr);
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKBroadcasterInterface_JCalls_cloned(&tx_broadcaster_conv);
}
+ void* router_ptr = untag_ptr(router);
+ CHECK_ACCESS(router_ptr);
+ LDKRouter router_conv = *(LDKRouter*)(router_ptr);
+ if (router_conv.free == LDKRouter_JCalls_free) {
+ // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
+ LDKRouter_JCalls_cloned(&router_conv);
+ }
void* logger_ptr = untag_ptr(logger);
CHECK_ACCESS(logger_ptr);
LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKLogger_JCalls_cloned(&logger_conv);
}
- void* keys_manager_ptr = untag_ptr(keys_manager);
- CHECK_ACCESS(keys_manager_ptr);
- LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr);
- if (keys_manager_conv.free == LDKKeysInterface_JCalls_free) {
+ void* entropy_source_ptr = untag_ptr(entropy_source);
+ CHECK_ACCESS(entropy_source_ptr);
+ LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr);
+ if (entropy_source_conv.free == LDKEntropySource_JCalls_free) {
+ // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
+ LDKEntropySource_JCalls_cloned(&entropy_source_conv);
+ }
+ void* node_signer_ptr = untag_ptr(node_signer);
+ CHECK_ACCESS(node_signer_ptr);
+ LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr);
+ if (node_signer_conv.free == LDKNodeSigner_JCalls_free) {
+ // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
+ LDKNodeSigner_JCalls_cloned(&node_signer_conv);
+ }
+ void* signer_provider_ptr = untag_ptr(signer_provider);
+ CHECK_ACCESS(signer_provider_ptr);
+ LDKSignerProvider signer_provider_conv = *(LDKSignerProvider*)(signer_provider_ptr);
+ if (signer_provider_conv.free == LDKSignerProvider_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
- LDKKeysInterface_JCalls_cloned(&keys_manager_conv);
+ LDKSignerProvider_JCalls_cloned(&signer_provider_conv);
}
LDKUserConfig config_conv;
config_conv.inner = untag_ptr(config);
params_conv.is_owned = ptr_is_owned(params);
CHECK_INNER_FIELD_ACCESS_OR_NULL(params_conv);
params_conv = ChainParameters_clone(¶ms_conv);
- LDKChannelManager ret_var = ChannelManager_new(fee_est_conv, chain_monitor_conv, tx_broadcaster_conv, logger_conv, keys_manager_conv, config_conv, params_conv);
+ LDKChannelManager ret_var = ChannelManager_new(fee_est_conv, chain_monitor_conv, tx_broadcaster_conv, router_conv, logger_conv, entropy_source_conv, node_signer_conv, signer_provider_conv, config_conv, params_conv);
uint64_t ret_ref = 0;
CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
return ret_ref;
}
-uint64_t __attribute__((export_name("TS_ChannelManager_create_channel"))) TS_ChannelManager_create_channel(uint64_t this_arg, int8_tArray their_network_key, int64_t channel_value_satoshis, int64_t push_msat, int64_t user_channel_id, uint64_t override_config) {
+uint64_t __attribute__((export_name("TS_ChannelManager_create_channel"))) TS_ChannelManager_create_channel(uint64_t this_arg, int8_tArray their_network_key, int64_t channel_value_satoshis, int64_t push_msat, int8_tArray user_channel_id, uint64_t override_config) {
LDKChannelManager this_arg_conv;
this_arg_conv.inner = untag_ptr(this_arg);
this_arg_conv.is_owned = ptr_is_owned(this_arg);
LDKPublicKey their_network_key_ref;
CHECK(their_network_key->arr_len == 33);
memcpy(their_network_key_ref.compressed_form, their_network_key->elems, 33); FREE(their_network_key);
+ LDKU128 user_channel_id_ref;
+ CHECK(user_channel_id->arr_len == 16);
+ memcpy(user_channel_id_ref.le_bytes, user_channel_id->elems, 16); FREE(user_channel_id);
LDKUserConfig override_config_conv;
override_config_conv.inner = untag_ptr(override_config);
override_config_conv.is_owned = ptr_is_owned(override_config);
CHECK_INNER_FIELD_ACCESS_OR_NULL(override_config_conv);
override_config_conv = UserConfig_clone(&override_config_conv);
LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ");
- *ret_conv = ChannelManager_create_channel(&this_arg_conv, their_network_key_ref, channel_value_satoshis, push_msat, user_channel_id, override_config_conv);
+ *ret_conv = ChannelManager_create_channel(&this_arg_conv, their_network_key_ref, channel_value_satoshis, push_msat, user_channel_id_ref, override_config_conv);
return tag_ptr(ret_conv, true);
}
return ret_arr;
}
+uint64_tArray __attribute__((export_name("TS_ChannelManager_list_recent_payments"))) TS_ChannelManager_list_recent_payments(uint64_t this_arg) {
+ LDKChannelManager this_arg_conv;
+ this_arg_conv.inner = untag_ptr(this_arg);
+ this_arg_conv.is_owned = ptr_is_owned(this_arg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ this_arg_conv.is_owned = false;
+ LDKCVec_RecentPaymentDetailsZ ret_var = ChannelManager_list_recent_payments(&this_arg_conv);
+ uint64_tArray ret_arr = NULL;
+ ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
+ uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
+ for (size_t w = 0; w < ret_var.datalen; w++) {
+ LDKRecentPaymentDetails *ret_conv_22_copy = MALLOC(sizeof(LDKRecentPaymentDetails), "LDKRecentPaymentDetails");
+ *ret_conv_22_copy = ret_var.data[w];
+ uint64_t ret_conv_22_ref = tag_ptr(ret_conv_22_copy, true);
+ ret_arr_ptr[w] = ret_conv_22_ref;
+ }
+
+ FREE(ret_var.data);
+ return ret_arr;
+}
+
uint64_t __attribute__((export_name("TS_ChannelManager_close_channel"))) TS_ChannelManager_close_channel(uint64_t this_arg, int8_tArray channel_id, int8_tArray counterparty_node_id) {
LDKChannelManager this_arg_conv;
this_arg_conv.inner = untag_ptr(this_arg);
this_arg_conv.is_owned = ptr_is_owned(this_arg);
CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
this_arg_conv.is_owned = false;
- unsigned char channel_id_arr[32];
+ uint8_t channel_id_arr[32];
CHECK(channel_id->arr_len == 32);
memcpy(channel_id_arr, channel_id->elems, 32); FREE(channel_id);
- unsigned char (*channel_id_ref)[32] = &channel_id_arr;
+ uint8_t (*channel_id_ref)[32] = &channel_id_arr;
LDKPublicKey counterparty_node_id_ref;
CHECK(counterparty_node_id->arr_len == 33);
memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id);
this_arg_conv.is_owned = ptr_is_owned(this_arg);
CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
this_arg_conv.is_owned = false;
- unsigned char channel_id_arr[32];
+ uint8_t channel_id_arr[32];
CHECK(channel_id->arr_len == 32);
memcpy(channel_id_arr, channel_id->elems, 32); FREE(channel_id);
- unsigned char (*channel_id_ref)[32] = &channel_id_arr;
+ uint8_t (*channel_id_ref)[32] = &channel_id_arr;
LDKPublicKey counterparty_node_id_ref;
CHECK(counterparty_node_id->arr_len == 33);
memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id);
this_arg_conv.is_owned = ptr_is_owned(this_arg);
CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
this_arg_conv.is_owned = false;
- unsigned char channel_id_arr[32];
+ uint8_t channel_id_arr[32];
CHECK(channel_id->arr_len == 32);
memcpy(channel_id_arr, channel_id->elems, 32); FREE(channel_id);
- unsigned char (*channel_id_ref)[32] = &channel_id_arr;
+ uint8_t (*channel_id_ref)[32] = &channel_id_arr;
LDKPublicKey counterparty_node_id_ref;
CHECK(counterparty_node_id->arr_len == 33);
memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id);
this_arg_conv.is_owned = ptr_is_owned(this_arg);
CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
this_arg_conv.is_owned = false;
- unsigned char channel_id_arr[32];
+ uint8_t channel_id_arr[32];
CHECK(channel_id->arr_len == 32);
memcpy(channel_id_arr, channel_id->elems, 32); FREE(channel_id);
- unsigned char (*channel_id_ref)[32] = &channel_id_arr;
+ uint8_t (*channel_id_ref)[32] = &channel_id_arr;
LDKPublicKey counterparty_node_id_ref;
CHECK(counterparty_node_id->arr_len == 33);
memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id);
ChannelManager_force_close_all_channels_without_broadcasting_txn(&this_arg_conv);
}
-uint64_t __attribute__((export_name("TS_ChannelManager_send_payment"))) TS_ChannelManager_send_payment(uint64_t this_arg, uint64_t route, int8_tArray payment_hash, int8_tArray payment_secret) {
+uint64_t __attribute__((export_name("TS_ChannelManager_send_payment"))) TS_ChannelManager_send_payment(uint64_t this_arg, uint64_t route, int8_tArray payment_hash, int8_tArray payment_secret, int8_tArray payment_id) {
LDKChannelManager this_arg_conv;
this_arg_conv.inner = untag_ptr(this_arg);
this_arg_conv.is_owned = ptr_is_owned(this_arg);
LDKThirtyTwoBytes payment_secret_ref;
CHECK(payment_secret->arr_len == 32);
memcpy(payment_secret_ref.data, payment_secret->elems, 32); FREE(payment_secret);
- LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ");
- *ret_conv = ChannelManager_send_payment(&this_arg_conv, &route_conv, payment_hash_ref, payment_secret_ref);
+ LDKThirtyTwoBytes payment_id_ref;
+ CHECK(payment_id->arr_len == 32);
+ memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id);
+ LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
+ *ret_conv = ChannelManager_send_payment(&this_arg_conv, &route_conv, payment_hash_ref, payment_secret_ref, payment_id_ref);
return tag_ptr(ret_conv, true);
}
-uint64_t __attribute__((export_name("TS_ChannelManager_retry_payment"))) TS_ChannelManager_retry_payment(uint64_t this_arg, uint64_t route, int8_tArray payment_id) {
+uint64_t __attribute__((export_name("TS_ChannelManager_send_payment_with_retry"))) TS_ChannelManager_send_payment_with_retry(uint64_t this_arg, int8_tArray payment_hash, int8_tArray payment_secret, int8_tArray payment_id, uint64_t route_params, uint64_t retry_strategy) {
LDKChannelManager this_arg_conv;
this_arg_conv.inner = untag_ptr(this_arg);
this_arg_conv.is_owned = ptr_is_owned(this_arg);
CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
this_arg_conv.is_owned = false;
- LDKRoute route_conv;
- route_conv.inner = untag_ptr(route);
- route_conv.is_owned = ptr_is_owned(route);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv);
- route_conv.is_owned = false;
+ LDKThirtyTwoBytes payment_hash_ref;
+ CHECK(payment_hash->arr_len == 32);
+ memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
+ LDKThirtyTwoBytes payment_secret_ref;
+ CHECK(payment_secret->arr_len == 32);
+ memcpy(payment_secret_ref.data, payment_secret->elems, 32); FREE(payment_secret);
LDKThirtyTwoBytes payment_id_ref;
CHECK(payment_id->arr_len == 32);
memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id);
- LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
- *ret_conv = ChannelManager_retry_payment(&this_arg_conv, &route_conv, payment_id_ref);
+ LDKRouteParameters route_params_conv;
+ route_params_conv.inner = untag_ptr(route_params);
+ route_params_conv.is_owned = ptr_is_owned(route_params);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_conv);
+ route_params_conv = RouteParameters_clone(&route_params_conv);
+ void* retry_strategy_ptr = untag_ptr(retry_strategy);
+ CHECK_ACCESS(retry_strategy_ptr);
+ LDKRetry retry_strategy_conv = *(LDKRetry*)(retry_strategy_ptr);
+ retry_strategy_conv = Retry_clone((LDKRetry*)untag_ptr(retry_strategy));
+ LDKCResult_NoneRetryableSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneRetryableSendFailureZ), "LDKCResult_NoneRetryableSendFailureZ");
+ *ret_conv = ChannelManager_send_payment_with_retry(&this_arg_conv, payment_hash_ref, payment_secret_ref, payment_id_ref, route_params_conv, retry_strategy_conv);
return tag_ptr(ret_conv, true);
}
ChannelManager_abandon_payment(&this_arg_conv, payment_id_ref);
}
-uint64_t __attribute__((export_name("TS_ChannelManager_send_spontaneous_payment"))) TS_ChannelManager_send_spontaneous_payment(uint64_t this_arg, uint64_t route, int8_tArray payment_preimage) {
+uint64_t __attribute__((export_name("TS_ChannelManager_send_spontaneous_payment"))) TS_ChannelManager_send_spontaneous_payment(uint64_t this_arg, uint64_t route, int8_tArray payment_preimage, int8_tArray payment_id) {
LDKChannelManager this_arg_conv;
this_arg_conv.inner = untag_ptr(this_arg);
this_arg_conv.is_owned = ptr_is_owned(this_arg);
LDKThirtyTwoBytes payment_preimage_ref;
CHECK(payment_preimage->arr_len == 32);
memcpy(payment_preimage_ref.data, payment_preimage->elems, 32); FREE(payment_preimage);
- LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ");
- *ret_conv = ChannelManager_send_spontaneous_payment(&this_arg_conv, &route_conv, payment_preimage_ref);
+ LDKThirtyTwoBytes payment_id_ref;
+ CHECK(payment_id->arr_len == 32);
+ memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id);
+ LDKCResult_PaymentHashPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentHashPaymentSendFailureZ), "LDKCResult_PaymentHashPaymentSendFailureZ");
+ *ret_conv = ChannelManager_send_spontaneous_payment(&this_arg_conv, &route_conv, payment_preimage_ref, payment_id_ref);
+ return tag_ptr(ret_conv, true);
+}
+
+uint64_t __attribute__((export_name("TS_ChannelManager_send_spontaneous_payment_with_retry"))) TS_ChannelManager_send_spontaneous_payment_with_retry(uint64_t this_arg, int8_tArray payment_preimage, int8_tArray payment_id, uint64_t route_params, uint64_t retry_strategy) {
+ LDKChannelManager this_arg_conv;
+ this_arg_conv.inner = untag_ptr(this_arg);
+ this_arg_conv.is_owned = ptr_is_owned(this_arg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ this_arg_conv.is_owned = false;
+ LDKThirtyTwoBytes payment_preimage_ref;
+ CHECK(payment_preimage->arr_len == 32);
+ memcpy(payment_preimage_ref.data, payment_preimage->elems, 32); FREE(payment_preimage);
+ LDKThirtyTwoBytes payment_id_ref;
+ CHECK(payment_id->arr_len == 32);
+ memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id);
+ LDKRouteParameters route_params_conv;
+ route_params_conv.inner = untag_ptr(route_params);
+ route_params_conv.is_owned = ptr_is_owned(route_params);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_conv);
+ route_params_conv = RouteParameters_clone(&route_params_conv);
+ void* retry_strategy_ptr = untag_ptr(retry_strategy);
+ CHECK_ACCESS(retry_strategy_ptr);
+ LDKRetry retry_strategy_conv = *(LDKRetry*)(retry_strategy_ptr);
+ retry_strategy_conv = Retry_clone((LDKRetry*)untag_ptr(retry_strategy));
+ LDKCResult_PaymentHashRetryableSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentHashRetryableSendFailureZ), "LDKCResult_PaymentHashRetryableSendFailureZ");
+ *ret_conv = ChannelManager_send_spontaneous_payment_with_retry(&this_arg_conv, payment_preimage_ref, payment_id_ref, route_params_conv, retry_strategy_conv);
return tag_ptr(ret_conv, true);
}
this_arg_conv.is_owned = ptr_is_owned(this_arg);
CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
this_arg_conv.is_owned = false;
- unsigned char temporary_channel_id_arr[32];
+ uint8_t temporary_channel_id_arr[32];
CHECK(temporary_channel_id->arr_len == 32);
memcpy(temporary_channel_id_arr, temporary_channel_id->elems, 32); FREE(temporary_channel_id);
- unsigned char (*temporary_channel_id_ref)[32] = &temporary_channel_id_arr;
+ uint8_t (*temporary_channel_id_ref)[32] = &temporary_channel_id_arr;
LDKPublicKey counterparty_node_id_ref;
CHECK(counterparty_node_id->arr_len == 33);
memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id);
return tag_ptr(ret_conv, true);
}
-void __attribute__((export_name("TS_ChannelManager_broadcast_node_announcement"))) TS_ChannelManager_broadcast_node_announcement(uint64_t this_arg, int8_tArray rgb, int8_tArray alias, uint64_tArray addresses) {
- LDKChannelManager this_arg_conv;
- this_arg_conv.inner = untag_ptr(this_arg);
- this_arg_conv.is_owned = ptr_is_owned(this_arg);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
- this_arg_conv.is_owned = false;
- LDKThreeBytes rgb_ref;
- CHECK(rgb->arr_len == 3);
- memcpy(rgb_ref.data, rgb->elems, 3); FREE(rgb);
- LDKThirtyTwoBytes alias_ref;
- CHECK(alias->arr_len == 32);
- memcpy(alias_ref.data, alias->elems, 32); FREE(alias);
- LDKCVec_NetAddressZ addresses_constr;
- addresses_constr.datalen = addresses->arr_len;
- if (addresses_constr.datalen > 0)
- addresses_constr.data = MALLOC(addresses_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements");
- else
- addresses_constr.data = NULL;
- uint64_t* addresses_vals = addresses->elems;
- for (size_t m = 0; m < addresses_constr.datalen; m++) {
- uint64_t addresses_conv_12 = addresses_vals[m];
- void* addresses_conv_12_ptr = untag_ptr(addresses_conv_12);
- CHECK_ACCESS(addresses_conv_12_ptr);
- LDKNetAddress addresses_conv_12_conv = *(LDKNetAddress*)(addresses_conv_12_ptr);
- addresses_constr.data[m] = addresses_conv_12_conv;
- }
- FREE(addresses);
- ChannelManager_broadcast_node_announcement(&this_arg_conv, rgb_ref, alias_ref, addresses_constr);
-}
-
uint64_t __attribute__((export_name("TS_ChannelManager_update_channel_config"))) TS_ChannelManager_update_channel_config(uint64_t this_arg, int8_tArray counterparty_node_id, ptrArray channel_ids, uint64_t config) {
LDKChannelManager this_arg_conv;
this_arg_conv.inner = untag_ptr(this_arg);
return tag_ptr(ret_conv, true);
}
+uint64_t __attribute__((export_name("TS_ChannelManager_forward_intercepted_htlc"))) TS_ChannelManager_forward_intercepted_htlc(uint64_t this_arg, int8_tArray intercept_id, int8_tArray next_hop_channel_id, int8_tArray next_node_id, int64_t amt_to_forward_msat) {
+ LDKChannelManager this_arg_conv;
+ this_arg_conv.inner = untag_ptr(this_arg);
+ this_arg_conv.is_owned = ptr_is_owned(this_arg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ this_arg_conv.is_owned = false;
+ LDKThirtyTwoBytes intercept_id_ref;
+ CHECK(intercept_id->arr_len == 32);
+ memcpy(intercept_id_ref.data, intercept_id->elems, 32); FREE(intercept_id);
+ uint8_t next_hop_channel_id_arr[32];
+ CHECK(next_hop_channel_id->arr_len == 32);
+ memcpy(next_hop_channel_id_arr, next_hop_channel_id->elems, 32); FREE(next_hop_channel_id);
+ uint8_t (*next_hop_channel_id_ref)[32] = &next_hop_channel_id_arr;
+ LDKPublicKey next_node_id_ref;
+ CHECK(next_node_id->arr_len == 33);
+ memcpy(next_node_id_ref.compressed_form, next_node_id->elems, 33); FREE(next_node_id);
+ LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
+ *ret_conv = ChannelManager_forward_intercepted_htlc(&this_arg_conv, intercept_id_ref, next_hop_channel_id_ref, next_node_id_ref, amt_to_forward_msat);
+ return tag_ptr(ret_conv, true);
+}
+
+uint64_t __attribute__((export_name("TS_ChannelManager_fail_intercepted_htlc"))) TS_ChannelManager_fail_intercepted_htlc(uint64_t this_arg, int8_tArray intercept_id) {
+ LDKChannelManager this_arg_conv;
+ this_arg_conv.inner = untag_ptr(this_arg);
+ this_arg_conv.is_owned = ptr_is_owned(this_arg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ this_arg_conv.is_owned = false;
+ LDKThirtyTwoBytes intercept_id_ref;
+ CHECK(intercept_id->arr_len == 32);
+ memcpy(intercept_id_ref.data, intercept_id->elems, 32); FREE(intercept_id);
+ LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
+ *ret_conv = ChannelManager_fail_intercepted_htlc(&this_arg_conv, intercept_id_ref);
+ return tag_ptr(ret_conv, true);
+}
+
void __attribute__((export_name("TS_ChannelManager_process_pending_htlc_forwards"))) TS_ChannelManager_process_pending_htlc_forwards(uint64_t this_arg) {
LDKChannelManager this_arg_conv;
this_arg_conv.inner = untag_ptr(this_arg);
this_arg_conv.is_owned = ptr_is_owned(this_arg);
CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
this_arg_conv.is_owned = false;
- unsigned char payment_hash_arr[32];
+ uint8_t payment_hash_arr[32];
CHECK(payment_hash->arr_len == 32);
memcpy(payment_hash_arr, payment_hash->elems, 32); FREE(payment_hash);
- unsigned char (*payment_hash_ref)[32] = &payment_hash_arr;
+ uint8_t (*payment_hash_ref)[32] = &payment_hash_arr;
ChannelManager_fail_htlc_backwards(&this_arg_conv, payment_hash_ref);
}
+void __attribute__((export_name("TS_ChannelManager_fail_htlc_backwards_with_reason"))) TS_ChannelManager_fail_htlc_backwards_with_reason(uint64_t this_arg, int8_tArray payment_hash, uint32_t failure_code) {
+ LDKChannelManager this_arg_conv;
+ this_arg_conv.inner = untag_ptr(this_arg);
+ this_arg_conv.is_owned = ptr_is_owned(this_arg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ this_arg_conv.is_owned = false;
+ uint8_t payment_hash_arr[32];
+ CHECK(payment_hash->arr_len == 32);
+ memcpy(payment_hash_arr, payment_hash->elems, 32); FREE(payment_hash);
+ uint8_t (*payment_hash_ref)[32] = &payment_hash_arr;
+ LDKFailureCode failure_code_conv = LDKFailureCode_from_js(failure_code);
+ ChannelManager_fail_htlc_backwards_with_reason(&this_arg_conv, payment_hash_ref, failure_code_conv);
+}
+
void __attribute__((export_name("TS_ChannelManager_claim_funds"))) TS_ChannelManager_claim_funds(uint64_t this_arg, int8_tArray payment_preimage) {
LDKChannelManager this_arg_conv;
this_arg_conv.inner = untag_ptr(this_arg);
return ret_arr;
}
-uint64_t __attribute__((export_name("TS_ChannelManager_accept_inbound_channel"))) TS_ChannelManager_accept_inbound_channel(uint64_t this_arg, int8_tArray temporary_channel_id, int8_tArray counterparty_node_id, int64_t user_channel_id) {
+uint64_t __attribute__((export_name("TS_ChannelManager_accept_inbound_channel"))) TS_ChannelManager_accept_inbound_channel(uint64_t this_arg, int8_tArray temporary_channel_id, int8_tArray counterparty_node_id, int8_tArray user_channel_id) {
LDKChannelManager this_arg_conv;
this_arg_conv.inner = untag_ptr(this_arg);
this_arg_conv.is_owned = ptr_is_owned(this_arg);
CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
this_arg_conv.is_owned = false;
- unsigned char temporary_channel_id_arr[32];
+ uint8_t temporary_channel_id_arr[32];
CHECK(temporary_channel_id->arr_len == 32);
memcpy(temporary_channel_id_arr, temporary_channel_id->elems, 32); FREE(temporary_channel_id);
- unsigned char (*temporary_channel_id_ref)[32] = &temporary_channel_id_arr;
+ uint8_t (*temporary_channel_id_ref)[32] = &temporary_channel_id_arr;
LDKPublicKey counterparty_node_id_ref;
CHECK(counterparty_node_id->arr_len == 33);
memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id);
+ LDKU128 user_channel_id_ref;
+ CHECK(user_channel_id->arr_len == 16);
+ memcpy(user_channel_id_ref.le_bytes, user_channel_id->elems, 16); FREE(user_channel_id);
LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
- *ret_conv = ChannelManager_accept_inbound_channel(&this_arg_conv, temporary_channel_id_ref, counterparty_node_id_ref, user_channel_id);
+ *ret_conv = ChannelManager_accept_inbound_channel(&this_arg_conv, temporary_channel_id_ref, counterparty_node_id_ref, user_channel_id_ref);
return tag_ptr(ret_conv, true);
}
-uint64_t __attribute__((export_name("TS_ChannelManager_accept_inbound_channel_from_trusted_peer_0conf"))) TS_ChannelManager_accept_inbound_channel_from_trusted_peer_0conf(uint64_t this_arg, int8_tArray temporary_channel_id, int8_tArray counterparty_node_id, int64_t user_channel_id) {
+uint64_t __attribute__((export_name("TS_ChannelManager_accept_inbound_channel_from_trusted_peer_0conf"))) TS_ChannelManager_accept_inbound_channel_from_trusted_peer_0conf(uint64_t this_arg, int8_tArray temporary_channel_id, int8_tArray counterparty_node_id, int8_tArray user_channel_id) {
LDKChannelManager this_arg_conv;
this_arg_conv.inner = untag_ptr(this_arg);
this_arg_conv.is_owned = ptr_is_owned(this_arg);
CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
this_arg_conv.is_owned = false;
- unsigned char temporary_channel_id_arr[32];
+ uint8_t temporary_channel_id_arr[32];
CHECK(temporary_channel_id->arr_len == 32);
memcpy(temporary_channel_id_arr, temporary_channel_id->elems, 32); FREE(temporary_channel_id);
- unsigned char (*temporary_channel_id_ref)[32] = &temporary_channel_id_arr;
+ uint8_t (*temporary_channel_id_ref)[32] = &temporary_channel_id_arr;
LDKPublicKey counterparty_node_id_ref;
CHECK(counterparty_node_id->arr_len == 33);
memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id);
+ LDKU128 user_channel_id_ref;
+ CHECK(user_channel_id->arr_len == 16);
+ memcpy(user_channel_id_ref.le_bytes, user_channel_id->elems, 16); FREE(user_channel_id);
LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
- *ret_conv = ChannelManager_accept_inbound_channel_from_trusted_peer_0conf(&this_arg_conv, temporary_channel_id_ref, counterparty_node_id_ref, user_channel_id);
+ *ret_conv = ChannelManager_accept_inbound_channel_from_trusted_peer_0conf(&this_arg_conv, temporary_channel_id_ref, counterparty_node_id_ref, user_channel_id_ref);
return tag_ptr(ret_conv, true);
}
-uint64_t __attribute__((export_name("TS_ChannelManager_create_inbound_payment"))) TS_ChannelManager_create_inbound_payment(uint64_t this_arg, uint64_t min_value_msat, int32_t invoice_expiry_delta_secs) {
+uint64_t __attribute__((export_name("TS_ChannelManager_create_inbound_payment"))) TS_ChannelManager_create_inbound_payment(uint64_t this_arg, uint64_t min_value_msat, int32_t invoice_expiry_delta_secs, uint64_t min_final_cltv_expiry_delta) {
LDKChannelManager this_arg_conv;
this_arg_conv.inner = untag_ptr(this_arg);
this_arg_conv.is_owned = ptr_is_owned(this_arg);
CHECK_ACCESS(min_value_msat_ptr);
LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr);
min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(min_value_msat));
+ void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta);
+ CHECK_ACCESS(min_final_cltv_expiry_delta_ptr);
+ LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr);
+ min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta));
LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ");
- *ret_conv = ChannelManager_create_inbound_payment(&this_arg_conv, min_value_msat_conv, invoice_expiry_delta_secs);
+ *ret_conv = ChannelManager_create_inbound_payment(&this_arg_conv, min_value_msat_conv, invoice_expiry_delta_secs, min_final_cltv_expiry_delta_conv);
return tag_ptr(ret_conv, true);
}
return tag_ptr(ret_conv, true);
}
-uint64_t __attribute__((export_name("TS_ChannelManager_create_inbound_payment_for_hash"))) TS_ChannelManager_create_inbound_payment_for_hash(uint64_t this_arg, int8_tArray payment_hash, uint64_t min_value_msat, int32_t invoice_expiry_delta_secs) {
+uint64_t __attribute__((export_name("TS_ChannelManager_create_inbound_payment_for_hash"))) TS_ChannelManager_create_inbound_payment_for_hash(uint64_t this_arg, int8_tArray payment_hash, uint64_t min_value_msat, int32_t invoice_expiry_delta_secs, uint64_t min_final_cltv_expiry) {
LDKChannelManager this_arg_conv;
this_arg_conv.inner = untag_ptr(this_arg);
this_arg_conv.is_owned = ptr_is_owned(this_arg);
CHECK_ACCESS(min_value_msat_ptr);
LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr);
min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(min_value_msat));
+ void* min_final_cltv_expiry_ptr = untag_ptr(min_final_cltv_expiry);
+ CHECK_ACCESS(min_final_cltv_expiry_ptr);
+ LDKCOption_u16Z min_final_cltv_expiry_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_ptr);
+ min_final_cltv_expiry_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry));
LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ");
- *ret_conv = ChannelManager_create_inbound_payment_for_hash(&this_arg_conv, payment_hash_ref, min_value_msat_conv, invoice_expiry_delta_secs);
+ *ret_conv = ChannelManager_create_inbound_payment_for_hash(&this_arg_conv, payment_hash_ref, min_value_msat_conv, invoice_expiry_delta_secs, min_final_cltv_expiry_conv);
return tag_ptr(ret_conv, true);
}
return ret_ref;
}
+int64_t __attribute__((export_name("TS_ChannelManager_get_intercept_scid"))) TS_ChannelManager_get_intercept_scid(uint64_t this_arg) {
+ LDKChannelManager this_arg_conv;
+ this_arg_conv.inner = untag_ptr(this_arg);
+ this_arg_conv.is_owned = ptr_is_owned(this_arg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ this_arg_conv.is_owned = false;
+ int64_t ret_conv = ChannelManager_get_intercept_scid(&this_arg_conv);
+ return ret_conv;
+}
+
+uint64_t __attribute__((export_name("TS_ChannelManager_compute_inflight_htlcs"))) TS_ChannelManager_compute_inflight_htlcs(uint64_t this_arg) {
+ LDKChannelManager this_arg_conv;
+ this_arg_conv.inner = untag_ptr(this_arg);
+ this_arg_conv.is_owned = ptr_is_owned(this_arg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ this_arg_conv.is_owned = false;
+ LDKInFlightHtlcs ret_var = ChannelManager_compute_inflight_htlcs(&this_arg_conv);
+ uint64_t ret_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ return ret_ref;
+}
+
uint64_t __attribute__((export_name("TS_ChannelManager_as_MessageSendEventsProvider"))) TS_ChannelManager_as_MessageSendEventsProvider(uint64_t this_arg) {
LDKChannelManager this_arg_conv;
this_arg_conv.inner = untag_ptr(this_arg);
ChannelManager_await_persistable_update(&this_arg_conv);
}
+uint64_t __attribute__((export_name("TS_ChannelManager_get_persistable_update_future"))) TS_ChannelManager_get_persistable_update_future(uint64_t this_arg) {
+ LDKChannelManager this_arg_conv;
+ this_arg_conv.inner = untag_ptr(this_arg);
+ this_arg_conv.is_owned = ptr_is_owned(this_arg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ this_arg_conv.is_owned = false;
+ LDKFuture ret_var = ChannelManager_get_persistable_update_future(&this_arg_conv);
+ uint64_t ret_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ return ret_ref;
+}
+
uint64_t __attribute__((export_name("TS_ChannelManager_current_best_block"))) TS_ChannelManager_current_best_block(uint64_t this_arg) {
LDKChannelManager this_arg_conv;
this_arg_conv.inner = untag_ptr(this_arg);
return ret_ref;
}
+uint64_t __attribute__((export_name("TS_ChannelManager_node_features"))) TS_ChannelManager_node_features(uint64_t this_arg) {
+ LDKChannelManager this_arg_conv;
+ this_arg_conv.inner = untag_ptr(this_arg);
+ this_arg_conv.is_owned = ptr_is_owned(this_arg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ this_arg_conv.is_owned = false;
+ LDKNodeFeatures ret_var = ChannelManager_node_features(&this_arg_conv);
+ uint64_t ret_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ return ret_ref;
+}
+
+uint64_t __attribute__((export_name("TS_ChannelManager_channel_features"))) TS_ChannelManager_channel_features(uint64_t this_arg) {
+ LDKChannelManager this_arg_conv;
+ this_arg_conv.inner = untag_ptr(this_arg);
+ this_arg_conv.is_owned = ptr_is_owned(this_arg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ this_arg_conv.is_owned = false;
+ LDKChannelFeatures ret_var = ChannelManager_channel_features(&this_arg_conv);
+ uint64_t ret_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ return ret_ref;
+}
+
+uint64_t __attribute__((export_name("TS_ChannelManager_channel_type_features"))) TS_ChannelManager_channel_type_features(uint64_t this_arg) {
+ LDKChannelManager this_arg_conv;
+ this_arg_conv.inner = untag_ptr(this_arg);
+ this_arg_conv.is_owned = ptr_is_owned(this_arg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ this_arg_conv.is_owned = false;
+ LDKChannelTypeFeatures ret_var = ChannelManager_channel_type_features(&this_arg_conv);
+ uint64_t ret_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ return ret_ref;
+}
+
+uint64_t __attribute__((export_name("TS_ChannelManager_init_features"))) TS_ChannelManager_init_features(uint64_t this_arg) {
+ LDKChannelManager this_arg_conv;
+ this_arg_conv.inner = untag_ptr(this_arg);
+ this_arg_conv.is_owned = ptr_is_owned(this_arg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ this_arg_conv.is_owned = false;
+ LDKInitFeatures ret_var = ChannelManager_init_features(&this_arg_conv);
+ uint64_t ret_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ return ret_ref;
+}
+
uint64_t __attribute__((export_name("TS_ChannelManager_as_ChannelMessageHandler"))) TS_ChannelManager_as_ChannelMessageHandler(uint64_t this_arg) {
LDKChannelManager this_arg_conv;
this_arg_conv.inner = untag_ptr(this_arg);
return tag_ptr(ret_ret, true);
}
+uint64_t __attribute__((export_name("TS_provided_init_features"))) TS_provided_init_features(uint64_t _config) {
+ LDKUserConfig _config_conv;
+ _config_conv.inner = untag_ptr(_config);
+ _config_conv.is_owned = ptr_is_owned(_config);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(_config_conv);
+ _config_conv.is_owned = false;
+ LDKInitFeatures ret_var = provided_init_features(&_config_conv);
+ uint64_t ret_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ return ret_ref;
+}
+
int8_tArray __attribute__((export_name("TS_CounterpartyForwardingInfo_write"))) TS_CounterpartyForwardingInfo_write(uint64_t obj) {
LDKCounterpartyForwardingInfo obj_conv;
obj_conv.inner = untag_ptr(obj);
ChannelManagerReadArgs_free(this_obj_conv);
}
-uint64_t __attribute__((export_name("TS_ChannelManagerReadArgs_get_keys_manager"))) TS_ChannelManagerReadArgs_get_keys_manager(uint64_t this_ptr) {
+uint64_t __attribute__((export_name("TS_ChannelManagerReadArgs_get_entropy_source"))) TS_ChannelManagerReadArgs_get_entropy_source(uint64_t this_ptr) {
LDKChannelManagerReadArgs this_ptr_conv;
this_ptr_conv.inner = untag_ptr(this_ptr);
this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
this_ptr_conv.is_owned = false;
// WARNING: This object doesn't live past this scope, needs clone!
- uint64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_keys_manager(&this_ptr_conv), false);
+ uint64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_entropy_source(&this_ptr_conv), false);
return ret_ret;
}
-void __attribute__((export_name("TS_ChannelManagerReadArgs_set_keys_manager"))) TS_ChannelManagerReadArgs_set_keys_manager(uint64_t this_ptr, uint64_t val) {
+void __attribute__((export_name("TS_ChannelManagerReadArgs_set_entropy_source"))) TS_ChannelManagerReadArgs_set_entropy_source(uint64_t this_ptr, uint64_t val) {
LDKChannelManagerReadArgs this_ptr_conv;
this_ptr_conv.inner = untag_ptr(this_ptr);
this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
this_ptr_conv.is_owned = false;
void* val_ptr = untag_ptr(val);
CHECK_ACCESS(val_ptr);
- LDKKeysInterface val_conv = *(LDKKeysInterface*)(val_ptr);
- if (val_conv.free == LDKKeysInterface_JCalls_free) {
+ LDKEntropySource val_conv = *(LDKEntropySource*)(val_ptr);
+ if (val_conv.free == LDKEntropySource_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
- LDKKeysInterface_JCalls_cloned(&val_conv);
+ LDKEntropySource_JCalls_cloned(&val_conv);
}
- ChannelManagerReadArgs_set_keys_manager(&this_ptr_conv, val_conv);
+ ChannelManagerReadArgs_set_entropy_source(&this_ptr_conv, val_conv);
+}
+
+uint64_t __attribute__((export_name("TS_ChannelManagerReadArgs_get_node_signer"))) TS_ChannelManagerReadArgs_get_node_signer(uint64_t this_ptr) {
+ LDKChannelManagerReadArgs this_ptr_conv;
+ this_ptr_conv.inner = untag_ptr(this_ptr);
+ this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ this_ptr_conv.is_owned = false;
+ // WARNING: This object doesn't live past this scope, needs clone!
+ uint64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_node_signer(&this_ptr_conv), false);
+ return ret_ret;
+}
+
+void __attribute__((export_name("TS_ChannelManagerReadArgs_set_node_signer"))) TS_ChannelManagerReadArgs_set_node_signer(uint64_t this_ptr, uint64_t val) {
+ LDKChannelManagerReadArgs this_ptr_conv;
+ this_ptr_conv.inner = untag_ptr(this_ptr);
+ this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ this_ptr_conv.is_owned = false;
+ void* val_ptr = untag_ptr(val);
+ CHECK_ACCESS(val_ptr);
+ LDKNodeSigner val_conv = *(LDKNodeSigner*)(val_ptr);
+ if (val_conv.free == LDKNodeSigner_JCalls_free) {
+ // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
+ LDKNodeSigner_JCalls_cloned(&val_conv);
+ }
+ ChannelManagerReadArgs_set_node_signer(&this_ptr_conv, val_conv);
+}
+
+uint64_t __attribute__((export_name("TS_ChannelManagerReadArgs_get_signer_provider"))) TS_ChannelManagerReadArgs_get_signer_provider(uint64_t this_ptr) {
+ LDKChannelManagerReadArgs this_ptr_conv;
+ this_ptr_conv.inner = untag_ptr(this_ptr);
+ this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ this_ptr_conv.is_owned = false;
+ // WARNING: This object doesn't live past this scope, needs clone!
+ uint64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_signer_provider(&this_ptr_conv), false);
+ return ret_ret;
+}
+
+void __attribute__((export_name("TS_ChannelManagerReadArgs_set_signer_provider"))) TS_ChannelManagerReadArgs_set_signer_provider(uint64_t this_ptr, uint64_t val) {
+ LDKChannelManagerReadArgs this_ptr_conv;
+ this_ptr_conv.inner = untag_ptr(this_ptr);
+ this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ this_ptr_conv.is_owned = false;
+ void* val_ptr = untag_ptr(val);
+ CHECK_ACCESS(val_ptr);
+ LDKSignerProvider val_conv = *(LDKSignerProvider*)(val_ptr);
+ if (val_conv.free == LDKSignerProvider_JCalls_free) {
+ // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
+ LDKSignerProvider_JCalls_cloned(&val_conv);
+ }
+ ChannelManagerReadArgs_set_signer_provider(&this_ptr_conv, val_conv);
}
uint64_t __attribute__((export_name("TS_ChannelManagerReadArgs_get_fee_estimator"))) TS_ChannelManagerReadArgs_get_fee_estimator(uint64_t this_ptr) {
ChannelManagerReadArgs_set_tx_broadcaster(&this_ptr_conv, val_conv);
}
+uint64_t __attribute__((export_name("TS_ChannelManagerReadArgs_get_router"))) TS_ChannelManagerReadArgs_get_router(uint64_t this_ptr) {
+ LDKChannelManagerReadArgs this_ptr_conv;
+ this_ptr_conv.inner = untag_ptr(this_ptr);
+ this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ this_ptr_conv.is_owned = false;
+ // WARNING: This object doesn't live past this scope, needs clone!
+ uint64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_router(&this_ptr_conv), false);
+ return ret_ret;
+}
+
+void __attribute__((export_name("TS_ChannelManagerReadArgs_set_router"))) TS_ChannelManagerReadArgs_set_router(uint64_t this_ptr, uint64_t val) {
+ LDKChannelManagerReadArgs this_ptr_conv;
+ this_ptr_conv.inner = untag_ptr(this_ptr);
+ this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ this_ptr_conv.is_owned = false;
+ void* val_ptr = untag_ptr(val);
+ CHECK_ACCESS(val_ptr);
+ LDKRouter val_conv = *(LDKRouter*)(val_ptr);
+ if (val_conv.free == LDKRouter_JCalls_free) {
+ // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
+ LDKRouter_JCalls_cloned(&val_conv);
+ }
+ ChannelManagerReadArgs_set_router(&this_ptr_conv, val_conv);
+}
+
uint64_t __attribute__((export_name("TS_ChannelManagerReadArgs_get_logger"))) TS_ChannelManagerReadArgs_get_logger(uint64_t this_ptr) {
LDKChannelManagerReadArgs this_ptr_conv;
this_ptr_conv.inner = untag_ptr(this_ptr);
ChannelManagerReadArgs_set_default_config(&this_ptr_conv, val_conv);
}
-uint64_t __attribute__((export_name("TS_ChannelManagerReadArgs_new"))) TS_ChannelManagerReadArgs_new(uint64_t keys_manager, uint64_t fee_estimator, uint64_t chain_monitor, uint64_t tx_broadcaster, uint64_t logger, uint64_t default_config, uint64_tArray channel_monitors) {
- void* keys_manager_ptr = untag_ptr(keys_manager);
- CHECK_ACCESS(keys_manager_ptr);
- LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr);
- if (keys_manager_conv.free == LDKKeysInterface_JCalls_free) {
+uint64_t __attribute__((export_name("TS_ChannelManagerReadArgs_new"))) TS_ChannelManagerReadArgs_new(uint64_t entropy_source, uint64_t node_signer, uint64_t signer_provider, uint64_t fee_estimator, uint64_t chain_monitor, uint64_t tx_broadcaster, uint64_t router, uint64_t logger, uint64_t default_config, uint64_tArray channel_monitors) {
+ void* entropy_source_ptr = untag_ptr(entropy_source);
+ CHECK_ACCESS(entropy_source_ptr);
+ LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr);
+ if (entropy_source_conv.free == LDKEntropySource_JCalls_free) {
+ // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
+ LDKEntropySource_JCalls_cloned(&entropy_source_conv);
+ }
+ void* node_signer_ptr = untag_ptr(node_signer);
+ CHECK_ACCESS(node_signer_ptr);
+ LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr);
+ if (node_signer_conv.free == LDKNodeSigner_JCalls_free) {
+ // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
+ LDKNodeSigner_JCalls_cloned(&node_signer_conv);
+ }
+ void* signer_provider_ptr = untag_ptr(signer_provider);
+ CHECK_ACCESS(signer_provider_ptr);
+ LDKSignerProvider signer_provider_conv = *(LDKSignerProvider*)(signer_provider_ptr);
+ if (signer_provider_conv.free == LDKSignerProvider_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
- LDKKeysInterface_JCalls_cloned(&keys_manager_conv);
+ LDKSignerProvider_JCalls_cloned(&signer_provider_conv);
}
void* fee_estimator_ptr = untag_ptr(fee_estimator);
CHECK_ACCESS(fee_estimator_ptr);
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKBroadcasterInterface_JCalls_cloned(&tx_broadcaster_conv);
}
+ void* router_ptr = untag_ptr(router);
+ CHECK_ACCESS(router_ptr);
+ LDKRouter router_conv = *(LDKRouter*)(router_ptr);
+ if (router_conv.free == LDKRouter_JCalls_free) {
+ // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
+ LDKRouter_JCalls_cloned(&router_conv);
+ }
void* logger_ptr = untag_ptr(logger);
CHECK_ACCESS(logger_ptr);
LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
channel_monitors_constr.data[q] = channel_monitors_conv_16_conv;
}
FREE(channel_monitors);
- LDKChannelManagerReadArgs ret_var = ChannelManagerReadArgs_new(keys_manager_conv, fee_estimator_conv, chain_monitor_conv, tx_broadcaster_conv, logger_conv, default_config_conv, channel_monitors_constr);
+ LDKChannelManagerReadArgs ret_var = ChannelManagerReadArgs_new(entropy_source_conv, node_signer_conv, signer_provider_conv, fee_estimator_conv, chain_monitor_conv, tx_broadcaster_conv, router_conv, logger_conv, default_config_conv, channel_monitors_constr);
uint64_t ret_ref = 0;
CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
}
uint64_t __attribute__((export_name("TS_ExpandedKey_new"))) TS_ExpandedKey_new(int8_tArray key_material) {
- unsigned char key_material_arr[32];
+ uint8_t key_material_arr[32];
CHECK(key_material->arr_len == 32);
memcpy(key_material_arr, key_material->elems, 32); FREE(key_material);
- unsigned char (*key_material_ref)[32] = &key_material_arr;
+ uint8_t (*key_material_ref)[32] = &key_material_arr;
LDKExpandedKey ret_var = ExpandedKey_new(key_material_ref);
uint64_t ret_ref = 0;
CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
return ret_ref;
}
-uint64_t __attribute__((export_name("TS_create"))) TS_create(uint64_t keys, uint64_t min_value_msat, int32_t invoice_expiry_delta_secs, uint64_t keys_manager, int64_t current_time) {
+uint64_t __attribute__((export_name("TS_create"))) TS_create(uint64_t keys, uint64_t min_value_msat, int32_t invoice_expiry_delta_secs, uint64_t entropy_source, int64_t current_time, uint64_t min_final_cltv_expiry_delta) {
LDKExpandedKey keys_conv;
keys_conv.inner = untag_ptr(keys);
keys_conv.is_owned = ptr_is_owned(keys);
CHECK_ACCESS(min_value_msat_ptr);
LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr);
min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(min_value_msat));
- void* keys_manager_ptr = untag_ptr(keys_manager);
- if (ptr_is_owned(keys_manager)) { CHECK_ACCESS(keys_manager_ptr); }
- LDKKeysInterface* keys_manager_conv = (LDKKeysInterface*)keys_manager_ptr;
+ void* entropy_source_ptr = untag_ptr(entropy_source);
+ if (ptr_is_owned(entropy_source)) { CHECK_ACCESS(entropy_source_ptr); }
+ LDKEntropySource* entropy_source_conv = (LDKEntropySource*)entropy_source_ptr;
+ void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta);
+ CHECK_ACCESS(min_final_cltv_expiry_delta_ptr);
+ LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr);
+ min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta));
LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ");
- *ret_conv = create(&keys_conv, min_value_msat_conv, invoice_expiry_delta_secs, keys_manager_conv, current_time);
+ *ret_conv = create(&keys_conv, min_value_msat_conv, invoice_expiry_delta_secs, entropy_source_conv, current_time, min_final_cltv_expiry_delta_conv);
return tag_ptr(ret_conv, true);
}
-uint64_t __attribute__((export_name("TS_create_from_hash"))) TS_create_from_hash(uint64_t keys, uint64_t min_value_msat, int8_tArray payment_hash, int32_t invoice_expiry_delta_secs, int64_t current_time) {
+uint64_t __attribute__((export_name("TS_create_from_hash"))) TS_create_from_hash(uint64_t keys, uint64_t min_value_msat, int8_tArray payment_hash, int32_t invoice_expiry_delta_secs, int64_t current_time, uint64_t min_final_cltv_expiry_delta) {
LDKExpandedKey keys_conv;
keys_conv.inner = untag_ptr(keys);
keys_conv.is_owned = ptr_is_owned(keys);
LDKThirtyTwoBytes payment_hash_ref;
CHECK(payment_hash->arr_len == 32);
memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
+ void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta);
+ CHECK_ACCESS(min_final_cltv_expiry_delta_ptr);
+ LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr);
+ min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta));
LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ");
- *ret_conv = create_from_hash(&keys_conv, min_value_msat_conv, payment_hash_ref, invoice_expiry_delta_secs, current_time);
+ *ret_conv = create_from_hash(&keys_conv, min_value_msat_conv, payment_hash_ref, invoice_expiry_delta_secs, current_time, min_final_cltv_expiry_delta_conv);
return tag_ptr(ret_conv, true);
}
-void __attribute__((export_name("TS_DecodeError_free"))) TS_DecodeError_free(uint64_t this_obj) {
- LDKDecodeError this_obj_conv;
- this_obj_conv.inner = untag_ptr(this_obj);
- this_obj_conv.is_owned = ptr_is_owned(this_obj);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
- DecodeError_free(this_obj_conv);
+void __attribute__((export_name("TS_DecodeError_free"))) TS_DecodeError_free(uint64_t this_ptr) {
+ if (!ptr_is_owned(this_ptr)) return;
+ void* this_ptr_ptr = untag_ptr(this_ptr);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKDecodeError this_ptr_conv = *(LDKDecodeError*)(this_ptr_ptr);
+ FREE(untag_ptr(this_ptr));
+ DecodeError_free(this_ptr_conv);
}
static inline uint64_t DecodeError_clone_ptr(LDKDecodeError *NONNULL_PTR arg) {
- LDKDecodeError ret_var = DecodeError_clone(arg);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = DecodeError_clone(arg);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
int64_t __attribute__((export_name("TS_DecodeError_clone_ptr"))) TS_DecodeError_clone_ptr(uint64_t arg) {
- LDKDecodeError arg_conv;
- arg_conv.inner = untag_ptr(arg);
- arg_conv.is_owned = ptr_is_owned(arg);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
- arg_conv.is_owned = false;
- int64_t ret_conv = DecodeError_clone_ptr(&arg_conv);
+ LDKDecodeError* arg_conv = (LDKDecodeError*)untag_ptr(arg);
+ int64_t ret_conv = DecodeError_clone_ptr(arg_conv);
return ret_conv;
}
uint64_t __attribute__((export_name("TS_DecodeError_clone"))) TS_DecodeError_clone(uint64_t orig) {
- LDKDecodeError orig_conv;
- orig_conv.inner = untag_ptr(orig);
- orig_conv.is_owned = ptr_is_owned(orig);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
- orig_conv.is_owned = false;
- LDKDecodeError ret_var = DecodeError_clone(&orig_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError* orig_conv = (LDKDecodeError*)untag_ptr(orig);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = DecodeError_clone(orig_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+uint64_t __attribute__((export_name("TS_DecodeError_unknown_version"))) TS_DecodeError_unknown_version() {
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = DecodeError_unknown_version();
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
+uint64_t __attribute__((export_name("TS_DecodeError_unknown_required_feature"))) TS_DecodeError_unknown_required_feature() {
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = DecodeError_unknown_required_feature();
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+uint64_t __attribute__((export_name("TS_DecodeError_invalid_value"))) TS_DecodeError_invalid_value() {
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = DecodeError_invalid_value();
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+uint64_t __attribute__((export_name("TS_DecodeError_short_read"))) TS_DecodeError_short_read() {
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = DecodeError_short_read();
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+uint64_t __attribute__((export_name("TS_DecodeError_bad_length_descriptor"))) TS_DecodeError_bad_length_descriptor() {
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = DecodeError_bad_length_descriptor();
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+uint64_t __attribute__((export_name("TS_DecodeError_io"))) TS_DecodeError_io(uint32_t a) {
+ LDKIOError a_conv = LDKIOError_from_js(a);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = DecodeError_io(a_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+uint64_t __attribute__((export_name("TS_DecodeError_unsupported_compression"))) TS_DecodeError_unsupported_compression() {
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = DecodeError_unsupported_compression();
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+jboolean __attribute__((export_name("TS_DecodeError_eq"))) TS_DecodeError_eq(uint64_t a, uint64_t b) {
+ LDKDecodeError* a_conv = (LDKDecodeError*)untag_ptr(a);
+ LDKDecodeError* b_conv = (LDKDecodeError*)untag_ptr(b);
+ jboolean ret_conv = DecodeError_eq(a_conv, b_conv);
+ return ret_conv;
+}
+
void __attribute__((export_name("TS_Init_free"))) TS_Init_free(uint64_t this_obj) {
LDKInit this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+jboolean __attribute__((export_name("TS_Init_eq"))) TS_Init_eq(uint64_t a, uint64_t b) {
+ LDKInit a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKInit b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = Init_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
void __attribute__((export_name("TS_ErrorMessage_free"))) TS_ErrorMessage_free(uint64_t this_obj) {
LDKErrorMessage this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+jboolean __attribute__((export_name("TS_ErrorMessage_eq"))) TS_ErrorMessage_eq(uint64_t a, uint64_t b) {
+ LDKErrorMessage a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKErrorMessage b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = ErrorMessage_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
void __attribute__((export_name("TS_WarningMessage_free"))) TS_WarningMessage_free(uint64_t this_obj) {
LDKWarningMessage this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+jboolean __attribute__((export_name("TS_WarningMessage_eq"))) TS_WarningMessage_eq(uint64_t a, uint64_t b) {
+ LDKWarningMessage a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKWarningMessage b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = WarningMessage_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
void __attribute__((export_name("TS_Ping_free"))) TS_Ping_free(uint64_t this_obj) {
LDKPing this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+jboolean __attribute__((export_name("TS_Ping_eq"))) TS_Ping_eq(uint64_t a, uint64_t b) {
+ LDKPing a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKPing b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = Ping_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
void __attribute__((export_name("TS_Pong_free"))) TS_Pong_free(uint64_t this_obj) {
LDKPong this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+jboolean __attribute__((export_name("TS_Pong_eq"))) TS_Pong_eq(uint64_t a, uint64_t b) {
+ LDKPong a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKPong b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = Pong_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
void __attribute__((export_name("TS_OpenChannel_free"))) TS_OpenChannel_free(uint64_t this_obj) {
LDKOpenChannel this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+jboolean __attribute__((export_name("TS_OpenChannel_eq"))) TS_OpenChannel_eq(uint64_t a, uint64_t b) {
+ LDKOpenChannel a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKOpenChannel b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = OpenChannel_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
void __attribute__((export_name("TS_AcceptChannel_free"))) TS_AcceptChannel_free(uint64_t this_obj) {
LDKAcceptChannel this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+jboolean __attribute__((export_name("TS_AcceptChannel_eq"))) TS_AcceptChannel_eq(uint64_t a, uint64_t b) {
+ LDKAcceptChannel a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKAcceptChannel b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = AcceptChannel_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
void __attribute__((export_name("TS_FundingCreated_free"))) TS_FundingCreated_free(uint64_t this_obj) {
LDKFundingCreated this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+jboolean __attribute__((export_name("TS_FundingCreated_eq"))) TS_FundingCreated_eq(uint64_t a, uint64_t b) {
+ LDKFundingCreated a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKFundingCreated b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = FundingCreated_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
void __attribute__((export_name("TS_FundingSigned_free"))) TS_FundingSigned_free(uint64_t this_obj) {
LDKFundingSigned this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+jboolean __attribute__((export_name("TS_FundingSigned_eq"))) TS_FundingSigned_eq(uint64_t a, uint64_t b) {
+ LDKFundingSigned a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKFundingSigned b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = FundingSigned_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
void __attribute__((export_name("TS_ChannelReady_free"))) TS_ChannelReady_free(uint64_t this_obj) {
LDKChannelReady this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+jboolean __attribute__((export_name("TS_ChannelReady_eq"))) TS_ChannelReady_eq(uint64_t a, uint64_t b) {
+ LDKChannelReady a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKChannelReady b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = ChannelReady_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
void __attribute__((export_name("TS_Shutdown_free"))) TS_Shutdown_free(uint64_t this_obj) {
LDKShutdown this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+jboolean __attribute__((export_name("TS_Shutdown_eq"))) TS_Shutdown_eq(uint64_t a, uint64_t b) {
+ LDKShutdown a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKShutdown b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = Shutdown_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
void __attribute__((export_name("TS_ClosingSignedFeeRange_free"))) TS_ClosingSignedFeeRange_free(uint64_t this_obj) {
LDKClosingSignedFeeRange this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+jboolean __attribute__((export_name("TS_ClosingSignedFeeRange_eq"))) TS_ClosingSignedFeeRange_eq(uint64_t a, uint64_t b) {
+ LDKClosingSignedFeeRange a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKClosingSignedFeeRange b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = ClosingSignedFeeRange_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
void __attribute__((export_name("TS_ClosingSigned_free"))) TS_ClosingSigned_free(uint64_t this_obj) {
LDKClosingSigned this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+jboolean __attribute__((export_name("TS_ClosingSigned_eq"))) TS_ClosingSigned_eq(uint64_t a, uint64_t b) {
+ LDKClosingSigned a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKClosingSigned b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = ClosingSigned_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
void __attribute__((export_name("TS_UpdateAddHTLC_free"))) TS_UpdateAddHTLC_free(uint64_t this_obj) {
LDKUpdateAddHTLC this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+jboolean __attribute__((export_name("TS_UpdateAddHTLC_eq"))) TS_UpdateAddHTLC_eq(uint64_t a, uint64_t b) {
+ LDKUpdateAddHTLC a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKUpdateAddHTLC b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = UpdateAddHTLC_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
+void __attribute__((export_name("TS_OnionMessage_free"))) TS_OnionMessage_free(uint64_t this_obj) {
+ LDKOnionMessage this_obj_conv;
+ this_obj_conv.inner = untag_ptr(this_obj);
+ this_obj_conv.is_owned = ptr_is_owned(this_obj);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
+ OnionMessage_free(this_obj_conv);
+}
+
+int8_tArray __attribute__((export_name("TS_OnionMessage_get_blinding_point"))) TS_OnionMessage_get_blinding_point(uint64_t this_ptr) {
+ LDKOnionMessage this_ptr_conv;
+ this_ptr_conv.inner = untag_ptr(this_ptr);
+ this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ this_ptr_conv.is_owned = false;
+ int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
+ memcpy(ret_arr->elems, OnionMessage_get_blinding_point(&this_ptr_conv).compressed_form, 33);
+ return ret_arr;
+}
+
+void __attribute__((export_name("TS_OnionMessage_set_blinding_point"))) TS_OnionMessage_set_blinding_point(uint64_t this_ptr, int8_tArray val) {
+ LDKOnionMessage this_ptr_conv;
+ this_ptr_conv.inner = untag_ptr(this_ptr);
+ this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ this_ptr_conv.is_owned = false;
+ LDKPublicKey val_ref;
+ CHECK(val->arr_len == 33);
+ memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
+ OnionMessage_set_blinding_point(&this_ptr_conv, val_ref);
+}
+
+static inline uint64_t OnionMessage_clone_ptr(LDKOnionMessage *NONNULL_PTR arg) {
+ LDKOnionMessage ret_var = OnionMessage_clone(arg);
+ uint64_t ret_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ return ret_ref;
+}
+int64_t __attribute__((export_name("TS_OnionMessage_clone_ptr"))) TS_OnionMessage_clone_ptr(uint64_t arg) {
+ LDKOnionMessage arg_conv;
+ arg_conv.inner = untag_ptr(arg);
+ arg_conv.is_owned = ptr_is_owned(arg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+ arg_conv.is_owned = false;
+ int64_t ret_conv = OnionMessage_clone_ptr(&arg_conv);
+ return ret_conv;
+}
+
+uint64_t __attribute__((export_name("TS_OnionMessage_clone"))) TS_OnionMessage_clone(uint64_t orig) {
+ LDKOnionMessage orig_conv;
+ orig_conv.inner = untag_ptr(orig);
+ orig_conv.is_owned = ptr_is_owned(orig);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
+ orig_conv.is_owned = false;
+ LDKOnionMessage ret_var = OnionMessage_clone(&orig_conv);
+ uint64_t ret_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ return ret_ref;
+}
+
+jboolean __attribute__((export_name("TS_OnionMessage_eq"))) TS_OnionMessage_eq(uint64_t a, uint64_t b) {
+ LDKOnionMessage a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKOnionMessage b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = OnionMessage_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
void __attribute__((export_name("TS_UpdateFulfillHTLC_free"))) TS_UpdateFulfillHTLC_free(uint64_t this_obj) {
LDKUpdateFulfillHTLC this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+jboolean __attribute__((export_name("TS_UpdateFulfillHTLC_eq"))) TS_UpdateFulfillHTLC_eq(uint64_t a, uint64_t b) {
+ LDKUpdateFulfillHTLC a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKUpdateFulfillHTLC b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = UpdateFulfillHTLC_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
void __attribute__((export_name("TS_UpdateFailHTLC_free"))) TS_UpdateFailHTLC_free(uint64_t this_obj) {
LDKUpdateFailHTLC this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+jboolean __attribute__((export_name("TS_UpdateFailHTLC_eq"))) TS_UpdateFailHTLC_eq(uint64_t a, uint64_t b) {
+ LDKUpdateFailHTLC a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKUpdateFailHTLC b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = UpdateFailHTLC_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
void __attribute__((export_name("TS_UpdateFailMalformedHTLC_free"))) TS_UpdateFailMalformedHTLC_free(uint64_t this_obj) {
LDKUpdateFailMalformedHTLC this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+jboolean __attribute__((export_name("TS_UpdateFailMalformedHTLC_eq"))) TS_UpdateFailMalformedHTLC_eq(uint64_t a, uint64_t b) {
+ LDKUpdateFailMalformedHTLC a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKUpdateFailMalformedHTLC b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = UpdateFailMalformedHTLC_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
void __attribute__((export_name("TS_CommitmentSigned_free"))) TS_CommitmentSigned_free(uint64_t this_obj) {
LDKCommitmentSigned this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+jboolean __attribute__((export_name("TS_CommitmentSigned_eq"))) TS_CommitmentSigned_eq(uint64_t a, uint64_t b) {
+ LDKCommitmentSigned a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKCommitmentSigned b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = CommitmentSigned_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
void __attribute__((export_name("TS_RevokeAndACK_free"))) TS_RevokeAndACK_free(uint64_t this_obj) {
LDKRevokeAndACK this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+jboolean __attribute__((export_name("TS_RevokeAndACK_eq"))) TS_RevokeAndACK_eq(uint64_t a, uint64_t b) {
+ LDKRevokeAndACK a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKRevokeAndACK b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = RevokeAndACK_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
void __attribute__((export_name("TS_UpdateFee_free"))) TS_UpdateFee_free(uint64_t this_obj) {
LDKUpdateFee this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+jboolean __attribute__((export_name("TS_UpdateFee_eq"))) TS_UpdateFee_eq(uint64_t a, uint64_t b) {
+ LDKUpdateFee a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKUpdateFee b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = UpdateFee_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
void __attribute__((export_name("TS_DataLossProtect_free"))) TS_DataLossProtect_free(uint64_t this_obj) {
LDKDataLossProtect this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+jboolean __attribute__((export_name("TS_DataLossProtect_eq"))) TS_DataLossProtect_eq(uint64_t a, uint64_t b) {
+ LDKDataLossProtect a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKDataLossProtect b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = DataLossProtect_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
void __attribute__((export_name("TS_ChannelReestablish_free"))) TS_ChannelReestablish_free(uint64_t this_obj) {
LDKChannelReestablish this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+jboolean __attribute__((export_name("TS_ChannelReestablish_eq"))) TS_ChannelReestablish_eq(uint64_t a, uint64_t b) {
+ LDKChannelReestablish a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKChannelReestablish b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = ChannelReestablish_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
void __attribute__((export_name("TS_AnnouncementSignatures_free"))) TS_AnnouncementSignatures_free(uint64_t this_obj) {
LDKAnnouncementSignatures this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+jboolean __attribute__((export_name("TS_AnnouncementSignatures_eq"))) TS_AnnouncementSignatures_eq(uint64_t a, uint64_t b) {
+ LDKAnnouncementSignatures a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKAnnouncementSignatures b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = AnnouncementSignatures_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
void __attribute__((export_name("TS_NetAddress_free"))) TS_NetAddress_free(uint64_t this_ptr) {
if (!ptr_is_owned(this_ptr)) return;
void* this_ptr_ptr = untag_ptr(this_ptr);
return ret_ref;
}
+jboolean __attribute__((export_name("TS_NetAddress_eq"))) TS_NetAddress_eq(uint64_t a, uint64_t b) {
+ LDKNetAddress* a_conv = (LDKNetAddress*)untag_ptr(a);
+ LDKNetAddress* b_conv = (LDKNetAddress*)untag_ptr(b);
+ jboolean ret_conv = NetAddress_eq(a_conv, b_conv);
+ return ret_conv;
+}
+
int8_tArray __attribute__((export_name("TS_NetAddress_write"))) TS_NetAddress_write(uint64_t obj) {
LDKNetAddress* obj_conv = (LDKNetAddress*)untag_ptr(obj);
LDKCVec_u8Z ret_var = NetAddress_write(obj_conv);
return tag_ptr(ret_conv, true);
}
+void __attribute__((export_name("TS_UnsignedGossipMessage_free"))) TS_UnsignedGossipMessage_free(uint64_t this_ptr) {
+ if (!ptr_is_owned(this_ptr)) return;
+ void* this_ptr_ptr = untag_ptr(this_ptr);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKUnsignedGossipMessage this_ptr_conv = *(LDKUnsignedGossipMessage*)(this_ptr_ptr);
+ FREE(untag_ptr(this_ptr));
+ UnsignedGossipMessage_free(this_ptr_conv);
+}
+
+static inline uint64_t UnsignedGossipMessage_clone_ptr(LDKUnsignedGossipMessage *NONNULL_PTR arg) {
+ LDKUnsignedGossipMessage *ret_copy = MALLOC(sizeof(LDKUnsignedGossipMessage), "LDKUnsignedGossipMessage");
+ *ret_copy = UnsignedGossipMessage_clone(arg);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+int64_t __attribute__((export_name("TS_UnsignedGossipMessage_clone_ptr"))) TS_UnsignedGossipMessage_clone_ptr(uint64_t arg) {
+ LDKUnsignedGossipMessage* arg_conv = (LDKUnsignedGossipMessage*)untag_ptr(arg);
+ int64_t ret_conv = UnsignedGossipMessage_clone_ptr(arg_conv);
+ return ret_conv;
+}
+
+uint64_t __attribute__((export_name("TS_UnsignedGossipMessage_clone"))) TS_UnsignedGossipMessage_clone(uint64_t orig) {
+ LDKUnsignedGossipMessage* orig_conv = (LDKUnsignedGossipMessage*)untag_ptr(orig);
+ LDKUnsignedGossipMessage *ret_copy = MALLOC(sizeof(LDKUnsignedGossipMessage), "LDKUnsignedGossipMessage");
+ *ret_copy = UnsignedGossipMessage_clone(orig_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+uint64_t __attribute__((export_name("TS_UnsignedGossipMessage_channel_announcement"))) TS_UnsignedGossipMessage_channel_announcement(uint64_t a) {
+ LDKUnsignedChannelAnnouncement a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv = UnsignedChannelAnnouncement_clone(&a_conv);
+ LDKUnsignedGossipMessage *ret_copy = MALLOC(sizeof(LDKUnsignedGossipMessage), "LDKUnsignedGossipMessage");
+ *ret_copy = UnsignedGossipMessage_channel_announcement(a_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+uint64_t __attribute__((export_name("TS_UnsignedGossipMessage_channel_update"))) TS_UnsignedGossipMessage_channel_update(uint64_t a) {
+ LDKUnsignedChannelUpdate a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv = UnsignedChannelUpdate_clone(&a_conv);
+ LDKUnsignedGossipMessage *ret_copy = MALLOC(sizeof(LDKUnsignedGossipMessage), "LDKUnsignedGossipMessage");
+ *ret_copy = UnsignedGossipMessage_channel_update(a_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+uint64_t __attribute__((export_name("TS_UnsignedGossipMessage_node_announcement"))) TS_UnsignedGossipMessage_node_announcement(uint64_t a) {
+ LDKUnsignedNodeAnnouncement a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv = UnsignedNodeAnnouncement_clone(&a_conv);
+ LDKUnsignedGossipMessage *ret_copy = MALLOC(sizeof(LDKUnsignedGossipMessage), "LDKUnsignedGossipMessage");
+ *ret_copy = UnsignedGossipMessage_node_announcement(a_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+int8_tArray __attribute__((export_name("TS_UnsignedGossipMessage_write"))) TS_UnsignedGossipMessage_write(uint64_t obj) {
+ LDKUnsignedGossipMessage* obj_conv = (LDKUnsignedGossipMessage*)untag_ptr(obj);
+ LDKCVec_u8Z ret_var = UnsignedGossipMessage_write(obj_conv);
+ int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
+ memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
+}
+
void __attribute__((export_name("TS_UnsignedNodeAnnouncement_free"))) TS_UnsignedNodeAnnouncement_free(uint64_t this_obj) {
LDKUnsignedNodeAnnouncement this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
UnsignedNodeAnnouncement_set_timestamp(&this_ptr_conv, val);
}
-int8_tArray __attribute__((export_name("TS_UnsignedNodeAnnouncement_get_node_id"))) TS_UnsignedNodeAnnouncement_get_node_id(uint64_t this_ptr) {
+uint64_t __attribute__((export_name("TS_UnsignedNodeAnnouncement_get_node_id"))) TS_UnsignedNodeAnnouncement_get_node_id(uint64_t this_ptr) {
LDKUnsignedNodeAnnouncement this_ptr_conv;
this_ptr_conv.inner = untag_ptr(this_ptr);
this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
this_ptr_conv.is_owned = false;
- int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
- memcpy(ret_arr->elems, UnsignedNodeAnnouncement_get_node_id(&this_ptr_conv).compressed_form, 33);
- return ret_arr;
+ LDKNodeId ret_var = UnsignedNodeAnnouncement_get_node_id(&this_ptr_conv);
+ uint64_t ret_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ return ret_ref;
}
-void __attribute__((export_name("TS_UnsignedNodeAnnouncement_set_node_id"))) TS_UnsignedNodeAnnouncement_set_node_id(uint64_t this_ptr, int8_tArray val) {
+void __attribute__((export_name("TS_UnsignedNodeAnnouncement_set_node_id"))) TS_UnsignedNodeAnnouncement_set_node_id(uint64_t this_ptr, uint64_t val) {
LDKUnsignedNodeAnnouncement this_ptr_conv;
this_ptr_conv.inner = untag_ptr(this_ptr);
this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
this_ptr_conv.is_owned = false;
- LDKPublicKey val_ref;
- CHECK(val->arr_len == 33);
- memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
- UnsignedNodeAnnouncement_set_node_id(&this_ptr_conv, val_ref);
+ LDKNodeId val_conv;
+ val_conv.inner = untag_ptr(val);
+ val_conv.is_owned = ptr_is_owned(val);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
+ val_conv = NodeId_clone(&val_conv);
+ UnsignedNodeAnnouncement_set_node_id(&this_ptr_conv, val_conv);
}
int8_tArray __attribute__((export_name("TS_UnsignedNodeAnnouncement_get_rgb"))) TS_UnsignedNodeAnnouncement_get_rgb(uint64_t this_ptr) {
return ret_ref;
}
+jboolean __attribute__((export_name("TS_UnsignedNodeAnnouncement_eq"))) TS_UnsignedNodeAnnouncement_eq(uint64_t a, uint64_t b) {
+ LDKUnsignedNodeAnnouncement a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKUnsignedNodeAnnouncement b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = UnsignedNodeAnnouncement_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
void __attribute__((export_name("TS_NodeAnnouncement_free"))) TS_NodeAnnouncement_free(uint64_t this_obj) {
LDKNodeAnnouncement this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+jboolean __attribute__((export_name("TS_NodeAnnouncement_eq"))) TS_NodeAnnouncement_eq(uint64_t a, uint64_t b) {
+ LDKNodeAnnouncement a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKNodeAnnouncement b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = NodeAnnouncement_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
void __attribute__((export_name("TS_UnsignedChannelAnnouncement_free"))) TS_UnsignedChannelAnnouncement_free(uint64_t this_obj) {
LDKUnsignedChannelAnnouncement this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
UnsignedChannelAnnouncement_set_short_channel_id(&this_ptr_conv, val);
}
-int8_tArray __attribute__((export_name("TS_UnsignedChannelAnnouncement_get_node_id_1"))) TS_UnsignedChannelAnnouncement_get_node_id_1(uint64_t this_ptr) {
+uint64_t __attribute__((export_name("TS_UnsignedChannelAnnouncement_get_node_id_1"))) TS_UnsignedChannelAnnouncement_get_node_id_1(uint64_t this_ptr) {
LDKUnsignedChannelAnnouncement this_ptr_conv;
this_ptr_conv.inner = untag_ptr(this_ptr);
this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
this_ptr_conv.is_owned = false;
- int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
- memcpy(ret_arr->elems, UnsignedChannelAnnouncement_get_node_id_1(&this_ptr_conv).compressed_form, 33);
- return ret_arr;
+ LDKNodeId ret_var = UnsignedChannelAnnouncement_get_node_id_1(&this_ptr_conv);
+ uint64_t ret_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ return ret_ref;
}
-void __attribute__((export_name("TS_UnsignedChannelAnnouncement_set_node_id_1"))) TS_UnsignedChannelAnnouncement_set_node_id_1(uint64_t this_ptr, int8_tArray val) {
+void __attribute__((export_name("TS_UnsignedChannelAnnouncement_set_node_id_1"))) TS_UnsignedChannelAnnouncement_set_node_id_1(uint64_t this_ptr, uint64_t val) {
LDKUnsignedChannelAnnouncement this_ptr_conv;
this_ptr_conv.inner = untag_ptr(this_ptr);
this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
this_ptr_conv.is_owned = false;
- LDKPublicKey val_ref;
- CHECK(val->arr_len == 33);
- memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
- UnsignedChannelAnnouncement_set_node_id_1(&this_ptr_conv, val_ref);
+ LDKNodeId val_conv;
+ val_conv.inner = untag_ptr(val);
+ val_conv.is_owned = ptr_is_owned(val);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
+ val_conv = NodeId_clone(&val_conv);
+ UnsignedChannelAnnouncement_set_node_id_1(&this_ptr_conv, val_conv);
}
-int8_tArray __attribute__((export_name("TS_UnsignedChannelAnnouncement_get_node_id_2"))) TS_UnsignedChannelAnnouncement_get_node_id_2(uint64_t this_ptr) {
+uint64_t __attribute__((export_name("TS_UnsignedChannelAnnouncement_get_node_id_2"))) TS_UnsignedChannelAnnouncement_get_node_id_2(uint64_t this_ptr) {
LDKUnsignedChannelAnnouncement this_ptr_conv;
this_ptr_conv.inner = untag_ptr(this_ptr);
this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
this_ptr_conv.is_owned = false;
- int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
- memcpy(ret_arr->elems, UnsignedChannelAnnouncement_get_node_id_2(&this_ptr_conv).compressed_form, 33);
- return ret_arr;
+ LDKNodeId ret_var = UnsignedChannelAnnouncement_get_node_id_2(&this_ptr_conv);
+ uint64_t ret_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ return ret_ref;
}
-void __attribute__((export_name("TS_UnsignedChannelAnnouncement_set_node_id_2"))) TS_UnsignedChannelAnnouncement_set_node_id_2(uint64_t this_ptr, int8_tArray val) {
+void __attribute__((export_name("TS_UnsignedChannelAnnouncement_set_node_id_2"))) TS_UnsignedChannelAnnouncement_set_node_id_2(uint64_t this_ptr, uint64_t val) {
LDKUnsignedChannelAnnouncement this_ptr_conv;
this_ptr_conv.inner = untag_ptr(this_ptr);
this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
this_ptr_conv.is_owned = false;
- LDKPublicKey val_ref;
- CHECK(val->arr_len == 33);
- memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
- UnsignedChannelAnnouncement_set_node_id_2(&this_ptr_conv, val_ref);
+ LDKNodeId val_conv;
+ val_conv.inner = untag_ptr(val);
+ val_conv.is_owned = ptr_is_owned(val);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
+ val_conv = NodeId_clone(&val_conv);
+ UnsignedChannelAnnouncement_set_node_id_2(&this_ptr_conv, val_conv);
}
-int8_tArray __attribute__((export_name("TS_UnsignedChannelAnnouncement_get_bitcoin_key_1"))) TS_UnsignedChannelAnnouncement_get_bitcoin_key_1(uint64_t this_ptr) {
+uint64_t __attribute__((export_name("TS_UnsignedChannelAnnouncement_get_bitcoin_key_1"))) TS_UnsignedChannelAnnouncement_get_bitcoin_key_1(uint64_t this_ptr) {
LDKUnsignedChannelAnnouncement this_ptr_conv;
this_ptr_conv.inner = untag_ptr(this_ptr);
this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
this_ptr_conv.is_owned = false;
- int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
- memcpy(ret_arr->elems, UnsignedChannelAnnouncement_get_bitcoin_key_1(&this_ptr_conv).compressed_form, 33);
- return ret_arr;
+ LDKNodeId ret_var = UnsignedChannelAnnouncement_get_bitcoin_key_1(&this_ptr_conv);
+ uint64_t ret_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ return ret_ref;
}
-void __attribute__((export_name("TS_UnsignedChannelAnnouncement_set_bitcoin_key_1"))) TS_UnsignedChannelAnnouncement_set_bitcoin_key_1(uint64_t this_ptr, int8_tArray val) {
+void __attribute__((export_name("TS_UnsignedChannelAnnouncement_set_bitcoin_key_1"))) TS_UnsignedChannelAnnouncement_set_bitcoin_key_1(uint64_t this_ptr, uint64_t val) {
LDKUnsignedChannelAnnouncement this_ptr_conv;
this_ptr_conv.inner = untag_ptr(this_ptr);
this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
this_ptr_conv.is_owned = false;
- LDKPublicKey val_ref;
- CHECK(val->arr_len == 33);
- memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
- UnsignedChannelAnnouncement_set_bitcoin_key_1(&this_ptr_conv, val_ref);
+ LDKNodeId val_conv;
+ val_conv.inner = untag_ptr(val);
+ val_conv.is_owned = ptr_is_owned(val);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
+ val_conv = NodeId_clone(&val_conv);
+ UnsignedChannelAnnouncement_set_bitcoin_key_1(&this_ptr_conv, val_conv);
}
-int8_tArray __attribute__((export_name("TS_UnsignedChannelAnnouncement_get_bitcoin_key_2"))) TS_UnsignedChannelAnnouncement_get_bitcoin_key_2(uint64_t this_ptr) {
+uint64_t __attribute__((export_name("TS_UnsignedChannelAnnouncement_get_bitcoin_key_2"))) TS_UnsignedChannelAnnouncement_get_bitcoin_key_2(uint64_t this_ptr) {
LDKUnsignedChannelAnnouncement this_ptr_conv;
this_ptr_conv.inner = untag_ptr(this_ptr);
this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
this_ptr_conv.is_owned = false;
- int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
- memcpy(ret_arr->elems, UnsignedChannelAnnouncement_get_bitcoin_key_2(&this_ptr_conv).compressed_form, 33);
- return ret_arr;
+ LDKNodeId ret_var = UnsignedChannelAnnouncement_get_bitcoin_key_2(&this_ptr_conv);
+ uint64_t ret_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ return ret_ref;
}
-void __attribute__((export_name("TS_UnsignedChannelAnnouncement_set_bitcoin_key_2"))) TS_UnsignedChannelAnnouncement_set_bitcoin_key_2(uint64_t this_ptr, int8_tArray val) {
+void __attribute__((export_name("TS_UnsignedChannelAnnouncement_set_bitcoin_key_2"))) TS_UnsignedChannelAnnouncement_set_bitcoin_key_2(uint64_t this_ptr, uint64_t val) {
LDKUnsignedChannelAnnouncement this_ptr_conv;
this_ptr_conv.inner = untag_ptr(this_ptr);
this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
this_ptr_conv.is_owned = false;
- LDKPublicKey val_ref;
- CHECK(val->arr_len == 33);
- memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
- UnsignedChannelAnnouncement_set_bitcoin_key_2(&this_ptr_conv, val_ref);
+ LDKNodeId val_conv;
+ val_conv.inner = untag_ptr(val);
+ val_conv.is_owned = ptr_is_owned(val);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
+ val_conv = NodeId_clone(&val_conv);
+ UnsignedChannelAnnouncement_set_bitcoin_key_2(&this_ptr_conv, val_conv);
}
static inline uint64_t UnsignedChannelAnnouncement_clone_ptr(LDKUnsignedChannelAnnouncement *NONNULL_PTR arg) {
return ret_ref;
}
+jboolean __attribute__((export_name("TS_UnsignedChannelAnnouncement_eq"))) TS_UnsignedChannelAnnouncement_eq(uint64_t a, uint64_t b) {
+ LDKUnsignedChannelAnnouncement a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKUnsignedChannelAnnouncement b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = UnsignedChannelAnnouncement_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
void __attribute__((export_name("TS_ChannelAnnouncement_free"))) TS_ChannelAnnouncement_free(uint64_t this_obj) {
LDKChannelAnnouncement this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+jboolean __attribute__((export_name("TS_ChannelAnnouncement_eq"))) TS_ChannelAnnouncement_eq(uint64_t a, uint64_t b) {
+ LDKChannelAnnouncement a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKChannelAnnouncement b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = ChannelAnnouncement_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
void __attribute__((export_name("TS_UnsignedChannelUpdate_free"))) TS_UnsignedChannelUpdate_free(uint64_t this_obj) {
LDKUnsignedChannelUpdate this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+jboolean __attribute__((export_name("TS_UnsignedChannelUpdate_eq"))) TS_UnsignedChannelUpdate_eq(uint64_t a, uint64_t b) {
+ LDKUnsignedChannelUpdate a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKUnsignedChannelUpdate b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = UnsignedChannelUpdate_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
void __attribute__((export_name("TS_ChannelUpdate_free"))) TS_ChannelUpdate_free(uint64_t this_obj) {
LDKChannelUpdate this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+jboolean __attribute__((export_name("TS_ChannelUpdate_eq"))) TS_ChannelUpdate_eq(uint64_t a, uint64_t b) {
+ LDKChannelUpdate a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKChannelUpdate b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = ChannelUpdate_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
void __attribute__((export_name("TS_QueryChannelRange_free"))) TS_QueryChannelRange_free(uint64_t this_obj) {
LDKQueryChannelRange this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+jboolean __attribute__((export_name("TS_QueryChannelRange_eq"))) TS_QueryChannelRange_eq(uint64_t a, uint64_t b) {
+ LDKQueryChannelRange a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKQueryChannelRange b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = QueryChannelRange_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
void __attribute__((export_name("TS_ReplyChannelRange_free"))) TS_ReplyChannelRange_free(uint64_t this_obj) {
LDKReplyChannelRange this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+jboolean __attribute__((export_name("TS_ReplyChannelRange_eq"))) TS_ReplyChannelRange_eq(uint64_t a, uint64_t b) {
+ LDKReplyChannelRange a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKReplyChannelRange b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = ReplyChannelRange_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
void __attribute__((export_name("TS_QueryShortChannelIds_free"))) TS_QueryShortChannelIds_free(uint64_t this_obj) {
LDKQueryShortChannelIds this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+jboolean __attribute__((export_name("TS_QueryShortChannelIds_eq"))) TS_QueryShortChannelIds_eq(uint64_t a, uint64_t b) {
+ LDKQueryShortChannelIds a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKQueryShortChannelIds b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = QueryShortChannelIds_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
void __attribute__((export_name("TS_ReplyShortChannelIdsEnd_free"))) TS_ReplyShortChannelIdsEnd_free(uint64_t this_obj) {
LDKReplyShortChannelIdsEnd this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+jboolean __attribute__((export_name("TS_ReplyShortChannelIdsEnd_eq"))) TS_ReplyShortChannelIdsEnd_eq(uint64_t a, uint64_t b) {
+ LDKReplyShortChannelIdsEnd a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKReplyShortChannelIdsEnd b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = ReplyShortChannelIdsEnd_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
void __attribute__((export_name("TS_GossipTimestampFilter_free"))) TS_GossipTimestampFilter_free(uint64_t this_obj) {
LDKGossipTimestampFilter this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+jboolean __attribute__((export_name("TS_GossipTimestampFilter_eq"))) TS_GossipTimestampFilter_eq(uint64_t a, uint64_t b) {
+ LDKGossipTimestampFilter a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKGossipTimestampFilter b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = GossipTimestampFilter_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
void __attribute__((export_name("TS_ErrorAction_free"))) TS_ErrorAction_free(uint64_t this_ptr) {
if (!ptr_is_owned(this_ptr)) return;
void* this_ptr_ptr = untag_ptr(this_ptr);
return ret_ref;
}
+jboolean __attribute__((export_name("TS_CommitmentUpdate_eq"))) TS_CommitmentUpdate_eq(uint64_t a, uint64_t b) {
+ LDKCommitmentUpdate a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKCommitmentUpdate b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = CommitmentUpdate_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
void __attribute__((export_name("TS_ChannelMessageHandler_free"))) TS_ChannelMessageHandler_free(uint64_t this_ptr) {
if (!ptr_is_owned(this_ptr)) return;
void* this_ptr_ptr = untag_ptr(this_ptr);
RoutingMessageHandler_free(this_ptr_conv);
}
+void __attribute__((export_name("TS_OnionMessageHandler_free"))) TS_OnionMessageHandler_free(uint64_t this_ptr) {
+ if (!ptr_is_owned(this_ptr)) return;
+ void* this_ptr_ptr = untag_ptr(this_ptr);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKOnionMessageHandler this_ptr_conv = *(LDKOnionMessageHandler*)(this_ptr_ptr);
+ FREE(untag_ptr(this_ptr));
+ OnionMessageHandler_free(this_ptr_conv);
+}
+
int8_tArray __attribute__((export_name("TS_AcceptChannel_write"))) TS_AcceptChannel_write(uint64_t obj) {
LDKAcceptChannel obj_conv;
obj_conv.inner = untag_ptr(obj);
return tag_ptr(ret_conv, true);
}
+uint64_t __attribute__((export_name("TS_OnionMessage_read"))) TS_OnionMessage_read(int8_tArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.datalen = ser->arr_len;
+ ser_ref.data = ser->elems;
+ LDKCResult_OnionMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OnionMessageDecodeErrorZ), "LDKCResult_OnionMessageDecodeErrorZ");
+ *ret_conv = OnionMessage_read(ser_ref);
+ FREE(ser);
+ return tag_ptr(ret_conv, true);
+}
+
+int8_tArray __attribute__((export_name("TS_OnionMessage_write"))) TS_OnionMessage_write(uint64_t obj) {
+ LDKOnionMessage obj_conv;
+ obj_conv.inner = untag_ptr(obj);
+ obj_conv.is_owned = ptr_is_owned(obj);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z ret_var = OnionMessage_write(&obj_conv);
+ int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
+ memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
+}
+
int8_tArray __attribute__((export_name("TS_Ping_write"))) TS_Ping_write(uint64_t obj) {
LDKPing obj_conv;
obj_conv.inner = untag_ptr(obj);
return tag_ptr(ret_ret, true);
}
+uint64_t __attribute__((export_name("TS_IgnoringMessageHandler_as_OnionMessageProvider"))) TS_IgnoringMessageHandler_as_OnionMessageProvider(uint64_t this_arg) {
+ LDKIgnoringMessageHandler this_arg_conv;
+ this_arg_conv.inner = untag_ptr(this_arg);
+ this_arg_conv.is_owned = ptr_is_owned(this_arg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ this_arg_conv.is_owned = false;
+ LDKOnionMessageProvider* ret_ret = MALLOC(sizeof(LDKOnionMessageProvider), "LDKOnionMessageProvider");
+ *ret_ret = IgnoringMessageHandler_as_OnionMessageProvider(&this_arg_conv);
+ return tag_ptr(ret_ret, true);
+}
+
+uint64_t __attribute__((export_name("TS_IgnoringMessageHandler_as_OnionMessageHandler"))) TS_IgnoringMessageHandler_as_OnionMessageHandler(uint64_t this_arg) {
+ LDKIgnoringMessageHandler this_arg_conv;
+ this_arg_conv.inner = untag_ptr(this_arg);
+ this_arg_conv.is_owned = ptr_is_owned(this_arg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ this_arg_conv.is_owned = false;
+ LDKOnionMessageHandler* ret_ret = MALLOC(sizeof(LDKOnionMessageHandler), "LDKOnionMessageHandler");
+ *ret_ret = IgnoringMessageHandler_as_OnionMessageHandler(&this_arg_conv);
+ return tag_ptr(ret_ret, true);
+}
+
+uint64_t __attribute__((export_name("TS_IgnoringMessageHandler_as_CustomOnionMessageHandler"))) TS_IgnoringMessageHandler_as_CustomOnionMessageHandler(uint64_t this_arg) {
+ LDKIgnoringMessageHandler this_arg_conv;
+ this_arg_conv.inner = untag_ptr(this_arg);
+ this_arg_conv.is_owned = ptr_is_owned(this_arg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ this_arg_conv.is_owned = false;
+ LDKCustomOnionMessageHandler* ret_ret = MALLOC(sizeof(LDKCustomOnionMessageHandler), "LDKCustomOnionMessageHandler");
+ *ret_ret = IgnoringMessageHandler_as_CustomOnionMessageHandler(&this_arg_conv);
+ return tag_ptr(ret_ret, true);
+}
+
uint64_t __attribute__((export_name("TS_IgnoringMessageHandler_as_CustomMessageReader"))) TS_IgnoringMessageHandler_as_CustomMessageReader(uint64_t this_arg) {
LDKIgnoringMessageHandler this_arg_conv;
this_arg_conv.inner = untag_ptr(this_arg);
MessageHandler_set_route_handler(&this_ptr_conv, val_conv);
}
-uint64_t __attribute__((export_name("TS_MessageHandler_new"))) TS_MessageHandler_new(uint64_t chan_handler_arg, uint64_t route_handler_arg) {
+uint64_t __attribute__((export_name("TS_MessageHandler_get_onion_message_handler"))) TS_MessageHandler_get_onion_message_handler(uint64_t this_ptr) {
+ LDKMessageHandler this_ptr_conv;
+ this_ptr_conv.inner = untag_ptr(this_ptr);
+ this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ this_ptr_conv.is_owned = false;
+ // WARNING: This object doesn't live past this scope, needs clone!
+ uint64_t ret_ret = tag_ptr(MessageHandler_get_onion_message_handler(&this_ptr_conv), false);
+ return ret_ret;
+}
+
+void __attribute__((export_name("TS_MessageHandler_set_onion_message_handler"))) TS_MessageHandler_set_onion_message_handler(uint64_t this_ptr, uint64_t val) {
+ LDKMessageHandler this_ptr_conv;
+ this_ptr_conv.inner = untag_ptr(this_ptr);
+ this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ this_ptr_conv.is_owned = false;
+ void* val_ptr = untag_ptr(val);
+ CHECK_ACCESS(val_ptr);
+ LDKOnionMessageHandler val_conv = *(LDKOnionMessageHandler*)(val_ptr);
+ if (val_conv.free == LDKOnionMessageHandler_JCalls_free) {
+ // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
+ LDKOnionMessageHandler_JCalls_cloned(&val_conv);
+ }
+ MessageHandler_set_onion_message_handler(&this_ptr_conv, val_conv);
+}
+
+uint64_t __attribute__((export_name("TS_MessageHandler_new"))) TS_MessageHandler_new(uint64_t chan_handler_arg, uint64_t route_handler_arg, uint64_t onion_message_handler_arg) {
void* chan_handler_arg_ptr = untag_ptr(chan_handler_arg);
CHECK_ACCESS(chan_handler_arg_ptr);
LDKChannelMessageHandler chan_handler_arg_conv = *(LDKChannelMessageHandler*)(chan_handler_arg_ptr);
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKRoutingMessageHandler_JCalls_cloned(&route_handler_arg_conv);
}
- LDKMessageHandler ret_var = MessageHandler_new(chan_handler_arg_conv, route_handler_arg_conv);
+ void* onion_message_handler_arg_ptr = untag_ptr(onion_message_handler_arg);
+ CHECK_ACCESS(onion_message_handler_arg_ptr);
+ LDKOnionMessageHandler onion_message_handler_arg_conv = *(LDKOnionMessageHandler*)(onion_message_handler_arg_ptr);
+ if (onion_message_handler_arg_conv.free == LDKOnionMessageHandler_JCalls_free) {
+ // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
+ LDKOnionMessageHandler_JCalls_cloned(&onion_message_handler_arg_conv);
+ }
+ LDKMessageHandler ret_var = MessageHandler_new(chan_handler_arg_conv, route_handler_arg_conv, onion_message_handler_arg_conv);
uint64_t ret_ref = 0;
CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
PeerHandleError_free(this_obj_conv);
}
-jboolean __attribute__((export_name("TS_PeerHandleError_get_no_connection_possible"))) TS_PeerHandleError_get_no_connection_possible(uint64_t this_ptr) {
- LDKPeerHandleError this_ptr_conv;
- this_ptr_conv.inner = untag_ptr(this_ptr);
- this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
- this_ptr_conv.is_owned = false;
- jboolean ret_conv = PeerHandleError_get_no_connection_possible(&this_ptr_conv);
- return ret_conv;
-}
-
-void __attribute__((export_name("TS_PeerHandleError_set_no_connection_possible"))) TS_PeerHandleError_set_no_connection_possible(uint64_t this_ptr, jboolean val) {
- LDKPeerHandleError this_ptr_conv;
- this_ptr_conv.inner = untag_ptr(this_ptr);
- this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
- this_ptr_conv.is_owned = false;
- PeerHandleError_set_no_connection_possible(&this_ptr_conv, val);
-}
-
-uint64_t __attribute__((export_name("TS_PeerHandleError_new"))) TS_PeerHandleError_new(jboolean no_connection_possible_arg) {
- LDKPeerHandleError ret_var = PeerHandleError_new(no_connection_possible_arg);
+uint64_t __attribute__((export_name("TS_PeerHandleError_new"))) TS_PeerHandleError_new() {
+ LDKPeerHandleError ret_var = PeerHandleError_new();
uint64_t ret_ref = 0;
CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
PeerManager_free(this_obj_conv);
}
-uint64_t __attribute__((export_name("TS_PeerManager_new"))) TS_PeerManager_new(uint64_t message_handler, int8_tArray our_node_secret, int8_tArray ephemeral_random_data, uint64_t logger, uint64_t custom_message_handler) {
+uint64_t __attribute__((export_name("TS_PeerManager_new"))) TS_PeerManager_new(uint64_t message_handler, int32_t current_time, int8_tArray ephemeral_random_data, uint64_t logger, uint64_t custom_message_handler, uint64_t node_signer) {
LDKMessageHandler message_handler_conv;
message_handler_conv.inner = untag_ptr(message_handler);
message_handler_conv.is_owned = ptr_is_owned(message_handler);
CHECK_INNER_FIELD_ACCESS_OR_NULL(message_handler_conv);
// WARNING: we need a move here but no clone is available for LDKMessageHandler
- LDKSecretKey our_node_secret_ref;
- CHECK(our_node_secret->arr_len == 32);
- memcpy(our_node_secret_ref.bytes, our_node_secret->elems, 32); FREE(our_node_secret);
- unsigned char ephemeral_random_data_arr[32];
+ uint8_t ephemeral_random_data_arr[32];
CHECK(ephemeral_random_data->arr_len == 32);
memcpy(ephemeral_random_data_arr, ephemeral_random_data->elems, 32); FREE(ephemeral_random_data);
- unsigned char (*ephemeral_random_data_ref)[32] = &ephemeral_random_data_arr;
+ uint8_t (*ephemeral_random_data_ref)[32] = &ephemeral_random_data_arr;
void* logger_ptr = untag_ptr(logger);
CHECK_ACCESS(logger_ptr);
LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKCustomMessageHandler_JCalls_cloned(&custom_message_handler_conv);
}
- LDKPeerManager ret_var = PeerManager_new(message_handler_conv, our_node_secret_ref, ephemeral_random_data_ref, logger_conv, custom_message_handler_conv);
+ void* node_signer_ptr = untag_ptr(node_signer);
+ CHECK_ACCESS(node_signer_ptr);
+ LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr);
+ if (node_signer_conv.free == LDKNodeSigner_JCalls_free) {
+ // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
+ LDKNodeSigner_JCalls_cloned(&node_signer_conv);
+ }
+ LDKPeerManager ret_var = PeerManager_new(message_handler_conv, current_time, ephemeral_random_data_ref, logger_conv, custom_message_handler_conv, node_signer_conv);
uint64_t ret_ref = 0;
CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
return ret_ref;
}
-ptrArray __attribute__((export_name("TS_PeerManager_get_peer_node_ids"))) TS_PeerManager_get_peer_node_ids(uint64_t this_arg) {
+uint64_tArray __attribute__((export_name("TS_PeerManager_get_peer_node_ids"))) TS_PeerManager_get_peer_node_ids(uint64_t this_arg) {
LDKPeerManager this_arg_conv;
this_arg_conv.inner = untag_ptr(this_arg);
this_arg_conv.is_owned = ptr_is_owned(this_arg);
CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
this_arg_conv.is_owned = false;
- LDKCVec_PublicKeyZ ret_var = PeerManager_get_peer_node_ids(&this_arg_conv);
- ptrArray ret_arr = NULL;
- ret_arr = init_ptrArray(ret_var.datalen, __LINE__);
- int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 8);
- for (size_t m = 0; m < ret_var.datalen; m++) {
- int8_tArray ret_conv_12_arr = init_int8_tArray(33, __LINE__);
- memcpy(ret_conv_12_arr->elems, ret_var.data[m].compressed_form, 33);
- ret_arr_ptr[m] = ret_conv_12_arr;
+ LDKCVec_C2Tuple_PublicKeyCOption_NetAddressZZZ ret_var = PeerManager_get_peer_node_ids(&this_arg_conv);
+ uint64_tArray ret_arr = NULL;
+ ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
+ uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
+ for (size_t o = 0; o < ret_var.datalen; o++) {
+ LDKC2Tuple_PublicKeyCOption_NetAddressZZ* ret_conv_40_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyCOption_NetAddressZZ), "LDKC2Tuple_PublicKeyCOption_NetAddressZZ");
+ *ret_conv_40_conv = ret_var.data[o];
+ ret_arr_ptr[o] = tag_ptr(ret_conv_40_conv, true);
}
FREE(ret_var.data);
PeerManager_socket_disconnected(&this_arg_conv, descriptor_conv);
}
-void __attribute__((export_name("TS_PeerManager_disconnect_by_node_id"))) TS_PeerManager_disconnect_by_node_id(uint64_t this_arg, int8_tArray node_id, jboolean no_connection_possible) {
+void __attribute__((export_name("TS_PeerManager_disconnect_by_node_id"))) TS_PeerManager_disconnect_by_node_id(uint64_t this_arg, int8_tArray node_id) {
LDKPeerManager this_arg_conv;
this_arg_conv.inner = untag_ptr(this_arg);
this_arg_conv.is_owned = ptr_is_owned(this_arg);
LDKPublicKey node_id_ref;
CHECK(node_id->arr_len == 33);
memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
- PeerManager_disconnect_by_node_id(&this_arg_conv, node_id_ref, no_connection_possible);
+ PeerManager_disconnect_by_node_id(&this_arg_conv, node_id_ref);
}
void __attribute__((export_name("TS_PeerManager_disconnect_all_peers"))) TS_PeerManager_disconnect_all_peers(uint64_t this_arg) {
PeerManager_timer_tick_occurred(&this_arg_conv);
}
+void __attribute__((export_name("TS_PeerManager_broadcast_node_announcement"))) TS_PeerManager_broadcast_node_announcement(uint64_t this_arg, int8_tArray rgb, int8_tArray alias, uint64_tArray addresses) {
+ LDKPeerManager this_arg_conv;
+ this_arg_conv.inner = untag_ptr(this_arg);
+ this_arg_conv.is_owned = ptr_is_owned(this_arg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ this_arg_conv.is_owned = false;
+ LDKThreeBytes rgb_ref;
+ CHECK(rgb->arr_len == 3);
+ memcpy(rgb_ref.data, rgb->elems, 3); FREE(rgb);
+ LDKThirtyTwoBytes alias_ref;
+ CHECK(alias->arr_len == 32);
+ memcpy(alias_ref.data, alias->elems, 32); FREE(alias);
+ LDKCVec_NetAddressZ addresses_constr;
+ addresses_constr.datalen = addresses->arr_len;
+ if (addresses_constr.datalen > 0)
+ addresses_constr.data = MALLOC(addresses_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements");
+ else
+ addresses_constr.data = NULL;
+ uint64_t* addresses_vals = addresses->elems;
+ for (size_t m = 0; m < addresses_constr.datalen; m++) {
+ uint64_t addresses_conv_12 = addresses_vals[m];
+ void* addresses_conv_12_ptr = untag_ptr(addresses_conv_12);
+ CHECK_ACCESS(addresses_conv_12_ptr);
+ LDKNetAddress addresses_conv_12_conv = *(LDKNetAddress*)(addresses_conv_12_ptr);
+ addresses_constr.data[m] = addresses_conv_12_conv;
+ }
+ FREE(addresses);
+ PeerManager_broadcast_node_announcement(&this_arg_conv, rgb_ref, alias_ref, addresses_constr);
+}
+
int64_t __attribute__((export_name("TS_htlc_success_tx_weight"))) TS_htlc_success_tx_weight(jboolean opt_anchors) {
int64_t ret_conv = htlc_success_tx_weight(opt_anchors);
return ret_conv;
return ret_conv;
}
+uint32_t __attribute__((export_name("TS_HTLCClaim_clone"))) TS_HTLCClaim_clone(uint64_t orig) {
+ LDKHTLCClaim* orig_conv = (LDKHTLCClaim*)untag_ptr(orig);
+ uint32_t ret_conv = LDKHTLCClaim_to_js(HTLCClaim_clone(orig_conv));
+ return ret_conv;
+}
+
+uint32_t __attribute__((export_name("TS_HTLCClaim_offered_timeout"))) TS_HTLCClaim_offered_timeout() {
+ uint32_t ret_conv = LDKHTLCClaim_to_js(HTLCClaim_offered_timeout());
+ return ret_conv;
+}
+
+uint32_t __attribute__((export_name("TS_HTLCClaim_offered_preimage"))) TS_HTLCClaim_offered_preimage() {
+ uint32_t ret_conv = LDKHTLCClaim_to_js(HTLCClaim_offered_preimage());
+ return ret_conv;
+}
+
+uint32_t __attribute__((export_name("TS_HTLCClaim_accepted_timeout"))) TS_HTLCClaim_accepted_timeout() {
+ uint32_t ret_conv = LDKHTLCClaim_to_js(HTLCClaim_accepted_timeout());
+ return ret_conv;
+}
+
+uint32_t __attribute__((export_name("TS_HTLCClaim_accepted_preimage"))) TS_HTLCClaim_accepted_preimage() {
+ uint32_t ret_conv = LDKHTLCClaim_to_js(HTLCClaim_accepted_preimage());
+ return ret_conv;
+}
+
+uint32_t __attribute__((export_name("TS_HTLCClaim_revocation"))) TS_HTLCClaim_revocation() {
+ uint32_t ret_conv = LDKHTLCClaim_to_js(HTLCClaim_revocation());
+ return ret_conv;
+}
+
+jboolean __attribute__((export_name("TS_HTLCClaim_eq"))) TS_HTLCClaim_eq(uint64_t a, uint64_t b) {
+ LDKHTLCClaim* a_conv = (LDKHTLCClaim*)untag_ptr(a);
+ LDKHTLCClaim* b_conv = (LDKHTLCClaim*)untag_ptr(b);
+ jboolean ret_conv = HTLCClaim_eq(a_conv, b_conv);
+ return ret_conv;
+}
+
+uint64_t __attribute__((export_name("TS_HTLCClaim_from_witness"))) TS_HTLCClaim_from_witness(int8_tArray witness) {
+ LDKWitness witness_ref;
+ witness_ref.datalen = witness->arr_len;
+ witness_ref.data = MALLOC(witness_ref.datalen, "LDKWitness Bytes");
+ memcpy(witness_ref.data, witness->elems, witness_ref.datalen); FREE(witness);
+ witness_ref.data_is_owned = true;
+ LDKCOption_HTLCClaimZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCClaimZ), "LDKCOption_HTLCClaimZ");
+ *ret_copy = HTLCClaim_from_witness(witness_ref);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
int8_tArray __attribute__((export_name("TS_build_commitment_secret"))) TS_build_commitment_secret(int8_tArray commitment_seed, int64_t idx) {
- unsigned char commitment_seed_arr[32];
+ uint8_t commitment_seed_arr[32];
CHECK(commitment_seed->arr_len == 32);
memcpy(commitment_seed_arr, commitment_seed->elems, 32); FREE(commitment_seed);
- unsigned char (*commitment_seed_ref)[32] = &commitment_seed_arr;
+ uint8_t (*commitment_seed_ref)[32] = &commitment_seed_arr;
int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
memcpy(ret_arr->elems, build_commitment_secret(commitment_seed_ref, idx).data, 32);
return ret_arr;
return tag_ptr(ret_conv, true);
}
-uint64_t __attribute__((export_name("TS_derive_private_key"))) TS_derive_private_key(int8_tArray per_commitment_point, int8_tArray base_secret) {
+int8_tArray __attribute__((export_name("TS_derive_private_key"))) TS_derive_private_key(int8_tArray per_commitment_point, int8_tArray base_secret) {
LDKPublicKey per_commitment_point_ref;
CHECK(per_commitment_point->arr_len == 33);
memcpy(per_commitment_point_ref.compressed_form, per_commitment_point->elems, 33); FREE(per_commitment_point);
- unsigned char base_secret_arr[32];
+ uint8_t base_secret_arr[32];
CHECK(base_secret->arr_len == 32);
memcpy(base_secret_arr, base_secret->elems, 32); FREE(base_secret);
- unsigned char (*base_secret_ref)[32] = &base_secret_arr;
- LDKCResult_SecretKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyErrorZ), "LDKCResult_SecretKeyErrorZ");
- *ret_conv = derive_private_key(per_commitment_point_ref, base_secret_ref);
- return tag_ptr(ret_conv, true);
+ uint8_t (*base_secret_ref)[32] = &base_secret_arr;
+ int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
+ memcpy(ret_arr->elems, derive_private_key(per_commitment_point_ref, base_secret_ref).bytes, 32);
+ return ret_arr;
}
-uint64_t __attribute__((export_name("TS_derive_public_key"))) TS_derive_public_key(int8_tArray per_commitment_point, int8_tArray base_point) {
+int8_tArray __attribute__((export_name("TS_derive_public_key"))) TS_derive_public_key(int8_tArray per_commitment_point, int8_tArray base_point) {
LDKPublicKey per_commitment_point_ref;
CHECK(per_commitment_point->arr_len == 33);
memcpy(per_commitment_point_ref.compressed_form, per_commitment_point->elems, 33); FREE(per_commitment_point);
LDKPublicKey base_point_ref;
CHECK(base_point->arr_len == 33);
memcpy(base_point_ref.compressed_form, base_point->elems, 33); FREE(base_point);
- LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ");
- *ret_conv = derive_public_key(per_commitment_point_ref, base_point_ref);
- return tag_ptr(ret_conv, true);
+ int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
+ memcpy(ret_arr->elems, derive_public_key(per_commitment_point_ref, base_point_ref).compressed_form, 33);
+ return ret_arr;
}
-uint64_t __attribute__((export_name("TS_derive_private_revocation_key"))) TS_derive_private_revocation_key(int8_tArray per_commitment_secret, int8_tArray countersignatory_revocation_base_secret) {
- unsigned char per_commitment_secret_arr[32];
+int8_tArray __attribute__((export_name("TS_derive_private_revocation_key"))) TS_derive_private_revocation_key(int8_tArray per_commitment_secret, int8_tArray countersignatory_revocation_base_secret) {
+ uint8_t per_commitment_secret_arr[32];
CHECK(per_commitment_secret->arr_len == 32);
memcpy(per_commitment_secret_arr, per_commitment_secret->elems, 32); FREE(per_commitment_secret);
- unsigned char (*per_commitment_secret_ref)[32] = &per_commitment_secret_arr;
- unsigned char countersignatory_revocation_base_secret_arr[32];
+ uint8_t (*per_commitment_secret_ref)[32] = &per_commitment_secret_arr;
+ uint8_t countersignatory_revocation_base_secret_arr[32];
CHECK(countersignatory_revocation_base_secret->arr_len == 32);
memcpy(countersignatory_revocation_base_secret_arr, countersignatory_revocation_base_secret->elems, 32); FREE(countersignatory_revocation_base_secret);
- unsigned char (*countersignatory_revocation_base_secret_ref)[32] = &countersignatory_revocation_base_secret_arr;
- LDKCResult_SecretKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyErrorZ), "LDKCResult_SecretKeyErrorZ");
- *ret_conv = derive_private_revocation_key(per_commitment_secret_ref, countersignatory_revocation_base_secret_ref);
- return tag_ptr(ret_conv, true);
+ uint8_t (*countersignatory_revocation_base_secret_ref)[32] = &countersignatory_revocation_base_secret_arr;
+ int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
+ memcpy(ret_arr->elems, derive_private_revocation_key(per_commitment_secret_ref, countersignatory_revocation_base_secret_ref).bytes, 32);
+ return ret_arr;
}
-uint64_t __attribute__((export_name("TS_derive_public_revocation_key"))) TS_derive_public_revocation_key(int8_tArray per_commitment_point, int8_tArray countersignatory_revocation_base_point) {
+int8_tArray __attribute__((export_name("TS_derive_public_revocation_key"))) TS_derive_public_revocation_key(int8_tArray per_commitment_point, int8_tArray countersignatory_revocation_base_point) {
LDKPublicKey per_commitment_point_ref;
CHECK(per_commitment_point->arr_len == 33);
memcpy(per_commitment_point_ref.compressed_form, per_commitment_point->elems, 33); FREE(per_commitment_point);
LDKPublicKey countersignatory_revocation_base_point_ref;
CHECK(countersignatory_revocation_base_point->arr_len == 33);
memcpy(countersignatory_revocation_base_point_ref.compressed_form, countersignatory_revocation_base_point->elems, 33); FREE(countersignatory_revocation_base_point);
- LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ");
- *ret_conv = derive_public_revocation_key(per_commitment_point_ref, countersignatory_revocation_base_point_ref);
- return tag_ptr(ret_conv, true);
+ int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
+ memcpy(ret_arr->elems, derive_public_revocation_key(per_commitment_point_ref, countersignatory_revocation_base_point_ref).compressed_form, 33);
+ return ret_arr;
}
void __attribute__((export_name("TS_TxCreationKeys_free"))) TS_TxCreationKeys_free(uint64_t this_obj) {
return ret_ref;
}
+jboolean __attribute__((export_name("TS_TxCreationKeys_eq"))) TS_TxCreationKeys_eq(uint64_t a, uint64_t b) {
+ LDKTxCreationKeys a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKTxCreationKeys b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = TxCreationKeys_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
static inline uint64_t TxCreationKeys_clone_ptr(LDKTxCreationKeys *NONNULL_PTR arg) {
LDKTxCreationKeys ret_var = TxCreationKeys_clone(arg);
uint64_t ret_ref = 0;
return ret_ref;
}
+jboolean __attribute__((export_name("TS_ChannelPublicKeys_eq"))) TS_ChannelPublicKeys_eq(uint64_t a, uint64_t b) {
+ LDKChannelPublicKeys a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKChannelPublicKeys b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = ChannelPublicKeys_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
int8_tArray __attribute__((export_name("TS_ChannelPublicKeys_write"))) TS_ChannelPublicKeys_write(uint64_t obj) {
LDKChannelPublicKeys obj_conv;
obj_conv.inner = untag_ptr(obj);
LDKPublicKey countersignatory_htlc_base_ref;
CHECK(countersignatory_htlc_base->arr_len == 33);
memcpy(countersignatory_htlc_base_ref.compressed_form, countersignatory_htlc_base->elems, 33); FREE(countersignatory_htlc_base);
- LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ");
- *ret_conv = TxCreationKeys_derive_new(per_commitment_point_ref, broadcaster_delayed_payment_base_ref, broadcaster_htlc_base_ref, countersignatory_revocation_base_ref, countersignatory_htlc_base_ref);
- return tag_ptr(ret_conv, true);
+ LDKTxCreationKeys ret_var = TxCreationKeys_derive_new(per_commitment_point_ref, broadcaster_delayed_payment_base_ref, broadcaster_htlc_base_ref, countersignatory_revocation_base_ref, countersignatory_htlc_base_ref);
+ uint64_t ret_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ return ret_ref;
}
uint64_t __attribute__((export_name("TS_TxCreationKeys_from_channel_static_keys"))) TS_TxCreationKeys_from_channel_static_keys(int8_tArray per_commitment_point, uint64_t broadcaster_keys, uint64_t countersignatory_keys) {
countersignatory_keys_conv.is_owned = ptr_is_owned(countersignatory_keys);
CHECK_INNER_FIELD_ACCESS_OR_NULL(countersignatory_keys_conv);
countersignatory_keys_conv.is_owned = false;
- LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ");
- *ret_conv = TxCreationKeys_from_channel_static_keys(per_commitment_point_ref, &broadcaster_keys_conv, &countersignatory_keys_conv);
- return tag_ptr(ret_conv, true);
+ LDKTxCreationKeys ret_var = TxCreationKeys_from_channel_static_keys(per_commitment_point_ref, &broadcaster_keys_conv, &countersignatory_keys_conv);
+ uint64_t ret_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ return ret_ref;
}
int8_tArray __attribute__((export_name("TS_get_revokeable_redeemscript"))) TS_get_revokeable_redeemscript(int8_tArray revocation_key, int16_t contest_delay, int8_tArray broadcaster_delayed_payment_key) {
return ret_ref;
}
+jboolean __attribute__((export_name("TS_HTLCOutputInCommitment_eq"))) TS_HTLCOutputInCommitment_eq(uint64_t a, uint64_t b) {
+ LDKHTLCOutputInCommitment a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKHTLCOutputInCommitment b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = HTLCOutputInCommitment_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
int8_tArray __attribute__((export_name("TS_HTLCOutputInCommitment_write"))) TS_HTLCOutputInCommitment_write(uint64_t obj) {
LDKHTLCOutputInCommitment obj_conv;
obj_conv.inner = untag_ptr(obj);
return ret_arr;
}
-int8_tArray __attribute__((export_name("TS_build_htlc_transaction"))) TS_build_htlc_transaction(int8_tArray commitment_txid, int32_t feerate_per_kw, int16_t contest_delay, uint64_t htlc, jboolean opt_anchors, int8_tArray broadcaster_delayed_payment_key, int8_tArray revocation_key) {
- unsigned char commitment_txid_arr[32];
+int8_tArray __attribute__((export_name("TS_build_htlc_transaction"))) TS_build_htlc_transaction(int8_tArray commitment_txid, int32_t feerate_per_kw, int16_t contest_delay, uint64_t htlc, jboolean opt_anchors, jboolean use_non_zero_fee_anchors, int8_tArray broadcaster_delayed_payment_key, int8_tArray revocation_key) {
+ uint8_t commitment_txid_arr[32];
CHECK(commitment_txid->arr_len == 32);
memcpy(commitment_txid_arr, commitment_txid->elems, 32); FREE(commitment_txid);
- unsigned char (*commitment_txid_ref)[32] = &commitment_txid_arr;
+ uint8_t (*commitment_txid_ref)[32] = &commitment_txid_arr;
LDKHTLCOutputInCommitment htlc_conv;
htlc_conv.inner = untag_ptr(htlc);
htlc_conv.is_owned = ptr_is_owned(htlc);
LDKPublicKey revocation_key_ref;
CHECK(revocation_key->arr_len == 33);
memcpy(revocation_key_ref.compressed_form, revocation_key->elems, 33); FREE(revocation_key);
- LDKTransaction ret_var = build_htlc_transaction(commitment_txid_ref, feerate_per_kw, contest_delay, &htlc_conv, opt_anchors, broadcaster_delayed_payment_key_ref, revocation_key_ref);
+ LDKTransaction ret_var = build_htlc_transaction(commitment_txid_ref, feerate_per_kw, contest_delay, &htlc_conv, opt_anchors, use_non_zero_fee_anchors, broadcaster_delayed_payment_key_ref, revocation_key_ref);
int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
Transaction_free(ret_var);
return ret_arr;
}
+int8_tArray __attribute__((export_name("TS_build_htlc_input_witness"))) TS_build_htlc_input_witness(int8_tArray local_sig, int8_tArray remote_sig, int8_tArray preimage, int8_tArray redeem_script, jboolean opt_anchors) {
+ LDKSignature local_sig_ref;
+ CHECK(local_sig->arr_len == 64);
+ memcpy(local_sig_ref.compact_form, local_sig->elems, 64); FREE(local_sig);
+ LDKSignature remote_sig_ref;
+ CHECK(remote_sig->arr_len == 64);
+ memcpy(remote_sig_ref.compact_form, remote_sig->elems, 64); FREE(remote_sig);
+ LDKThirtyTwoBytes preimage_ref;
+ CHECK(preimage->arr_len == 32);
+ memcpy(preimage_ref.data, preimage->elems, 32); FREE(preimage);
+ LDKu8slice redeem_script_ref;
+ redeem_script_ref.datalen = redeem_script->arr_len;
+ redeem_script_ref.data = redeem_script->elems;
+ LDKWitness ret_var = build_htlc_input_witness(local_sig_ref, remote_sig_ref, preimage_ref, redeem_script_ref, opt_anchors);
+ int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
+ memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
+ Witness_free(ret_var);
+ FREE(redeem_script);
+ return ret_arr;
+}
+
+int8_tArray __attribute__((export_name("TS_get_to_countersignatory_with_anchors_redeemscript"))) TS_get_to_countersignatory_with_anchors_redeemscript(int8_tArray payment_point) {
+ LDKPublicKey payment_point_ref;
+ CHECK(payment_point->arr_len == 33);
+ memcpy(payment_point_ref.compressed_form, payment_point->elems, 33); FREE(payment_point);
+ LDKCVec_u8Z ret_var = get_to_countersignatory_with_anchors_redeemscript(payment_point_ref);
+ int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
+ memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
+}
+
int8_tArray __attribute__((export_name("TS_get_anchor_redeemscript"))) TS_get_anchor_redeemscript(int8_tArray funding_pubkey) {
LDKPublicKey funding_pubkey_ref;
CHECK(funding_pubkey->arr_len == 33);
return ret_arr;
}
+int8_tArray __attribute__((export_name("TS_build_anchor_input_witness"))) TS_build_anchor_input_witness(int8_tArray funding_key, int8_tArray funding_sig) {
+ LDKPublicKey funding_key_ref;
+ CHECK(funding_key->arr_len == 33);
+ memcpy(funding_key_ref.compressed_form, funding_key->elems, 33); FREE(funding_key);
+ LDKSignature funding_sig_ref;
+ CHECK(funding_sig->arr_len == 64);
+ memcpy(funding_sig_ref.compact_form, funding_sig->elems, 64); FREE(funding_sig);
+ LDKWitness ret_var = build_anchor_input_witness(funding_key_ref, funding_sig_ref);
+ int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
+ memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
+ Witness_free(ret_var);
+ return ret_arr;
+}
+
void __attribute__((export_name("TS_ChannelTransactionParameters_free"))) TS_ChannelTransactionParameters_free(uint64_t this_obj) {
LDKChannelTransactionParameters this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
ChannelTransactionParameters_set_opt_anchors(&this_ptr_conv, val_conv);
}
-uint64_t __attribute__((export_name("TS_ChannelTransactionParameters_new"))) TS_ChannelTransactionParameters_new(uint64_t holder_pubkeys_arg, int16_t holder_selected_contest_delay_arg, jboolean is_outbound_from_holder_arg, uint64_t counterparty_parameters_arg, uint64_t funding_outpoint_arg, uint32_t opt_anchors_arg) {
+uint32_t __attribute__((export_name("TS_ChannelTransactionParameters_get_opt_non_zero_fee_anchors"))) TS_ChannelTransactionParameters_get_opt_non_zero_fee_anchors(uint64_t this_ptr) {
+ LDKChannelTransactionParameters this_ptr_conv;
+ this_ptr_conv.inner = untag_ptr(this_ptr);
+ this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ this_ptr_conv.is_owned = false;
+ uint32_t ret_conv = LDKCOption_NoneZ_to_js(ChannelTransactionParameters_get_opt_non_zero_fee_anchors(&this_ptr_conv));
+ return ret_conv;
+}
+
+void __attribute__((export_name("TS_ChannelTransactionParameters_set_opt_non_zero_fee_anchors"))) TS_ChannelTransactionParameters_set_opt_non_zero_fee_anchors(uint64_t this_ptr, uint32_t val) {
+ LDKChannelTransactionParameters this_ptr_conv;
+ this_ptr_conv.inner = untag_ptr(this_ptr);
+ this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ this_ptr_conv.is_owned = false;
+ LDKCOption_NoneZ val_conv = LDKCOption_NoneZ_from_js(val);
+ ChannelTransactionParameters_set_opt_non_zero_fee_anchors(&this_ptr_conv, val_conv);
+}
+
+uint64_t __attribute__((export_name("TS_ChannelTransactionParameters_new"))) TS_ChannelTransactionParameters_new(uint64_t holder_pubkeys_arg, int16_t holder_selected_contest_delay_arg, jboolean is_outbound_from_holder_arg, uint64_t counterparty_parameters_arg, uint64_t funding_outpoint_arg, uint32_t opt_anchors_arg, uint32_t opt_non_zero_fee_anchors_arg) {
LDKChannelPublicKeys holder_pubkeys_arg_conv;
holder_pubkeys_arg_conv.inner = untag_ptr(holder_pubkeys_arg);
holder_pubkeys_arg_conv.is_owned = ptr_is_owned(holder_pubkeys_arg);
CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_arg_conv);
funding_outpoint_arg_conv = OutPoint_clone(&funding_outpoint_arg_conv);
LDKCOption_NoneZ opt_anchors_arg_conv = LDKCOption_NoneZ_from_js(opt_anchors_arg);
- LDKChannelTransactionParameters ret_var = ChannelTransactionParameters_new(holder_pubkeys_arg_conv, holder_selected_contest_delay_arg, is_outbound_from_holder_arg, counterparty_parameters_arg_conv, funding_outpoint_arg_conv, opt_anchors_arg_conv);
+ LDKCOption_NoneZ opt_non_zero_fee_anchors_arg_conv = LDKCOption_NoneZ_from_js(opt_non_zero_fee_anchors_arg);
+ LDKChannelTransactionParameters ret_var = ChannelTransactionParameters_new(holder_pubkeys_arg_conv, holder_selected_contest_delay_arg, is_outbound_from_holder_arg, counterparty_parameters_arg_conv, funding_outpoint_arg_conv, opt_anchors_arg_conv, opt_non_zero_fee_anchors_arg_conv);
uint64_t ret_ref = 0;
CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
this_arg_conv.is_owned = ptr_is_owned(this_arg);
CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
this_arg_conv.is_owned = false;
- unsigned char funding_key_arr[32];
+ uint8_t funding_key_arr[32];
CHECK(funding_key->arr_len == 32);
memcpy(funding_key_arr, funding_key->elems, 32); FREE(funding_key);
- unsigned char (*funding_key_ref)[32] = &funding_key_arr;
+ uint8_t (*funding_key_ref)[32] = &funding_key_arr;
LDKu8slice funding_redeemscript_ref;
funding_redeemscript_ref.datalen = funding_redeemscript->arr_len;
funding_redeemscript_ref.data = funding_redeemscript->elems;
return ret_conv;
}
+jboolean __attribute__((export_name("TS_ClosingTransaction_eq"))) TS_ClosingTransaction_eq(uint64_t a, uint64_t b) {
+ LDKClosingTransaction a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKClosingTransaction b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = ClosingTransaction_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
uint64_t __attribute__((export_name("TS_ClosingTransaction_new"))) TS_ClosingTransaction_new(int64_t to_holder_value_sat, int64_t to_counterparty_value_sat, int8_tArray to_holder_script, int8_tArray to_counterparty_script, uint64_t funding_outpoint) {
LDKCVec_u8Z to_holder_script_ref;
to_holder_script_ref.datalen = to_holder_script->arr_len;
this_arg_conv.is_owned = ptr_is_owned(this_arg);
CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
this_arg_conv.is_owned = false;
- unsigned char funding_key_arr[32];
+ uint8_t funding_key_arr[32];
CHECK(funding_key->arr_len == 32);
memcpy(funding_key_arr, funding_key->elems, 32); FREE(funding_key);
- unsigned char (*funding_key_ref)[32] = &funding_key_arr;
+ uint8_t (*funding_key_ref)[32] = &funding_key_arr;
LDKu8slice funding_redeemscript_ref;
funding_redeemscript_ref.datalen = funding_redeemscript->arr_len;
funding_redeemscript_ref.data = funding_redeemscript->elems;
this_arg_conv.is_owned = ptr_is_owned(this_arg);
CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
this_arg_conv.is_owned = false;
- unsigned char htlc_base_key_arr[32];
+ uint8_t htlc_base_key_arr[32];
CHECK(htlc_base_key->arr_len == 32);
memcpy(htlc_base_key_arr, htlc_base_key->elems, 32); FREE(htlc_base_key);
- unsigned char (*htlc_base_key_ref)[32] = &htlc_base_key_arr;
+ uint8_t (*htlc_base_key_ref)[32] = &htlc_base_key_arr;
LDKDirectedChannelTransactionParameters channel_parameters_conv;
channel_parameters_conv.inner = untag_ptr(channel_parameters);
channel_parameters_conv.is_owned = ptr_is_owned(channel_parameters);
return ret_conv;
}
+jboolean __attribute__((export_name("TS_OfferFeatures_eq"))) TS_OfferFeatures_eq(uint64_t a, uint64_t b) {
+ LDKOfferFeatures a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKOfferFeatures b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = OfferFeatures_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
+jboolean __attribute__((export_name("TS_InvoiceRequestFeatures_eq"))) TS_InvoiceRequestFeatures_eq(uint64_t a, uint64_t b) {
+ LDKInvoiceRequestFeatures a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKInvoiceRequestFeatures b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = InvoiceRequestFeatures_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
+jboolean __attribute__((export_name("TS_Bolt12InvoiceFeatures_eq"))) TS_Bolt12InvoiceFeatures_eq(uint64_t a, uint64_t b) {
+ LDKBolt12InvoiceFeatures a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKBolt12InvoiceFeatures b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = Bolt12InvoiceFeatures_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
+jboolean __attribute__((export_name("TS_BlindedHopFeatures_eq"))) TS_BlindedHopFeatures_eq(uint64_t a, uint64_t b) {
+ LDKBlindedHopFeatures a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKBlindedHopFeatures b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = BlindedHopFeatures_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
jboolean __attribute__((export_name("TS_ChannelTypeFeatures_eq"))) TS_ChannelTypeFeatures_eq(uint64_t a, uint64_t b) {
LDKChannelTypeFeatures a_conv;
a_conv.inner = untag_ptr(a);
return ret_ref;
}
+static inline uint64_t OfferFeatures_clone_ptr(LDKOfferFeatures *NONNULL_PTR arg) {
+ LDKOfferFeatures ret_var = OfferFeatures_clone(arg);
+ uint64_t ret_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ return ret_ref;
+}
+int64_t __attribute__((export_name("TS_OfferFeatures_clone_ptr"))) TS_OfferFeatures_clone_ptr(uint64_t arg) {
+ LDKOfferFeatures arg_conv;
+ arg_conv.inner = untag_ptr(arg);
+ arg_conv.is_owned = ptr_is_owned(arg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+ arg_conv.is_owned = false;
+ int64_t ret_conv = OfferFeatures_clone_ptr(&arg_conv);
+ return ret_conv;
+}
+
+uint64_t __attribute__((export_name("TS_OfferFeatures_clone"))) TS_OfferFeatures_clone(uint64_t orig) {
+ LDKOfferFeatures orig_conv;
+ orig_conv.inner = untag_ptr(orig);
+ orig_conv.is_owned = ptr_is_owned(orig);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
+ orig_conv.is_owned = false;
+ LDKOfferFeatures ret_var = OfferFeatures_clone(&orig_conv);
+ uint64_t ret_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ return ret_ref;
+}
+
+static inline uint64_t InvoiceRequestFeatures_clone_ptr(LDKInvoiceRequestFeatures *NONNULL_PTR arg) {
+ LDKInvoiceRequestFeatures ret_var = InvoiceRequestFeatures_clone(arg);
+ uint64_t ret_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ return ret_ref;
+}
+int64_t __attribute__((export_name("TS_InvoiceRequestFeatures_clone_ptr"))) TS_InvoiceRequestFeatures_clone_ptr(uint64_t arg) {
+ LDKInvoiceRequestFeatures arg_conv;
+ arg_conv.inner = untag_ptr(arg);
+ arg_conv.is_owned = ptr_is_owned(arg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+ arg_conv.is_owned = false;
+ int64_t ret_conv = InvoiceRequestFeatures_clone_ptr(&arg_conv);
+ return ret_conv;
+}
+
+uint64_t __attribute__((export_name("TS_InvoiceRequestFeatures_clone"))) TS_InvoiceRequestFeatures_clone(uint64_t orig) {
+ LDKInvoiceRequestFeatures orig_conv;
+ orig_conv.inner = untag_ptr(orig);
+ orig_conv.is_owned = ptr_is_owned(orig);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
+ orig_conv.is_owned = false;
+ LDKInvoiceRequestFeatures ret_var = InvoiceRequestFeatures_clone(&orig_conv);
+ uint64_t ret_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ return ret_ref;
+}
+
+static inline uint64_t Bolt12InvoiceFeatures_clone_ptr(LDKBolt12InvoiceFeatures *NONNULL_PTR arg) {
+ LDKBolt12InvoiceFeatures ret_var = Bolt12InvoiceFeatures_clone(arg);
+ uint64_t ret_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ return ret_ref;
+}
+int64_t __attribute__((export_name("TS_Bolt12InvoiceFeatures_clone_ptr"))) TS_Bolt12InvoiceFeatures_clone_ptr(uint64_t arg) {
+ LDKBolt12InvoiceFeatures arg_conv;
+ arg_conv.inner = untag_ptr(arg);
+ arg_conv.is_owned = ptr_is_owned(arg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+ arg_conv.is_owned = false;
+ int64_t ret_conv = Bolt12InvoiceFeatures_clone_ptr(&arg_conv);
+ return ret_conv;
+}
+
+uint64_t __attribute__((export_name("TS_Bolt12InvoiceFeatures_clone"))) TS_Bolt12InvoiceFeatures_clone(uint64_t orig) {
+ LDKBolt12InvoiceFeatures orig_conv;
+ orig_conv.inner = untag_ptr(orig);
+ orig_conv.is_owned = ptr_is_owned(orig);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
+ orig_conv.is_owned = false;
+ LDKBolt12InvoiceFeatures ret_var = Bolt12InvoiceFeatures_clone(&orig_conv);
+ uint64_t ret_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ return ret_ref;
+}
+
+static inline uint64_t BlindedHopFeatures_clone_ptr(LDKBlindedHopFeatures *NONNULL_PTR arg) {
+ LDKBlindedHopFeatures ret_var = BlindedHopFeatures_clone(arg);
+ uint64_t ret_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ return ret_ref;
+}
+int64_t __attribute__((export_name("TS_BlindedHopFeatures_clone_ptr"))) TS_BlindedHopFeatures_clone_ptr(uint64_t arg) {
+ LDKBlindedHopFeatures arg_conv;
+ arg_conv.inner = untag_ptr(arg);
+ arg_conv.is_owned = ptr_is_owned(arg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+ arg_conv.is_owned = false;
+ int64_t ret_conv = BlindedHopFeatures_clone_ptr(&arg_conv);
+ return ret_conv;
+}
+
+uint64_t __attribute__((export_name("TS_BlindedHopFeatures_clone"))) TS_BlindedHopFeatures_clone(uint64_t orig) {
+ LDKBlindedHopFeatures orig_conv;
+ orig_conv.inner = untag_ptr(orig);
+ orig_conv.is_owned = ptr_is_owned(orig);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
+ orig_conv.is_owned = false;
+ LDKBlindedHopFeatures ret_var = BlindedHopFeatures_clone(&orig_conv);
+ uint64_t ret_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ return ret_ref;
+}
+
static inline uint64_t ChannelTypeFeatures_clone_ptr(LDKChannelTypeFeatures *NONNULL_PTR arg) {
LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_clone(arg);
uint64_t ret_ref = 0;
InvoiceFeatures_free(this_obj_conv);
}
+void __attribute__((export_name("TS_OfferFeatures_free"))) TS_OfferFeatures_free(uint64_t this_obj) {
+ LDKOfferFeatures this_obj_conv;
+ this_obj_conv.inner = untag_ptr(this_obj);
+ this_obj_conv.is_owned = ptr_is_owned(this_obj);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
+ OfferFeatures_free(this_obj_conv);
+}
+
+void __attribute__((export_name("TS_InvoiceRequestFeatures_free"))) TS_InvoiceRequestFeatures_free(uint64_t this_obj) {
+ LDKInvoiceRequestFeatures this_obj_conv;
+ this_obj_conv.inner = untag_ptr(this_obj);
+ this_obj_conv.is_owned = ptr_is_owned(this_obj);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
+ InvoiceRequestFeatures_free(this_obj_conv);
+}
+
+void __attribute__((export_name("TS_Bolt12InvoiceFeatures_free"))) TS_Bolt12InvoiceFeatures_free(uint64_t this_obj) {
+ LDKBolt12InvoiceFeatures this_obj_conv;
+ this_obj_conv.inner = untag_ptr(this_obj);
+ this_obj_conv.is_owned = ptr_is_owned(this_obj);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
+ Bolt12InvoiceFeatures_free(this_obj_conv);
+}
+
+void __attribute__((export_name("TS_BlindedHopFeatures_free"))) TS_BlindedHopFeatures_free(uint64_t this_obj) {
+ LDKBlindedHopFeatures this_obj_conv;
+ this_obj_conv.inner = untag_ptr(this_obj);
+ this_obj_conv.is_owned = ptr_is_owned(this_obj);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
+ BlindedHopFeatures_free(this_obj_conv);
+}
+
void __attribute__((export_name("TS_ChannelTypeFeatures_free"))) TS_ChannelTypeFeatures_free(uint64_t this_obj) {
LDKChannelTypeFeatures this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
-uint64_t __attribute__((export_name("TS_InitFeatures_known"))) TS_InitFeatures_known() {
- LDKInitFeatures ret_var = InitFeatures_known();
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
- return ret_ref;
-}
-
jboolean __attribute__((export_name("TS_InitFeatures_requires_unknown_bits"))) TS_InitFeatures_requires_unknown_bits(uint64_t this_arg) {
LDKInitFeatures this_arg_conv;
this_arg_conv.inner = untag_ptr(this_arg);
return ret_ref;
}
-uint64_t __attribute__((export_name("TS_NodeFeatures_known"))) TS_NodeFeatures_known() {
- LDKNodeFeatures ret_var = NodeFeatures_known();
+jboolean __attribute__((export_name("TS_NodeFeatures_requires_unknown_bits"))) TS_NodeFeatures_requires_unknown_bits(uint64_t this_arg) {
+ LDKNodeFeatures this_arg_conv;
+ this_arg_conv.inner = untag_ptr(this_arg);
+ this_arg_conv.is_owned = ptr_is_owned(this_arg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ this_arg_conv.is_owned = false;
+ jboolean ret_conv = NodeFeatures_requires_unknown_bits(&this_arg_conv);
+ return ret_conv;
+}
+
+uint64_t __attribute__((export_name("TS_ChannelFeatures_empty"))) TS_ChannelFeatures_empty() {
+ LDKChannelFeatures ret_var = ChannelFeatures_empty();
uint64_t ret_ref = 0;
CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
return ret_ref;
}
-jboolean __attribute__((export_name("TS_NodeFeatures_requires_unknown_bits"))) TS_NodeFeatures_requires_unknown_bits(uint64_t this_arg) {
- LDKNodeFeatures this_arg_conv;
+jboolean __attribute__((export_name("TS_ChannelFeatures_requires_unknown_bits"))) TS_ChannelFeatures_requires_unknown_bits(uint64_t this_arg) {
+ LDKChannelFeatures this_arg_conv;
this_arg_conv.inner = untag_ptr(this_arg);
this_arg_conv.is_owned = ptr_is_owned(this_arg);
CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
this_arg_conv.is_owned = false;
- jboolean ret_conv = NodeFeatures_requires_unknown_bits(&this_arg_conv);
+ jboolean ret_conv = ChannelFeatures_requires_unknown_bits(&this_arg_conv);
return ret_conv;
}
-uint64_t __attribute__((export_name("TS_ChannelFeatures_empty"))) TS_ChannelFeatures_empty() {
- LDKChannelFeatures ret_var = ChannelFeatures_empty();
+uint64_t __attribute__((export_name("TS_InvoiceFeatures_empty"))) TS_InvoiceFeatures_empty() {
+ LDKInvoiceFeatures ret_var = InvoiceFeatures_empty();
uint64_t ret_ref = 0;
CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
return ret_ref;
}
-uint64_t __attribute__((export_name("TS_ChannelFeatures_known"))) TS_ChannelFeatures_known() {
- LDKChannelFeatures ret_var = ChannelFeatures_known();
+jboolean __attribute__((export_name("TS_InvoiceFeatures_requires_unknown_bits"))) TS_InvoiceFeatures_requires_unknown_bits(uint64_t this_arg) {
+ LDKInvoiceFeatures this_arg_conv;
+ this_arg_conv.inner = untag_ptr(this_arg);
+ this_arg_conv.is_owned = ptr_is_owned(this_arg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ this_arg_conv.is_owned = false;
+ jboolean ret_conv = InvoiceFeatures_requires_unknown_bits(&this_arg_conv);
+ return ret_conv;
+}
+
+uint64_t __attribute__((export_name("TS_OfferFeatures_empty"))) TS_OfferFeatures_empty() {
+ LDKOfferFeatures ret_var = OfferFeatures_empty();
uint64_t ret_ref = 0;
CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
return ret_ref;
}
-jboolean __attribute__((export_name("TS_ChannelFeatures_requires_unknown_bits"))) TS_ChannelFeatures_requires_unknown_bits(uint64_t this_arg) {
- LDKChannelFeatures this_arg_conv;
+jboolean __attribute__((export_name("TS_OfferFeatures_requires_unknown_bits"))) TS_OfferFeatures_requires_unknown_bits(uint64_t this_arg) {
+ LDKOfferFeatures this_arg_conv;
this_arg_conv.inner = untag_ptr(this_arg);
this_arg_conv.is_owned = ptr_is_owned(this_arg);
CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
this_arg_conv.is_owned = false;
- jboolean ret_conv = ChannelFeatures_requires_unknown_bits(&this_arg_conv);
+ jboolean ret_conv = OfferFeatures_requires_unknown_bits(&this_arg_conv);
return ret_conv;
}
-uint64_t __attribute__((export_name("TS_InvoiceFeatures_empty"))) TS_InvoiceFeatures_empty() {
- LDKInvoiceFeatures ret_var = InvoiceFeatures_empty();
+uint64_t __attribute__((export_name("TS_InvoiceRequestFeatures_empty"))) TS_InvoiceRequestFeatures_empty() {
+ LDKInvoiceRequestFeatures ret_var = InvoiceRequestFeatures_empty();
uint64_t ret_ref = 0;
CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
return ret_ref;
}
-uint64_t __attribute__((export_name("TS_InvoiceFeatures_known"))) TS_InvoiceFeatures_known() {
- LDKInvoiceFeatures ret_var = InvoiceFeatures_known();
+jboolean __attribute__((export_name("TS_InvoiceRequestFeatures_requires_unknown_bits"))) TS_InvoiceRequestFeatures_requires_unknown_bits(uint64_t this_arg) {
+ LDKInvoiceRequestFeatures this_arg_conv;
+ this_arg_conv.inner = untag_ptr(this_arg);
+ this_arg_conv.is_owned = ptr_is_owned(this_arg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ this_arg_conv.is_owned = false;
+ jboolean ret_conv = InvoiceRequestFeatures_requires_unknown_bits(&this_arg_conv);
+ return ret_conv;
+}
+
+uint64_t __attribute__((export_name("TS_Bolt12InvoiceFeatures_empty"))) TS_Bolt12InvoiceFeatures_empty() {
+ LDKBolt12InvoiceFeatures ret_var = Bolt12InvoiceFeatures_empty();
uint64_t ret_ref = 0;
CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
return ret_ref;
}
-jboolean __attribute__((export_name("TS_InvoiceFeatures_requires_unknown_bits"))) TS_InvoiceFeatures_requires_unknown_bits(uint64_t this_arg) {
- LDKInvoiceFeatures this_arg_conv;
+jboolean __attribute__((export_name("TS_Bolt12InvoiceFeatures_requires_unknown_bits"))) TS_Bolt12InvoiceFeatures_requires_unknown_bits(uint64_t this_arg) {
+ LDKBolt12InvoiceFeatures this_arg_conv;
this_arg_conv.inner = untag_ptr(this_arg);
this_arg_conv.is_owned = ptr_is_owned(this_arg);
CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
this_arg_conv.is_owned = false;
- jboolean ret_conv = InvoiceFeatures_requires_unknown_bits(&this_arg_conv);
+ jboolean ret_conv = Bolt12InvoiceFeatures_requires_unknown_bits(&this_arg_conv);
return ret_conv;
}
-uint64_t __attribute__((export_name("TS_ChannelTypeFeatures_empty"))) TS_ChannelTypeFeatures_empty() {
- LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_empty();
+uint64_t __attribute__((export_name("TS_BlindedHopFeatures_empty"))) TS_BlindedHopFeatures_empty() {
+ LDKBlindedHopFeatures ret_var = BlindedHopFeatures_empty();
uint64_t ret_ref = 0;
CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
return ret_ref;
}
-uint64_t __attribute__((export_name("TS_ChannelTypeFeatures_known"))) TS_ChannelTypeFeatures_known() {
- LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_known();
+jboolean __attribute__((export_name("TS_BlindedHopFeatures_requires_unknown_bits"))) TS_BlindedHopFeatures_requires_unknown_bits(uint64_t this_arg) {
+ LDKBlindedHopFeatures this_arg_conv;
+ this_arg_conv.inner = untag_ptr(this_arg);
+ this_arg_conv.is_owned = ptr_is_owned(this_arg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ this_arg_conv.is_owned = false;
+ jboolean ret_conv = BlindedHopFeatures_requires_unknown_bits(&this_arg_conv);
+ return ret_conv;
+}
+
+uint64_t __attribute__((export_name("TS_ChannelTypeFeatures_empty"))) TS_ChannelTypeFeatures_empty() {
+ LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_empty();
uint64_t ret_ref = 0;
CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
return tag_ptr(ret_conv, true);
}
+int8_tArray __attribute__((export_name("TS_BlindedHopFeatures_write"))) TS_BlindedHopFeatures_write(uint64_t obj) {
+ LDKBlindedHopFeatures obj_conv;
+ obj_conv.inner = untag_ptr(obj);
+ obj_conv.is_owned = ptr_is_owned(obj);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z ret_var = BlindedHopFeatures_write(&obj_conv);
+ int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
+ memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
+}
+
+uint64_t __attribute__((export_name("TS_BlindedHopFeatures_read"))) TS_BlindedHopFeatures_read(int8_tArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.datalen = ser->arr_len;
+ ser_ref.data = ser->elems;
+ LDKCResult_BlindedHopFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopFeaturesDecodeErrorZ), "LDKCResult_BlindedHopFeaturesDecodeErrorZ");
+ *ret_conv = BlindedHopFeatures_read(ser_ref);
+ FREE(ser);
+ return tag_ptr(ret_conv, true);
+}
+
int8_tArray __attribute__((export_name("TS_ChannelTypeFeatures_write"))) TS_ChannelTypeFeatures_write(uint64_t obj) {
LDKChannelTypeFeatures obj_conv;
obj_conv.inner = untag_ptr(obj);
return ret_conv;
}
+void __attribute__((export_name("TS_Bolt12InvoiceFeatures_set_basic_mpp_optional"))) TS_Bolt12InvoiceFeatures_set_basic_mpp_optional(uint64_t this_arg) {
+ LDKBolt12InvoiceFeatures this_arg_conv;
+ this_arg_conv.inner = untag_ptr(this_arg);
+ this_arg_conv.is_owned = ptr_is_owned(this_arg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ this_arg_conv.is_owned = false;
+ Bolt12InvoiceFeatures_set_basic_mpp_optional(&this_arg_conv);
+}
+
+void __attribute__((export_name("TS_Bolt12InvoiceFeatures_set_basic_mpp_required"))) TS_Bolt12InvoiceFeatures_set_basic_mpp_required(uint64_t this_arg) {
+ LDKBolt12InvoiceFeatures this_arg_conv;
+ this_arg_conv.inner = untag_ptr(this_arg);
+ this_arg_conv.is_owned = ptr_is_owned(this_arg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ this_arg_conv.is_owned = false;
+ Bolt12InvoiceFeatures_set_basic_mpp_required(&this_arg_conv);
+}
+
+jboolean __attribute__((export_name("TS_Bolt12InvoiceFeatures_supports_basic_mpp"))) TS_Bolt12InvoiceFeatures_supports_basic_mpp(uint64_t this_arg) {
+ LDKBolt12InvoiceFeatures this_arg_conv;
+ this_arg_conv.inner = untag_ptr(this_arg);
+ this_arg_conv.is_owned = ptr_is_owned(this_arg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ this_arg_conv.is_owned = false;
+ jboolean ret_conv = Bolt12InvoiceFeatures_supports_basic_mpp(&this_arg_conv);
+ return ret_conv;
+}
+
jboolean __attribute__((export_name("TS_InitFeatures_requires_basic_mpp"))) TS_InitFeatures_requires_basic_mpp(uint64_t this_arg) {
LDKInitFeatures this_arg_conv;
this_arg_conv.inner = untag_ptr(this_arg);
return ret_conv;
}
+jboolean __attribute__((export_name("TS_Bolt12InvoiceFeatures_requires_basic_mpp"))) TS_Bolt12InvoiceFeatures_requires_basic_mpp(uint64_t this_arg) {
+ LDKBolt12InvoiceFeatures this_arg_conv;
+ this_arg_conv.inner = untag_ptr(this_arg);
+ this_arg_conv.is_owned = ptr_is_owned(this_arg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ this_arg_conv.is_owned = false;
+ jboolean ret_conv = Bolt12InvoiceFeatures_requires_basic_mpp(&this_arg_conv);
+ return ret_conv;
+}
+
void __attribute__((export_name("TS_InitFeatures_set_wumbo_optional"))) TS_InitFeatures_set_wumbo_optional(uint64_t this_arg) {
LDKInitFeatures this_arg_conv;
this_arg_conv.inner = untag_ptr(this_arg);
return ret_conv;
}
+void __attribute__((export_name("TS_InitFeatures_set_anchors_zero_fee_htlc_tx_optional"))) TS_InitFeatures_set_anchors_zero_fee_htlc_tx_optional(uint64_t this_arg) {
+ LDKInitFeatures this_arg_conv;
+ this_arg_conv.inner = untag_ptr(this_arg);
+ this_arg_conv.is_owned = ptr_is_owned(this_arg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ this_arg_conv.is_owned = false;
+ InitFeatures_set_anchors_zero_fee_htlc_tx_optional(&this_arg_conv);
+}
+
+void __attribute__((export_name("TS_InitFeatures_set_anchors_zero_fee_htlc_tx_required"))) TS_InitFeatures_set_anchors_zero_fee_htlc_tx_required(uint64_t this_arg) {
+ LDKInitFeatures this_arg_conv;
+ this_arg_conv.inner = untag_ptr(this_arg);
+ this_arg_conv.is_owned = ptr_is_owned(this_arg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ this_arg_conv.is_owned = false;
+ InitFeatures_set_anchors_zero_fee_htlc_tx_required(&this_arg_conv);
+}
+
+jboolean __attribute__((export_name("TS_InitFeatures_supports_anchors_zero_fee_htlc_tx"))) TS_InitFeatures_supports_anchors_zero_fee_htlc_tx(uint64_t this_arg) {
+ LDKInitFeatures this_arg_conv;
+ this_arg_conv.inner = untag_ptr(this_arg);
+ this_arg_conv.is_owned = ptr_is_owned(this_arg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ this_arg_conv.is_owned = false;
+ jboolean ret_conv = InitFeatures_supports_anchors_zero_fee_htlc_tx(&this_arg_conv);
+ return ret_conv;
+}
+
+void __attribute__((export_name("TS_NodeFeatures_set_anchors_zero_fee_htlc_tx_optional"))) TS_NodeFeatures_set_anchors_zero_fee_htlc_tx_optional(uint64_t this_arg) {
+ LDKNodeFeatures this_arg_conv;
+ this_arg_conv.inner = untag_ptr(this_arg);
+ this_arg_conv.is_owned = ptr_is_owned(this_arg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ this_arg_conv.is_owned = false;
+ NodeFeatures_set_anchors_zero_fee_htlc_tx_optional(&this_arg_conv);
+}
+
+void __attribute__((export_name("TS_NodeFeatures_set_anchors_zero_fee_htlc_tx_required"))) TS_NodeFeatures_set_anchors_zero_fee_htlc_tx_required(uint64_t this_arg) {
+ LDKNodeFeatures this_arg_conv;
+ this_arg_conv.inner = untag_ptr(this_arg);
+ this_arg_conv.is_owned = ptr_is_owned(this_arg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ this_arg_conv.is_owned = false;
+ NodeFeatures_set_anchors_zero_fee_htlc_tx_required(&this_arg_conv);
+}
+
+jboolean __attribute__((export_name("TS_NodeFeatures_supports_anchors_zero_fee_htlc_tx"))) TS_NodeFeatures_supports_anchors_zero_fee_htlc_tx(uint64_t this_arg) {
+ LDKNodeFeatures this_arg_conv;
+ this_arg_conv.inner = untag_ptr(this_arg);
+ this_arg_conv.is_owned = ptr_is_owned(this_arg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ this_arg_conv.is_owned = false;
+ jboolean ret_conv = NodeFeatures_supports_anchors_zero_fee_htlc_tx(&this_arg_conv);
+ return ret_conv;
+}
+
+void __attribute__((export_name("TS_ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_optional"))) TS_ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_optional(uint64_t this_arg) {
+ LDKChannelTypeFeatures this_arg_conv;
+ this_arg_conv.inner = untag_ptr(this_arg);
+ this_arg_conv.is_owned = ptr_is_owned(this_arg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ this_arg_conv.is_owned = false;
+ ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_optional(&this_arg_conv);
+}
+
+void __attribute__((export_name("TS_ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_required"))) TS_ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_required(uint64_t this_arg) {
+ LDKChannelTypeFeatures this_arg_conv;
+ this_arg_conv.inner = untag_ptr(this_arg);
+ this_arg_conv.is_owned = ptr_is_owned(this_arg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ this_arg_conv.is_owned = false;
+ ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_required(&this_arg_conv);
+}
+
+jboolean __attribute__((export_name("TS_ChannelTypeFeatures_supports_anchors_zero_fee_htlc_tx"))) TS_ChannelTypeFeatures_supports_anchors_zero_fee_htlc_tx(uint64_t this_arg) {
+ LDKChannelTypeFeatures this_arg_conv;
+ this_arg_conv.inner = untag_ptr(this_arg);
+ this_arg_conv.is_owned = ptr_is_owned(this_arg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ this_arg_conv.is_owned = false;
+ jboolean ret_conv = ChannelTypeFeatures_supports_anchors_zero_fee_htlc_tx(&this_arg_conv);
+ return ret_conv;
+}
+
+jboolean __attribute__((export_name("TS_InitFeatures_requires_anchors_zero_fee_htlc_tx"))) TS_InitFeatures_requires_anchors_zero_fee_htlc_tx(uint64_t this_arg) {
+ LDKInitFeatures this_arg_conv;
+ this_arg_conv.inner = untag_ptr(this_arg);
+ this_arg_conv.is_owned = ptr_is_owned(this_arg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ this_arg_conv.is_owned = false;
+ jboolean ret_conv = InitFeatures_requires_anchors_zero_fee_htlc_tx(&this_arg_conv);
+ return ret_conv;
+}
+
+jboolean __attribute__((export_name("TS_NodeFeatures_requires_anchors_zero_fee_htlc_tx"))) TS_NodeFeatures_requires_anchors_zero_fee_htlc_tx(uint64_t this_arg) {
+ LDKNodeFeatures this_arg_conv;
+ this_arg_conv.inner = untag_ptr(this_arg);
+ this_arg_conv.is_owned = ptr_is_owned(this_arg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ this_arg_conv.is_owned = false;
+ jboolean ret_conv = NodeFeatures_requires_anchors_zero_fee_htlc_tx(&this_arg_conv);
+ return ret_conv;
+}
+
+jboolean __attribute__((export_name("TS_ChannelTypeFeatures_requires_anchors_zero_fee_htlc_tx"))) TS_ChannelTypeFeatures_requires_anchors_zero_fee_htlc_tx(uint64_t this_arg) {
+ LDKChannelTypeFeatures this_arg_conv;
+ this_arg_conv.inner = untag_ptr(this_arg);
+ this_arg_conv.is_owned = ptr_is_owned(this_arg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ this_arg_conv.is_owned = false;
+ jboolean ret_conv = ChannelTypeFeatures_requires_anchors_zero_fee_htlc_tx(&this_arg_conv);
+ return ret_conv;
+}
+
void __attribute__((export_name("TS_InitFeatures_set_shutdown_any_segwit_optional"))) TS_InitFeatures_set_shutdown_any_segwit_optional(uint64_t this_arg) {
LDKInitFeatures this_arg_conv;
this_arg_conv.inner = untag_ptr(this_arg);
return ret_conv;
}
+void __attribute__((export_name("TS_InitFeatures_set_onion_messages_optional"))) TS_InitFeatures_set_onion_messages_optional(uint64_t this_arg) {
+ LDKInitFeatures this_arg_conv;
+ this_arg_conv.inner = untag_ptr(this_arg);
+ this_arg_conv.is_owned = ptr_is_owned(this_arg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ this_arg_conv.is_owned = false;
+ InitFeatures_set_onion_messages_optional(&this_arg_conv);
+}
+
+void __attribute__((export_name("TS_InitFeatures_set_onion_messages_required"))) TS_InitFeatures_set_onion_messages_required(uint64_t this_arg) {
+ LDKInitFeatures this_arg_conv;
+ this_arg_conv.inner = untag_ptr(this_arg);
+ this_arg_conv.is_owned = ptr_is_owned(this_arg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ this_arg_conv.is_owned = false;
+ InitFeatures_set_onion_messages_required(&this_arg_conv);
+}
+
+jboolean __attribute__((export_name("TS_InitFeatures_supports_onion_messages"))) TS_InitFeatures_supports_onion_messages(uint64_t this_arg) {
+ LDKInitFeatures this_arg_conv;
+ this_arg_conv.inner = untag_ptr(this_arg);
+ this_arg_conv.is_owned = ptr_is_owned(this_arg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ this_arg_conv.is_owned = false;
+ jboolean ret_conv = InitFeatures_supports_onion_messages(&this_arg_conv);
+ return ret_conv;
+}
+
+void __attribute__((export_name("TS_NodeFeatures_set_onion_messages_optional"))) TS_NodeFeatures_set_onion_messages_optional(uint64_t this_arg) {
+ LDKNodeFeatures this_arg_conv;
+ this_arg_conv.inner = untag_ptr(this_arg);
+ this_arg_conv.is_owned = ptr_is_owned(this_arg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ this_arg_conv.is_owned = false;
+ NodeFeatures_set_onion_messages_optional(&this_arg_conv);
+}
+
+void __attribute__((export_name("TS_NodeFeatures_set_onion_messages_required"))) TS_NodeFeatures_set_onion_messages_required(uint64_t this_arg) {
+ LDKNodeFeatures this_arg_conv;
+ this_arg_conv.inner = untag_ptr(this_arg);
+ this_arg_conv.is_owned = ptr_is_owned(this_arg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ this_arg_conv.is_owned = false;
+ NodeFeatures_set_onion_messages_required(&this_arg_conv);
+}
+
+jboolean __attribute__((export_name("TS_NodeFeatures_supports_onion_messages"))) TS_NodeFeatures_supports_onion_messages(uint64_t this_arg) {
+ LDKNodeFeatures this_arg_conv;
+ this_arg_conv.inner = untag_ptr(this_arg);
+ this_arg_conv.is_owned = ptr_is_owned(this_arg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ this_arg_conv.is_owned = false;
+ jboolean ret_conv = NodeFeatures_supports_onion_messages(&this_arg_conv);
+ return ret_conv;
+}
+
+jboolean __attribute__((export_name("TS_InitFeatures_requires_onion_messages"))) TS_InitFeatures_requires_onion_messages(uint64_t this_arg) {
+ LDKInitFeatures this_arg_conv;
+ this_arg_conv.inner = untag_ptr(this_arg);
+ this_arg_conv.is_owned = ptr_is_owned(this_arg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ this_arg_conv.is_owned = false;
+ jboolean ret_conv = InitFeatures_requires_onion_messages(&this_arg_conv);
+ return ret_conv;
+}
+
+jboolean __attribute__((export_name("TS_NodeFeatures_requires_onion_messages"))) TS_NodeFeatures_requires_onion_messages(uint64_t this_arg) {
+ LDKNodeFeatures this_arg_conv;
+ this_arg_conv.inner = untag_ptr(this_arg);
+ this_arg_conv.is_owned = ptr_is_owned(this_arg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ this_arg_conv.is_owned = false;
+ jboolean ret_conv = NodeFeatures_requires_onion_messages(&this_arg_conv);
+ return ret_conv;
+}
+
void __attribute__((export_name("TS_InitFeatures_set_channel_type_optional"))) TS_InitFeatures_set_channel_type_optional(uint64_t this_arg) {
LDKInitFeatures this_arg_conv;
this_arg_conv.inner = untag_ptr(this_arg);
return ret_ref;
}
+jboolean __attribute__((export_name("TS_ShutdownScript_eq"))) TS_ShutdownScript_eq(uint64_t a, uint64_t b) {
+ LDKShutdownScript a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKShutdownScript b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = ShutdownScript_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
void __attribute__((export_name("TS_InvalidShutdownScript_free"))) TS_InvalidShutdownScript_free(uint64_t this_obj) {
LDKInvalidShutdownScript this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
}
uint64_t __attribute__((export_name("TS_ShutdownScript_new_p2wpkh"))) TS_ShutdownScript_new_p2wpkh(int8_tArray pubkey_hash) {
- unsigned char pubkey_hash_arr[20];
+ uint8_t pubkey_hash_arr[20];
CHECK(pubkey_hash->arr_len == 20);
memcpy(pubkey_hash_arr, pubkey_hash->elems, 20); FREE(pubkey_hash);
- unsigned char (*pubkey_hash_ref)[20] = &pubkey_hash_arr;
+ uint8_t (*pubkey_hash_ref)[20] = &pubkey_hash_arr;
LDKShutdownScript ret_var = ShutdownScript_new_p2wpkh(pubkey_hash_ref);
uint64_t ret_ref = 0;
CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
}
uint64_t __attribute__((export_name("TS_ShutdownScript_new_p2wsh"))) TS_ShutdownScript_new_p2wsh(int8_tArray script_hash) {
- unsigned char script_hash_arr[32];
+ uint8_t script_hash_arr[32];
CHECK(script_hash->arr_len == 32);
memcpy(script_hash_arr, script_hash->elems, 32); FREE(script_hash);
- unsigned char (*script_hash_ref)[32] = &script_hash_arr;
+ uint8_t (*script_hash_ref)[32] = &script_hash_arr;
LDKShutdownScript ret_var = ShutdownScript_new_p2wsh(script_hash_ref);
uint64_t ret_ref = 0;
CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
return ret_conv;
}
+void __attribute__((export_name("TS_Retry_free"))) TS_Retry_free(uint64_t this_ptr) {
+ if (!ptr_is_owned(this_ptr)) return;
+ void* this_ptr_ptr = untag_ptr(this_ptr);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKRetry this_ptr_conv = *(LDKRetry*)(this_ptr_ptr);
+ FREE(untag_ptr(this_ptr));
+ Retry_free(this_ptr_conv);
+}
+
+static inline uint64_t Retry_clone_ptr(LDKRetry *NONNULL_PTR arg) {
+ LDKRetry *ret_copy = MALLOC(sizeof(LDKRetry), "LDKRetry");
+ *ret_copy = Retry_clone(arg);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+int64_t __attribute__((export_name("TS_Retry_clone_ptr"))) TS_Retry_clone_ptr(uint64_t arg) {
+ LDKRetry* arg_conv = (LDKRetry*)untag_ptr(arg);
+ int64_t ret_conv = Retry_clone_ptr(arg_conv);
+ return ret_conv;
+}
+
+uint64_t __attribute__((export_name("TS_Retry_clone"))) TS_Retry_clone(uint64_t orig) {
+ LDKRetry* orig_conv = (LDKRetry*)untag_ptr(orig);
+ LDKRetry *ret_copy = MALLOC(sizeof(LDKRetry), "LDKRetry");
+ *ret_copy = Retry_clone(orig_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+uint64_t __attribute__((export_name("TS_Retry_attempts"))) TS_Retry_attempts(uint32_t a) {
+ LDKRetry *ret_copy = MALLOC(sizeof(LDKRetry), "LDKRetry");
+ *ret_copy = Retry_attempts(a);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+jboolean __attribute__((export_name("TS_Retry_eq"))) TS_Retry_eq(uint64_t a, uint64_t b) {
+ LDKRetry* a_conv = (LDKRetry*)untag_ptr(a);
+ LDKRetry* b_conv = (LDKRetry*)untag_ptr(b);
+ jboolean ret_conv = Retry_eq(a_conv, b_conv);
+ return ret_conv;
+}
+
+int64_t __attribute__((export_name("TS_Retry_hash"))) TS_Retry_hash(uint64_t o) {
+ LDKRetry* o_conv = (LDKRetry*)untag_ptr(o);
+ int64_t ret_conv = Retry_hash(o_conv);
+ return ret_conv;
+}
+
+uint32_t __attribute__((export_name("TS_RetryableSendFailure_clone"))) TS_RetryableSendFailure_clone(uint64_t orig) {
+ LDKRetryableSendFailure* orig_conv = (LDKRetryableSendFailure*)untag_ptr(orig);
+ uint32_t ret_conv = LDKRetryableSendFailure_to_js(RetryableSendFailure_clone(orig_conv));
+ return ret_conv;
+}
+
+uint32_t __attribute__((export_name("TS_RetryableSendFailure_payment_expired"))) TS_RetryableSendFailure_payment_expired() {
+ uint32_t ret_conv = LDKRetryableSendFailure_to_js(RetryableSendFailure_payment_expired());
+ return ret_conv;
+}
+
+uint32_t __attribute__((export_name("TS_RetryableSendFailure_route_not_found"))) TS_RetryableSendFailure_route_not_found() {
+ uint32_t ret_conv = LDKRetryableSendFailure_to_js(RetryableSendFailure_route_not_found());
+ return ret_conv;
+}
+
+uint32_t __attribute__((export_name("TS_RetryableSendFailure_duplicate_payment"))) TS_RetryableSendFailure_duplicate_payment() {
+ uint32_t ret_conv = LDKRetryableSendFailure_to_js(RetryableSendFailure_duplicate_payment());
+ return ret_conv;
+}
+
+void __attribute__((export_name("TS_PaymentSendFailure_free"))) TS_PaymentSendFailure_free(uint64_t this_ptr) {
+ if (!ptr_is_owned(this_ptr)) return;
+ void* this_ptr_ptr = untag_ptr(this_ptr);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKPaymentSendFailure this_ptr_conv = *(LDKPaymentSendFailure*)(this_ptr_ptr);
+ FREE(untag_ptr(this_ptr));
+ PaymentSendFailure_free(this_ptr_conv);
+}
+
+static inline uint64_t PaymentSendFailure_clone_ptr(LDKPaymentSendFailure *NONNULL_PTR arg) {
+ LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
+ *ret_copy = PaymentSendFailure_clone(arg);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+int64_t __attribute__((export_name("TS_PaymentSendFailure_clone_ptr"))) TS_PaymentSendFailure_clone_ptr(uint64_t arg) {
+ LDKPaymentSendFailure* arg_conv = (LDKPaymentSendFailure*)untag_ptr(arg);
+ int64_t ret_conv = PaymentSendFailure_clone_ptr(arg_conv);
+ return ret_conv;
+}
+
+uint64_t __attribute__((export_name("TS_PaymentSendFailure_clone"))) TS_PaymentSendFailure_clone(uint64_t orig) {
+ LDKPaymentSendFailure* orig_conv = (LDKPaymentSendFailure*)untag_ptr(orig);
+ LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
+ *ret_copy = PaymentSendFailure_clone(orig_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+uint64_t __attribute__((export_name("TS_PaymentSendFailure_parameter_error"))) TS_PaymentSendFailure_parameter_error(uint64_t a) {
+ void* a_ptr = untag_ptr(a);
+ CHECK_ACCESS(a_ptr);
+ LDKAPIError a_conv = *(LDKAPIError*)(a_ptr);
+ a_conv = APIError_clone((LDKAPIError*)untag_ptr(a));
+ LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
+ *ret_copy = PaymentSendFailure_parameter_error(a_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+uint64_t __attribute__((export_name("TS_PaymentSendFailure_path_parameter_error"))) TS_PaymentSendFailure_path_parameter_error(uint64_tArray a) {
+ LDKCVec_CResult_NoneAPIErrorZZ a_constr;
+ a_constr.datalen = a->arr_len;
+ if (a_constr.datalen > 0)
+ a_constr.data = MALLOC(a_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements");
+ else
+ a_constr.data = NULL;
+ uint64_t* a_vals = a->elems;
+ for (size_t w = 0; w < a_constr.datalen; w++) {
+ uint64_t a_conv_22 = a_vals[w];
+ void* a_conv_22_ptr = untag_ptr(a_conv_22);
+ CHECK_ACCESS(a_conv_22_ptr);
+ LDKCResult_NoneAPIErrorZ a_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(a_conv_22_ptr);
+ a_conv_22_conv = CResult_NoneAPIErrorZ_clone((LDKCResult_NoneAPIErrorZ*)untag_ptr(a_conv_22));
+ a_constr.data[w] = a_conv_22_conv;
+ }
+ FREE(a);
+ LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
+ *ret_copy = PaymentSendFailure_path_parameter_error(a_constr);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+uint64_t __attribute__((export_name("TS_PaymentSendFailure_all_failed_resend_safe"))) TS_PaymentSendFailure_all_failed_resend_safe(uint64_tArray a) {
+ LDKCVec_APIErrorZ a_constr;
+ a_constr.datalen = a->arr_len;
+ if (a_constr.datalen > 0)
+ a_constr.data = MALLOC(a_constr.datalen * sizeof(LDKAPIError), "LDKCVec_APIErrorZ Elements");
+ else
+ a_constr.data = NULL;
+ uint64_t* a_vals = a->elems;
+ for (size_t k = 0; k < a_constr.datalen; k++) {
+ uint64_t a_conv_10 = a_vals[k];
+ void* a_conv_10_ptr = untag_ptr(a_conv_10);
+ CHECK_ACCESS(a_conv_10_ptr);
+ LDKAPIError a_conv_10_conv = *(LDKAPIError*)(a_conv_10_ptr);
+ a_conv_10_conv = APIError_clone((LDKAPIError*)untag_ptr(a_conv_10));
+ a_constr.data[k] = a_conv_10_conv;
+ }
+ FREE(a);
+ LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
+ *ret_copy = PaymentSendFailure_all_failed_resend_safe(a_constr);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+uint64_t __attribute__((export_name("TS_PaymentSendFailure_duplicate_payment"))) TS_PaymentSendFailure_duplicate_payment() {
+ LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
+ *ret_copy = PaymentSendFailure_duplicate_payment();
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+uint64_t __attribute__((export_name("TS_PaymentSendFailure_partial_failure"))) TS_PaymentSendFailure_partial_failure(uint64_tArray results, uint64_t failed_paths_retry, int8_tArray payment_id) {
+ LDKCVec_CResult_NoneAPIErrorZZ results_constr;
+ results_constr.datalen = results->arr_len;
+ if (results_constr.datalen > 0)
+ results_constr.data = MALLOC(results_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements");
+ else
+ results_constr.data = NULL;
+ uint64_t* results_vals = results->elems;
+ for (size_t w = 0; w < results_constr.datalen; w++) {
+ uint64_t results_conv_22 = results_vals[w];
+ void* results_conv_22_ptr = untag_ptr(results_conv_22);
+ CHECK_ACCESS(results_conv_22_ptr);
+ LDKCResult_NoneAPIErrorZ results_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(results_conv_22_ptr);
+ results_constr.data[w] = results_conv_22_conv;
+ }
+ FREE(results);
+ LDKRouteParameters failed_paths_retry_conv;
+ failed_paths_retry_conv.inner = untag_ptr(failed_paths_retry);
+ failed_paths_retry_conv.is_owned = ptr_is_owned(failed_paths_retry);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(failed_paths_retry_conv);
+ failed_paths_retry_conv = RouteParameters_clone(&failed_paths_retry_conv);
+ LDKThirtyTwoBytes payment_id_ref;
+ CHECK(payment_id->arr_len == 32);
+ memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id);
+ LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
+ *ret_copy = PaymentSendFailure_partial_failure(results_constr, failed_paths_retry_conv, payment_id_ref);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
void __attribute__((export_name("TS_CustomMessageReader_free"))) TS_CustomMessageReader_free(uint64_t this_ptr) {
if (!ptr_is_owned(this_ptr)) return;
void* this_ptr_ptr = untag_ptr(this_ptr);
Type_free(this_ptr_conv);
}
+uint32_t __attribute__((export_name("TS_UtxoLookupError_clone"))) TS_UtxoLookupError_clone(uint64_t orig) {
+ LDKUtxoLookupError* orig_conv = (LDKUtxoLookupError*)untag_ptr(orig);
+ uint32_t ret_conv = LDKUtxoLookupError_to_js(UtxoLookupError_clone(orig_conv));
+ return ret_conv;
+}
+
+uint32_t __attribute__((export_name("TS_UtxoLookupError_unknown_chain"))) TS_UtxoLookupError_unknown_chain() {
+ uint32_t ret_conv = LDKUtxoLookupError_to_js(UtxoLookupError_unknown_chain());
+ return ret_conv;
+}
+
+uint32_t __attribute__((export_name("TS_UtxoLookupError_unknown_tx"))) TS_UtxoLookupError_unknown_tx() {
+ uint32_t ret_conv = LDKUtxoLookupError_to_js(UtxoLookupError_unknown_tx());
+ return ret_conv;
+}
+
+void __attribute__((export_name("TS_UtxoResult_free"))) TS_UtxoResult_free(uint64_t this_ptr) {
+ if (!ptr_is_owned(this_ptr)) return;
+ void* this_ptr_ptr = untag_ptr(this_ptr);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKUtxoResult this_ptr_conv = *(LDKUtxoResult*)(this_ptr_ptr);
+ FREE(untag_ptr(this_ptr));
+ UtxoResult_free(this_ptr_conv);
+}
+
+static inline uint64_t UtxoResult_clone_ptr(LDKUtxoResult *NONNULL_PTR arg) {
+ LDKUtxoResult *ret_copy = MALLOC(sizeof(LDKUtxoResult), "LDKUtxoResult");
+ *ret_copy = UtxoResult_clone(arg);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+int64_t __attribute__((export_name("TS_UtxoResult_clone_ptr"))) TS_UtxoResult_clone_ptr(uint64_t arg) {
+ LDKUtxoResult* arg_conv = (LDKUtxoResult*)untag_ptr(arg);
+ int64_t ret_conv = UtxoResult_clone_ptr(arg_conv);
+ return ret_conv;
+}
+
+uint64_t __attribute__((export_name("TS_UtxoResult_clone"))) TS_UtxoResult_clone(uint64_t orig) {
+ LDKUtxoResult* orig_conv = (LDKUtxoResult*)untag_ptr(orig);
+ LDKUtxoResult *ret_copy = MALLOC(sizeof(LDKUtxoResult), "LDKUtxoResult");
+ *ret_copy = UtxoResult_clone(orig_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+uint64_t __attribute__((export_name("TS_UtxoResult_sync"))) TS_UtxoResult_sync(uint64_t a) {
+ void* a_ptr = untag_ptr(a);
+ CHECK_ACCESS(a_ptr);
+ LDKCResult_TxOutUtxoLookupErrorZ a_conv = *(LDKCResult_TxOutUtxoLookupErrorZ*)(a_ptr);
+ a_conv = CResult_TxOutUtxoLookupErrorZ_clone((LDKCResult_TxOutUtxoLookupErrorZ*)untag_ptr(a));
+ LDKUtxoResult *ret_copy = MALLOC(sizeof(LDKUtxoResult), "LDKUtxoResult");
+ *ret_copy = UtxoResult_sync(a_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+uint64_t __attribute__((export_name("TS_UtxoResult_async"))) TS_UtxoResult_async(uint64_t a) {
+ LDKUtxoFuture a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv = UtxoFuture_clone(&a_conv);
+ LDKUtxoResult *ret_copy = MALLOC(sizeof(LDKUtxoResult), "LDKUtxoResult");
+ *ret_copy = UtxoResult_async(a_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+void __attribute__((export_name("TS_UtxoLookup_free"))) TS_UtxoLookup_free(uint64_t this_ptr) {
+ if (!ptr_is_owned(this_ptr)) return;
+ void* this_ptr_ptr = untag_ptr(this_ptr);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKUtxoLookup this_ptr_conv = *(LDKUtxoLookup*)(this_ptr_ptr);
+ FREE(untag_ptr(this_ptr));
+ UtxoLookup_free(this_ptr_conv);
+}
+
+void __attribute__((export_name("TS_UtxoFuture_free"))) TS_UtxoFuture_free(uint64_t this_obj) {
+ LDKUtxoFuture this_obj_conv;
+ this_obj_conv.inner = untag_ptr(this_obj);
+ this_obj_conv.is_owned = ptr_is_owned(this_obj);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
+ UtxoFuture_free(this_obj_conv);
+}
+
+static inline uint64_t UtxoFuture_clone_ptr(LDKUtxoFuture *NONNULL_PTR arg) {
+ LDKUtxoFuture ret_var = UtxoFuture_clone(arg);
+ uint64_t ret_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ return ret_ref;
+}
+int64_t __attribute__((export_name("TS_UtxoFuture_clone_ptr"))) TS_UtxoFuture_clone_ptr(uint64_t arg) {
+ LDKUtxoFuture arg_conv;
+ arg_conv.inner = untag_ptr(arg);
+ arg_conv.is_owned = ptr_is_owned(arg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+ arg_conv.is_owned = false;
+ int64_t ret_conv = UtxoFuture_clone_ptr(&arg_conv);
+ return ret_conv;
+}
+
+uint64_t __attribute__((export_name("TS_UtxoFuture_clone"))) TS_UtxoFuture_clone(uint64_t orig) {
+ LDKUtxoFuture orig_conv;
+ orig_conv.inner = untag_ptr(orig);
+ orig_conv.is_owned = ptr_is_owned(orig);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
+ orig_conv.is_owned = false;
+ LDKUtxoFuture ret_var = UtxoFuture_clone(&orig_conv);
+ uint64_t ret_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ return ret_ref;
+}
+
+uint64_t __attribute__((export_name("TS_UtxoFuture_new"))) TS_UtxoFuture_new() {
+ LDKUtxoFuture ret_var = UtxoFuture_new();
+ uint64_t ret_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ return ret_ref;
+}
+
+void __attribute__((export_name("TS_UtxoFuture_resolve_without_forwarding"))) TS_UtxoFuture_resolve_without_forwarding(uint64_t this_arg, uint64_t graph, uint64_t result) {
+ LDKUtxoFuture this_arg_conv;
+ this_arg_conv.inner = untag_ptr(this_arg);
+ this_arg_conv.is_owned = ptr_is_owned(this_arg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ this_arg_conv.is_owned = false;
+ LDKNetworkGraph graph_conv;
+ graph_conv.inner = untag_ptr(graph);
+ graph_conv.is_owned = ptr_is_owned(graph);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(graph_conv);
+ graph_conv.is_owned = false;
+ void* result_ptr = untag_ptr(result);
+ CHECK_ACCESS(result_ptr);
+ LDKCResult_TxOutUtxoLookupErrorZ result_conv = *(LDKCResult_TxOutUtxoLookupErrorZ*)(result_ptr);
+ UtxoFuture_resolve_without_forwarding(&this_arg_conv, &graph_conv, result_conv);
+}
+
+void __attribute__((export_name("TS_UtxoFuture_resolve"))) TS_UtxoFuture_resolve(uint64_t this_arg, uint64_t graph, uint64_t gossip, uint64_t result) {
+ LDKUtxoFuture this_arg_conv;
+ this_arg_conv.inner = untag_ptr(this_arg);
+ this_arg_conv.is_owned = ptr_is_owned(this_arg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ this_arg_conv.is_owned = false;
+ LDKNetworkGraph graph_conv;
+ graph_conv.inner = untag_ptr(graph);
+ graph_conv.is_owned = ptr_is_owned(graph);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(graph_conv);
+ graph_conv.is_owned = false;
+ LDKP2PGossipSync gossip_conv;
+ gossip_conv.inner = untag_ptr(gossip);
+ gossip_conv.is_owned = ptr_is_owned(gossip);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(gossip_conv);
+ gossip_conv.is_owned = false;
+ void* result_ptr = untag_ptr(result);
+ CHECK_ACCESS(result_ptr);
+ LDKCResult_TxOutUtxoLookupErrorZ result_conv = *(LDKCResult_TxOutUtxoLookupErrorZ*)(result_ptr);
+ UtxoFuture_resolve(&this_arg_conv, &graph_conv, &gossip_conv, result_conv);
+}
+
void __attribute__((export_name("TS_NodeId_free"))) TS_NodeId_free(uint64_t this_obj) {
LDKNodeId this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+jboolean __attribute__((export_name("TS_NetworkUpdate_eq"))) TS_NetworkUpdate_eq(uint64_t a, uint64_t b) {
+ LDKNetworkUpdate* a_conv = (LDKNetworkUpdate*)untag_ptr(a);
+ LDKNetworkUpdate* b_conv = (LDKNetworkUpdate*)untag_ptr(b);
+ jboolean ret_conv = NetworkUpdate_eq(a_conv, b_conv);
+ return ret_conv;
+}
+
int8_tArray __attribute__((export_name("TS_NetworkUpdate_write"))) TS_NetworkUpdate_write(uint64_t obj) {
LDKNetworkUpdate* obj_conv = (LDKNetworkUpdate*)untag_ptr(obj);
LDKCVec_u8Z ret_var = NetworkUpdate_write(obj_conv);
P2PGossipSync_free(this_obj_conv);
}
-uint64_t __attribute__((export_name("TS_P2PGossipSync_new"))) TS_P2PGossipSync_new(uint64_t network_graph, uint64_t chain_access, uint64_t logger) {
+uint64_t __attribute__((export_name("TS_P2PGossipSync_new"))) TS_P2PGossipSync_new(uint64_t network_graph, uint64_t utxo_lookup, uint64_t logger) {
LDKNetworkGraph network_graph_conv;
network_graph_conv.inner = untag_ptr(network_graph);
network_graph_conv.is_owned = ptr_is_owned(network_graph);
CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv);
network_graph_conv.is_owned = false;
- void* chain_access_ptr = untag_ptr(chain_access);
- CHECK_ACCESS(chain_access_ptr);
- LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(chain_access_ptr);
- // WARNING: we may need a move here but no clone is available for LDKCOption_AccessZ
- if (chain_access_conv.tag == LDKCOption_AccessZ_Some) {
+ void* utxo_lookup_ptr = untag_ptr(utxo_lookup);
+ CHECK_ACCESS(utxo_lookup_ptr);
+ LDKCOption_UtxoLookupZ utxo_lookup_conv = *(LDKCOption_UtxoLookupZ*)(utxo_lookup_ptr);
+ // WARNING: we may need a move here but no clone is available for LDKCOption_UtxoLookupZ
+ if (utxo_lookup_conv.tag == LDKCOption_UtxoLookupZ_Some) {
// Manually implement clone for Java trait instances
- if (chain_access_conv.some.free == LDKAccess_JCalls_free) {
+ if (utxo_lookup_conv.some.free == LDKUtxoLookup_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
- LDKAccess_JCalls_cloned(&chain_access_conv.some);
+ LDKUtxoLookup_JCalls_cloned(&utxo_lookup_conv.some);
}
}
void* logger_ptr = untag_ptr(logger);
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKLogger_JCalls_cloned(&logger_conv);
}
- LDKP2PGossipSync ret_var = P2PGossipSync_new(&network_graph_conv, chain_access_conv, logger_conv);
+ LDKP2PGossipSync ret_var = P2PGossipSync_new(&network_graph_conv, utxo_lookup_conv, logger_conv);
uint64_t ret_ref = 0;
CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
return ret_ref;
}
-void __attribute__((export_name("TS_P2PGossipSync_add_chain_access"))) TS_P2PGossipSync_add_chain_access(uint64_t this_arg, uint64_t chain_access) {
+void __attribute__((export_name("TS_P2PGossipSync_add_utxo_lookup"))) TS_P2PGossipSync_add_utxo_lookup(uint64_t this_arg, uint64_t utxo_lookup) {
LDKP2PGossipSync this_arg_conv;
this_arg_conv.inner = untag_ptr(this_arg);
this_arg_conv.is_owned = ptr_is_owned(this_arg);
CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
this_arg_conv.is_owned = false;
- void* chain_access_ptr = untag_ptr(chain_access);
- CHECK_ACCESS(chain_access_ptr);
- LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(chain_access_ptr);
- // WARNING: we may need a move here but no clone is available for LDKCOption_AccessZ
- if (chain_access_conv.tag == LDKCOption_AccessZ_Some) {
+ void* utxo_lookup_ptr = untag_ptr(utxo_lookup);
+ CHECK_ACCESS(utxo_lookup_ptr);
+ LDKCOption_UtxoLookupZ utxo_lookup_conv = *(LDKCOption_UtxoLookupZ*)(utxo_lookup_ptr);
+ // WARNING: we may need a move here but no clone is available for LDKCOption_UtxoLookupZ
+ if (utxo_lookup_conv.tag == LDKCOption_UtxoLookupZ_Some) {
// Manually implement clone for Java trait instances
- if (chain_access_conv.some.free == LDKAccess_JCalls_free) {
+ if (utxo_lookup_conv.some.free == LDKUtxoLookup_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
- LDKAccess_JCalls_cloned(&chain_access_conv.some);
+ LDKUtxoLookup_JCalls_cloned(&utxo_lookup_conv.some);
}
}
- P2PGossipSync_add_chain_access(&this_arg_conv, chain_access_conv);
+ P2PGossipSync_add_utxo_lookup(&this_arg_conv, utxo_lookup_conv);
}
-uint64_t __attribute__((export_name("TS_NetworkGraph_as_EventHandler"))) TS_NetworkGraph_as_EventHandler(uint64_t this_arg) {
+void __attribute__((export_name("TS_NetworkGraph_handle_network_update"))) TS_NetworkGraph_handle_network_update(uint64_t this_arg, uint64_t network_update) {
LDKNetworkGraph this_arg_conv;
this_arg_conv.inner = untag_ptr(this_arg);
this_arg_conv.is_owned = ptr_is_owned(this_arg);
CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
this_arg_conv.is_owned = false;
- LDKEventHandler* ret_ret = MALLOC(sizeof(LDKEventHandler), "LDKEventHandler");
- *ret_ret = NetworkGraph_as_EventHandler(&this_arg_conv);
- return tag_ptr(ret_ret, true);
+ LDKNetworkUpdate* network_update_conv = (LDKNetworkUpdate*)untag_ptr(network_update);
+ NetworkGraph_handle_network_update(&this_arg_conv, network_update_conv);
}
uint64_t __attribute__((export_name("TS_P2PGossipSync_as_RoutingMessageHandler"))) TS_P2PGossipSync_as_RoutingMessageHandler(uint64_t this_arg) {
return ret_ref;
}
+jboolean __attribute__((export_name("TS_ChannelUpdateInfo_eq"))) TS_ChannelUpdateInfo_eq(uint64_t a, uint64_t b) {
+ LDKChannelUpdateInfo a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKChannelUpdateInfo b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = ChannelUpdateInfo_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
int8_tArray __attribute__((export_name("TS_ChannelUpdateInfo_write"))) TS_ChannelUpdateInfo_write(uint64_t obj) {
LDKChannelUpdateInfo obj_conv;
obj_conv.inner = untag_ptr(obj);
return ret_ref;
}
+jboolean __attribute__((export_name("TS_ChannelInfo_eq"))) TS_ChannelInfo_eq(uint64_t a, uint64_t b) {
+ LDKChannelInfo a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKChannelInfo b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = ChannelInfo_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
uint64_t __attribute__((export_name("TS_ChannelInfo_get_directional_info"))) TS_ChannelInfo_get_directional_info(uint64_t this_arg, int8_t channel_flags) {
LDKChannelInfo this_arg_conv;
this_arg_conv.inner = untag_ptr(this_arg);
return ret_ref;
}
-uint64_t __attribute__((export_name("TS_DirectedChannelInfo_direction"))) TS_DirectedChannelInfo_direction(uint64_t this_arg) {
- LDKDirectedChannelInfo this_arg_conv;
- this_arg_conv.inner = untag_ptr(this_arg);
- this_arg_conv.is_owned = ptr_is_owned(this_arg);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
- this_arg_conv.is_owned = false;
- LDKChannelUpdateInfo ret_var = DirectedChannelInfo_direction(&this_arg_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
- return ret_ref;
-}
-
int64_t __attribute__((export_name("TS_DirectedChannelInfo_htlc_maximum_msat"))) TS_DirectedChannelInfo_htlc_maximum_msat(uint64_t this_arg) {
LDKDirectedChannelInfo this_arg_conv;
this_arg_conv.inner = untag_ptr(this_arg);
return ret_ref;
}
-uint64_t __attribute__((export_name("TS_EffectiveCapacity_total"))) TS_EffectiveCapacity_total(int64_t capacity_msat, uint64_t htlc_maximum_msat) {
- void* htlc_maximum_msat_ptr = untag_ptr(htlc_maximum_msat);
- CHECK_ACCESS(htlc_maximum_msat_ptr);
- LDKCOption_u64Z htlc_maximum_msat_conv = *(LDKCOption_u64Z*)(htlc_maximum_msat_ptr);
- htlc_maximum_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(htlc_maximum_msat));
+uint64_t __attribute__((export_name("TS_EffectiveCapacity_total"))) TS_EffectiveCapacity_total(int64_t capacity_msat, int64_t htlc_maximum_msat) {
LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity");
- *ret_copy = EffectiveCapacity_total(capacity_msat, htlc_maximum_msat_conv);
+ *ret_copy = EffectiveCapacity_total(capacity_msat, htlc_maximum_msat);
uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
return ret_ref;
}
+jboolean __attribute__((export_name("TS_NodeAnnouncementInfo_eq"))) TS_NodeAnnouncementInfo_eq(uint64_t a, uint64_t b) {
+ LDKNodeAnnouncementInfo a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKNodeAnnouncementInfo b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = NodeAnnouncementInfo_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
int8_tArray __attribute__((export_name("TS_NodeAnnouncementInfo_write"))) TS_NodeAnnouncementInfo_write(uint64_t obj) {
LDKNodeAnnouncementInfo obj_conv;
obj_conv.inner = untag_ptr(obj);
return ret_ref;
}
+jboolean __attribute__((export_name("TS_NodeAlias_eq"))) TS_NodeAlias_eq(uint64_t a, uint64_t b) {
+ LDKNodeAlias a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKNodeAlias b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = NodeAlias_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
int8_tArray __attribute__((export_name("TS_NodeAlias_write"))) TS_NodeAlias_write(uint64_t obj) {
LDKNodeAlias obj_conv;
obj_conv.inner = untag_ptr(obj);
NodeInfo_set_channels(&this_ptr_conv, val_constr);
}
-uint64_t __attribute__((export_name("TS_NodeInfo_get_lowest_inbound_channel_fees"))) TS_NodeInfo_get_lowest_inbound_channel_fees(uint64_t this_ptr) {
- LDKNodeInfo this_ptr_conv;
- this_ptr_conv.inner = untag_ptr(this_ptr);
- this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
- this_ptr_conv.is_owned = false;
- LDKRoutingFees ret_var = NodeInfo_get_lowest_inbound_channel_fees(&this_ptr_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
- return ret_ref;
-}
-
-void __attribute__((export_name("TS_NodeInfo_set_lowest_inbound_channel_fees"))) TS_NodeInfo_set_lowest_inbound_channel_fees(uint64_t this_ptr, uint64_t val) {
- LDKNodeInfo this_ptr_conv;
- this_ptr_conv.inner = untag_ptr(this_ptr);
- this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
- this_ptr_conv.is_owned = false;
- LDKRoutingFees val_conv;
- val_conv.inner = untag_ptr(val);
- val_conv.is_owned = ptr_is_owned(val);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
- val_conv = RoutingFees_clone(&val_conv);
- NodeInfo_set_lowest_inbound_channel_fees(&this_ptr_conv, val_conv);
-}
-
uint64_t __attribute__((export_name("TS_NodeInfo_get_announcement_info"))) TS_NodeInfo_get_announcement_info(uint64_t this_ptr) {
LDKNodeInfo this_ptr_conv;
this_ptr_conv.inner = untag_ptr(this_ptr);
NodeInfo_set_announcement_info(&this_ptr_conv, val_conv);
}
-uint64_t __attribute__((export_name("TS_NodeInfo_new"))) TS_NodeInfo_new(int64_tArray channels_arg, uint64_t lowest_inbound_channel_fees_arg, uint64_t announcement_info_arg) {
+uint64_t __attribute__((export_name("TS_NodeInfo_new"))) TS_NodeInfo_new(int64_tArray channels_arg, uint64_t announcement_info_arg) {
LDKCVec_u64Z channels_arg_constr;
channels_arg_constr.datalen = channels_arg->arr_len;
if (channels_arg_constr.datalen > 0)
channels_arg_constr.data[i] = channels_arg_conv_8;
}
FREE(channels_arg);
- LDKRoutingFees lowest_inbound_channel_fees_arg_conv;
- lowest_inbound_channel_fees_arg_conv.inner = untag_ptr(lowest_inbound_channel_fees_arg);
- lowest_inbound_channel_fees_arg_conv.is_owned = ptr_is_owned(lowest_inbound_channel_fees_arg);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(lowest_inbound_channel_fees_arg_conv);
- lowest_inbound_channel_fees_arg_conv = RoutingFees_clone(&lowest_inbound_channel_fees_arg_conv);
LDKNodeAnnouncementInfo announcement_info_arg_conv;
announcement_info_arg_conv.inner = untag_ptr(announcement_info_arg);
announcement_info_arg_conv.is_owned = ptr_is_owned(announcement_info_arg);
CHECK_INNER_FIELD_ACCESS_OR_NULL(announcement_info_arg_conv);
announcement_info_arg_conv = NodeAnnouncementInfo_clone(&announcement_info_arg_conv);
- LDKNodeInfo ret_var = NodeInfo_new(channels_arg_constr, lowest_inbound_channel_fees_arg_conv, announcement_info_arg_conv);
+ LDKNodeInfo ret_var = NodeInfo_new(channels_arg_constr, announcement_info_arg_conv);
uint64_t ret_ref = 0;
CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
return ret_ref;
}
+jboolean __attribute__((export_name("TS_NodeInfo_eq"))) TS_NodeInfo_eq(uint64_t a, uint64_t b) {
+ LDKNodeInfo a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKNodeInfo b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = NodeInfo_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
int8_tArray __attribute__((export_name("TS_NodeInfo_write"))) TS_NodeInfo_write(uint64_t obj) {
LDKNodeInfo obj_conv;
obj_conv.inner = untag_ptr(obj);
return tag_ptr(ret_conv, true);
}
-uint64_t __attribute__((export_name("TS_NetworkGraph_new"))) TS_NetworkGraph_new(int8_tArray genesis_hash, uint64_t logger) {
- LDKThirtyTwoBytes genesis_hash_ref;
- CHECK(genesis_hash->arr_len == 32);
- memcpy(genesis_hash_ref.data, genesis_hash->elems, 32); FREE(genesis_hash);
+uint64_t __attribute__((export_name("TS_NetworkGraph_new"))) TS_NetworkGraph_new(uint32_t network, uint64_t logger) {
+ LDKNetwork network_conv = LDKNetwork_from_js(network);
void* logger_ptr = untag_ptr(logger);
CHECK_ACCESS(logger_ptr);
LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKLogger_JCalls_cloned(&logger_conv);
}
- LDKNetworkGraph ret_var = NetworkGraph_new(genesis_hash_ref, logger_conv);
+ LDKNetworkGraph ret_var = NetworkGraph_new(network_conv, logger_conv);
uint64_t ret_ref = 0;
CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
return tag_ptr(ret_conv, true);
}
-uint64_t __attribute__((export_name("TS_NetworkGraph_update_channel_from_announcement"))) TS_NetworkGraph_update_channel_from_announcement(uint64_t this_arg, uint64_t msg, uint64_t chain_access) {
+uint64_t __attribute__((export_name("TS_NetworkGraph_update_channel_from_announcement"))) TS_NetworkGraph_update_channel_from_announcement(uint64_t this_arg, uint64_t msg, uint64_t utxo_lookup) {
LDKNetworkGraph this_arg_conv;
this_arg_conv.inner = untag_ptr(this_arg);
this_arg_conv.is_owned = ptr_is_owned(this_arg);
msg_conv.is_owned = ptr_is_owned(msg);
CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
msg_conv.is_owned = false;
- void* chain_access_ptr = untag_ptr(chain_access);
- CHECK_ACCESS(chain_access_ptr);
- LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(chain_access_ptr);
- // WARNING: we may need a move here but no clone is available for LDKCOption_AccessZ
- if (chain_access_conv.tag == LDKCOption_AccessZ_Some) {
+ void* utxo_lookup_ptr = untag_ptr(utxo_lookup);
+ CHECK_ACCESS(utxo_lookup_ptr);
+ LDKCOption_UtxoLookupZ utxo_lookup_conv = *(LDKCOption_UtxoLookupZ*)(utxo_lookup_ptr);
+ // WARNING: we may need a move here but no clone is available for LDKCOption_UtxoLookupZ
+ if (utxo_lookup_conv.tag == LDKCOption_UtxoLookupZ_Some) {
// Manually implement clone for Java trait instances
- if (chain_access_conv.some.free == LDKAccess_JCalls_free) {
+ if (utxo_lookup_conv.some.free == LDKUtxoLookup_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
- LDKAccess_JCalls_cloned(&chain_access_conv.some);
+ LDKUtxoLookup_JCalls_cloned(&utxo_lookup_conv.some);
}
}
LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
- *ret_conv = NetworkGraph_update_channel_from_announcement(&this_arg_conv, &msg_conv, chain_access_conv);
+ *ret_conv = NetworkGraph_update_channel_from_announcement(&this_arg_conv, &msg_conv, utxo_lookup_conv);
return tag_ptr(ret_conv, true);
}
-uint64_t __attribute__((export_name("TS_NetworkGraph_update_channel_from_unsigned_announcement"))) TS_NetworkGraph_update_channel_from_unsigned_announcement(uint64_t this_arg, uint64_t msg, uint64_t chain_access) {
+uint64_t __attribute__((export_name("TS_NetworkGraph_update_channel_from_unsigned_announcement"))) TS_NetworkGraph_update_channel_from_unsigned_announcement(uint64_t this_arg, uint64_t msg, uint64_t utxo_lookup) {
LDKNetworkGraph this_arg_conv;
this_arg_conv.inner = untag_ptr(this_arg);
this_arg_conv.is_owned = ptr_is_owned(this_arg);
msg_conv.is_owned = ptr_is_owned(msg);
CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
msg_conv.is_owned = false;
- void* chain_access_ptr = untag_ptr(chain_access);
- CHECK_ACCESS(chain_access_ptr);
- LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(chain_access_ptr);
- // WARNING: we may need a move here but no clone is available for LDKCOption_AccessZ
- if (chain_access_conv.tag == LDKCOption_AccessZ_Some) {
+ void* utxo_lookup_ptr = untag_ptr(utxo_lookup);
+ CHECK_ACCESS(utxo_lookup_ptr);
+ LDKCOption_UtxoLookupZ utxo_lookup_conv = *(LDKCOption_UtxoLookupZ*)(utxo_lookup_ptr);
+ // WARNING: we may need a move here but no clone is available for LDKCOption_UtxoLookupZ
+ if (utxo_lookup_conv.tag == LDKCOption_UtxoLookupZ_Some) {
// Manually implement clone for Java trait instances
- if (chain_access_conv.some.free == LDKAccess_JCalls_free) {
+ if (utxo_lookup_conv.some.free == LDKUtxoLookup_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
- LDKAccess_JCalls_cloned(&chain_access_conv.some);
+ LDKUtxoLookup_JCalls_cloned(&utxo_lookup_conv.some);
}
}
LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
- *ret_conv = NetworkGraph_update_channel_from_unsigned_announcement(&this_arg_conv, &msg_conv, chain_access_conv);
+ *ret_conv = NetworkGraph_update_channel_from_unsigned_announcement(&this_arg_conv, &msg_conv, utxo_lookup_conv);
return tag_ptr(ret_conv, true);
}
NetworkGraph_channel_failed(&this_arg_conv, short_channel_id, is_permanent);
}
-void __attribute__((export_name("TS_NetworkGraph_node_failed"))) TS_NetworkGraph_node_failed(uint64_t this_arg, int8_tArray _node_id, jboolean is_permanent) {
+void __attribute__((export_name("TS_NetworkGraph_node_failed_permanent"))) TS_NetworkGraph_node_failed_permanent(uint64_t this_arg, int8_tArray node_id) {
LDKNetworkGraph this_arg_conv;
this_arg_conv.inner = untag_ptr(this_arg);
this_arg_conv.is_owned = ptr_is_owned(this_arg);
CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
this_arg_conv.is_owned = false;
- LDKPublicKey _node_id_ref;
- CHECK(_node_id->arr_len == 33);
- memcpy(_node_id_ref.compressed_form, _node_id->elems, 33); FREE(_node_id);
- NetworkGraph_node_failed(&this_arg_conv, _node_id_ref, is_permanent);
+ LDKPublicKey node_id_ref;
+ CHECK(node_id->arr_len == 33);
+ memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
+ NetworkGraph_node_failed_permanent(&this_arg_conv, node_id_ref);
}
-void __attribute__((export_name("TS_NetworkGraph_remove_stale_channels_with_time"))) TS_NetworkGraph_remove_stale_channels_with_time(uint64_t this_arg, int64_t current_time_unix) {
+void __attribute__((export_name("TS_NetworkGraph_remove_stale_channels_and_tracking_with_time"))) TS_NetworkGraph_remove_stale_channels_and_tracking_with_time(uint64_t this_arg, int64_t current_time_unix) {
LDKNetworkGraph this_arg_conv;
this_arg_conv.inner = untag_ptr(this_arg);
this_arg_conv.is_owned = ptr_is_owned(this_arg);
CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
this_arg_conv.is_owned = false;
- NetworkGraph_remove_stale_channels_with_time(&this_arg_conv, current_time_unix);
+ NetworkGraph_remove_stale_channels_and_tracking_with_time(&this_arg_conv, current_time_unix);
}
uint64_t __attribute__((export_name("TS_NetworkGraph_update_channel"))) TS_NetworkGraph_update_channel(uint64_t this_arg, uint64_t msg) {
return ret_ref;
}
+void __attribute__((export_name("TS_DefaultRouter_free"))) TS_DefaultRouter_free(uint64_t this_obj) {
+ LDKDefaultRouter this_obj_conv;
+ this_obj_conv.inner = untag_ptr(this_obj);
+ this_obj_conv.is_owned = ptr_is_owned(this_obj);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
+ DefaultRouter_free(this_obj_conv);
+}
+
+uint64_t __attribute__((export_name("TS_DefaultRouter_new"))) TS_DefaultRouter_new(uint64_t network_graph, uint64_t logger, int8_tArray random_seed_bytes, uint64_t scorer) {
+ LDKNetworkGraph network_graph_conv;
+ network_graph_conv.inner = untag_ptr(network_graph);
+ network_graph_conv.is_owned = ptr_is_owned(network_graph);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv);
+ network_graph_conv.is_owned = false;
+ void* logger_ptr = untag_ptr(logger);
+ CHECK_ACCESS(logger_ptr);
+ LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
+ if (logger_conv.free == LDKLogger_JCalls_free) {
+ // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
+ LDKLogger_JCalls_cloned(&logger_conv);
+ }
+ LDKThirtyTwoBytes random_seed_bytes_ref;
+ CHECK(random_seed_bytes->arr_len == 32);
+ memcpy(random_seed_bytes_ref.data, random_seed_bytes->elems, 32); FREE(random_seed_bytes);
+ void* scorer_ptr = untag_ptr(scorer);
+ CHECK_ACCESS(scorer_ptr);
+ LDKLockableScore scorer_conv = *(LDKLockableScore*)(scorer_ptr);
+ if (scorer_conv.free == LDKLockableScore_JCalls_free) {
+ // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
+ LDKLockableScore_JCalls_cloned(&scorer_conv);
+ }
+ LDKDefaultRouter ret_var = DefaultRouter_new(&network_graph_conv, logger_conv, random_seed_bytes_ref, scorer_conv);
+ uint64_t ret_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ return ret_ref;
+}
+
+uint64_t __attribute__((export_name("TS_DefaultRouter_as_Router"))) TS_DefaultRouter_as_Router(uint64_t this_arg) {
+ LDKDefaultRouter this_arg_conv;
+ this_arg_conv.inner = untag_ptr(this_arg);
+ this_arg_conv.is_owned = ptr_is_owned(this_arg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ this_arg_conv.is_owned = false;
+ LDKRouter* ret_ret = MALLOC(sizeof(LDKRouter), "LDKRouter");
+ *ret_ret = DefaultRouter_as_Router(&this_arg_conv);
+ return tag_ptr(ret_ret, true);
+}
+
+void __attribute__((export_name("TS_Router_free"))) TS_Router_free(uint64_t this_ptr) {
+ if (!ptr_is_owned(this_ptr)) return;
+ void* this_ptr_ptr = untag_ptr(this_ptr);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKRouter this_ptr_conv = *(LDKRouter*)(this_ptr_ptr);
+ FREE(untag_ptr(this_ptr));
+ Router_free(this_ptr_conv);
+}
+
+void __attribute__((export_name("TS_ScorerAccountingForInFlightHtlcs_free"))) TS_ScorerAccountingForInFlightHtlcs_free(uint64_t this_obj) {
+ LDKScorerAccountingForInFlightHtlcs this_obj_conv;
+ this_obj_conv.inner = untag_ptr(this_obj);
+ this_obj_conv.is_owned = ptr_is_owned(this_obj);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
+ ScorerAccountingForInFlightHtlcs_free(this_obj_conv);
+}
+
+uint64_t __attribute__((export_name("TS_ScorerAccountingForInFlightHtlcs_new"))) TS_ScorerAccountingForInFlightHtlcs_new(uint64_t scorer, uint64_t inflight_htlcs) {
+ void* scorer_ptr = untag_ptr(scorer);
+ CHECK_ACCESS(scorer_ptr);
+ LDKScore scorer_conv = *(LDKScore*)(scorer_ptr);
+ if (scorer_conv.free == LDKScore_JCalls_free) {
+ // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
+ LDKScore_JCalls_cloned(&scorer_conv);
+ }
+ LDKInFlightHtlcs inflight_htlcs_conv;
+ inflight_htlcs_conv.inner = untag_ptr(inflight_htlcs);
+ inflight_htlcs_conv.is_owned = ptr_is_owned(inflight_htlcs);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(inflight_htlcs_conv);
+ inflight_htlcs_conv.is_owned = false;
+ LDKScorerAccountingForInFlightHtlcs ret_var = ScorerAccountingForInFlightHtlcs_new(scorer_conv, &inflight_htlcs_conv);
+ uint64_t ret_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ return ret_ref;
+}
+
+int8_tArray __attribute__((export_name("TS_ScorerAccountingForInFlightHtlcs_write"))) TS_ScorerAccountingForInFlightHtlcs_write(uint64_t obj) {
+ LDKScorerAccountingForInFlightHtlcs obj_conv;
+ obj_conv.inner = untag_ptr(obj);
+ obj_conv.is_owned = ptr_is_owned(obj);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z ret_var = ScorerAccountingForInFlightHtlcs_write(&obj_conv);
+ int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
+ memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
+}
+
+uint64_t __attribute__((export_name("TS_ScorerAccountingForInFlightHtlcs_as_Score"))) TS_ScorerAccountingForInFlightHtlcs_as_Score(uint64_t this_arg) {
+ LDKScorerAccountingForInFlightHtlcs this_arg_conv;
+ this_arg_conv.inner = untag_ptr(this_arg);
+ this_arg_conv.is_owned = ptr_is_owned(this_arg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ this_arg_conv.is_owned = false;
+ LDKScore* ret_ret = MALLOC(sizeof(LDKScore), "LDKScore");
+ *ret_ret = ScorerAccountingForInFlightHtlcs_as_Score(&this_arg_conv);
+ return tag_ptr(ret_ret, true);
+}
+
+void __attribute__((export_name("TS_InFlightHtlcs_free"))) TS_InFlightHtlcs_free(uint64_t this_obj) {
+ LDKInFlightHtlcs this_obj_conv;
+ this_obj_conv.inner = untag_ptr(this_obj);
+ this_obj_conv.is_owned = ptr_is_owned(this_obj);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
+ InFlightHtlcs_free(this_obj_conv);
+}
+
+static inline uint64_t InFlightHtlcs_clone_ptr(LDKInFlightHtlcs *NONNULL_PTR arg) {
+ LDKInFlightHtlcs ret_var = InFlightHtlcs_clone(arg);
+ uint64_t ret_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ return ret_ref;
+}
+int64_t __attribute__((export_name("TS_InFlightHtlcs_clone_ptr"))) TS_InFlightHtlcs_clone_ptr(uint64_t arg) {
+ LDKInFlightHtlcs arg_conv;
+ arg_conv.inner = untag_ptr(arg);
+ arg_conv.is_owned = ptr_is_owned(arg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+ arg_conv.is_owned = false;
+ int64_t ret_conv = InFlightHtlcs_clone_ptr(&arg_conv);
+ return ret_conv;
+}
+
+uint64_t __attribute__((export_name("TS_InFlightHtlcs_clone"))) TS_InFlightHtlcs_clone(uint64_t orig) {
+ LDKInFlightHtlcs orig_conv;
+ orig_conv.inner = untag_ptr(orig);
+ orig_conv.is_owned = ptr_is_owned(orig);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
+ orig_conv.is_owned = false;
+ LDKInFlightHtlcs ret_var = InFlightHtlcs_clone(&orig_conv);
+ uint64_t ret_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ return ret_ref;
+}
+
+uint64_t __attribute__((export_name("TS_InFlightHtlcs_new"))) TS_InFlightHtlcs_new() {
+ LDKInFlightHtlcs ret_var = InFlightHtlcs_new();
+ uint64_t ret_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ return ret_ref;
+}
+
+uint64_t __attribute__((export_name("TS_InFlightHtlcs_used_liquidity_msat"))) TS_InFlightHtlcs_used_liquidity_msat(uint64_t this_arg, uint64_t source, uint64_t target, int64_t channel_scid) {
+ LDKInFlightHtlcs this_arg_conv;
+ this_arg_conv.inner = untag_ptr(this_arg);
+ this_arg_conv.is_owned = ptr_is_owned(this_arg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ this_arg_conv.is_owned = false;
+ LDKNodeId source_conv;
+ source_conv.inner = untag_ptr(source);
+ source_conv.is_owned = ptr_is_owned(source);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(source_conv);
+ source_conv.is_owned = false;
+ LDKNodeId target_conv;
+ target_conv.inner = untag_ptr(target);
+ target_conv.is_owned = ptr_is_owned(target);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv);
+ target_conv.is_owned = false;
+ LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
+ *ret_copy = InFlightHtlcs_used_liquidity_msat(&this_arg_conv, &source_conv, &target_conv, channel_scid);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+int8_tArray __attribute__((export_name("TS_InFlightHtlcs_write"))) TS_InFlightHtlcs_write(uint64_t obj) {
+ LDKInFlightHtlcs obj_conv;
+ obj_conv.inner = untag_ptr(obj);
+ obj_conv.is_owned = ptr_is_owned(obj);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z ret_var = InFlightHtlcs_write(&obj_conv);
+ int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
+ memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
+}
+
+uint64_t __attribute__((export_name("TS_InFlightHtlcs_read"))) TS_InFlightHtlcs_read(int8_tArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.datalen = ser->arr_len;
+ ser_ref.data = ser->elems;
+ LDKCResult_InFlightHtlcsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InFlightHtlcsDecodeErrorZ), "LDKCResult_InFlightHtlcsDecodeErrorZ");
+ *ret_conv = InFlightHtlcs_read(ser_ref);
+ FREE(ser);
+ return tag_ptr(ret_conv, true);
+}
+
void __attribute__((export_name("TS_RouteHop_free"))) TS_RouteHop_free(uint64_t this_obj) {
LDKRouteHop this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
RouteParameters_set_final_value_msat(&this_ptr_conv, val);
}
-int32_t __attribute__((export_name("TS_RouteParameters_get_final_cltv_expiry_delta"))) TS_RouteParameters_get_final_cltv_expiry_delta(uint64_t this_ptr) {
- LDKRouteParameters this_ptr_conv;
- this_ptr_conv.inner = untag_ptr(this_ptr);
- this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
- this_ptr_conv.is_owned = false;
- int32_t ret_conv = RouteParameters_get_final_cltv_expiry_delta(&this_ptr_conv);
- return ret_conv;
-}
-
-void __attribute__((export_name("TS_RouteParameters_set_final_cltv_expiry_delta"))) TS_RouteParameters_set_final_cltv_expiry_delta(uint64_t this_ptr, int32_t val) {
- LDKRouteParameters this_ptr_conv;
- this_ptr_conv.inner = untag_ptr(this_ptr);
- this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
- this_ptr_conv.is_owned = false;
- RouteParameters_set_final_cltv_expiry_delta(&this_ptr_conv, val);
-}
-
-uint64_t __attribute__((export_name("TS_RouteParameters_new"))) TS_RouteParameters_new(uint64_t payment_params_arg, int64_t final_value_msat_arg, int32_t final_cltv_expiry_delta_arg) {
+uint64_t __attribute__((export_name("TS_RouteParameters_new"))) TS_RouteParameters_new(uint64_t payment_params_arg, int64_t final_value_msat_arg) {
LDKPaymentParameters payment_params_arg_conv;
payment_params_arg_conv.inner = untag_ptr(payment_params_arg);
payment_params_arg_conv.is_owned = ptr_is_owned(payment_params_arg);
CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_params_arg_conv);
payment_params_arg_conv = PaymentParameters_clone(&payment_params_arg_conv);
- LDKRouteParameters ret_var = RouteParameters_new(payment_params_arg_conv, final_value_msat_arg, final_cltv_expiry_delta_arg);
+ LDKRouteParameters ret_var = RouteParameters_new(payment_params_arg_conv, final_value_msat_arg);
uint64_t ret_ref = 0;
CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
return ret_ref;
}
+jboolean __attribute__((export_name("TS_RouteParameters_eq"))) TS_RouteParameters_eq(uint64_t a, uint64_t b) {
+ LDKRouteParameters a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKRouteParameters b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = RouteParameters_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
int8_tArray __attribute__((export_name("TS_RouteParameters_write"))) TS_RouteParameters_write(uint64_t obj) {
LDKRouteParameters obj_conv;
obj_conv.inner = untag_ptr(obj);
PaymentParameters_set_previously_failed_channels(&this_ptr_conv, val_constr);
}
-uint64_t __attribute__((export_name("TS_PaymentParameters_new"))) TS_PaymentParameters_new(int8_tArray payee_pubkey_arg, uint64_t features_arg, uint64_tArray route_hints_arg, uint64_t expiry_time_arg, int32_t max_total_cltv_expiry_delta_arg, int8_t max_path_count_arg, int8_t max_channel_saturation_power_of_half_arg, int64_tArray previously_failed_channels_arg) {
+int32_t __attribute__((export_name("TS_PaymentParameters_get_final_cltv_expiry_delta"))) TS_PaymentParameters_get_final_cltv_expiry_delta(uint64_t this_ptr) {
+ LDKPaymentParameters this_ptr_conv;
+ this_ptr_conv.inner = untag_ptr(this_ptr);
+ this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ this_ptr_conv.is_owned = false;
+ int32_t ret_conv = PaymentParameters_get_final_cltv_expiry_delta(&this_ptr_conv);
+ return ret_conv;
+}
+
+void __attribute__((export_name("TS_PaymentParameters_set_final_cltv_expiry_delta"))) TS_PaymentParameters_set_final_cltv_expiry_delta(uint64_t this_ptr, int32_t val) {
+ LDKPaymentParameters this_ptr_conv;
+ this_ptr_conv.inner = untag_ptr(this_ptr);
+ this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ this_ptr_conv.is_owned = false;
+ PaymentParameters_set_final_cltv_expiry_delta(&this_ptr_conv, val);
+}
+
+uint64_t __attribute__((export_name("TS_PaymentParameters_new"))) TS_PaymentParameters_new(int8_tArray payee_pubkey_arg, uint64_t features_arg, uint64_tArray route_hints_arg, uint64_t expiry_time_arg, int32_t max_total_cltv_expiry_delta_arg, int8_t max_path_count_arg, int8_t max_channel_saturation_power_of_half_arg, int64_tArray previously_failed_channels_arg, int32_t final_cltv_expiry_delta_arg) {
LDKPublicKey payee_pubkey_arg_ref;
CHECK(payee_pubkey_arg->arr_len == 33);
memcpy(payee_pubkey_arg_ref.compressed_form, payee_pubkey_arg->elems, 33); FREE(payee_pubkey_arg);
previously_failed_channels_arg_constr.data[i] = previously_failed_channels_arg_conv_8;
}
FREE(previously_failed_channels_arg);
- LDKPaymentParameters ret_var = PaymentParameters_new(payee_pubkey_arg_ref, features_arg_conv, route_hints_arg_constr, expiry_time_arg_conv, max_total_cltv_expiry_delta_arg, max_path_count_arg, max_channel_saturation_power_of_half_arg, previously_failed_channels_arg_constr);
+ LDKPaymentParameters ret_var = PaymentParameters_new(payee_pubkey_arg_ref, features_arg_conv, route_hints_arg_constr, expiry_time_arg_conv, max_total_cltv_expiry_delta_arg, max_path_count_arg, max_channel_saturation_power_of_half_arg, previously_failed_channels_arg_constr, final_cltv_expiry_delta_arg);
uint64_t ret_ref = 0;
CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
return ret_arr;
}
-uint64_t __attribute__((export_name("TS_PaymentParameters_read"))) TS_PaymentParameters_read(int8_tArray ser) {
+uint64_t __attribute__((export_name("TS_PaymentParameters_read"))) TS_PaymentParameters_read(int8_tArray ser, int32_t arg) {
LDKu8slice ser_ref;
ser_ref.datalen = ser->arr_len;
ser_ref.data = ser->elems;
LDKCResult_PaymentParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentParametersDecodeErrorZ), "LDKCResult_PaymentParametersDecodeErrorZ");
- *ret_conv = PaymentParameters_read(ser_ref);
+ *ret_conv = PaymentParameters_read(ser_ref, arg);
FREE(ser);
return tag_ptr(ret_conv, true);
}
-uint64_t __attribute__((export_name("TS_PaymentParameters_from_node_id"))) TS_PaymentParameters_from_node_id(int8_tArray payee_pubkey) {
+uint64_t __attribute__((export_name("TS_PaymentParameters_from_node_id"))) TS_PaymentParameters_from_node_id(int8_tArray payee_pubkey, int32_t final_cltv_expiry_delta) {
LDKPublicKey payee_pubkey_ref;
CHECK(payee_pubkey->arr_len == 33);
memcpy(payee_pubkey_ref.compressed_form, payee_pubkey->elems, 33); FREE(payee_pubkey);
- LDKPaymentParameters ret_var = PaymentParameters_from_node_id(payee_pubkey_ref);
+ LDKPaymentParameters ret_var = PaymentParameters_from_node_id(payee_pubkey_ref, final_cltv_expiry_delta);
uint64_t ret_ref = 0;
CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
return ret_ref;
}
-uint64_t __attribute__((export_name("TS_PaymentParameters_for_keysend"))) TS_PaymentParameters_for_keysend(int8_tArray payee_pubkey) {
+uint64_t __attribute__((export_name("TS_PaymentParameters_for_keysend"))) TS_PaymentParameters_for_keysend(int8_tArray payee_pubkey, int32_t final_cltv_expiry_delta) {
LDKPublicKey payee_pubkey_ref;
CHECK(payee_pubkey->arr_len == 33);
memcpy(payee_pubkey_ref.compressed_form, payee_pubkey->elems, 33); FREE(payee_pubkey);
- LDKPaymentParameters ret_var = PaymentParameters_for_keysend(payee_pubkey_ref);
+ LDKPaymentParameters ret_var = PaymentParameters_for_keysend(payee_pubkey_ref, final_cltv_expiry_delta);
uint64_t ret_ref = 0;
CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
void* scorer_ptr = untag_ptr(scorer);
if (ptr_is_owned(scorer)) { CHECK_ACCESS(scorer_ptr); }
LDKScore* scorer_conv = (LDKScore*)scorer_ptr;
- unsigned char random_seed_bytes_arr[32];
+ uint8_t random_seed_bytes_arr[32];
CHECK(random_seed_bytes->arr_len == 32);
memcpy(random_seed_bytes_arr, random_seed_bytes->elems, 32); FREE(random_seed_bytes);
- unsigned char (*random_seed_bytes_ref)[32] = &random_seed_bytes_arr;
+ uint8_t (*random_seed_bytes_ref)[32] = &random_seed_bytes_arr;
LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
*ret_conv = find_route(our_node_pubkey_ref, &route_params_conv, &network_graph_conv, first_hops_ptr, logger_conv, scorer_conv, random_seed_bytes_ref);
if (first_hops_ptr != NULL) { FREE(first_hops_constr.data); }
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKLogger_JCalls_cloned(&logger_conv);
}
- unsigned char random_seed_bytes_arr[32];
+ uint8_t random_seed_bytes_arr[32];
CHECK(random_seed_bytes->arr_len == 32);
memcpy(random_seed_bytes_arr, random_seed_bytes->elems, 32); FREE(random_seed_bytes);
- unsigned char (*random_seed_bytes_ref)[32] = &random_seed_bytes_arr;
+ uint8_t (*random_seed_bytes_ref)[32] = &random_seed_bytes_arr;
LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
*ret_conv = build_route_from_hops(our_node_pubkey_ref, hops_constr, &route_params_conv, &network_graph_conv, logger_conv, random_seed_bytes_ref);
return tag_ptr(ret_conv, true);
LockableScore_free(this_ptr_conv);
}
+void __attribute__((export_name("TS_WriteableScore_free"))) TS_WriteableScore_free(uint64_t this_ptr) {
+ if (!ptr_is_owned(this_ptr)) return;
+ void* this_ptr_ptr = untag_ptr(this_ptr);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKWriteableScore this_ptr_conv = *(LDKWriteableScore*)(this_ptr_ptr);
+ FREE(untag_ptr(this_ptr));
+ WriteableScore_free(this_ptr_conv);
+}
+
void __attribute__((export_name("TS_MultiThreadedLockableScore_free"))) TS_MultiThreadedLockableScore_free(uint64_t this_obj) {
LDKMultiThreadedLockableScore this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
MultiThreadedLockableScore_free(this_obj_conv);
}
+void __attribute__((export_name("TS_MultiThreadedScoreLock_free"))) TS_MultiThreadedScoreLock_free(uint64_t this_obj) {
+ LDKMultiThreadedScoreLock this_obj_conv;
+ this_obj_conv.inner = untag_ptr(this_obj);
+ this_obj_conv.is_owned = ptr_is_owned(this_obj);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
+ MultiThreadedScoreLock_free(this_obj_conv);
+}
+
+uint64_t __attribute__((export_name("TS_MultiThreadedScoreLock_as_Score"))) TS_MultiThreadedScoreLock_as_Score(uint64_t this_arg) {
+ LDKMultiThreadedScoreLock this_arg_conv;
+ this_arg_conv.inner = untag_ptr(this_arg);
+ this_arg_conv.is_owned = ptr_is_owned(this_arg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ this_arg_conv.is_owned = false;
+ LDKScore* ret_ret = MALLOC(sizeof(LDKScore), "LDKScore");
+ *ret_ret = MultiThreadedScoreLock_as_Score(&this_arg_conv);
+ return tag_ptr(ret_ret, true);
+}
+
+int8_tArray __attribute__((export_name("TS_MultiThreadedScoreLock_write"))) TS_MultiThreadedScoreLock_write(uint64_t obj) {
+ LDKMultiThreadedScoreLock obj_conv;
+ obj_conv.inner = untag_ptr(obj);
+ obj_conv.is_owned = ptr_is_owned(obj);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z ret_var = MultiThreadedScoreLock_write(&obj_conv);
+ int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
+ memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
+}
+
+uint64_t __attribute__((export_name("TS_MultiThreadedLockableScore_as_LockableScore"))) TS_MultiThreadedLockableScore_as_LockableScore(uint64_t this_arg) {
+ LDKMultiThreadedLockableScore this_arg_conv;
+ this_arg_conv.inner = untag_ptr(this_arg);
+ this_arg_conv.is_owned = ptr_is_owned(this_arg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ this_arg_conv.is_owned = false;
+ LDKLockableScore* ret_ret = MALLOC(sizeof(LDKLockableScore), "LDKLockableScore");
+ *ret_ret = MultiThreadedLockableScore_as_LockableScore(&this_arg_conv);
+ return tag_ptr(ret_ret, true);
+}
+
int8_tArray __attribute__((export_name("TS_MultiThreadedLockableScore_write"))) TS_MultiThreadedLockableScore_write(uint64_t obj) {
LDKMultiThreadedLockableScore obj_conv;
obj_conv.inner = untag_ptr(obj);
return ret_arr;
}
+uint64_t __attribute__((export_name("TS_MultiThreadedLockableScore_as_WriteableScore"))) TS_MultiThreadedLockableScore_as_WriteableScore(uint64_t this_arg) {
+ LDKMultiThreadedLockableScore this_arg_conv;
+ this_arg_conv.inner = untag_ptr(this_arg);
+ this_arg_conv.is_owned = ptr_is_owned(this_arg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ this_arg_conv.is_owned = false;
+ LDKWriteableScore* ret_ret = MALLOC(sizeof(LDKWriteableScore), "LDKWriteableScore");
+ *ret_ret = MultiThreadedLockableScore_as_WriteableScore(&this_arg_conv);
+ return tag_ptr(ret_ret, true);
+}
+
uint64_t __attribute__((export_name("TS_MultiThreadedLockableScore_new"))) TS_MultiThreadedLockableScore_new(uint64_t score) {
void* score_ptr = untag_ptr(score);
CHECK_ACCESS(score_ptr);
ProbabilisticScoringParameters_set_liquidity_penalty_amount_multiplier_msat(&this_ptr_conv, val);
}
+int64_t __attribute__((export_name("TS_ProbabilisticScoringParameters_get_historical_liquidity_penalty_multiplier_msat"))) TS_ProbabilisticScoringParameters_get_historical_liquidity_penalty_multiplier_msat(uint64_t this_ptr) {
+ LDKProbabilisticScoringParameters this_ptr_conv;
+ this_ptr_conv.inner = untag_ptr(this_ptr);
+ this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ this_ptr_conv.is_owned = false;
+ int64_t ret_conv = ProbabilisticScoringParameters_get_historical_liquidity_penalty_multiplier_msat(&this_ptr_conv);
+ return ret_conv;
+}
+
+void __attribute__((export_name("TS_ProbabilisticScoringParameters_set_historical_liquidity_penalty_multiplier_msat"))) TS_ProbabilisticScoringParameters_set_historical_liquidity_penalty_multiplier_msat(uint64_t this_ptr, int64_t val) {
+ LDKProbabilisticScoringParameters this_ptr_conv;
+ this_ptr_conv.inner = untag_ptr(this_ptr);
+ this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ this_ptr_conv.is_owned = false;
+ ProbabilisticScoringParameters_set_historical_liquidity_penalty_multiplier_msat(&this_ptr_conv, val);
+}
+
+int64_t __attribute__((export_name("TS_ProbabilisticScoringParameters_get_historical_liquidity_penalty_amount_multiplier_msat"))) TS_ProbabilisticScoringParameters_get_historical_liquidity_penalty_amount_multiplier_msat(uint64_t this_ptr) {
+ LDKProbabilisticScoringParameters this_ptr_conv;
+ this_ptr_conv.inner = untag_ptr(this_ptr);
+ this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ this_ptr_conv.is_owned = false;
+ int64_t ret_conv = ProbabilisticScoringParameters_get_historical_liquidity_penalty_amount_multiplier_msat(&this_ptr_conv);
+ return ret_conv;
+}
+
+void __attribute__((export_name("TS_ProbabilisticScoringParameters_set_historical_liquidity_penalty_amount_multiplier_msat"))) TS_ProbabilisticScoringParameters_set_historical_liquidity_penalty_amount_multiplier_msat(uint64_t this_ptr, int64_t val) {
+ LDKProbabilisticScoringParameters this_ptr_conv;
+ this_ptr_conv.inner = untag_ptr(this_ptr);
+ this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ this_ptr_conv.is_owned = false;
+ ProbabilisticScoringParameters_set_historical_liquidity_penalty_amount_multiplier_msat(&this_ptr_conv, val);
+}
+
+int64_t __attribute__((export_name("TS_ProbabilisticScoringParameters_get_historical_no_updates_half_life"))) TS_ProbabilisticScoringParameters_get_historical_no_updates_half_life(uint64_t this_ptr) {
+ LDKProbabilisticScoringParameters this_ptr_conv;
+ this_ptr_conv.inner = untag_ptr(this_ptr);
+ this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ this_ptr_conv.is_owned = false;
+ int64_t ret_conv = ProbabilisticScoringParameters_get_historical_no_updates_half_life(&this_ptr_conv);
+ return ret_conv;
+}
+
+void __attribute__((export_name("TS_ProbabilisticScoringParameters_set_historical_no_updates_half_life"))) TS_ProbabilisticScoringParameters_set_historical_no_updates_half_life(uint64_t this_ptr, int64_t val) {
+ LDKProbabilisticScoringParameters this_ptr_conv;
+ this_ptr_conv.inner = untag_ptr(this_ptr);
+ this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ this_ptr_conv.is_owned = false;
+ ProbabilisticScoringParameters_set_historical_no_updates_half_life(&this_ptr_conv, val);
+}
+
int64_t __attribute__((export_name("TS_ProbabilisticScoringParameters_get_anti_probing_penalty_msat"))) TS_ProbabilisticScoringParameters_get_anti_probing_penalty_msat(uint64_t this_ptr) {
LDKProbabilisticScoringParameters this_ptr_conv;
this_ptr_conv.inner = untag_ptr(this_ptr);
return ret_ref;
}
+uint64_t __attribute__((export_name("TS_ProbabilisticScorer_historical_estimated_channel_liquidity_probabilities"))) TS_ProbabilisticScorer_historical_estimated_channel_liquidity_probabilities(uint64_t this_arg, int64_t scid, uint64_t target) {
+ LDKProbabilisticScorer this_arg_conv;
+ this_arg_conv.inner = untag_ptr(this_arg);
+ this_arg_conv.is_owned = ptr_is_owned(this_arg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ this_arg_conv.is_owned = false;
+ LDKNodeId target_conv;
+ target_conv.inner = untag_ptr(target);
+ target_conv.is_owned = ptr_is_owned(target);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv);
+ target_conv.is_owned = false;
+ LDKCOption_C2Tuple_EightU16sEightU16sZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_EightU16sEightU16sZZ), "LDKCOption_C2Tuple_EightU16sEightU16sZZ");
+ *ret_copy = ProbabilisticScorer_historical_estimated_channel_liquidity_probabilities(&this_arg_conv, scid, &target_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
void __attribute__((export_name("TS_ProbabilisticScorer_add_banned"))) TS_ProbabilisticScorer_add_banned(uint64_t this_arg, uint64_t node_id) {
LDKProbabilisticScorer this_arg_conv;
this_arg_conv.inner = untag_ptr(this_arg);
return tag_ptr(ret_conv, true);
}
+void __attribute__((export_name("TS_BlindedPath_free"))) TS_BlindedPath_free(uint64_t this_obj) {
+ LDKBlindedPath this_obj_conv;
+ this_obj_conv.inner = untag_ptr(this_obj);
+ this_obj_conv.is_owned = ptr_is_owned(this_obj);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
+ BlindedPath_free(this_obj_conv);
+}
+
+static inline uint64_t BlindedPath_clone_ptr(LDKBlindedPath *NONNULL_PTR arg) {
+ LDKBlindedPath ret_var = BlindedPath_clone(arg);
+ uint64_t ret_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ return ret_ref;
+}
+int64_t __attribute__((export_name("TS_BlindedPath_clone_ptr"))) TS_BlindedPath_clone_ptr(uint64_t arg) {
+ LDKBlindedPath arg_conv;
+ arg_conv.inner = untag_ptr(arg);
+ arg_conv.is_owned = ptr_is_owned(arg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+ arg_conv.is_owned = false;
+ int64_t ret_conv = BlindedPath_clone_ptr(&arg_conv);
+ return ret_conv;
+}
+
+uint64_t __attribute__((export_name("TS_BlindedPath_clone"))) TS_BlindedPath_clone(uint64_t orig) {
+ LDKBlindedPath orig_conv;
+ orig_conv.inner = untag_ptr(orig);
+ orig_conv.is_owned = ptr_is_owned(orig);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
+ orig_conv.is_owned = false;
+ LDKBlindedPath ret_var = BlindedPath_clone(&orig_conv);
+ uint64_t ret_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ return ret_ref;
+}
+
+void __attribute__((export_name("TS_BlindedHop_free"))) TS_BlindedHop_free(uint64_t this_obj) {
+ LDKBlindedHop this_obj_conv;
+ this_obj_conv.inner = untag_ptr(this_obj);
+ this_obj_conv.is_owned = ptr_is_owned(this_obj);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
+ BlindedHop_free(this_obj_conv);
+}
+
+static inline uint64_t BlindedHop_clone_ptr(LDKBlindedHop *NONNULL_PTR arg) {
+ LDKBlindedHop ret_var = BlindedHop_clone(arg);
+ uint64_t ret_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ return ret_ref;
+}
+int64_t __attribute__((export_name("TS_BlindedHop_clone_ptr"))) TS_BlindedHop_clone_ptr(uint64_t arg) {
+ LDKBlindedHop arg_conv;
+ arg_conv.inner = untag_ptr(arg);
+ arg_conv.is_owned = ptr_is_owned(arg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+ arg_conv.is_owned = false;
+ int64_t ret_conv = BlindedHop_clone_ptr(&arg_conv);
+ return ret_conv;
+}
+
+uint64_t __attribute__((export_name("TS_BlindedHop_clone"))) TS_BlindedHop_clone(uint64_t orig) {
+ LDKBlindedHop orig_conv;
+ orig_conv.inner = untag_ptr(orig);
+ orig_conv.is_owned = ptr_is_owned(orig);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
+ orig_conv.is_owned = false;
+ LDKBlindedHop ret_var = BlindedHop_clone(&orig_conv);
+ uint64_t ret_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ return ret_ref;
+}
+
+uint64_t __attribute__((export_name("TS_BlindedPath_new"))) TS_BlindedPath_new(ptrArray node_pks, uint64_t entropy_source) {
+ LDKCVec_PublicKeyZ node_pks_constr;
+ node_pks_constr.datalen = node_pks->arr_len;
+ if (node_pks_constr.datalen > 0)
+ node_pks_constr.data = MALLOC(node_pks_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements");
+ else
+ node_pks_constr.data = NULL;
+ int8_tArray* node_pks_vals = (void*) node_pks->elems;
+ for (size_t m = 0; m < node_pks_constr.datalen; m++) {
+ int8_tArray node_pks_conv_12 = node_pks_vals[m];
+ LDKPublicKey node_pks_conv_12_ref;
+ CHECK(node_pks_conv_12->arr_len == 33);
+ memcpy(node_pks_conv_12_ref.compressed_form, node_pks_conv_12->elems, 33); FREE(node_pks_conv_12);
+ node_pks_constr.data[m] = node_pks_conv_12_ref;
+ }
+ FREE(node_pks);
+ void* entropy_source_ptr = untag_ptr(entropy_source);
+ if (ptr_is_owned(entropy_source)) { CHECK_ACCESS(entropy_source_ptr); }
+ LDKEntropySource* entropy_source_conv = (LDKEntropySource*)entropy_source_ptr;
+ LDKCResult_BlindedPathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathNoneZ), "LDKCResult_BlindedPathNoneZ");
+ *ret_conv = BlindedPath_new(node_pks_constr, entropy_source_conv);
+ return tag_ptr(ret_conv, true);
+}
+
+int8_tArray __attribute__((export_name("TS_BlindedPath_write"))) TS_BlindedPath_write(uint64_t obj) {
+ LDKBlindedPath obj_conv;
+ obj_conv.inner = untag_ptr(obj);
+ obj_conv.is_owned = ptr_is_owned(obj);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z ret_var = BlindedPath_write(&obj_conv);
+ int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
+ memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
+}
+
+uint64_t __attribute__((export_name("TS_BlindedPath_read"))) TS_BlindedPath_read(int8_tArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.datalen = ser->arr_len;
+ ser_ref.data = ser->elems;
+ LDKCResult_BlindedPathDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathDecodeErrorZ), "LDKCResult_BlindedPathDecodeErrorZ");
+ *ret_conv = BlindedPath_read(ser_ref);
+ FREE(ser);
+ return tag_ptr(ret_conv, true);
+}
+
+int8_tArray __attribute__((export_name("TS_BlindedHop_write"))) TS_BlindedHop_write(uint64_t obj) {
+ LDKBlindedHop obj_conv;
+ obj_conv.inner = untag_ptr(obj);
+ obj_conv.is_owned = ptr_is_owned(obj);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z ret_var = BlindedHop_write(&obj_conv);
+ int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
+ memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
+}
+
+uint64_t __attribute__((export_name("TS_BlindedHop_read"))) TS_BlindedHop_read(int8_tArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.datalen = ser->arr_len;
+ ser_ref.data = ser->elems;
+ LDKCResult_BlindedHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopDecodeErrorZ), "LDKCResult_BlindedHopDecodeErrorZ");
+ *ret_conv = BlindedHop_read(ser_ref);
+ FREE(ser);
+ return tag_ptr(ret_conv, true);
+}
+
+void __attribute__((export_name("TS_OnionMessenger_free"))) TS_OnionMessenger_free(uint64_t this_obj) {
+ LDKOnionMessenger this_obj_conv;
+ this_obj_conv.inner = untag_ptr(this_obj);
+ this_obj_conv.is_owned = ptr_is_owned(this_obj);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
+ OnionMessenger_free(this_obj_conv);
+}
+
+void __attribute__((export_name("TS_Destination_free"))) TS_Destination_free(uint64_t this_ptr) {
+ if (!ptr_is_owned(this_ptr)) return;
+ void* this_ptr_ptr = untag_ptr(this_ptr);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKDestination this_ptr_conv = *(LDKDestination*)(this_ptr_ptr);
+ FREE(untag_ptr(this_ptr));
+ Destination_free(this_ptr_conv);
+}
+
+static inline uint64_t Destination_clone_ptr(LDKDestination *NONNULL_PTR arg) {
+ LDKDestination *ret_copy = MALLOC(sizeof(LDKDestination), "LDKDestination");
+ *ret_copy = Destination_clone(arg);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+int64_t __attribute__((export_name("TS_Destination_clone_ptr"))) TS_Destination_clone_ptr(uint64_t arg) {
+ LDKDestination* arg_conv = (LDKDestination*)untag_ptr(arg);
+ int64_t ret_conv = Destination_clone_ptr(arg_conv);
+ return ret_conv;
+}
+
+uint64_t __attribute__((export_name("TS_Destination_clone"))) TS_Destination_clone(uint64_t orig) {
+ LDKDestination* orig_conv = (LDKDestination*)untag_ptr(orig);
+ LDKDestination *ret_copy = MALLOC(sizeof(LDKDestination), "LDKDestination");
+ *ret_copy = Destination_clone(orig_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+uint64_t __attribute__((export_name("TS_Destination_node"))) TS_Destination_node(int8_tArray a) {
+ LDKPublicKey a_ref;
+ CHECK(a->arr_len == 33);
+ memcpy(a_ref.compressed_form, a->elems, 33); FREE(a);
+ LDKDestination *ret_copy = MALLOC(sizeof(LDKDestination), "LDKDestination");
+ *ret_copy = Destination_node(a_ref);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+uint64_t __attribute__((export_name("TS_Destination_blinded_path"))) TS_Destination_blinded_path(uint64_t a) {
+ LDKBlindedPath a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv = BlindedPath_clone(&a_conv);
+ LDKDestination *ret_copy = MALLOC(sizeof(LDKDestination), "LDKDestination");
+ *ret_copy = Destination_blinded_path(a_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+void __attribute__((export_name("TS_SendError_free"))) TS_SendError_free(uint64_t this_ptr) {
+ if (!ptr_is_owned(this_ptr)) return;
+ void* this_ptr_ptr = untag_ptr(this_ptr);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKSendError this_ptr_conv = *(LDKSendError*)(this_ptr_ptr);
+ FREE(untag_ptr(this_ptr));
+ SendError_free(this_ptr_conv);
+}
+
+static inline uint64_t SendError_clone_ptr(LDKSendError *NONNULL_PTR arg) {
+ LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError");
+ *ret_copy = SendError_clone(arg);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+int64_t __attribute__((export_name("TS_SendError_clone_ptr"))) TS_SendError_clone_ptr(uint64_t arg) {
+ LDKSendError* arg_conv = (LDKSendError*)untag_ptr(arg);
+ int64_t ret_conv = SendError_clone_ptr(arg_conv);
+ return ret_conv;
+}
+
+uint64_t __attribute__((export_name("TS_SendError_clone"))) TS_SendError_clone(uint64_t orig) {
+ LDKSendError* orig_conv = (LDKSendError*)untag_ptr(orig);
+ LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError");
+ *ret_copy = SendError_clone(orig_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+uint64_t __attribute__((export_name("TS_SendError_secp256k1"))) TS_SendError_secp256k1(uint32_t a) {
+ LDKSecp256k1Error a_conv = LDKSecp256k1Error_from_js(a);
+ LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError");
+ *ret_copy = SendError_secp256k1(a_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+uint64_t __attribute__((export_name("TS_SendError_too_big_packet"))) TS_SendError_too_big_packet() {
+ LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError");
+ *ret_copy = SendError_too_big_packet();
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+uint64_t __attribute__((export_name("TS_SendError_too_few_blinded_hops"))) TS_SendError_too_few_blinded_hops() {
+ LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError");
+ *ret_copy = SendError_too_few_blinded_hops();
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+uint64_t __attribute__((export_name("TS_SendError_invalid_first_hop"))) TS_SendError_invalid_first_hop() {
+ LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError");
+ *ret_copy = SendError_invalid_first_hop();
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+uint64_t __attribute__((export_name("TS_SendError_invalid_message"))) TS_SendError_invalid_message() {
+ LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError");
+ *ret_copy = SendError_invalid_message();
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+uint64_t __attribute__((export_name("TS_SendError_buffer_full"))) TS_SendError_buffer_full() {
+ LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError");
+ *ret_copy = SendError_buffer_full();
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+uint64_t __attribute__((export_name("TS_SendError_get_node_id_failed"))) TS_SendError_get_node_id_failed() {
+ LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError");
+ *ret_copy = SendError_get_node_id_failed();
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+uint64_t __attribute__((export_name("TS_SendError_blinded_path_advance_failed"))) TS_SendError_blinded_path_advance_failed() {
+ LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError");
+ *ret_copy = SendError_blinded_path_advance_failed();
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+jboolean __attribute__((export_name("TS_SendError_eq"))) TS_SendError_eq(uint64_t a, uint64_t b) {
+ LDKSendError* a_conv = (LDKSendError*)untag_ptr(a);
+ LDKSendError* b_conv = (LDKSendError*)untag_ptr(b);
+ jboolean ret_conv = SendError_eq(a_conv, b_conv);
+ return ret_conv;
+}
+
+void __attribute__((export_name("TS_CustomOnionMessageHandler_free"))) TS_CustomOnionMessageHandler_free(uint64_t this_ptr) {
+ if (!ptr_is_owned(this_ptr)) return;
+ void* this_ptr_ptr = untag_ptr(this_ptr);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKCustomOnionMessageHandler this_ptr_conv = *(LDKCustomOnionMessageHandler*)(this_ptr_ptr);
+ FREE(untag_ptr(this_ptr));
+ CustomOnionMessageHandler_free(this_ptr_conv);
+}
+
+uint64_t __attribute__((export_name("TS_OnionMessenger_new"))) TS_OnionMessenger_new(uint64_t entropy_source, uint64_t node_signer, uint64_t logger, uint64_t custom_handler) {
+ void* entropy_source_ptr = untag_ptr(entropy_source);
+ CHECK_ACCESS(entropy_source_ptr);
+ LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr);
+ if (entropy_source_conv.free == LDKEntropySource_JCalls_free) {
+ // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
+ LDKEntropySource_JCalls_cloned(&entropy_source_conv);
+ }
+ void* node_signer_ptr = untag_ptr(node_signer);
+ CHECK_ACCESS(node_signer_ptr);
+ LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr);
+ if (node_signer_conv.free == LDKNodeSigner_JCalls_free) {
+ // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
+ LDKNodeSigner_JCalls_cloned(&node_signer_conv);
+ }
+ void* logger_ptr = untag_ptr(logger);
+ CHECK_ACCESS(logger_ptr);
+ LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
+ if (logger_conv.free == LDKLogger_JCalls_free) {
+ // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
+ LDKLogger_JCalls_cloned(&logger_conv);
+ }
+ void* custom_handler_ptr = untag_ptr(custom_handler);
+ CHECK_ACCESS(custom_handler_ptr);
+ LDKCustomOnionMessageHandler custom_handler_conv = *(LDKCustomOnionMessageHandler*)(custom_handler_ptr);
+ if (custom_handler_conv.free == LDKCustomOnionMessageHandler_JCalls_free) {
+ // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
+ LDKCustomOnionMessageHandler_JCalls_cloned(&custom_handler_conv);
+ }
+ LDKOnionMessenger ret_var = OnionMessenger_new(entropy_source_conv, node_signer_conv, logger_conv, custom_handler_conv);
+ uint64_t ret_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ return ret_ref;
+}
+
+uint64_t __attribute__((export_name("TS_OnionMessenger_send_onion_message"))) TS_OnionMessenger_send_onion_message(uint64_t this_arg, ptrArray intermediate_nodes, uint64_t destination, uint64_t message, uint64_t reply_path) {
+ LDKOnionMessenger this_arg_conv;
+ this_arg_conv.inner = untag_ptr(this_arg);
+ this_arg_conv.is_owned = ptr_is_owned(this_arg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ this_arg_conv.is_owned = false;
+ LDKCVec_PublicKeyZ intermediate_nodes_constr;
+ intermediate_nodes_constr.datalen = intermediate_nodes->arr_len;
+ if (intermediate_nodes_constr.datalen > 0)
+ intermediate_nodes_constr.data = MALLOC(intermediate_nodes_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements");
+ else
+ intermediate_nodes_constr.data = NULL;
+ int8_tArray* intermediate_nodes_vals = (void*) intermediate_nodes->elems;
+ for (size_t m = 0; m < intermediate_nodes_constr.datalen; m++) {
+ int8_tArray intermediate_nodes_conv_12 = intermediate_nodes_vals[m];
+ LDKPublicKey intermediate_nodes_conv_12_ref;
+ CHECK(intermediate_nodes_conv_12->arr_len == 33);
+ memcpy(intermediate_nodes_conv_12_ref.compressed_form, intermediate_nodes_conv_12->elems, 33); FREE(intermediate_nodes_conv_12);
+ intermediate_nodes_constr.data[m] = intermediate_nodes_conv_12_ref;
+ }
+ FREE(intermediate_nodes);
+ void* destination_ptr = untag_ptr(destination);
+ CHECK_ACCESS(destination_ptr);
+ LDKDestination destination_conv = *(LDKDestination*)(destination_ptr);
+ destination_conv = Destination_clone((LDKDestination*)untag_ptr(destination));
+ void* message_ptr = untag_ptr(message);
+ CHECK_ACCESS(message_ptr);
+ LDKOnionMessageContents message_conv = *(LDKOnionMessageContents*)(message_ptr);
+ message_conv = OnionMessageContents_clone((LDKOnionMessageContents*)untag_ptr(message));
+ LDKBlindedPath reply_path_conv;
+ reply_path_conv.inner = untag_ptr(reply_path);
+ reply_path_conv.is_owned = ptr_is_owned(reply_path);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(reply_path_conv);
+ reply_path_conv = BlindedPath_clone(&reply_path_conv);
+ LDKCResult_NoneSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSendErrorZ), "LDKCResult_NoneSendErrorZ");
+ *ret_conv = OnionMessenger_send_onion_message(&this_arg_conv, intermediate_nodes_constr, destination_conv, message_conv, reply_path_conv);
+ return tag_ptr(ret_conv, true);
+}
+
+uint64_t __attribute__((export_name("TS_OnionMessenger_as_OnionMessageHandler"))) TS_OnionMessenger_as_OnionMessageHandler(uint64_t this_arg) {
+ LDKOnionMessenger this_arg_conv;
+ this_arg_conv.inner = untag_ptr(this_arg);
+ this_arg_conv.is_owned = ptr_is_owned(this_arg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ this_arg_conv.is_owned = false;
+ LDKOnionMessageHandler* ret_ret = MALLOC(sizeof(LDKOnionMessageHandler), "LDKOnionMessageHandler");
+ *ret_ret = OnionMessenger_as_OnionMessageHandler(&this_arg_conv);
+ return tag_ptr(ret_ret, true);
+}
+
+uint64_t __attribute__((export_name("TS_OnionMessenger_as_OnionMessageProvider"))) TS_OnionMessenger_as_OnionMessageProvider(uint64_t this_arg) {
+ LDKOnionMessenger this_arg_conv;
+ this_arg_conv.inner = untag_ptr(this_arg);
+ this_arg_conv.is_owned = ptr_is_owned(this_arg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ this_arg_conv.is_owned = false;
+ LDKOnionMessageProvider* ret_ret = MALLOC(sizeof(LDKOnionMessageProvider), "LDKOnionMessageProvider");
+ *ret_ret = OnionMessenger_as_OnionMessageProvider(&this_arg_conv);
+ return tag_ptr(ret_ret, true);
+}
+
+void __attribute__((export_name("TS_OnionMessageContents_free"))) TS_OnionMessageContents_free(uint64_t this_ptr) {
+ if (!ptr_is_owned(this_ptr)) return;
+ void* this_ptr_ptr = untag_ptr(this_ptr);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKOnionMessageContents this_ptr_conv = *(LDKOnionMessageContents*)(this_ptr_ptr);
+ FREE(untag_ptr(this_ptr));
+ OnionMessageContents_free(this_ptr_conv);
+}
+
+static inline uint64_t OnionMessageContents_clone_ptr(LDKOnionMessageContents *NONNULL_PTR arg) {
+ LDKOnionMessageContents *ret_copy = MALLOC(sizeof(LDKOnionMessageContents), "LDKOnionMessageContents");
+ *ret_copy = OnionMessageContents_clone(arg);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+int64_t __attribute__((export_name("TS_OnionMessageContents_clone_ptr"))) TS_OnionMessageContents_clone_ptr(uint64_t arg) {
+ LDKOnionMessageContents* arg_conv = (LDKOnionMessageContents*)untag_ptr(arg);
+ int64_t ret_conv = OnionMessageContents_clone_ptr(arg_conv);
+ return ret_conv;
+}
+
+uint64_t __attribute__((export_name("TS_OnionMessageContents_clone"))) TS_OnionMessageContents_clone(uint64_t orig) {
+ LDKOnionMessageContents* orig_conv = (LDKOnionMessageContents*)untag_ptr(orig);
+ LDKOnionMessageContents *ret_copy = MALLOC(sizeof(LDKOnionMessageContents), "LDKOnionMessageContents");
+ *ret_copy = OnionMessageContents_clone(orig_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+uint64_t __attribute__((export_name("TS_OnionMessageContents_custom"))) TS_OnionMessageContents_custom(uint64_t a) {
+ void* a_ptr = untag_ptr(a);
+ CHECK_ACCESS(a_ptr);
+ LDKCustomOnionMessageContents a_conv = *(LDKCustomOnionMessageContents*)(a_ptr);
+ if (a_conv.free == LDKCustomOnionMessageContents_JCalls_free) {
+ // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
+ LDKCustomOnionMessageContents_JCalls_cloned(&a_conv);
+ }
+ LDKOnionMessageContents *ret_copy = MALLOC(sizeof(LDKOnionMessageContents), "LDKOnionMessageContents");
+ *ret_copy = OnionMessageContents_custom(a_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+static inline uint64_t CustomOnionMessageContents_clone_ptr(LDKCustomOnionMessageContents *NONNULL_PTR arg) {
+ LDKCustomOnionMessageContents* ret_ret = MALLOC(sizeof(LDKCustomOnionMessageContents), "LDKCustomOnionMessageContents");
+ *ret_ret = CustomOnionMessageContents_clone(arg);
+ return tag_ptr(ret_ret, true);
+}
+int64_t __attribute__((export_name("TS_CustomOnionMessageContents_clone_ptr"))) TS_CustomOnionMessageContents_clone_ptr(uint64_t arg) {
+ void* arg_ptr = untag_ptr(arg);
+ if (ptr_is_owned(arg)) { CHECK_ACCESS(arg_ptr); }
+ LDKCustomOnionMessageContents* arg_conv = (LDKCustomOnionMessageContents*)arg_ptr;
+ int64_t ret_conv = CustomOnionMessageContents_clone_ptr(arg_conv);
+ return ret_conv;
+}
+
+uint64_t __attribute__((export_name("TS_CustomOnionMessageContents_clone"))) TS_CustomOnionMessageContents_clone(uint64_t orig) {
+ void* orig_ptr = untag_ptr(orig);
+ if (ptr_is_owned(orig)) { CHECK_ACCESS(orig_ptr); }
+ LDKCustomOnionMessageContents* orig_conv = (LDKCustomOnionMessageContents*)orig_ptr;
+ LDKCustomOnionMessageContents* ret_ret = MALLOC(sizeof(LDKCustomOnionMessageContents), "LDKCustomOnionMessageContents");
+ *ret_ret = CustomOnionMessageContents_clone(orig_conv);
+ return tag_ptr(ret_ret, true);
+}
+
+void __attribute__((export_name("TS_CustomOnionMessageContents_free"))) TS_CustomOnionMessageContents_free(uint64_t this_ptr) {
+ if (!ptr_is_owned(this_ptr)) return;
+ void* this_ptr_ptr = untag_ptr(this_ptr);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKCustomOnionMessageContents this_ptr_conv = *(LDKCustomOnionMessageContents*)(this_ptr_ptr);
+ FREE(untag_ptr(this_ptr));
+ CustomOnionMessageContents_free(this_ptr_conv);
+}
+
+void __attribute__((export_name("TS_GossipSync_free"))) TS_GossipSync_free(uint64_t this_ptr) {
+ if (!ptr_is_owned(this_ptr)) return;
+ void* this_ptr_ptr = untag_ptr(this_ptr);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKGossipSync this_ptr_conv = *(LDKGossipSync*)(this_ptr_ptr);
+ FREE(untag_ptr(this_ptr));
+ GossipSync_free(this_ptr_conv);
+}
+
+uint64_t __attribute__((export_name("TS_GossipSync_p2_p"))) TS_GossipSync_p2_p(uint64_t a) {
+ LDKP2PGossipSync a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKGossipSync *ret_copy = MALLOC(sizeof(LDKGossipSync), "LDKGossipSync");
+ *ret_copy = GossipSync_p2_p(&a_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+uint64_t __attribute__((export_name("TS_GossipSync_rapid"))) TS_GossipSync_rapid(uint64_t a) {
+ LDKRapidGossipSync a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKGossipSync *ret_copy = MALLOC(sizeof(LDKGossipSync), "LDKGossipSync");
+ *ret_copy = GossipSync_rapid(&a_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+uint64_t __attribute__((export_name("TS_GossipSync_none"))) TS_GossipSync_none() {
+ LDKGossipSync *ret_copy = MALLOC(sizeof(LDKGossipSync), "LDKGossipSync");
+ *ret_copy = GossipSync_none();
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+void __attribute__((export_name("TS_RapidGossipSync_free"))) TS_RapidGossipSync_free(uint64_t this_obj) {
+ LDKRapidGossipSync this_obj_conv;
+ this_obj_conv.inner = untag_ptr(this_obj);
+ this_obj_conv.is_owned = ptr_is_owned(this_obj);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
+ RapidGossipSync_free(this_obj_conv);
+}
+
+uint64_t __attribute__((export_name("TS_RapidGossipSync_new"))) TS_RapidGossipSync_new(uint64_t network_graph, uint64_t logger) {
+ LDKNetworkGraph network_graph_conv;
+ network_graph_conv.inner = untag_ptr(network_graph);
+ network_graph_conv.is_owned = ptr_is_owned(network_graph);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv);
+ network_graph_conv.is_owned = false;
+ void* logger_ptr = untag_ptr(logger);
+ CHECK_ACCESS(logger_ptr);
+ LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
+ if (logger_conv.free == LDKLogger_JCalls_free) {
+ // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
+ LDKLogger_JCalls_cloned(&logger_conv);
+ }
+ LDKRapidGossipSync ret_var = RapidGossipSync_new(&network_graph_conv, logger_conv);
+ uint64_t ret_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ return ret_ref;
+}
+
+uint64_t __attribute__((export_name("TS_RapidGossipSync_update_network_graph"))) TS_RapidGossipSync_update_network_graph(uint64_t this_arg, int8_tArray update_data) {
+ LDKRapidGossipSync this_arg_conv;
+ this_arg_conv.inner = untag_ptr(this_arg);
+ this_arg_conv.is_owned = ptr_is_owned(this_arg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ this_arg_conv.is_owned = false;
+ LDKu8slice update_data_ref;
+ update_data_ref.datalen = update_data->arr_len;
+ update_data_ref.data = update_data->elems;
+ LDKCResult_u32GraphSyncErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_u32GraphSyncErrorZ), "LDKCResult_u32GraphSyncErrorZ");
+ *ret_conv = RapidGossipSync_update_network_graph(&this_arg_conv, update_data_ref);
+ FREE(update_data);
+ return tag_ptr(ret_conv, true);
+}
+
+uint64_t __attribute__((export_name("TS_RapidGossipSync_update_network_graph_no_std"))) TS_RapidGossipSync_update_network_graph_no_std(uint64_t this_arg, int8_tArray update_data, uint64_t current_time_unix) {
+ LDKRapidGossipSync this_arg_conv;
+ this_arg_conv.inner = untag_ptr(this_arg);
+ this_arg_conv.is_owned = ptr_is_owned(this_arg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ this_arg_conv.is_owned = false;
+ LDKu8slice update_data_ref;
+ update_data_ref.datalen = update_data->arr_len;
+ update_data_ref.data = update_data->elems;
+ void* current_time_unix_ptr = untag_ptr(current_time_unix);
+ CHECK_ACCESS(current_time_unix_ptr);
+ LDKCOption_u64Z current_time_unix_conv = *(LDKCOption_u64Z*)(current_time_unix_ptr);
+ current_time_unix_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(current_time_unix));
+ LDKCResult_u32GraphSyncErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_u32GraphSyncErrorZ), "LDKCResult_u32GraphSyncErrorZ");
+ *ret_conv = RapidGossipSync_update_network_graph_no_std(&this_arg_conv, update_data_ref, current_time_unix_conv);
+ FREE(update_data);
+ return tag_ptr(ret_conv, true);
+}
+
+jboolean __attribute__((export_name("TS_RapidGossipSync_is_initial_sync_complete"))) TS_RapidGossipSync_is_initial_sync_complete(uint64_t this_arg) {
+ LDKRapidGossipSync this_arg_conv;
+ this_arg_conv.inner = untag_ptr(this_arg);
+ this_arg_conv.is_owned = ptr_is_owned(this_arg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ this_arg_conv.is_owned = false;
+ jboolean ret_conv = RapidGossipSync_is_initial_sync_complete(&this_arg_conv);
+ return ret_conv;
+}
+
+void __attribute__((export_name("TS_GraphSyncError_free"))) TS_GraphSyncError_free(uint64_t this_ptr) {
+ if (!ptr_is_owned(this_ptr)) return;
+ void* this_ptr_ptr = untag_ptr(this_ptr);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKGraphSyncError this_ptr_conv = *(LDKGraphSyncError*)(this_ptr_ptr);
+ FREE(untag_ptr(this_ptr));
+ GraphSyncError_free(this_ptr_conv);
+}
+
+static inline uint64_t GraphSyncError_clone_ptr(LDKGraphSyncError *NONNULL_PTR arg) {
+ LDKGraphSyncError *ret_copy = MALLOC(sizeof(LDKGraphSyncError), "LDKGraphSyncError");
+ *ret_copy = GraphSyncError_clone(arg);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+int64_t __attribute__((export_name("TS_GraphSyncError_clone_ptr"))) TS_GraphSyncError_clone_ptr(uint64_t arg) {
+ LDKGraphSyncError* arg_conv = (LDKGraphSyncError*)untag_ptr(arg);
+ int64_t ret_conv = GraphSyncError_clone_ptr(arg_conv);
+ return ret_conv;
+}
+
+uint64_t __attribute__((export_name("TS_GraphSyncError_clone"))) TS_GraphSyncError_clone(uint64_t orig) {
+ LDKGraphSyncError* orig_conv = (LDKGraphSyncError*)untag_ptr(orig);
+ LDKGraphSyncError *ret_copy = MALLOC(sizeof(LDKGraphSyncError), "LDKGraphSyncError");
+ *ret_copy = GraphSyncError_clone(orig_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+uint64_t __attribute__((export_name("TS_GraphSyncError_decode_error"))) TS_GraphSyncError_decode_error(uint64_t a) {
+ void* a_ptr = untag_ptr(a);
+ CHECK_ACCESS(a_ptr);
+ LDKDecodeError a_conv = *(LDKDecodeError*)(a_ptr);
+ a_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(a));
+ LDKGraphSyncError *ret_copy = MALLOC(sizeof(LDKGraphSyncError), "LDKGraphSyncError");
+ *ret_copy = GraphSyncError_decode_error(a_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+uint64_t __attribute__((export_name("TS_GraphSyncError_lightning_error"))) TS_GraphSyncError_lightning_error(uint64_t a) {
+ LDKLightningError a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv = LightningError_clone(&a_conv);
+ LDKGraphSyncError *ret_copy = MALLOC(sizeof(LDKGraphSyncError), "LDKGraphSyncError");
+ *ret_copy = GraphSyncError_lightning_error(a_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
void __attribute__((export_name("TS_ParseError_free"))) TS_ParseError_free(uint64_t this_ptr) {
if (!ptr_is_owned(this_ptr)) return;
void* this_ptr_ptr = untag_ptr(this_ptr);
return ret_ref;
}
+jboolean __attribute__((export_name("TS_ParseError_eq"))) TS_ParseError_eq(uint64_t a, uint64_t b) {
+ LDKParseError* a_conv = (LDKParseError*)untag_ptr(a);
+ LDKParseError* b_conv = (LDKParseError*)untag_ptr(b);
+ jboolean ret_conv = ParseError_eq(a_conv, b_conv);
+ return ret_conv;
+}
+
void __attribute__((export_name("TS_ParseOrSemanticError_free"))) TS_ParseOrSemanticError_free(uint64_t this_ptr) {
if (!ptr_is_owned(this_ptr)) return;
void* this_ptr_ptr = untag_ptr(this_ptr);
return ret_ref;
}
+jboolean __attribute__((export_name("TS_ParseOrSemanticError_eq"))) TS_ParseOrSemanticError_eq(uint64_t a, uint64_t b) {
+ LDKParseOrSemanticError* a_conv = (LDKParseOrSemanticError*)untag_ptr(a);
+ LDKParseOrSemanticError* b_conv = (LDKParseOrSemanticError*)untag_ptr(b);
+ jboolean ret_conv = ParseOrSemanticError_eq(a_conv, b_conv);
+ return ret_conv;
+}
+
void __attribute__((export_name("TS_Invoice_free"))) TS_Invoice_free(uint64_t this_obj) {
LDKInvoice this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+int64_t __attribute__((export_name("TS_Invoice_hash"))) TS_Invoice_hash(uint64_t o) {
+ LDKInvoice o_conv;
+ o_conv.inner = untag_ptr(o);
+ o_conv.is_owned = ptr_is_owned(o);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
+ o_conv.is_owned = false;
+ int64_t ret_conv = Invoice_hash(&o_conv);
+ return ret_conv;
+}
+
void __attribute__((export_name("TS_SignedRawInvoice_free"))) TS_SignedRawInvoice_free(uint64_t this_obj) {
LDKSignedRawInvoice this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+int64_t __attribute__((export_name("TS_SignedRawInvoice_hash"))) TS_SignedRawInvoice_hash(uint64_t o) {
+ LDKSignedRawInvoice o_conv;
+ o_conv.inner = untag_ptr(o);
+ o_conv.is_owned = ptr_is_owned(o);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
+ o_conv.is_owned = false;
+ int64_t ret_conv = SignedRawInvoice_hash(&o_conv);
+ return ret_conv;
+}
+
void __attribute__((export_name("TS_RawInvoice_free"))) TS_RawInvoice_free(uint64_t this_obj) {
LDKRawInvoice this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+int64_t __attribute__((export_name("TS_RawInvoice_hash"))) TS_RawInvoice_hash(uint64_t o) {
+ LDKRawInvoice o_conv;
+ o_conv.inner = untag_ptr(o);
+ o_conv.is_owned = ptr_is_owned(o);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
+ o_conv.is_owned = false;
+ int64_t ret_conv = RawInvoice_hash(&o_conv);
+ return ret_conv;
+}
+
void __attribute__((export_name("TS_RawDataPart_free"))) TS_RawDataPart_free(uint64_t this_obj) {
LDKRawDataPart this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+int64_t __attribute__((export_name("TS_RawDataPart_hash"))) TS_RawDataPart_hash(uint64_t o) {
+ LDKRawDataPart o_conv;
+ o_conv.inner = untag_ptr(o);
+ o_conv.is_owned = ptr_is_owned(o);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
+ o_conv.is_owned = false;
+ int64_t ret_conv = RawDataPart_hash(&o_conv);
+ return ret_conv;
+}
+
void __attribute__((export_name("TS_PositiveTimestamp_free"))) TS_PositiveTimestamp_free(uint64_t this_obj) {
LDKPositiveTimestamp this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+int64_t __attribute__((export_name("TS_PositiveTimestamp_hash"))) TS_PositiveTimestamp_hash(uint64_t o) {
+ LDKPositiveTimestamp o_conv;
+ o_conv.inner = untag_ptr(o);
+ o_conv.is_owned = ptr_is_owned(o);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
+ o_conv.is_owned = false;
+ int64_t ret_conv = PositiveTimestamp_hash(&o_conv);
+ return ret_conv;
+}
+
uint32_t __attribute__((export_name("TS_SiPrefix_clone"))) TS_SiPrefix_clone(uint64_t orig) {
LDKSiPrefix* orig_conv = (LDKSiPrefix*)untag_ptr(orig);
uint32_t ret_conv = LDKSiPrefix_to_js(SiPrefix_clone(orig_conv));
return ret_conv;
}
+int64_t __attribute__((export_name("TS_SiPrefix_hash"))) TS_SiPrefix_hash(uint64_t o) {
+ LDKSiPrefix* o_conv = (LDKSiPrefix*)untag_ptr(o);
+ int64_t ret_conv = SiPrefix_hash(o_conv);
+ return ret_conv;
+}
+
int64_t __attribute__((export_name("TS_SiPrefix_multiplier"))) TS_SiPrefix_multiplier(uint64_t this_arg) {
LDKSiPrefix* this_arg_conv = (LDKSiPrefix*)untag_ptr(this_arg);
int64_t ret_conv = SiPrefix_multiplier(this_arg_conv);
return ret_conv;
}
-void __attribute__((export_name("TS_MinFinalCltvExpiry_free"))) TS_MinFinalCltvExpiry_free(uint64_t this_obj) {
- LDKMinFinalCltvExpiry this_obj_conv;
+void __attribute__((export_name("TS_MinFinalCltvExpiryDelta_free"))) TS_MinFinalCltvExpiryDelta_free(uint64_t this_obj) {
+ LDKMinFinalCltvExpiryDelta this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
this_obj_conv.is_owned = ptr_is_owned(this_obj);
CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
- MinFinalCltvExpiry_free(this_obj_conv);
+ MinFinalCltvExpiryDelta_free(this_obj_conv);
}
-int64_t __attribute__((export_name("TS_MinFinalCltvExpiry_get_a"))) TS_MinFinalCltvExpiry_get_a(uint64_t this_ptr) {
- LDKMinFinalCltvExpiry this_ptr_conv;
+int64_t __attribute__((export_name("TS_MinFinalCltvExpiryDelta_get_a"))) TS_MinFinalCltvExpiryDelta_get_a(uint64_t this_ptr) {
+ LDKMinFinalCltvExpiryDelta this_ptr_conv;
this_ptr_conv.inner = untag_ptr(this_ptr);
this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
this_ptr_conv.is_owned = false;
- int64_t ret_conv = MinFinalCltvExpiry_get_a(&this_ptr_conv);
+ int64_t ret_conv = MinFinalCltvExpiryDelta_get_a(&this_ptr_conv);
return ret_conv;
}
-void __attribute__((export_name("TS_MinFinalCltvExpiry_set_a"))) TS_MinFinalCltvExpiry_set_a(uint64_t this_ptr, int64_t val) {
- LDKMinFinalCltvExpiry this_ptr_conv;
+void __attribute__((export_name("TS_MinFinalCltvExpiryDelta_set_a"))) TS_MinFinalCltvExpiryDelta_set_a(uint64_t this_ptr, int64_t val) {
+ LDKMinFinalCltvExpiryDelta this_ptr_conv;
this_ptr_conv.inner = untag_ptr(this_ptr);
this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
this_ptr_conv.is_owned = false;
- MinFinalCltvExpiry_set_a(&this_ptr_conv, val);
+ MinFinalCltvExpiryDelta_set_a(&this_ptr_conv, val);
}
-uint64_t __attribute__((export_name("TS_MinFinalCltvExpiry_new"))) TS_MinFinalCltvExpiry_new(int64_t a_arg) {
- LDKMinFinalCltvExpiry ret_var = MinFinalCltvExpiry_new(a_arg);
+uint64_t __attribute__((export_name("TS_MinFinalCltvExpiryDelta_new"))) TS_MinFinalCltvExpiryDelta_new(int64_t a_arg) {
+ LDKMinFinalCltvExpiryDelta ret_var = MinFinalCltvExpiryDelta_new(a_arg);
uint64_t ret_ref = 0;
CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
return ret_ref;
}
-static inline uint64_t MinFinalCltvExpiry_clone_ptr(LDKMinFinalCltvExpiry *NONNULL_PTR arg) {
- LDKMinFinalCltvExpiry ret_var = MinFinalCltvExpiry_clone(arg);
+static inline uint64_t MinFinalCltvExpiryDelta_clone_ptr(LDKMinFinalCltvExpiryDelta *NONNULL_PTR arg) {
+ LDKMinFinalCltvExpiryDelta ret_var = MinFinalCltvExpiryDelta_clone(arg);
uint64_t ret_ref = 0;
CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
return ret_ref;
}
-int64_t __attribute__((export_name("TS_MinFinalCltvExpiry_clone_ptr"))) TS_MinFinalCltvExpiry_clone_ptr(uint64_t arg) {
- LDKMinFinalCltvExpiry arg_conv;
+int64_t __attribute__((export_name("TS_MinFinalCltvExpiryDelta_clone_ptr"))) TS_MinFinalCltvExpiryDelta_clone_ptr(uint64_t arg) {
+ LDKMinFinalCltvExpiryDelta arg_conv;
arg_conv.inner = untag_ptr(arg);
arg_conv.is_owned = ptr_is_owned(arg);
CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
arg_conv.is_owned = false;
- int64_t ret_conv = MinFinalCltvExpiry_clone_ptr(&arg_conv);
+ int64_t ret_conv = MinFinalCltvExpiryDelta_clone_ptr(&arg_conv);
return ret_conv;
}
-uint64_t __attribute__((export_name("TS_MinFinalCltvExpiry_clone"))) TS_MinFinalCltvExpiry_clone(uint64_t orig) {
- LDKMinFinalCltvExpiry orig_conv;
+uint64_t __attribute__((export_name("TS_MinFinalCltvExpiryDelta_clone"))) TS_MinFinalCltvExpiryDelta_clone(uint64_t orig) {
+ LDKMinFinalCltvExpiryDelta orig_conv;
orig_conv.inner = untag_ptr(orig);
orig_conv.is_owned = ptr_is_owned(orig);
CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
orig_conv.is_owned = false;
- LDKMinFinalCltvExpiry ret_var = MinFinalCltvExpiry_clone(&orig_conv);
+ LDKMinFinalCltvExpiryDelta ret_var = MinFinalCltvExpiryDelta_clone(&orig_conv);
uint64_t ret_ref = 0;
CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
return ret_ref;
}
-int64_t __attribute__((export_name("TS_MinFinalCltvExpiry_hash"))) TS_MinFinalCltvExpiry_hash(uint64_t o) {
- LDKMinFinalCltvExpiry o_conv;
+int64_t __attribute__((export_name("TS_MinFinalCltvExpiryDelta_hash"))) TS_MinFinalCltvExpiryDelta_hash(uint64_t o) {
+ LDKMinFinalCltvExpiryDelta o_conv;
o_conv.inner = untag_ptr(o);
o_conv.is_owned = ptr_is_owned(o);
CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
o_conv.is_owned = false;
- int64_t ret_conv = MinFinalCltvExpiry_hash(&o_conv);
+ int64_t ret_conv = MinFinalCltvExpiryDelta_hash(&o_conv);
return ret_conv;
}
-jboolean __attribute__((export_name("TS_MinFinalCltvExpiry_eq"))) TS_MinFinalCltvExpiry_eq(uint64_t a, uint64_t b) {
- LDKMinFinalCltvExpiry a_conv;
+jboolean __attribute__((export_name("TS_MinFinalCltvExpiryDelta_eq"))) TS_MinFinalCltvExpiryDelta_eq(uint64_t a, uint64_t b) {
+ LDKMinFinalCltvExpiryDelta a_conv;
a_conv.inner = untag_ptr(a);
a_conv.is_owned = ptr_is_owned(a);
CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
a_conv.is_owned = false;
- LDKMinFinalCltvExpiry b_conv;
+ LDKMinFinalCltvExpiryDelta b_conv;
b_conv.inner = untag_ptr(b);
b_conv.is_owned = ptr_is_owned(b);
CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
b_conv.is_owned = false;
- jboolean ret_conv = MinFinalCltvExpiry_eq(&a_conv, &b_conv);
+ jboolean ret_conv = MinFinalCltvExpiryDelta_eq(&a_conv, &b_conv);
return ret_conv;
}
program_ref.data = MALLOC(program_ref.datalen, "LDKCVec_u8Z Bytes");
memcpy(program_ref.data, program->elems, program_ref.datalen); FREE(program);
LDKFallback *ret_copy = MALLOC(sizeof(LDKFallback), "LDKFallback");
- *ret_copy = Fallback_seg_wit_program((LDKu5){ ._0 = version }, program_ref);
+ *ret_copy = Fallback_seg_wit_program((LDKU5){ ._0 = version }, program_ref);
uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
return ret_ref;
}
+int64_t __attribute__((export_name("TS_InvoiceSignature_hash"))) TS_InvoiceSignature_hash(uint64_t o) {
+ LDKInvoiceSignature o_conv;
+ o_conv.inner = untag_ptr(o);
+ o_conv.is_owned = ptr_is_owned(o);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
+ o_conv.is_owned = false;
+ int64_t ret_conv = InvoiceSignature_hash(&o_conv);
+ return ret_conv;
+}
+
jboolean __attribute__((export_name("TS_InvoiceSignature_eq"))) TS_InvoiceSignature_eq(uint64_t a, uint64_t b) {
LDKInvoiceSignature a_conv;
a_conv.inner = untag_ptr(a);
return ret_ref;
}
-int8_tArray __attribute__((export_name("TS_SignedRawInvoice_hash"))) TS_SignedRawInvoice_hash(uint64_t this_arg) {
+int8_tArray __attribute__((export_name("TS_SignedRawInvoice_signable_hash"))) TS_SignedRawInvoice_signable_hash(uint64_t this_arg) {
LDKSignedRawInvoice this_arg_conv;
this_arg_conv.inner = untag_ptr(this_arg);
this_arg_conv.is_owned = ptr_is_owned(this_arg);
CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
this_arg_conv.is_owned = false;
int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
- memcpy(ret_arr->elems, *SignedRawInvoice_hash(&this_arg_conv), 32);
+ memcpy(ret_arr->elems, *SignedRawInvoice_signable_hash(&this_arg_conv), 32);
return ret_arr;
}
return ret_conv;
}
-int8_tArray __attribute__((export_name("TS_RawInvoice_hash"))) TS_RawInvoice_hash(uint64_t this_arg) {
+int8_tArray __attribute__((export_name("TS_RawInvoice_signable_hash"))) TS_RawInvoice_signable_hash(uint64_t this_arg) {
LDKRawInvoice this_arg_conv;
this_arg_conv.inner = untag_ptr(this_arg);
this_arg_conv.is_owned = ptr_is_owned(this_arg);
CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
this_arg_conv.is_owned = false;
int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
- memcpy(ret_arr->elems, RawInvoice_hash(&this_arg_conv).data, 32);
+ memcpy(ret_arr->elems, RawInvoice_signable_hash(&this_arg_conv).data, 32);
return ret_arr;
}
return ret_ref;
}
-uint64_t __attribute__((export_name("TS_RawInvoice_min_final_cltv_expiry"))) TS_RawInvoice_min_final_cltv_expiry(uint64_t this_arg) {
+uint64_t __attribute__((export_name("TS_RawInvoice_min_final_cltv_expiry_delta"))) TS_RawInvoice_min_final_cltv_expiry_delta(uint64_t this_arg) {
LDKRawInvoice this_arg_conv;
this_arg_conv.inner = untag_ptr(this_arg);
this_arg_conv.is_owned = ptr_is_owned(this_arg);
CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
this_arg_conv.is_owned = false;
- LDKMinFinalCltvExpiry ret_var = RawInvoice_min_final_cltv_expiry(&this_arg_conv);
+ LDKMinFinalCltvExpiryDelta ret_var = RawInvoice_min_final_cltv_expiry_delta(&this_arg_conv);
uint64_t ret_ref = 0;
CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
return ret_conv;
}
-int64_t __attribute__((export_name("TS_Invoice_min_final_cltv_expiry"))) TS_Invoice_min_final_cltv_expiry(uint64_t this_arg) {
+int64_t __attribute__((export_name("TS_Invoice_min_final_cltv_expiry_delta"))) TS_Invoice_min_final_cltv_expiry_delta(uint64_t this_arg) {
LDKInvoice this_arg_conv;
this_arg_conv.inner = untag_ptr(this_arg);
this_arg_conv.is_owned = ptr_is_owned(this_arg);
CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
this_arg_conv.is_owned = false;
- int64_t ret_conv = Invoice_min_final_cltv_expiry(&this_arg_conv);
+ int64_t ret_conv = Invoice_min_final_cltv_expiry_delta(&this_arg_conv);
return ret_conv;
}
return ret_conv;
}
+uint32_t __attribute__((export_name("TS_CreationError_min_final_cltv_expiry_delta_too_short"))) TS_CreationError_min_final_cltv_expiry_delta_too_short() {
+ uint32_t ret_conv = LDKCreationError_to_js(CreationError_min_final_cltv_expiry_delta_too_short());
+ return ret_conv;
+}
+
jboolean __attribute__((export_name("TS_CreationError_eq"))) TS_CreationError_eq(uint64_t a, uint64_t b) {
LDKCreationError* a_conv = (LDKCreationError*)untag_ptr(a);
LDKCreationError* b_conv = (LDKCreationError*)untag_ptr(b);
return ret_conv;
}
-void __attribute__((export_name("TS_InvoicePayer_free"))) TS_InvoicePayer_free(uint64_t this_obj) {
- LDKInvoicePayer this_obj_conv;
- this_obj_conv.inner = untag_ptr(this_obj);
- this_obj_conv.is_owned = ptr_is_owned(this_obj);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
- InvoicePayer_free(this_obj_conv);
-}
-
-void __attribute__((export_name("TS_Payer_free"))) TS_Payer_free(uint64_t this_ptr) {
- if (!ptr_is_owned(this_ptr)) return;
- void* this_ptr_ptr = untag_ptr(this_ptr);
- CHECK_ACCESS(this_ptr_ptr);
- LDKPayer this_ptr_conv = *(LDKPayer*)(this_ptr_ptr);
- FREE(untag_ptr(this_ptr));
- Payer_free(this_ptr_conv);
-}
-
-void __attribute__((export_name("TS_Router_free"))) TS_Router_free(uint64_t this_ptr) {
- if (!ptr_is_owned(this_ptr)) return;
- void* this_ptr_ptr = untag_ptr(this_ptr);
- CHECK_ACCESS(this_ptr_ptr);
- LDKRouter this_ptr_conv = *(LDKRouter*)(this_ptr_ptr);
- FREE(untag_ptr(this_ptr));
- Router_free(this_ptr_conv);
-}
-
-void __attribute__((export_name("TS_Retry_free"))) TS_Retry_free(uint64_t this_ptr) {
- if (!ptr_is_owned(this_ptr)) return;
- void* this_ptr_ptr = untag_ptr(this_ptr);
- CHECK_ACCESS(this_ptr_ptr);
- LDKRetry this_ptr_conv = *(LDKRetry*)(this_ptr_ptr);
- FREE(untag_ptr(this_ptr));
- Retry_free(this_ptr_conv);
-}
-
-static inline uint64_t Retry_clone_ptr(LDKRetry *NONNULL_PTR arg) {
- LDKRetry *ret_copy = MALLOC(sizeof(LDKRetry), "LDKRetry");
- *ret_copy = Retry_clone(arg);
- uint64_t ret_ref = tag_ptr(ret_copy, true);
- return ret_ref;
-}
-int64_t __attribute__((export_name("TS_Retry_clone_ptr"))) TS_Retry_clone_ptr(uint64_t arg) {
- LDKRetry* arg_conv = (LDKRetry*)untag_ptr(arg);
- int64_t ret_conv = Retry_clone_ptr(arg_conv);
- return ret_conv;
-}
-
-uint64_t __attribute__((export_name("TS_Retry_clone"))) TS_Retry_clone(uint64_t orig) {
- LDKRetry* orig_conv = (LDKRetry*)untag_ptr(orig);
- LDKRetry *ret_copy = MALLOC(sizeof(LDKRetry), "LDKRetry");
- *ret_copy = Retry_clone(orig_conv);
- uint64_t ret_ref = tag_ptr(ret_copy, true);
- return ret_ref;
+uint64_t __attribute__((export_name("TS_pay_invoice"))) TS_pay_invoice(uint64_t invoice, uint64_t retry_strategy, uint64_t channelmanager) {
+ LDKInvoice invoice_conv;
+ invoice_conv.inner = untag_ptr(invoice);
+ invoice_conv.is_owned = ptr_is_owned(invoice);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_conv);
+ invoice_conv.is_owned = false;
+ void* retry_strategy_ptr = untag_ptr(retry_strategy);
+ CHECK_ACCESS(retry_strategy_ptr);
+ LDKRetry retry_strategy_conv = *(LDKRetry*)(retry_strategy_ptr);
+ retry_strategy_conv = Retry_clone((LDKRetry*)untag_ptr(retry_strategy));
+ LDKChannelManager channelmanager_conv;
+ channelmanager_conv.inner = untag_ptr(channelmanager);
+ channelmanager_conv.is_owned = ptr_is_owned(channelmanager);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv);
+ channelmanager_conv.is_owned = false;
+ LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
+ *ret_conv = pay_invoice(&invoice_conv, retry_strategy_conv, &channelmanager_conv);
+ return tag_ptr(ret_conv, true);
}
-uint64_t __attribute__((export_name("TS_Retry_attempts"))) TS_Retry_attempts(uint32_t a) {
- LDKRetry *ret_copy = MALLOC(sizeof(LDKRetry), "LDKRetry");
- *ret_copy = Retry_attempts(a);
- uint64_t ret_ref = tag_ptr(ret_copy, true);
- return ret_ref;
+uint64_t __attribute__((export_name("TS_pay_invoice_with_id"))) TS_pay_invoice_with_id(uint64_t invoice, int8_tArray payment_id, uint64_t retry_strategy, uint64_t channelmanager) {
+ LDKInvoice invoice_conv;
+ invoice_conv.inner = untag_ptr(invoice);
+ invoice_conv.is_owned = ptr_is_owned(invoice);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_conv);
+ invoice_conv.is_owned = false;
+ LDKThirtyTwoBytes payment_id_ref;
+ CHECK(payment_id->arr_len == 32);
+ memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id);
+ void* retry_strategy_ptr = untag_ptr(retry_strategy);
+ CHECK_ACCESS(retry_strategy_ptr);
+ LDKRetry retry_strategy_conv = *(LDKRetry*)(retry_strategy_ptr);
+ retry_strategy_conv = Retry_clone((LDKRetry*)untag_ptr(retry_strategy));
+ LDKChannelManager channelmanager_conv;
+ channelmanager_conv.inner = untag_ptr(channelmanager);
+ channelmanager_conv.is_owned = ptr_is_owned(channelmanager);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv);
+ channelmanager_conv.is_owned = false;
+ LDKCResult_NonePaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentErrorZ), "LDKCResult_NonePaymentErrorZ");
+ *ret_conv = pay_invoice_with_id(&invoice_conv, payment_id_ref, retry_strategy_conv, &channelmanager_conv);
+ return tag_ptr(ret_conv, true);
}
-jboolean __attribute__((export_name("TS_Retry_eq"))) TS_Retry_eq(uint64_t a, uint64_t b) {
- LDKRetry* a_conv = (LDKRetry*)untag_ptr(a);
- LDKRetry* b_conv = (LDKRetry*)untag_ptr(b);
- jboolean ret_conv = Retry_eq(a_conv, b_conv);
- return ret_conv;
+uint64_t __attribute__((export_name("TS_pay_zero_value_invoice"))) TS_pay_zero_value_invoice(uint64_t invoice, int64_t amount_msats, uint64_t retry_strategy, uint64_t channelmanager) {
+ LDKInvoice invoice_conv;
+ invoice_conv.inner = untag_ptr(invoice);
+ invoice_conv.is_owned = ptr_is_owned(invoice);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_conv);
+ invoice_conv.is_owned = false;
+ void* retry_strategy_ptr = untag_ptr(retry_strategy);
+ CHECK_ACCESS(retry_strategy_ptr);
+ LDKRetry retry_strategy_conv = *(LDKRetry*)(retry_strategy_ptr);
+ retry_strategy_conv = Retry_clone((LDKRetry*)untag_ptr(retry_strategy));
+ LDKChannelManager channelmanager_conv;
+ channelmanager_conv.inner = untag_ptr(channelmanager);
+ channelmanager_conv.is_owned = ptr_is_owned(channelmanager);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv);
+ channelmanager_conv.is_owned = false;
+ LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
+ *ret_conv = pay_zero_value_invoice(&invoice_conv, amount_msats, retry_strategy_conv, &channelmanager_conv);
+ return tag_ptr(ret_conv, true);
}
-int64_t __attribute__((export_name("TS_Retry_hash"))) TS_Retry_hash(uint64_t o) {
- LDKRetry* o_conv = (LDKRetry*)untag_ptr(o);
- int64_t ret_conv = Retry_hash(o_conv);
- return ret_conv;
+uint64_t __attribute__((export_name("TS_pay_zero_value_invoice_with_id"))) TS_pay_zero_value_invoice_with_id(uint64_t invoice, int64_t amount_msats, int8_tArray payment_id, uint64_t retry_strategy, uint64_t channelmanager) {
+ LDKInvoice invoice_conv;
+ invoice_conv.inner = untag_ptr(invoice);
+ invoice_conv.is_owned = ptr_is_owned(invoice);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_conv);
+ invoice_conv.is_owned = false;
+ LDKThirtyTwoBytes payment_id_ref;
+ CHECK(payment_id->arr_len == 32);
+ memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id);
+ void* retry_strategy_ptr = untag_ptr(retry_strategy);
+ CHECK_ACCESS(retry_strategy_ptr);
+ LDKRetry retry_strategy_conv = *(LDKRetry*)(retry_strategy_ptr);
+ retry_strategy_conv = Retry_clone((LDKRetry*)untag_ptr(retry_strategy));
+ LDKChannelManager channelmanager_conv;
+ channelmanager_conv.inner = untag_ptr(channelmanager);
+ channelmanager_conv.is_owned = ptr_is_owned(channelmanager);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv);
+ channelmanager_conv.is_owned = false;
+ LDKCResult_NonePaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentErrorZ), "LDKCResult_NonePaymentErrorZ");
+ *ret_conv = pay_zero_value_invoice_with_id(&invoice_conv, amount_msats, payment_id_ref, retry_strategy_conv, &channelmanager_conv);
+ return tag_ptr(ret_conv, true);
}
void __attribute__((export_name("TS_PaymentError_free"))) TS_PaymentError_free(uint64_t this_ptr) {
return ret_ref;
}
-uint64_t __attribute__((export_name("TS_PaymentError_routing"))) TS_PaymentError_routing(uint64_t a) {
- LDKLightningError a_conv;
- a_conv.inner = untag_ptr(a);
- a_conv.is_owned = ptr_is_owned(a);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
- a_conv = LightningError_clone(&a_conv);
- LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError");
- *ret_copy = PaymentError_routing(a_conv);
- uint64_t ret_ref = tag_ptr(ret_copy, true);
- return ret_ref;
-}
-
-uint64_t __attribute__((export_name("TS_PaymentError_sending"))) TS_PaymentError_sending(uint64_t a) {
- void* a_ptr = untag_ptr(a);
- CHECK_ACCESS(a_ptr);
- LDKPaymentSendFailure a_conv = *(LDKPaymentSendFailure*)(a_ptr);
- a_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)untag_ptr(a));
+uint64_t __attribute__((export_name("TS_PaymentError_sending"))) TS_PaymentError_sending(uint32_t a) {
+ LDKRetryableSendFailure a_conv = LDKRetryableSendFailure_from_js(a);
LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError");
*ret_copy = PaymentError_sending(a_conv);
uint64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
-uint64_t __attribute__((export_name("TS_InvoicePayer_new"))) TS_InvoicePayer_new(uint64_t payer, uint64_t router, uint64_t scorer, uint64_t logger, uint64_t event_handler, uint64_t retry) {
- void* payer_ptr = untag_ptr(payer);
- CHECK_ACCESS(payer_ptr);
- LDKPayer payer_conv = *(LDKPayer*)(payer_ptr);
- if (payer_conv.free == LDKPayer_JCalls_free) {
+uint64_t __attribute__((export_name("TS_create_phantom_invoice"))) TS_create_phantom_invoice(uint64_t amt_msat, int8_tArray payment_hash, jstring description, int32_t invoice_expiry_delta_secs, uint64_tArray phantom_route_hints, uint64_t entropy_source, uint64_t node_signer, uint64_t logger, uint32_t network, uint64_t min_final_cltv_expiry_delta, int64_t duration_since_epoch) {
+ void* amt_msat_ptr = untag_ptr(amt_msat);
+ CHECK_ACCESS(amt_msat_ptr);
+ LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr);
+ amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat));
+ LDKThirtyTwoBytes payment_hash_ref;
+ CHECK(payment_hash->arr_len == 32);
+ memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
+ LDKStr description_conv = str_ref_to_owned_c(description);
+ LDKCVec_PhantomRouteHintsZ phantom_route_hints_constr;
+ phantom_route_hints_constr.datalen = phantom_route_hints->arr_len;
+ if (phantom_route_hints_constr.datalen > 0)
+ phantom_route_hints_constr.data = MALLOC(phantom_route_hints_constr.datalen * sizeof(LDKPhantomRouteHints), "LDKCVec_PhantomRouteHintsZ Elements");
+ else
+ phantom_route_hints_constr.data = NULL;
+ uint64_t* phantom_route_hints_vals = phantom_route_hints->elems;
+ for (size_t t = 0; t < phantom_route_hints_constr.datalen; t++) {
+ uint64_t phantom_route_hints_conv_19 = phantom_route_hints_vals[t];
+ LDKPhantomRouteHints phantom_route_hints_conv_19_conv;
+ phantom_route_hints_conv_19_conv.inner = untag_ptr(phantom_route_hints_conv_19);
+ phantom_route_hints_conv_19_conv.is_owned = ptr_is_owned(phantom_route_hints_conv_19);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(phantom_route_hints_conv_19_conv);
+ phantom_route_hints_conv_19_conv = PhantomRouteHints_clone(&phantom_route_hints_conv_19_conv);
+ phantom_route_hints_constr.data[t] = phantom_route_hints_conv_19_conv;
+ }
+ FREE(phantom_route_hints);
+ void* entropy_source_ptr = untag_ptr(entropy_source);
+ CHECK_ACCESS(entropy_source_ptr);
+ LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr);
+ if (entropy_source_conv.free == LDKEntropySource_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
- LDKPayer_JCalls_cloned(&payer_conv);
+ LDKEntropySource_JCalls_cloned(&entropy_source_conv);
}
- void* router_ptr = untag_ptr(router);
- CHECK_ACCESS(router_ptr);
- LDKRouter router_conv = *(LDKRouter*)(router_ptr);
- if (router_conv.free == LDKRouter_JCalls_free) {
+ void* node_signer_ptr = untag_ptr(node_signer);
+ CHECK_ACCESS(node_signer_ptr);
+ LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr);
+ if (node_signer_conv.free == LDKNodeSigner_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
- LDKRouter_JCalls_cloned(&router_conv);
+ LDKNodeSigner_JCalls_cloned(&node_signer_conv);
}
- LDKMultiThreadedLockableScore scorer_conv;
- scorer_conv.inner = untag_ptr(scorer);
- scorer_conv.is_owned = ptr_is_owned(scorer);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(scorer_conv);
- scorer_conv.is_owned = false;
void* logger_ptr = untag_ptr(logger);
CHECK_ACCESS(logger_ptr);
LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKLogger_JCalls_cloned(&logger_conv);
}
- void* event_handler_ptr = untag_ptr(event_handler);
- CHECK_ACCESS(event_handler_ptr);
- LDKEventHandler event_handler_conv = *(LDKEventHandler*)(event_handler_ptr);
- if (event_handler_conv.free == LDKEventHandler_JCalls_free) {
- // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
- LDKEventHandler_JCalls_cloned(&event_handler_conv);
- }
- void* retry_ptr = untag_ptr(retry);
- CHECK_ACCESS(retry_ptr);
- LDKRetry retry_conv = *(LDKRetry*)(retry_ptr);
- retry_conv = Retry_clone((LDKRetry*)untag_ptr(retry));
- LDKInvoicePayer ret_var = InvoicePayer_new(payer_conv, router_conv, &scorer_conv, logger_conv, event_handler_conv, retry_conv);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
- return ret_ref;
-}
-
-uint64_t __attribute__((export_name("TS_InvoicePayer_pay_invoice"))) TS_InvoicePayer_pay_invoice(uint64_t this_arg, uint64_t invoice) {
- LDKInvoicePayer this_arg_conv;
- this_arg_conv.inner = untag_ptr(this_arg);
- this_arg_conv.is_owned = ptr_is_owned(this_arg);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
- this_arg_conv.is_owned = false;
- LDKInvoice invoice_conv;
- invoice_conv.inner = untag_ptr(invoice);
- invoice_conv.is_owned = ptr_is_owned(invoice);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_conv);
- invoice_conv.is_owned = false;
- LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
- *ret_conv = InvoicePayer_pay_invoice(&this_arg_conv, &invoice_conv);
- return tag_ptr(ret_conv, true);
-}
-
-uint64_t __attribute__((export_name("TS_InvoicePayer_pay_zero_value_invoice"))) TS_InvoicePayer_pay_zero_value_invoice(uint64_t this_arg, uint64_t invoice, int64_t amount_msats) {
- LDKInvoicePayer this_arg_conv;
- this_arg_conv.inner = untag_ptr(this_arg);
- this_arg_conv.is_owned = ptr_is_owned(this_arg);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
- this_arg_conv.is_owned = false;
- LDKInvoice invoice_conv;
- invoice_conv.inner = untag_ptr(invoice);
- invoice_conv.is_owned = ptr_is_owned(invoice);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_conv);
- invoice_conv.is_owned = false;
- LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
- *ret_conv = InvoicePayer_pay_zero_value_invoice(&this_arg_conv, &invoice_conv, amount_msats);
- return tag_ptr(ret_conv, true);
-}
-
-uint64_t __attribute__((export_name("TS_InvoicePayer_pay_pubkey"))) TS_InvoicePayer_pay_pubkey(uint64_t this_arg, int8_tArray pubkey, int8_tArray payment_preimage, int64_t amount_msats, int32_t final_cltv_expiry_delta) {
- LDKInvoicePayer this_arg_conv;
- this_arg_conv.inner = untag_ptr(this_arg);
- this_arg_conv.is_owned = ptr_is_owned(this_arg);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
- this_arg_conv.is_owned = false;
- LDKPublicKey pubkey_ref;
- CHECK(pubkey->arr_len == 33);
- memcpy(pubkey_ref.compressed_form, pubkey->elems, 33); FREE(pubkey);
- LDKThirtyTwoBytes payment_preimage_ref;
- CHECK(payment_preimage->arr_len == 32);
- memcpy(payment_preimage_ref.data, payment_preimage->elems, 32); FREE(payment_preimage);
- LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
- *ret_conv = InvoicePayer_pay_pubkey(&this_arg_conv, pubkey_ref, payment_preimage_ref, amount_msats, final_cltv_expiry_delta);
+ LDKCurrency network_conv = LDKCurrency_from_js(network);
+ void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta);
+ CHECK_ACCESS(min_final_cltv_expiry_delta_ptr);
+ LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr);
+ min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta));
+ LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
+ *ret_conv = create_phantom_invoice(amt_msat_conv, payment_hash_ref, description_conv, invoice_expiry_delta_secs, phantom_route_hints_constr, entropy_source_conv, node_signer_conv, logger_conv, network_conv, min_final_cltv_expiry_delta_conv, duration_since_epoch);
return tag_ptr(ret_conv, true);
}
-void __attribute__((export_name("TS_InvoicePayer_remove_cached_payment"))) TS_InvoicePayer_remove_cached_payment(uint64_t this_arg, int8_tArray payment_hash) {
- LDKInvoicePayer this_arg_conv;
- this_arg_conv.inner = untag_ptr(this_arg);
- this_arg_conv.is_owned = ptr_is_owned(this_arg);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
- this_arg_conv.is_owned = false;
- unsigned char payment_hash_arr[32];
+uint64_t __attribute__((export_name("TS_create_phantom_invoice_with_description_hash"))) TS_create_phantom_invoice_with_description_hash(uint64_t amt_msat, int8_tArray payment_hash, int32_t invoice_expiry_delta_secs, uint64_t description_hash, uint64_tArray phantom_route_hints, uint64_t entropy_source, uint64_t node_signer, uint64_t logger, uint32_t network, uint64_t min_final_cltv_expiry_delta, int64_t duration_since_epoch) {
+ void* amt_msat_ptr = untag_ptr(amt_msat);
+ CHECK_ACCESS(amt_msat_ptr);
+ LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr);
+ amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat));
+ LDKThirtyTwoBytes payment_hash_ref;
CHECK(payment_hash->arr_len == 32);
- memcpy(payment_hash_arr, payment_hash->elems, 32); FREE(payment_hash);
- unsigned char (*payment_hash_ref)[32] = &payment_hash_arr;
- InvoicePayer_remove_cached_payment(&this_arg_conv, payment_hash_ref);
-}
-
-uint64_t __attribute__((export_name("TS_InvoicePayer_as_EventHandler"))) TS_InvoicePayer_as_EventHandler(uint64_t this_arg) {
- LDKInvoicePayer this_arg_conv;
- this_arg_conv.inner = untag_ptr(this_arg);
- this_arg_conv.is_owned = ptr_is_owned(this_arg);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
- this_arg_conv.is_owned = false;
- LDKEventHandler* ret_ret = MALLOC(sizeof(LDKEventHandler), "LDKEventHandler");
- *ret_ret = InvoicePayer_as_EventHandler(&this_arg_conv);
- return tag_ptr(ret_ret, true);
+ memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
+ LDKSha256 description_hash_conv;
+ description_hash_conv.inner = untag_ptr(description_hash);
+ description_hash_conv.is_owned = ptr_is_owned(description_hash);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(description_hash_conv);
+ description_hash_conv = Sha256_clone(&description_hash_conv);
+ LDKCVec_PhantomRouteHintsZ phantom_route_hints_constr;
+ phantom_route_hints_constr.datalen = phantom_route_hints->arr_len;
+ if (phantom_route_hints_constr.datalen > 0)
+ phantom_route_hints_constr.data = MALLOC(phantom_route_hints_constr.datalen * sizeof(LDKPhantomRouteHints), "LDKCVec_PhantomRouteHintsZ Elements");
+ else
+ phantom_route_hints_constr.data = NULL;
+ uint64_t* phantom_route_hints_vals = phantom_route_hints->elems;
+ for (size_t t = 0; t < phantom_route_hints_constr.datalen; t++) {
+ uint64_t phantom_route_hints_conv_19 = phantom_route_hints_vals[t];
+ LDKPhantomRouteHints phantom_route_hints_conv_19_conv;
+ phantom_route_hints_conv_19_conv.inner = untag_ptr(phantom_route_hints_conv_19);
+ phantom_route_hints_conv_19_conv.is_owned = ptr_is_owned(phantom_route_hints_conv_19);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(phantom_route_hints_conv_19_conv);
+ phantom_route_hints_conv_19_conv = PhantomRouteHints_clone(&phantom_route_hints_conv_19_conv);
+ phantom_route_hints_constr.data[t] = phantom_route_hints_conv_19_conv;
+ }
+ FREE(phantom_route_hints);
+ void* entropy_source_ptr = untag_ptr(entropy_source);
+ CHECK_ACCESS(entropy_source_ptr);
+ LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr);
+ if (entropy_source_conv.free == LDKEntropySource_JCalls_free) {
+ // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
+ LDKEntropySource_JCalls_cloned(&entropy_source_conv);
+ }
+ void* node_signer_ptr = untag_ptr(node_signer);
+ CHECK_ACCESS(node_signer_ptr);
+ LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr);
+ if (node_signer_conv.free == LDKNodeSigner_JCalls_free) {
+ // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
+ LDKNodeSigner_JCalls_cloned(&node_signer_conv);
+ }
+ void* logger_ptr = untag_ptr(logger);
+ CHECK_ACCESS(logger_ptr);
+ LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
+ if (logger_conv.free == LDKLogger_JCalls_free) {
+ // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
+ LDKLogger_JCalls_cloned(&logger_conv);
+ }
+ LDKCurrency network_conv = LDKCurrency_from_js(network);
+ void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta);
+ CHECK_ACCESS(min_final_cltv_expiry_delta_ptr);
+ LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr);
+ min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta));
+ LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
+ *ret_conv = create_phantom_invoice_with_description_hash(amt_msat_conv, payment_hash_ref, invoice_expiry_delta_secs, description_hash_conv, phantom_route_hints_constr, entropy_source_conv, node_signer_conv, logger_conv, network_conv, min_final_cltv_expiry_delta_conv, duration_since_epoch);
+ return tag_ptr(ret_conv, true);
}
-uint64_t __attribute__((export_name("TS_create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch"))) TS_create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(uint64_t channelmanager, uint64_t keys_manager, uint32_t network, uint64_t amt_msat, uint64_t description_hash, int64_t duration_since_epoch, int32_t invoice_expiry_delta_secs) {
+uint64_t __attribute__((export_name("TS_create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch"))) TS_create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(uint64_t channelmanager, uint64_t node_signer, uint64_t logger, uint32_t network, uint64_t amt_msat, uint64_t description_hash, int64_t duration_since_epoch, int32_t invoice_expiry_delta_secs, uint64_t min_final_cltv_expiry_delta) {
LDKChannelManager channelmanager_conv;
channelmanager_conv.inner = untag_ptr(channelmanager);
channelmanager_conv.is_owned = ptr_is_owned(channelmanager);
CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv);
channelmanager_conv.is_owned = false;
- void* keys_manager_ptr = untag_ptr(keys_manager);
- CHECK_ACCESS(keys_manager_ptr);
- LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr);
- if (keys_manager_conv.free == LDKKeysInterface_JCalls_free) {
+ void* node_signer_ptr = untag_ptr(node_signer);
+ CHECK_ACCESS(node_signer_ptr);
+ LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr);
+ if (node_signer_conv.free == LDKNodeSigner_JCalls_free) {
+ // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
+ LDKNodeSigner_JCalls_cloned(&node_signer_conv);
+ }
+ void* logger_ptr = untag_ptr(logger);
+ CHECK_ACCESS(logger_ptr);
+ LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
+ if (logger_conv.free == LDKLogger_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
- LDKKeysInterface_JCalls_cloned(&keys_manager_conv);
+ LDKLogger_JCalls_cloned(&logger_conv);
}
LDKCurrency network_conv = LDKCurrency_from_js(network);
void* amt_msat_ptr = untag_ptr(amt_msat);
description_hash_conv.is_owned = ptr_is_owned(description_hash);
CHECK_INNER_FIELD_ACCESS_OR_NULL(description_hash_conv);
description_hash_conv = Sha256_clone(&description_hash_conv);
+ void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta);
+ CHECK_ACCESS(min_final_cltv_expiry_delta_ptr);
+ LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr);
+ min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta));
LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
- *ret_conv = create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(&channelmanager_conv, keys_manager_conv, network_conv, amt_msat_conv, description_hash_conv, duration_since_epoch, invoice_expiry_delta_secs);
+ *ret_conv = create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(&channelmanager_conv, node_signer_conv, logger_conv, network_conv, amt_msat_conv, description_hash_conv, duration_since_epoch, invoice_expiry_delta_secs, min_final_cltv_expiry_delta_conv);
return tag_ptr(ret_conv, true);
}
-uint64_t __attribute__((export_name("TS_create_invoice_from_channelmanager_and_duration_since_epoch"))) TS_create_invoice_from_channelmanager_and_duration_since_epoch(uint64_t channelmanager, uint64_t keys_manager, uint32_t network, uint64_t amt_msat, jstring description, int64_t duration_since_epoch, int32_t invoice_expiry_delta_secs) {
+uint64_t __attribute__((export_name("TS_create_invoice_from_channelmanager_and_duration_since_epoch"))) TS_create_invoice_from_channelmanager_and_duration_since_epoch(uint64_t channelmanager, uint64_t node_signer, uint64_t logger, uint32_t network, uint64_t amt_msat, jstring description, int64_t duration_since_epoch, int32_t invoice_expiry_delta_secs, uint64_t min_final_cltv_expiry_delta) {
LDKChannelManager channelmanager_conv;
channelmanager_conv.inner = untag_ptr(channelmanager);
channelmanager_conv.is_owned = ptr_is_owned(channelmanager);
CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv);
channelmanager_conv.is_owned = false;
- void* keys_manager_ptr = untag_ptr(keys_manager);
- CHECK_ACCESS(keys_manager_ptr);
- LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr);
- if (keys_manager_conv.free == LDKKeysInterface_JCalls_free) {
+ void* node_signer_ptr = untag_ptr(node_signer);
+ CHECK_ACCESS(node_signer_ptr);
+ LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr);
+ if (node_signer_conv.free == LDKNodeSigner_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
- LDKKeysInterface_JCalls_cloned(&keys_manager_conv);
+ LDKNodeSigner_JCalls_cloned(&node_signer_conv);
+ }
+ void* logger_ptr = untag_ptr(logger);
+ CHECK_ACCESS(logger_ptr);
+ LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
+ if (logger_conv.free == LDKLogger_JCalls_free) {
+ // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
+ LDKLogger_JCalls_cloned(&logger_conv);
}
LDKCurrency network_conv = LDKCurrency_from_js(network);
void* amt_msat_ptr = untag_ptr(amt_msat);
LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr);
amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat));
LDKStr description_conv = str_ref_to_owned_c(description);
+ void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta);
+ CHECK_ACCESS(min_final_cltv_expiry_delta_ptr);
+ LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr);
+ min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta));
LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
- *ret_conv = create_invoice_from_channelmanager_and_duration_since_epoch(&channelmanager_conv, keys_manager_conv, network_conv, amt_msat_conv, description_conv, duration_since_epoch, invoice_expiry_delta_secs);
+ *ret_conv = create_invoice_from_channelmanager_and_duration_since_epoch(&channelmanager_conv, node_signer_conv, logger_conv, network_conv, amt_msat_conv, description_conv, duration_since_epoch, invoice_expiry_delta_secs, min_final_cltv_expiry_delta_conv);
return tag_ptr(ret_conv, true);
}
-void __attribute__((export_name("TS_DefaultRouter_free"))) TS_DefaultRouter_free(uint64_t this_obj) {
- LDKDefaultRouter this_obj_conv;
- this_obj_conv.inner = untag_ptr(this_obj);
- this_obj_conv.is_owned = ptr_is_owned(this_obj);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
- DefaultRouter_free(this_obj_conv);
-}
-
-uint64_t __attribute__((export_name("TS_DefaultRouter_new"))) TS_DefaultRouter_new(uint64_t network_graph, uint64_t logger, int8_tArray random_seed_bytes) {
- LDKNetworkGraph network_graph_conv;
- network_graph_conv.inner = untag_ptr(network_graph);
- network_graph_conv.is_owned = ptr_is_owned(network_graph);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv);
- network_graph_conv.is_owned = false;
+uint64_t __attribute__((export_name("TS_create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_hash"))) TS_create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_hash(uint64_t channelmanager, uint64_t node_signer, uint64_t logger, uint32_t network, uint64_t amt_msat, jstring description, int64_t duration_since_epoch, int32_t invoice_expiry_delta_secs, int8_tArray payment_hash, uint64_t min_final_cltv_expiry_delta) {
+ LDKChannelManager channelmanager_conv;
+ channelmanager_conv.inner = untag_ptr(channelmanager);
+ channelmanager_conv.is_owned = ptr_is_owned(channelmanager);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv);
+ channelmanager_conv.is_owned = false;
+ void* node_signer_ptr = untag_ptr(node_signer);
+ CHECK_ACCESS(node_signer_ptr);
+ LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr);
+ if (node_signer_conv.free == LDKNodeSigner_JCalls_free) {
+ // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
+ LDKNodeSigner_JCalls_cloned(&node_signer_conv);
+ }
void* logger_ptr = untag_ptr(logger);
CHECK_ACCESS(logger_ptr);
LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKLogger_JCalls_cloned(&logger_conv);
}
- LDKThirtyTwoBytes random_seed_bytes_ref;
- CHECK(random_seed_bytes->arr_len == 32);
- memcpy(random_seed_bytes_ref.data, random_seed_bytes->elems, 32); FREE(random_seed_bytes);
- LDKDefaultRouter ret_var = DefaultRouter_new(&network_graph_conv, logger_conv, random_seed_bytes_ref);
- uint64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
- return ret_ref;
-}
-
-uint64_t __attribute__((export_name("TS_DefaultRouter_as_Router"))) TS_DefaultRouter_as_Router(uint64_t this_arg) {
- LDKDefaultRouter this_arg_conv;
- this_arg_conv.inner = untag_ptr(this_arg);
- this_arg_conv.is_owned = ptr_is_owned(this_arg);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
- this_arg_conv.is_owned = false;
- LDKRouter* ret_ret = MALLOC(sizeof(LDKRouter), "LDKRouter");
- *ret_ret = DefaultRouter_as_Router(&this_arg_conv);
- return tag_ptr(ret_ret, true);
-}
-
-uint64_t __attribute__((export_name("TS_ChannelManager_as_Payer"))) TS_ChannelManager_as_Payer(uint64_t this_arg) {
- LDKChannelManager this_arg_conv;
- this_arg_conv.inner = untag_ptr(this_arg);
- this_arg_conv.is_owned = ptr_is_owned(this_arg);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
- this_arg_conv.is_owned = false;
- LDKPayer* ret_ret = MALLOC(sizeof(LDKPayer), "LDKPayer");
- *ret_ret = ChannelManager_as_Payer(&this_arg_conv);
- return tag_ptr(ret_ret, true);
+ LDKCurrency network_conv = LDKCurrency_from_js(network);
+ void* amt_msat_ptr = untag_ptr(amt_msat);
+ CHECK_ACCESS(amt_msat_ptr);
+ LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr);
+ amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat));
+ LDKStr description_conv = str_ref_to_owned_c(description);
+ LDKThirtyTwoBytes payment_hash_ref;
+ CHECK(payment_hash->arr_len == 32);
+ memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
+ void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta);
+ CHECK_ACCESS(min_final_cltv_expiry_delta_ptr);
+ LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr);
+ min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta));
+ LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
+ *ret_conv = create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_hash(&channelmanager_conv, node_signer_conv, logger_conv, network_conv, amt_msat_conv, description_conv, duration_since_epoch, invoice_expiry_delta_secs, payment_hash_ref, min_final_cltv_expiry_delta_conv);
+ return tag_ptr(ret_conv, true);
}
uint64_t __attribute__((export_name("TS_SiPrefix_from_str"))) TS_SiPrefix_from_str(jstring s) {