X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=ts%2Fbindings.c.body;fp=ts%2Fbindings.c.body;h=13b1d657ea105c56f0fdc2162a8d741a6c236388;hb=1a1849cb9b6e08f4ca8ba2ec4adea1f063bf248d;hp=81ffbe79c475c617670cd0796a4f1a0ff382636b;hpb=0b07fe133fc9956d0ce1b96ebdb927252858ddc4;p=ldk-java diff --git a/ts/bindings.c.body b/ts/bindings.c.body index 81ffbe79..13b1d657 100644 --- a/ts/bindings.c.body +++ b/ts/bindings.c.body @@ -360,6 +360,28 @@ static inline int32_t LDKNetwork_to_js(LDKNetwork val) { default: abort(); } } +static inline LDKPaymentFailureReason LDKPaymentFailureReason_from_js(int32_t ord) { + switch (ord) { + case 0: return LDKPaymentFailureReason_RecipientRejected; + case 1: return LDKPaymentFailureReason_UserAbandoned; + case 2: return LDKPaymentFailureReason_RetriesExhausted; + case 3: return LDKPaymentFailureReason_PaymentExpired; + case 4: return LDKPaymentFailureReason_RouteNotFound; + case 5: return LDKPaymentFailureReason_UnexpectedError; + } + abort(); +} +static inline int32_t LDKPaymentFailureReason_to_js(LDKPaymentFailureReason val) { + switch (val) { + case LDKPaymentFailureReason_RecipientRejected: return 0; + case LDKPaymentFailureReason_UserAbandoned: return 1; + case LDKPaymentFailureReason_RetriesExhausted: return 2; + case LDKPaymentFailureReason_PaymentExpired: return 3; + case LDKPaymentFailureReason_RouteNotFound: return 4; + case LDKPaymentFailureReason_UnexpectedError: return 5; + default: abort(); + } +} static inline LDKRecipient LDKRecipient_from_js(int32_t ord) { switch (ord) { case 0: return LDKRecipient_Node; @@ -550,6 +572,41 @@ uint64_t TxOut_get_value (struct LDKTxOut* thing) { return thing->value;}int64_t return ret_conv; } +uint32_t __attribute__((export_name("TS_LDKCOption_DurationZ_ty_from_ptr"))) TS_LDKCOption_DurationZ_ty_from_ptr(uint64_t ptr) { + LDKCOption_DurationZ *obj = (LDKCOption_DurationZ*)untag_ptr(ptr); + switch(obj->tag) { + case LDKCOption_DurationZ_Some: return 0; + case LDKCOption_DurationZ_None: return 1; + default: abort(); + } +} +int64_t __attribute__((export_name("TS_LDKCOption_DurationZ_Some_get_some"))) TS_LDKCOption_DurationZ_Some_get_some(uint64_t ptr) { + LDKCOption_DurationZ *obj = (LDKCOption_DurationZ*)untag_ptr(ptr); + assert(obj->tag == LDKCOption_DurationZ_Some); + int64_t some_conv = obj->some; + return some_conv; +} +static inline LDKCVec_BlindedPathZ CVec_BlindedPathZ_clone(const LDKCVec_BlindedPathZ *orig) { + LDKCVec_BlindedPathZ ret = { .data = MALLOC(sizeof(LDKBlindedPath) * orig->datalen, "LDKCVec_BlindedPathZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = BlindedPath_clone(&orig->data[i]); + } + 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; +} 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) { @@ -640,6 +697,67 @@ static inline LDKCVec_APIErrorZ CVec_APIErrorZ_clone(const LDKCVec_APIErrorZ *or } return ret; } +uint32_t __attribute__((export_name("TS_LDKCOption_CVec_u8ZZ_ty_from_ptr"))) TS_LDKCOption_CVec_u8ZZ_ty_from_ptr(uint64_t ptr) { + LDKCOption_CVec_u8ZZ *obj = (LDKCOption_CVec_u8ZZ*)untag_ptr(ptr); + switch(obj->tag) { + case LDKCOption_CVec_u8ZZ_Some: return 0; + case LDKCOption_CVec_u8ZZ_None: return 1; + default: abort(); + } +} +int8_tArray __attribute__((export_name("TS_LDKCOption_CVec_u8ZZ_Some_get_some"))) TS_LDKCOption_CVec_u8ZZ_Some_get_some(uint64_t ptr) { + LDKCOption_CVec_u8ZZ *obj = (LDKCOption_CVec_u8ZZ*)untag_ptr(ptr); + assert(obj->tag == LDKCOption_CVec_u8ZZ_Some); + LDKCVec_u8Z some_var = obj->some; + int8_tArray some_arr = init_int8_tArray(some_var.datalen, __LINE__); + memcpy(some_arr->elems, some_var.data, some_var.datalen); + return some_arr; +} +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 LDKRecipientOnionFields CResult_RecipientOnionFieldsDecodeErrorZ_get_ok(LDKCResult_RecipientOnionFieldsDecodeErrorZ *NONNULL_PTR owner){ + LDKRecipientOnionFields ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +uint64_t __attribute__((export_name("TS_CResult_RecipientOnionFieldsDecodeErrorZ_get_ok"))) TS_CResult_RecipientOnionFieldsDecodeErrorZ_get_ok(uint64_t owner) { + LDKCResult_RecipientOnionFieldsDecodeErrorZ* owner_conv = (LDKCResult_RecipientOnionFieldsDecodeErrorZ*)untag_ptr(owner); + LDKRecipientOnionFields ret_var = CResult_RecipientOnionFieldsDecodeErrorZ_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_RecipientOnionFieldsDecodeErrorZ_get_err(LDKCResult_RecipientOnionFieldsDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +uint64_t __attribute__((export_name("TS_CResult_RecipientOnionFieldsDecodeErrorZ_get_err"))) TS_CResult_RecipientOnionFieldsDecodeErrorZ_get_err(uint64_t owner) { + LDKCResult_RecipientOnionFieldsDecodeErrorZ* owner_conv = (LDKCResult_RecipientOnionFieldsDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_RecipientOnionFieldsDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + 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) { @@ -672,25 +790,6 @@ void __attribute__((export_name("TS_CResult_NoneNoneZ_get_err"))) TS_CResult_No 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; @@ -1067,77 +1166,28 @@ uint64_t __attribute__((export_name("TS_CResult_ShutdownScriptInvalidShutdownSc return ret_ref; } -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_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 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_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; +static inline struct LDKBlindedPayInfo CResult_BlindedPayInfoDecodeErrorZ_get_ok(LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR owner){ + LDKBlindedPayInfo 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 __attribute__((export_name("TS_CResult_BlindedPayInfoDecodeErrorZ_get_ok"))) TS_CResult_BlindedPayInfoDecodeErrorZ_get_ok(uint64_t owner) { + LDKCResult_BlindedPayInfoDecodeErrorZ* owner_conv = (LDKCResult_BlindedPayInfoDecodeErrorZ*)untag_ptr(owner); + LDKBlindedPayInfo ret_var = CResult_BlindedPayInfoDecodeErrorZ_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){ +static inline struct LDKDecodeError CResult_BlindedPayInfoDecodeErrorZ_get_err(LDKCResult_BlindedPayInfoDecodeErrorZ *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); +uint64_t __attribute__((export_name("TS_CResult_BlindedPayInfoDecodeErrorZ_get_err"))) TS_CResult_BlindedPayInfoDecodeErrorZ_get_err(uint64_t owner) { + LDKCResult_BlindedPayInfoDecodeErrorZ* owner_conv = (LDKCResult_BlindedPayInfoDecodeErrorZ*)untag_ptr(owner); LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_BlindedHopDecodeErrorZ_get_err(owner_conv); + *ret_copy = CResult_BlindedPayInfoDecodeErrorZ_get_err(owner_conv); uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -1177,27 +1227,6 @@ uint64_t __attribute__((export_name("TS_CResult_RouteLightningErrorZ_get_err")) return ret_ref; } -static inline LDKCVec_RouteHopZ CVec_RouteHopZ_clone(const LDKCVec_RouteHopZ *orig) { - LDKCVec_RouteHopZ ret = { .data = MALLOC(sizeof(LDKRouteHop) * orig->datalen, "LDKCVec_RouteHopZ clone bytes"), .datalen = orig->datalen }; - for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = RouteHop_clone(&orig->data[i]); - } - 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; @@ -1250,10 +1279,50 @@ uint64_t __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_get_err")) 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 }; +static inline LDKCVec_BlindedHopZ CVec_BlindedHopZ_clone(const LDKCVec_BlindedHopZ *orig) { + LDKCVec_BlindedHopZ ret = { .data = MALLOC(sizeof(LDKBlindedHop) * orig->datalen, "LDKCVec_BlindedHopZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = BlindedHop_clone(&orig->data[i]); + } + return ret; +} +static inline struct LDKBlindedTail CResult_BlindedTailDecodeErrorZ_get_ok(LDKCResult_BlindedTailDecodeErrorZ *NONNULL_PTR owner){ + LDKBlindedTail ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +uint64_t __attribute__((export_name("TS_CResult_BlindedTailDecodeErrorZ_get_ok"))) TS_CResult_BlindedTailDecodeErrorZ_get_ok(uint64_t owner) { + LDKCResult_BlindedTailDecodeErrorZ* owner_conv = (LDKCResult_BlindedTailDecodeErrorZ*)untag_ptr(owner); + LDKBlindedTail ret_var = CResult_BlindedTailDecodeErrorZ_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_BlindedTailDecodeErrorZ_get_err(LDKCResult_BlindedTailDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +uint64_t __attribute__((export_name("TS_CResult_BlindedTailDecodeErrorZ_get_err"))) TS_CResult_BlindedTailDecodeErrorZ_get_err(uint64_t owner) { + LDKCResult_BlindedTailDecodeErrorZ* owner_conv = (LDKCResult_BlindedTailDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_BlindedTailDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline LDKCVec_RouteHopZ CVec_RouteHopZ_clone(const LDKCVec_RouteHopZ *orig) { + LDKCVec_RouteHopZ ret = { .data = MALLOC(sizeof(LDKRouteHop) * orig->datalen, "LDKCVec_RouteHopZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = RouteHop_clone(&orig->data[i]); + } + return ret; +} +static inline LDKCVec_PathZ CVec_PathZ_clone(const LDKCVec_PathZ *orig) { + LDKCVec_PathZ ret = { .data = MALLOC(sizeof(LDKPath) * orig->datalen, "LDKCVec_PathZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = CVec_RouteHopZ_clone(&orig->data[i]); + ret.data[i] = Path_clone(&orig->data[i]); } return ret; } @@ -1309,13 +1378,6 @@ uint64_t __attribute__((export_name("TS_CResult_RouteParametersDecodeErrorZ_get return ret_ref; } -static inline LDKCVec_RouteHintZ CVec_RouteHintZ_clone(const LDKCVec_RouteHintZ *orig) { - LDKCVec_RouteHintZ ret = { .data = MALLOC(sizeof(LDKRouteHint) * orig->datalen, "LDKCVec_RouteHintZ clone bytes"), .datalen = orig->datalen }; - for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = RouteHint_clone(&orig->data[i]); - } - return ret; -} 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); @@ -1347,6 +1409,48 @@ uint64_t __attribute__((export_name("TS_CResult_PaymentParametersDecodeErrorZ_g return ret_ref; } +static inline struct LDKBlindedPayInfo C2Tuple_BlindedPayInfoBlindedPathZ_get_a(LDKC2Tuple_BlindedPayInfoBlindedPathZ *NONNULL_PTR owner){ + LDKBlindedPayInfo ret = owner->a; + ret.is_owned = false; + return ret; +} +uint64_t __attribute__((export_name("TS_C2Tuple_BlindedPayInfoBlindedPathZ_get_a"))) TS_C2Tuple_BlindedPayInfoBlindedPathZ_get_a(uint64_t owner) { + LDKC2Tuple_BlindedPayInfoBlindedPathZ* owner_conv = (LDKC2Tuple_BlindedPayInfoBlindedPathZ*)untag_ptr(owner); + LDKBlindedPayInfo ret_var = C2Tuple_BlindedPayInfoBlindedPathZ_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 LDKBlindedPath C2Tuple_BlindedPayInfoBlindedPathZ_get_b(LDKC2Tuple_BlindedPayInfoBlindedPathZ *NONNULL_PTR owner){ + LDKBlindedPath ret = owner->b; + ret.is_owned = false; + return ret; +} +uint64_t __attribute__((export_name("TS_C2Tuple_BlindedPayInfoBlindedPathZ_get_b"))) TS_C2Tuple_BlindedPayInfoBlindedPathZ_get_b(uint64_t owner) { + LDKC2Tuple_BlindedPayInfoBlindedPathZ* owner_conv = (LDKC2Tuple_BlindedPayInfoBlindedPathZ*)untag_ptr(owner); + LDKBlindedPath ret_var = C2Tuple_BlindedPayInfoBlindedPathZ_get_b(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_C2Tuple_BlindedPayInfoBlindedPathZZ CVec_C2Tuple_BlindedPayInfoBlindedPathZZ_clone(const LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ *orig) { + LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ) * orig->datalen, "LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = C2Tuple_BlindedPayInfoBlindedPathZ_clone(&orig->data[i]); + } + return ret; +} +static inline LDKCVec_RouteHintZ CVec_RouteHintZ_clone(const LDKCVec_RouteHintZ *orig) { + LDKCVec_RouteHintZ ret = { .data = MALLOC(sizeof(LDKRouteHint) * orig->datalen, "LDKCVec_RouteHintZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = RouteHint_clone(&orig->data[i]); + } + return ret; +} static inline LDKCVec_RouteHintHopZ CVec_RouteHintHopZ_clone(const LDKCVec_RouteHintHopZ *orig) { LDKCVec_RouteHintHopZ ret = { .data = MALLOC(sizeof(LDKRouteHintHop) * orig->datalen, "LDKCVec_RouteHintHopZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -1406,169 +1510,678 @@ uint64_t __attribute__((export_name("TS_CResult_RouteHintHopDecodeErrorZ_get_er return ret_ref; } -uint32_t __attribute__((export_name("TS_LDKPaymentPurpose_ty_from_ptr"))) TS_LDKPaymentPurpose_ty_from_ptr(uint64_t ptr) { - LDKPaymentPurpose *obj = (LDKPaymentPurpose*)untag_ptr(ptr); - switch(obj->tag) { - case LDKPaymentPurpose_InvoicePayment: return 0; - case LDKPaymentPurpose_SpontaneousPayment: return 1; - default: abort(); - } +static inline uintptr_t C2Tuple_usizeTransactionZ_get_a(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR owner){ + return owner->a; } -int8_tArray __attribute__((export_name("TS_LDKPaymentPurpose_InvoicePayment_get_payment_preimage"))) TS_LDKPaymentPurpose_InvoicePayment_get_payment_preimage(uint64_t ptr) { - LDKPaymentPurpose *obj = (LDKPaymentPurpose*)untag_ptr(ptr); - assert(obj->tag == LDKPaymentPurpose_InvoicePayment); - int8_tArray payment_preimage_arr = init_int8_tArray(32, __LINE__); - memcpy(payment_preimage_arr->elems, obj->invoice_payment.payment_preimage.data, 32); - return payment_preimage_arr; +uint32_t __attribute__((export_name("TS_C2Tuple_usizeTransactionZ_get_a"))) TS_C2Tuple_usizeTransactionZ_get_a(uint64_t owner) { + LDKC2Tuple_usizeTransactionZ* owner_conv = (LDKC2Tuple_usizeTransactionZ*)untag_ptr(owner); + uint32_t ret_conv = C2Tuple_usizeTransactionZ_get_a(owner_conv); + return ret_conv; } -int8_tArray __attribute__((export_name("TS_LDKPaymentPurpose_InvoicePayment_get_payment_secret"))) TS_LDKPaymentPurpose_InvoicePayment_get_payment_secret(uint64_t ptr) { - LDKPaymentPurpose *obj = (LDKPaymentPurpose*)untag_ptr(ptr); - assert(obj->tag == LDKPaymentPurpose_InvoicePayment); - int8_tArray payment_secret_arr = init_int8_tArray(32, __LINE__); - memcpy(payment_secret_arr->elems, obj->invoice_payment.payment_secret.data, 32); - return payment_secret_arr; + +static inline struct LDKTransaction C2Tuple_usizeTransactionZ_get_b(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR owner){ + return owner->b; } -int8_tArray __attribute__((export_name("TS_LDKPaymentPurpose_SpontaneousPayment_get_spontaneous_payment"))) TS_LDKPaymentPurpose_SpontaneousPayment_get_spontaneous_payment(uint64_t ptr) { - LDKPaymentPurpose *obj = (LDKPaymentPurpose*)untag_ptr(ptr); - assert(obj->tag == LDKPaymentPurpose_SpontaneousPayment); - int8_tArray spontaneous_payment_arr = init_int8_tArray(32, __LINE__); - memcpy(spontaneous_payment_arr->elems, obj->spontaneous_payment.data, 32); - return spontaneous_payment_arr; +int8_tArray __attribute__((export_name("TS_C2Tuple_usizeTransactionZ_get_b"))) TS_C2Tuple_usizeTransactionZ_get_b(uint64_t owner) { + LDKC2Tuple_usizeTransactionZ* owner_conv = (LDKC2Tuple_usizeTransactionZ*)untag_ptr(owner); + LDKTransaction ret_var = C2Tuple_usizeTransactionZ_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); + return ret_arr; } -static inline struct LDKPaymentPurpose CResult_PaymentPurposeDecodeErrorZ_get_ok(LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return PaymentPurpose_clone(&*owner->contents.result); + +static inline LDKCVec_C2Tuple_usizeTransactionZZ CVec_C2Tuple_usizeTransactionZZ_clone(const LDKCVec_C2Tuple_usizeTransactionZZ *orig) { + LDKCVec_C2Tuple_usizeTransactionZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ) * orig->datalen, "LDKCVec_C2Tuple_usizeTransactionZZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = C2Tuple_usizeTransactionZ_clone(&orig->data[i]); + } + return ret; } -uint64_t __attribute__((export_name("TS_CResult_PaymentPurposeDecodeErrorZ_get_ok"))) TS_CResult_PaymentPurposeDecodeErrorZ_get_ok(uint64_t owner) { - LDKCResult_PaymentPurposeDecodeErrorZ* owner_conv = (LDKCResult_PaymentPurposeDecodeErrorZ*)untag_ptr(owner); - LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose"); - *ret_copy = CResult_PaymentPurposeDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +static inline struct LDKThirtyTwoBytes C2Tuple_TxidBlockHashZ_get_a(LDKC2Tuple_TxidBlockHashZ *NONNULL_PTR owner){ + return ThirtyTwoBytes_clone(&owner->a); +} +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 struct LDKDecodeError CResult_PaymentPurposeDecodeErrorZ_get_err(LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return DecodeError_clone(&*owner->contents.err); +static inline struct LDKThirtyTwoBytes C2Tuple_TxidBlockHashZ_get_b(LDKC2Tuple_TxidBlockHashZ *NONNULL_PTR owner){ + return ThirtyTwoBytes_clone(&owner->b); } -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_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; +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; } -uint32_t __attribute__((export_name("TS_LDKNetworkUpdate_ty_from_ptr"))) TS_LDKNetworkUpdate_ty_from_ptr(uint64_t ptr) { - LDKNetworkUpdate *obj = (LDKNetworkUpdate*)untag_ptr(ptr); +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 LDKNetworkUpdate_ChannelUpdateMessage: return 0; - case LDKNetworkUpdate_ChannelFailure: return 1; - case LDKNetworkUpdate_NodeFailure: return 2; + case LDKMonitorEvent_HTLCEvent: return 0; + case LDKMonitorEvent_CommitmentTxConfirmed: return 1; + case LDKMonitorEvent_Completed: return 2; + case LDKMonitorEvent_UpdateFailed: return 3; 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; +uint64_t __attribute__((export_name("TS_LDKMonitorEvent_HTLCEvent_get_htlc_event"))) TS_LDKMonitorEvent_HTLCEvent_get_htlc_event(uint64_t ptr) { + LDKMonitorEvent *obj = (LDKMonitorEvent*)untag_ptr(ptr); + assert(obj->tag == LDKMonitorEvent_HTLCEvent); + LDKHTLCUpdate htlc_event_var = obj->htlc_event; + uint64_t htlc_event_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_event_var); + htlc_event_ref = tag_ptr(htlc_event_var.inner, false); + return htlc_event_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; +uint64_t __attribute__((export_name("TS_LDKMonitorEvent_CommitmentTxConfirmed_get_commitment_tx_confirmed"))) TS_LDKMonitorEvent_CommitmentTxConfirmed_get_commitment_tx_confirmed(uint64_t ptr) { + LDKMonitorEvent *obj = (LDKMonitorEvent*)untag_ptr(ptr); + assert(obj->tag == LDKMonitorEvent_CommitmentTxConfirmed); + LDKOutPoint commitment_tx_confirmed_var = obj->commitment_tx_confirmed; + uint64_t commitment_tx_confirmed_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_confirmed_var); + commitment_tx_confirmed_ref = tag_ptr(commitment_tx_confirmed_var.inner, false); + return commitment_tx_confirmed_ref; } -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; +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_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; } -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; +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_Completed); + int64_t monitor_update_id_conv = obj->completed.monitor_update_id; + return monitor_update_id_conv; } -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; +uint64_t __attribute__((export_name("TS_LDKMonitorEvent_UpdateFailed_get_update_failed"))) TS_LDKMonitorEvent_UpdateFailed_get_update_failed(uint64_t ptr) { + LDKMonitorEvent *obj = (LDKMonitorEvent*)untag_ptr(ptr); + assert(obj->tag == LDKMonitorEvent_UpdateFailed); + LDKOutPoint update_failed_var = obj->update_failed; + uint64_t update_failed_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_failed_var); + update_failed_ref = tag_ptr(update_failed_var.inner, false); + return update_failed_ref; } -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(); +static inline LDKCVec_MonitorEventZ CVec_MonitorEventZ_clone(const LDKCVec_MonitorEventZ *orig) { + LDKCVec_MonitorEventZ ret = { .data = MALLOC(sizeof(LDKMonitorEvent) * orig->datalen, "LDKCVec_MonitorEventZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = MonitorEvent_clone(&orig->data[i]); } + return ret; } -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; +static inline struct LDKOutPoint C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_a(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *NONNULL_PTR owner){ + LDKOutPoint ret = owner->a; + ret.is_owned = false; + return ret; } -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_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_a"))) TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_a(uint64_t owner) { + LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* owner_conv = (LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)untag_ptr(owner); + LDKOutPoint ret_var = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_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_MonitorEventZ C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_b(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *NONNULL_PTR owner){ + return CVec_MonitorEventZ_clone(&owner->b); +} +uint64_tArray __attribute__((export_name("TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_b"))) TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_b(uint64_t owner) { + LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* owner_conv = (LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)untag_ptr(owner); + LDKCVec_MonitorEventZ ret_var = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_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 o = 0; o < ret_var.datalen; o++) { + LDKMonitorEvent *ret_conv_14_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); + *ret_conv_14_copy = ret_var.data[o]; + uint64_t ret_conv_14_ref = tag_ptr(ret_conv_14_copy, true); + ret_arr_ptr[o] = ret_conv_14_ref; } + + FREE(ret_var.data); + return ret_arr; } -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; + +static inline struct LDKPublicKey C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_c(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *NONNULL_PTR owner){ + return owner->c; } -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; +int8_tArray __attribute__((export_name("TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_c"))) TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_c(uint64_t owner) { + LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* owner_conv = (LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)untag_ptr(owner); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_c(owner_conv).compressed_form, 33); + return ret_arr; } -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(); + +static inline LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ CVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ_clone(const LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ *orig) { + LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ ret = { .data = MALLOC(sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ) * orig->datalen, "LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone(&orig->data[i]); } + return ret; } -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); +static inline struct LDKFixedPenaltyScorer CResult_FixedPenaltyScorerDecodeErrorZ_get_ok(LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR owner){ + LDKFixedPenaltyScorer ret = *owner->contents.result; + ret.is_owned = false; + return ret; } -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); +uint64_t __attribute__((export_name("TS_CResult_FixedPenaltyScorerDecodeErrorZ_get_ok"))) TS_CResult_FixedPenaltyScorerDecodeErrorZ_get_ok(uint64_t owner) { + LDKCResult_FixedPenaltyScorerDecodeErrorZ* owner_conv = (LDKCResult_FixedPenaltyScorerDecodeErrorZ*)untag_ptr(owner); + LDKFixedPenaltyScorer ret_var = CResult_FixedPenaltyScorerDecodeErrorZ_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_COption_PathFailureZDecodeErrorZ_get_err(LDKCResult_COption_PathFailureZDecodeErrorZ *NONNULL_PTR owner){ +static inline struct LDKDecodeError CResult_FixedPenaltyScorerDecodeErrorZ_get_err(LDKCResult_FixedPenaltyScorerDecodeErrorZ *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"); +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_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; +} + +static inline uint64_t C2Tuple_u64u64Z_get_a(LDKC2Tuple_u64u64Z *NONNULL_PTR owner){ + return owner->a; +} +int64_t __attribute__((export_name("TS_C2Tuple_u64u64Z_get_a"))) TS_C2Tuple_u64u64Z_get_a(uint64_t owner) { + LDKC2Tuple_u64u64Z* owner_conv = (LDKC2Tuple_u64u64Z*)untag_ptr(owner); + int64_t ret_conv = C2Tuple_u64u64Z_get_a(owner_conv); + return ret_conv; +} + +static inline uint64_t C2Tuple_u64u64Z_get_b(LDKC2Tuple_u64u64Z *NONNULL_PTR owner){ + return owner->b; +} +int64_t __attribute__((export_name("TS_C2Tuple_u64u64Z_get_b"))) TS_C2Tuple_u64u64Z_get_b(uint64_t owner) { + LDKC2Tuple_u64u64Z* owner_conv = (LDKC2Tuple_u64u64Z*)untag_ptr(owner); + int64_t ret_conv = C2Tuple_u64u64Z_get_b(owner_conv); + return ret_conv; +} + +uint32_t __attribute__((export_name("TS_LDKCOption_C2Tuple_u64u64ZZ_ty_from_ptr"))) TS_LDKCOption_C2Tuple_u64u64ZZ_ty_from_ptr(uint64_t ptr) { + LDKCOption_C2Tuple_u64u64ZZ *obj = (LDKCOption_C2Tuple_u64u64ZZ*)untag_ptr(ptr); + switch(obj->tag) { + case LDKCOption_C2Tuple_u64u64ZZ_Some: return 0; + case LDKCOption_C2Tuple_u64u64ZZ_None: return 1; + default: abort(); + } +} +uint64_t __attribute__((export_name("TS_LDKCOption_C2Tuple_u64u64ZZ_Some_get_some"))) TS_LDKCOption_C2Tuple_u64u64ZZ_Some_get_some(uint64_t ptr) { + LDKCOption_C2Tuple_u64u64ZZ *obj = (LDKCOption_C2Tuple_u64u64ZZ*)untag_ptr(ptr); + assert(obj->tag == LDKCOption_C2Tuple_u64u64ZZ_Some); + LDKC2Tuple_u64u64Z* some_conv = MALLOC(sizeof(LDKC2Tuple_u64u64Z), "LDKC2Tuple_u64u64Z"); + *some_conv = obj->some; + *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++) { + ret.data[i] = NodeId_clone(&orig->data[i]); + } + return ret; +} +typedef struct LDKLogger_JCalls { + atomic_size_t refcnt; + uint32_t instance_ptr; +} LDKLogger_JCalls; +static void LDKLogger_JCalls_free(void* this_arg) { + LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) this_arg; + if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) { + FREE(j_calls); + } +} +void log_LDKLogger_jcall(const void* this_arg, const LDKRecord * record) { + LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) this_arg; + LDKRecord record_var = *record; + uint64_t record_ref = 0; + record_var = Record_clone(&record_var); + CHECK_INNER_FIELD_ACCESS_OR_NULL(record_var); + record_ref = tag_ptr(record_var.inner, record_var.is_owned); + js_invoke_function_buuuuu(j_calls->instance_ptr, 0, record_ref, 0, 0, 0, 0, 0); +} +static void LDKLogger_JCalls_cloned(LDKLogger* new_obj) { + LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) new_obj->this_arg; + atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); +} +static inline LDKLogger LDKLogger_init (JSValue o) { + LDKLogger_JCalls *calls = MALLOC(sizeof(LDKLogger_JCalls), "LDKLogger_JCalls"); + atomic_init(&calls->refcnt, 1); + calls->instance_ptr = o; + + LDKLogger ret = { + .this_arg = (void*) calls, + .log = log_LDKLogger_jcall, + .free = LDKLogger_JCalls_free, + }; + return ret; +} +uint64_t __attribute__((export_name("TS_LDKLogger_new"))) TS_LDKLogger_new(JSValue o) { + LDKLogger *res_ptr = MALLOC(sizeof(LDKLogger), "LDKLogger"); + *res_ptr = LDKLogger_init(o); + return tag_ptr(res_ptr, true); +} +static inline struct LDKProbabilisticScorer CResult_ProbabilisticScorerDecodeErrorZ_get_ok(LDKCResult_ProbabilisticScorerDecodeErrorZ *NONNULL_PTR owner){ + LDKProbabilisticScorer ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +uint64_t __attribute__((export_name("TS_CResult_ProbabilisticScorerDecodeErrorZ_get_ok"))) TS_CResult_ProbabilisticScorerDecodeErrorZ_get_ok(uint64_t owner) { + LDKCResult_ProbabilisticScorerDecodeErrorZ* owner_conv = (LDKCResult_ProbabilisticScorerDecodeErrorZ*)untag_ptr(owner); + LDKProbabilisticScorer ret_var = CResult_ProbabilisticScorerDecodeErrorZ_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_ProbabilisticScorerDecodeErrorZ_get_err(LDKCResult_ProbabilisticScorerDecodeErrorZ *NONNULL_PTR owner){ +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_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 LDKInitFeatures CResult_InitFeaturesDecodeErrorZ_get_ok(LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR owner){ + LDKInitFeatures ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +uint64_t __attribute__((export_name("TS_CResult_InitFeaturesDecodeErrorZ_get_ok"))) TS_CResult_InitFeaturesDecodeErrorZ_get_ok(uint64_t owner) { + LDKCResult_InitFeaturesDecodeErrorZ* owner_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)untag_ptr(owner); + LDKInitFeatures ret_var = CResult_InitFeaturesDecodeErrorZ_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_InitFeaturesDecodeErrorZ_get_err(LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR owner){ +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_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 LDKChannelFeatures CResult_ChannelFeaturesDecodeErrorZ_get_ok(LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR owner){ + LDKChannelFeatures ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +uint64_t __attribute__((export_name("TS_CResult_ChannelFeaturesDecodeErrorZ_get_ok"))) TS_CResult_ChannelFeaturesDecodeErrorZ_get_ok(uint64_t owner) { + LDKCResult_ChannelFeaturesDecodeErrorZ* owner_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)untag_ptr(owner); + LDKChannelFeatures ret_var = CResult_ChannelFeaturesDecodeErrorZ_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_ChannelFeaturesDecodeErrorZ_get_err(LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR owner){ +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_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 LDKNodeFeatures CResult_NodeFeaturesDecodeErrorZ_get_ok(LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR owner){ + LDKNodeFeatures ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +uint64_t __attribute__((export_name("TS_CResult_NodeFeaturesDecodeErrorZ_get_ok"))) TS_CResult_NodeFeaturesDecodeErrorZ_get_ok(uint64_t owner) { + LDKCResult_NodeFeaturesDecodeErrorZ* owner_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)untag_ptr(owner); + LDKNodeFeatures ret_var = CResult_NodeFeaturesDecodeErrorZ_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_NodeFeaturesDecodeErrorZ_get_err(LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR owner){ +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_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 LDKInvoiceFeatures CResult_InvoiceFeaturesDecodeErrorZ_get_ok(LDKCResult_InvoiceFeaturesDecodeErrorZ *NONNULL_PTR owner){ + LDKInvoiceFeatures ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +uint64_t __attribute__((export_name("TS_CResult_InvoiceFeaturesDecodeErrorZ_get_ok"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_get_ok(uint64_t owner) { + LDKCResult_InvoiceFeaturesDecodeErrorZ* owner_conv = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)untag_ptr(owner); + LDKInvoiceFeatures ret_var = CResult_InvoiceFeaturesDecodeErrorZ_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_InvoiceFeaturesDecodeErrorZ_get_err(LDKCResult_InvoiceFeaturesDecodeErrorZ *NONNULL_PTR owner){ +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_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; + return ret; +} +uint64_t __attribute__((export_name("TS_CResult_ChannelTypeFeaturesDecodeErrorZ_get_ok"))) TS_CResult_ChannelTypeFeaturesDecodeErrorZ_get_ok(uint64_t owner) { + LDKCResult_ChannelTypeFeaturesDecodeErrorZ* owner_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)untag_ptr(owner); + LDKChannelTypeFeatures ret_var = CResult_ChannelTypeFeaturesDecodeErrorZ_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_ChannelTypeFeaturesDecodeErrorZ_get_err(LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR owner){ +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_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; +} + +uint32_t __attribute__((export_name("TS_LDKPaymentPurpose_ty_from_ptr"))) TS_LDKPaymentPurpose_ty_from_ptr(uint64_t ptr) { + LDKPaymentPurpose *obj = (LDKPaymentPurpose*)untag_ptr(ptr); + switch(obj->tag) { + case LDKPaymentPurpose_InvoicePayment: return 0; + case LDKPaymentPurpose_SpontaneousPayment: return 1; + default: abort(); + } +} +int8_tArray __attribute__((export_name("TS_LDKPaymentPurpose_InvoicePayment_get_payment_preimage"))) TS_LDKPaymentPurpose_InvoicePayment_get_payment_preimage(uint64_t ptr) { + LDKPaymentPurpose *obj = (LDKPaymentPurpose*)untag_ptr(ptr); + assert(obj->tag == LDKPaymentPurpose_InvoicePayment); + int8_tArray payment_preimage_arr = init_int8_tArray(32, __LINE__); + memcpy(payment_preimage_arr->elems, obj->invoice_payment.payment_preimage.data, 32); + return payment_preimage_arr; +} +int8_tArray __attribute__((export_name("TS_LDKPaymentPurpose_InvoicePayment_get_payment_secret"))) TS_LDKPaymentPurpose_InvoicePayment_get_payment_secret(uint64_t ptr) { + LDKPaymentPurpose *obj = (LDKPaymentPurpose*)untag_ptr(ptr); + assert(obj->tag == LDKPaymentPurpose_InvoicePayment); + int8_tArray payment_secret_arr = init_int8_tArray(32, __LINE__); + memcpy(payment_secret_arr->elems, obj->invoice_payment.payment_secret.data, 32); + return payment_secret_arr; +} +int8_tArray __attribute__((export_name("TS_LDKPaymentPurpose_SpontaneousPayment_get_spontaneous_payment"))) TS_LDKPaymentPurpose_SpontaneousPayment_get_spontaneous_payment(uint64_t ptr) { + LDKPaymentPurpose *obj = (LDKPaymentPurpose*)untag_ptr(ptr); + assert(obj->tag == LDKPaymentPurpose_SpontaneousPayment); + int8_tArray spontaneous_payment_arr = init_int8_tArray(32, __LINE__); + memcpy(spontaneous_payment_arr->elems, obj->spontaneous_payment.data, 32); + return spontaneous_payment_arr; +} +static inline struct LDKPaymentPurpose CResult_PaymentPurposeDecodeErrorZ_get_ok(LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return PaymentPurpose_clone(&*owner->contents.result); +} +uint64_t __attribute__((export_name("TS_CResult_PaymentPurposeDecodeErrorZ_get_ok"))) TS_CResult_PaymentPurposeDecodeErrorZ_get_ok(uint64_t owner) { + LDKCResult_PaymentPurposeDecodeErrorZ* owner_conv = (LDKCResult_PaymentPurposeDecodeErrorZ*)untag_ptr(owner); + LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose"); + *ret_copy = CResult_PaymentPurposeDecodeErrorZ_get_ok(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){ +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_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; @@ -1588,12 +2201,14 @@ uint32_t __attribute__((export_name("TS_LDKClosureReason_ty_from_ptr"))) TS_LDKC default: abort(); } } -jstring __attribute__((export_name("TS_LDKClosureReason_CounterpartyForceClosed_get_peer_msg"))) TS_LDKClosureReason_CounterpartyForceClosed_get_peer_msg(uint64_t ptr) { +uint64_t __attribute__((export_name("TS_LDKClosureReason_CounterpartyForceClosed_get_peer_msg"))) TS_LDKClosureReason_CounterpartyForceClosed_get_peer_msg(uint64_t ptr) { LDKClosureReason *obj = (LDKClosureReason*)untag_ptr(ptr); assert(obj->tag == LDKClosureReason_CounterpartyForceClosed); - LDKStr peer_msg_str = obj->counterparty_force_closed.peer_msg; - jstring peer_msg_conv = str_ref_to_ts(peer_msg_str.chars, peer_msg_str.len); - return peer_msg_conv; + LDKUntrustedString peer_msg_var = obj->counterparty_force_closed.peer_msg; + uint64_t peer_msg_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(peer_msg_var); + peer_msg_ref = tag_ptr(peer_msg_var.inner, false); + return peer_msg_ref; } jstring __attribute__((export_name("TS_LDKClosureReason_ProcessingError_get_err"))) TS_LDKClosureReason_ProcessingError_get_err(uint64_t ptr) { LDKClosureReason *obj = (LDKClosureReason*)untag_ptr(ptr); @@ -1721,6 +2336,28 @@ uint64_t __attribute__((export_name("TS_CResult_COption_HTLCDestinationZDecodeE return ret_ref; } +static inline enum LDKPaymentFailureReason CResult_PaymentFailureReasonDecodeErrorZ_get_ok(LDKCResult_PaymentFailureReasonDecodeErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return PaymentFailureReason_clone(&*owner->contents.result); +} +uint32_t __attribute__((export_name("TS_CResult_PaymentFailureReasonDecodeErrorZ_get_ok"))) TS_CResult_PaymentFailureReasonDecodeErrorZ_get_ok(uint64_t owner) { + LDKCResult_PaymentFailureReasonDecodeErrorZ* owner_conv = (LDKCResult_PaymentFailureReasonDecodeErrorZ*)untag_ptr(owner); + uint32_t ret_conv = LDKPaymentFailureReason_to_js(CResult_PaymentFailureReasonDecodeErrorZ_get_ok(owner_conv)); + return ret_conv; +} + +static inline struct LDKDecodeError CResult_PaymentFailureReasonDecodeErrorZ_get_err(LDKCResult_PaymentFailureReasonDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +uint64_t __attribute__((export_name("TS_CResult_PaymentFailureReasonDecodeErrorZ_get_err"))) TS_CResult_PaymentFailureReasonDecodeErrorZ_get_err(uint64_t owner) { + LDKCResult_PaymentFailureReasonDecodeErrorZ* owner_conv = (LDKCResult_PaymentFailureReasonDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_PaymentFailureReasonDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + 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) { @@ -1736,6 +2373,20 @@ int8_tArray __attribute__((export_name("TS_LDKCOption_u128Z_Some_get_some"))) TS memcpy(some_arr->elems, obj->some.le_bytes, 16); return some_arr; } +uint32_t __attribute__((export_name("TS_LDKCOption_PaymentFailureReasonZ_ty_from_ptr"))) TS_LDKCOption_PaymentFailureReasonZ_ty_from_ptr(uint64_t ptr) { + LDKCOption_PaymentFailureReasonZ *obj = (LDKCOption_PaymentFailureReasonZ*)untag_ptr(ptr); + switch(obj->tag) { + case LDKCOption_PaymentFailureReasonZ_Some: return 0; + case LDKCOption_PaymentFailureReasonZ_None: return 1; + default: abort(); + } +} +uint32_t __attribute__((export_name("TS_LDKCOption_PaymentFailureReasonZ_Some_get_some"))) TS_LDKCOption_PaymentFailureReasonZ_Some_get_some(uint64_t ptr) { + LDKCOption_PaymentFailureReasonZ *obj = (LDKCOption_PaymentFailureReasonZ*)untag_ptr(ptr); + assert(obj->tag == LDKCOption_PaymentFailureReasonZ_Some); + uint32_t some_conv = LDKPaymentFailureReason_to_js(obj->some); + return some_conv; +} uint32_t __attribute__((export_name("TS_LDKSpendableOutputDescriptor_ty_from_ptr"))) TS_LDKSpendableOutputDescriptor_ty_from_ptr(uint64_t ptr) { LDKSpendableOutputDescriptor *obj = (LDKSpendableOutputDescriptor*)untag_ptr(ptr); switch(obj->tag) { @@ -1801,11 +2452,12 @@ uint32_t __attribute__((export_name("TS_LDKEvent_ty_from_ptr"))) TS_LDKEvent_ty_ 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; + case LDKEvent_ChannelPending: return 13; + case LDKEvent_ChannelReady: return 14; + case LDKEvent_ChannelClosed: return 15; + case LDKEvent_DiscardFunding: return 16; + case LDKEvent_OpenChannelRequest: return 17; + case LDKEvent_HTLCHandlingFailed: return 18; default: abort(); } } @@ -1858,6 +2510,15 @@ int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentClaimable_get_payment memcpy(payment_hash_arr->elems, obj->payment_claimable.payment_hash.data, 32); return payment_hash_arr; } +uint64_t __attribute__((export_name("TS_LDKEvent_PaymentClaimable_get_onion_fields"))) TS_LDKEvent_PaymentClaimable_get_onion_fields(uint64_t ptr) { + LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); + assert(obj->tag == LDKEvent_PaymentClaimable); + LDKRecipientOnionFields onion_fields_var = obj->payment_claimable.onion_fields; + uint64_t onion_fields_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(onion_fields_var); + onion_fields_ref = tag_ptr(onion_fields_var.inner, false); + return onion_fields_ref; +} 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_PaymentClaimable); @@ -1883,6 +2544,12 @@ uint64_t __attribute__((export_name("TS_LDKEvent_PaymentClaimable_get_via_user_c uint64_t via_user_channel_id_ref = tag_ptr(&obj->payment_claimable.via_user_channel_id, false); return via_user_channel_id_ref; } +uint64_t __attribute__((export_name("TS_LDKEvent_PaymentClaimable_get_claim_deadline"))) TS_LDKEvent_PaymentClaimable_get_claim_deadline(uint64_t ptr) { + LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); + assert(obj->tag == LDKEvent_PaymentClaimable); + uint64_t claim_deadline_ref = tag_ptr(&obj->payment_claimable.claim_deadline, false); + return claim_deadline_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); @@ -1950,6 +2617,12 @@ int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentFailed_get_payment_ha memcpy(payment_hash_arr->elems, obj->payment_failed.payment_hash.data, 32); return payment_hash_arr; } +uint64_t __attribute__((export_name("TS_LDKEvent_PaymentFailed_get_reason"))) TS_LDKEvent_PaymentFailed_get_reason(uint64_t ptr) { + LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); + assert(obj->tag == LDKEvent_PaymentFailed); + uint64_t reason_ref = tag_ptr(&obj->payment_failed.reason, false); + return reason_ref; +} int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentPathSuccessful_get_payment_id"))) TS_LDKEvent_PaymentPathSuccessful_get_payment_id(uint64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); assert(obj->tag == LDKEvent_PaymentPathSuccessful); @@ -1964,22 +2637,14 @@ int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentPathSuccessful_get_pa memcpy(payment_hash_arr->elems, obj->payment_path_successful.payment_hash.data, 32); return payment_hash_arr; } -uint64_tArray __attribute__((export_name("TS_LDKEvent_PaymentPathSuccessful_get_path"))) TS_LDKEvent_PaymentPathSuccessful_get_path(uint64_t ptr) { +uint64_t __attribute__((export_name("TS_LDKEvent_PaymentPathSuccessful_get_path"))) TS_LDKEvent_PaymentPathSuccessful_get_path(uint64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); assert(obj->tag == LDKEvent_PaymentPathSuccessful); - LDKCVec_RouteHopZ path_var = obj->payment_path_successful.path; - uint64_tArray path_arr = NULL; - path_arr = init_uint64_tArray(path_var.datalen, __LINE__); - uint64_t *path_arr_ptr = (uint64_t*)(((uint8_t*)path_arr) + 8); - for (size_t k = 0; k < path_var.datalen; k++) { - LDKRouteHop path_conv_10_var = path_var.data[k]; - uint64_t path_conv_10_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var); - path_conv_10_ref = tag_ptr(path_conv_10_var.inner, false); - path_arr_ptr[k] = path_conv_10_ref; - } - - return path_arr; + LDKPath path_var = obj->payment_path_successful.path; + uint64_t path_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_var); + path_ref = tag_ptr(path_var.inner, false); + return path_ref; } int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentPathFailed_get_payment_id"))) TS_LDKEvent_PaymentPathFailed_get_payment_id(uint64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); @@ -2007,22 +2672,14 @@ uint64_t __attribute__((export_name("TS_LDKEvent_PaymentPathFailed_get_failure") 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) { +uint64_t __attribute__((export_name("TS_LDKEvent_PaymentPathFailed_get_path"))) TS_LDKEvent_PaymentPathFailed_get_path(uint64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); assert(obj->tag == LDKEvent_PaymentPathFailed); - LDKCVec_RouteHopZ path_var = obj->payment_path_failed.path; - uint64_tArray path_arr = NULL; - path_arr = init_uint64_tArray(path_var.datalen, __LINE__); - uint64_t *path_arr_ptr = (uint64_t*)(((uint8_t*)path_arr) + 8); - for (size_t k = 0; k < path_var.datalen; k++) { - LDKRouteHop path_conv_10_var = path_var.data[k]; - uint64_t path_conv_10_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var); - path_conv_10_ref = tag_ptr(path_conv_10_var.inner, false); - path_arr_ptr[k] = path_conv_10_ref; - } - - return path_arr; + LDKPath path_var = obj->payment_path_failed.path; + uint64_t path_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_var); + path_ref = tag_ptr(path_var.inner, false); + return path_ref; } uint64_t __attribute__((export_name("TS_LDKEvent_PaymentPathFailed_get_short_channel_id"))) TS_LDKEvent_PaymentPathFailed_get_short_channel_id(uint64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); @@ -2030,15 +2687,6 @@ uint64_t __attribute__((export_name("TS_LDKEvent_PaymentPathFailed_get_short_cha uint64_t short_channel_id_ref = tag_ptr(&obj->payment_path_failed.short_channel_id, false); return short_channel_id_ref; } -uint64_t __attribute__((export_name("TS_LDKEvent_PaymentPathFailed_get_retry"))) TS_LDKEvent_PaymentPathFailed_get_retry(uint64_t ptr) { - LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); - assert(obj->tag == LDKEvent_PaymentPathFailed); - LDKRouteParameters retry_var = obj->payment_path_failed.retry; - uint64_t retry_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(retry_var); - retry_ref = tag_ptr(retry_var.inner, false); - return retry_ref; -} int8_tArray __attribute__((export_name("TS_LDKEvent_ProbeSuccessful_get_payment_id"))) TS_LDKEvent_ProbeSuccessful_get_payment_id(uint64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); assert(obj->tag == LDKEvent_ProbeSuccessful); @@ -2053,22 +2701,14 @@ int8_tArray __attribute__((export_name("TS_LDKEvent_ProbeSuccessful_get_payment_ memcpy(payment_hash_arr->elems, obj->probe_successful.payment_hash.data, 32); return payment_hash_arr; } -uint64_tArray __attribute__((export_name("TS_LDKEvent_ProbeSuccessful_get_path"))) TS_LDKEvent_ProbeSuccessful_get_path(uint64_t ptr) { +uint64_t __attribute__((export_name("TS_LDKEvent_ProbeSuccessful_get_path"))) TS_LDKEvent_ProbeSuccessful_get_path(uint64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); assert(obj->tag == LDKEvent_ProbeSuccessful); - LDKCVec_RouteHopZ path_var = obj->probe_successful.path; - uint64_tArray path_arr = NULL; - path_arr = init_uint64_tArray(path_var.datalen, __LINE__); - uint64_t *path_arr_ptr = (uint64_t*)(((uint8_t*)path_arr) + 8); - for (size_t k = 0; k < path_var.datalen; k++) { - LDKRouteHop path_conv_10_var = path_var.data[k]; - uint64_t path_conv_10_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var); - path_conv_10_ref = tag_ptr(path_conv_10_var.inner, false); - path_arr_ptr[k] = path_conv_10_ref; - } - - return path_arr; + LDKPath path_var = obj->probe_successful.path; + uint64_t path_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_var); + path_ref = tag_ptr(path_var.inner, false); + return path_ref; } int8_tArray __attribute__((export_name("TS_LDKEvent_ProbeFailed_get_payment_id"))) TS_LDKEvent_ProbeFailed_get_payment_id(uint64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); @@ -2084,22 +2724,14 @@ int8_tArray __attribute__((export_name("TS_LDKEvent_ProbeFailed_get_payment_hash memcpy(payment_hash_arr->elems, obj->probe_failed.payment_hash.data, 32); return payment_hash_arr; } -uint64_tArray __attribute__((export_name("TS_LDKEvent_ProbeFailed_get_path"))) TS_LDKEvent_ProbeFailed_get_path(uint64_t ptr) { +uint64_t __attribute__((export_name("TS_LDKEvent_ProbeFailed_get_path"))) TS_LDKEvent_ProbeFailed_get_path(uint64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); assert(obj->tag == LDKEvent_ProbeFailed); - LDKCVec_RouteHopZ path_var = obj->probe_failed.path; - uint64_tArray path_arr = NULL; - path_arr = init_uint64_tArray(path_var.datalen, __LINE__); - uint64_t *path_arr_ptr = (uint64_t*)(((uint8_t*)path_arr) + 8); - for (size_t k = 0; k < path_var.datalen; k++) { - LDKRouteHop path_conv_10_var = path_var.data[k]; - uint64_t path_conv_10_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var); - path_conv_10_ref = tag_ptr(path_conv_10_var.inner, false); - path_arr_ptr[k] = path_conv_10_ref; - } - - return path_arr; + LDKPath path_var = obj->probe_failed.path; + uint64_t path_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_var); + path_ref = tag_ptr(path_var.inner, false); + return path_ref; } uint64_t __attribute__((export_name("TS_LDKEvent_ProbeFailed_get_short_channel_id"))) TS_LDKEvent_ProbeFailed_get_short_channel_id(uint64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); @@ -2185,6 +2817,49 @@ jboolean __attribute__((export_name("TS_LDKEvent_PaymentForwarded_get_claim_from jboolean claim_from_onchain_tx_conv = obj->payment_forwarded.claim_from_onchain_tx; return claim_from_onchain_tx_conv; } +uint64_t __attribute__((export_name("TS_LDKEvent_PaymentForwarded_get_outbound_amount_forwarded_msat"))) TS_LDKEvent_PaymentForwarded_get_outbound_amount_forwarded_msat(uint64_t ptr) { + LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); + assert(obj->tag == LDKEvent_PaymentForwarded); + uint64_t outbound_amount_forwarded_msat_ref = tag_ptr(&obj->payment_forwarded.outbound_amount_forwarded_msat, false); + return outbound_amount_forwarded_msat_ref; +} +int8_tArray __attribute__((export_name("TS_LDKEvent_ChannelPending_get_channel_id"))) TS_LDKEvent_ChannelPending_get_channel_id(uint64_t ptr) { + LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); + assert(obj->tag == LDKEvent_ChannelPending); + int8_tArray channel_id_arr = init_int8_tArray(32, __LINE__); + memcpy(channel_id_arr->elems, obj->channel_pending.channel_id.data, 32); + return channel_id_arr; +} +int8_tArray __attribute__((export_name("TS_LDKEvent_ChannelPending_get_user_channel_id"))) TS_LDKEvent_ChannelPending_get_user_channel_id(uint64_t ptr) { + LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); + assert(obj->tag == LDKEvent_ChannelPending); + int8_tArray user_channel_id_arr = init_int8_tArray(16, __LINE__); + memcpy(user_channel_id_arr->elems, obj->channel_pending.user_channel_id.le_bytes, 16); + return user_channel_id_arr; +} +int8_tArray __attribute__((export_name("TS_LDKEvent_ChannelPending_get_former_temporary_channel_id"))) TS_LDKEvent_ChannelPending_get_former_temporary_channel_id(uint64_t ptr) { + LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); + assert(obj->tag == LDKEvent_ChannelPending); + int8_tArray former_temporary_channel_id_arr = init_int8_tArray(32, __LINE__); + memcpy(former_temporary_channel_id_arr->elems, obj->channel_pending.former_temporary_channel_id.data, 32); + return former_temporary_channel_id_arr; +} +int8_tArray __attribute__((export_name("TS_LDKEvent_ChannelPending_get_counterparty_node_id"))) TS_LDKEvent_ChannelPending_get_counterparty_node_id(uint64_t ptr) { + LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); + assert(obj->tag == LDKEvent_ChannelPending); + int8_tArray counterparty_node_id_arr = init_int8_tArray(33, __LINE__); + memcpy(counterparty_node_id_arr->elems, obj->channel_pending.counterparty_node_id.compressed_form, 33); + return counterparty_node_id_arr; +} +uint64_t __attribute__((export_name("TS_LDKEvent_ChannelPending_get_funding_txo"))) TS_LDKEvent_ChannelPending_get_funding_txo(uint64_t ptr) { + LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); + assert(obj->tag == LDKEvent_ChannelPending); + LDKOutPoint funding_txo_var = obj->channel_pending.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; +} 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); @@ -2751,748 +3426,267 @@ static inline LDKCVec_MessageSendEventZ CVec_MessageSendEventZ_clone(const LDKCV } return ret; } -static inline uintptr_t C2Tuple_usizeTransactionZ_get_a(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR owner){ - return owner->a; -} -uint32_t __attribute__((export_name("TS_C2Tuple_usizeTransactionZ_get_a"))) TS_C2Tuple_usizeTransactionZ_get_a(uint64_t owner) { - LDKC2Tuple_usizeTransactionZ* owner_conv = (LDKC2Tuple_usizeTransactionZ*)untag_ptr(owner); - uint32_t ret_conv = C2Tuple_usizeTransactionZ_get_a(owner_conv); - return ret_conv; -} - -static inline struct LDKTransaction C2Tuple_usizeTransactionZ_get_b(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR owner){ - return owner->b; -} -int8_tArray __attribute__((export_name("TS_C2Tuple_usizeTransactionZ_get_b"))) TS_C2Tuple_usizeTransactionZ_get_b(uint64_t owner) { - LDKC2Tuple_usizeTransactionZ* owner_conv = (LDKC2Tuple_usizeTransactionZ*)untag_ptr(owner); - LDKTransaction ret_var = C2Tuple_usizeTransactionZ_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); - return ret_arr; -} - -static inline LDKCVec_C2Tuple_usizeTransactionZZ CVec_C2Tuple_usizeTransactionZZ_clone(const LDKCVec_C2Tuple_usizeTransactionZZ *orig) { - LDKCVec_C2Tuple_usizeTransactionZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ) * orig->datalen, "LDKCVec_C2Tuple_usizeTransactionZZ clone bytes"), .datalen = orig->datalen }; +static inline LDKCVec_ChainHashZ CVec_ChainHashZ_clone(const LDKCVec_ChainHashZ *orig) { + LDKCVec_ChainHashZ ret = { .data = MALLOC(sizeof(LDKThirtyTwoBytes) * orig->datalen, "LDKCVec_ChainHashZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = C2Tuple_usizeTransactionZ_clone(&orig->data[i]); + ret.data[i] = ThirtyTwoBytes_clone(&orig->data[i]); } return ret; } -static inline struct LDKThirtyTwoBytes C2Tuple_TxidBlockHashZ_get_a(LDKC2Tuple_TxidBlockHashZ *NONNULL_PTR owner){ - return ThirtyTwoBytes_clone(&owner->a); +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_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); +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 struct LDKThirtyTwoBytes C2Tuple_TxidBlockHashZ_get_b(LDKC2Tuple_TxidBlockHashZ *NONNULL_PTR owner){ - return ThirtyTwoBytes_clone(&owner->b); +static inline enum LDKSecp256k1Error CResult_PublicKeyErrorZ_get_err(LDKCResult_PublicKeyErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return *owner->contents.err; } -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; +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 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_Completed: return 2; - case LDKMonitorEvent_UpdateFailed: return 3; - default: abort(); - } -} -uint64_t __attribute__((export_name("TS_LDKMonitorEvent_HTLCEvent_get_htlc_event"))) TS_LDKMonitorEvent_HTLCEvent_get_htlc_event(uint64_t ptr) { - LDKMonitorEvent *obj = (LDKMonitorEvent*)untag_ptr(ptr); - assert(obj->tag == LDKMonitorEvent_HTLCEvent); - LDKHTLCUpdate htlc_event_var = obj->htlc_event; - uint64_t htlc_event_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_event_var); - htlc_event_ref = tag_ptr(htlc_event_var.inner, false); - return htlc_event_ref; -} -uint64_t __attribute__((export_name("TS_LDKMonitorEvent_CommitmentTxConfirmed_get_commitment_tx_confirmed"))) TS_LDKMonitorEvent_CommitmentTxConfirmed_get_commitment_tx_confirmed(uint64_t ptr) { - LDKMonitorEvent *obj = (LDKMonitorEvent*)untag_ptr(ptr); - assert(obj->tag == LDKMonitorEvent_CommitmentTxConfirmed); - LDKOutPoint commitment_tx_confirmed_var = obj->commitment_tx_confirmed; - uint64_t commitment_tx_confirmed_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_confirmed_var); - commitment_tx_confirmed_ref = tag_ptr(commitment_tx_confirmed_var.inner, false); - return commitment_tx_confirmed_ref; -} -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_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_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_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) { - LDKMonitorEvent *obj = (LDKMonitorEvent*)untag_ptr(ptr); - assert(obj->tag == LDKMonitorEvent_UpdateFailed); - LDKOutPoint update_failed_var = obj->update_failed; - uint64_t update_failed_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(update_failed_var); - update_failed_ref = tag_ptr(update_failed_var.inner, false); - return update_failed_ref; -} -static inline LDKCVec_MonitorEventZ CVec_MonitorEventZ_clone(const LDKCVec_MonitorEventZ *orig) { - LDKCVec_MonitorEventZ ret = { .data = MALLOC(sizeof(LDKMonitorEvent) * orig->datalen, "LDKCVec_MonitorEventZ clone bytes"), .datalen = orig->datalen }; - for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = MonitorEvent_clone(&orig->data[i]); - } - return ret; -} -static inline struct LDKOutPoint C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_a(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *NONNULL_PTR owner){ - LDKOutPoint ret = owner->a; +static inline struct LDKNodeId CResult_NodeIdDecodeErrorZ_get_ok(LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR owner){ + LDKNodeId ret = *owner->contents.result; ret.is_owned = false; return ret; } -uint64_t __attribute__((export_name("TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_a"))) TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_a(uint64_t owner) { - LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* owner_conv = (LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)untag_ptr(owner); - LDKOutPoint ret_var = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_a(owner_conv); +uint64_t __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_get_ok"))) TS_CResult_NodeIdDecodeErrorZ_get_ok(uint64_t owner) { + LDKCResult_NodeIdDecodeErrorZ* owner_conv = (LDKCResult_NodeIdDecodeErrorZ*)untag_ptr(owner); + LDKNodeId ret_var = CResult_NodeIdDecodeErrorZ_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 LDKCVec_MonitorEventZ C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_b(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *NONNULL_PTR owner){ - return CVec_MonitorEventZ_clone(&owner->b); -} -uint64_tArray __attribute__((export_name("TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_b"))) TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_b(uint64_t owner) { - LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* owner_conv = (LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)untag_ptr(owner); - LDKCVec_MonitorEventZ ret_var = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_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 o = 0; o < ret_var.datalen; o++) { - LDKMonitorEvent *ret_conv_14_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); - *ret_conv_14_copy = ret_var.data[o]; - uint64_t ret_conv_14_ref = tag_ptr(ret_conv_14_copy, true); - ret_arr_ptr[o] = ret_conv_14_ref; - } - - FREE(ret_var.data); - return ret_arr; -} - -static inline struct LDKPublicKey C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_c(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *NONNULL_PTR owner){ - return owner->c; +static inline struct LDKDecodeError CResult_NodeIdDecodeErrorZ_get_err(LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } -int8_tArray __attribute__((export_name("TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_c"))) TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_c(uint64_t owner) { - LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* owner_conv = (LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)untag_ptr(owner); - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_c(owner_conv).compressed_form, 33); - return ret_arr; +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_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 LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ CVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ_clone(const LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ *orig) { - LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ ret = { .data = MALLOC(sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ) * orig->datalen, "LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ clone bytes"), .datalen = orig->datalen }; - for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone(&orig->data[i]); - } - return ret; -} -static inline struct LDKFixedPenaltyScorer CResult_FixedPenaltyScorerDecodeErrorZ_get_ok(LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR owner){ - LDKFixedPenaltyScorer ret = *owner->contents.result; - ret.is_owned = false; - return ret; +static inline struct LDKCOption_NetworkUpdateZ CResult_COption_NetworkUpdateZDecodeErrorZ_get_ok(LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return COption_NetworkUpdateZ_clone(&*owner->contents.result); } -uint64_t __attribute__((export_name("TS_CResult_FixedPenaltyScorerDecodeErrorZ_get_ok"))) TS_CResult_FixedPenaltyScorerDecodeErrorZ_get_ok(uint64_t owner) { - LDKCResult_FixedPenaltyScorerDecodeErrorZ* owner_conv = (LDKCResult_FixedPenaltyScorerDecodeErrorZ*)untag_ptr(owner); - LDKFixedPenaltyScorer ret_var = CResult_FixedPenaltyScorerDecodeErrorZ_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_COption_NetworkUpdateZDecodeErrorZ_get_ok"))) TS_CResult_COption_NetworkUpdateZDecodeErrorZ_get_ok(uint64_t owner) { + LDKCResult_COption_NetworkUpdateZDecodeErrorZ* owner_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)untag_ptr(owner); + LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ"); + *ret_copy = CResult_COption_NetworkUpdateZDecodeErrorZ_get_ok(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -static inline struct LDKDecodeError CResult_FixedPenaltyScorerDecodeErrorZ_get_err(LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR owner){ +static inline struct LDKDecodeError CResult_COption_NetworkUpdateZDecodeErrorZ_get_err(LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR owner){ 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); +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_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_FixedPenaltyScorerDecodeErrorZ_get_err(owner_conv); + *ret_copy = CResult_COption_NetworkUpdateZDecodeErrorZ_get_err(owner_conv); uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -static inline uint64_t C2Tuple_u64u64Z_get_a(LDKC2Tuple_u64u64Z *NONNULL_PTR owner){ - return owner->a; +static inline struct LDKTxOut CResult_TxOutUtxoLookupErrorZ_get_ok(LDKCResult_TxOutUtxoLookupErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return TxOut_clone(&*owner->contents.result); } -int64_t __attribute__((export_name("TS_C2Tuple_u64u64Z_get_a"))) TS_C2Tuple_u64u64Z_get_a(uint64_t owner) { - LDKC2Tuple_u64u64Z* owner_conv = (LDKC2Tuple_u64u64Z*)untag_ptr(owner); - int64_t ret_conv = C2Tuple_u64u64Z_get_a(owner_conv); - return ret_conv; +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 uint64_t C2Tuple_u64u64Z_get_b(LDKC2Tuple_u64u64Z *NONNULL_PTR owner){ - return owner->b; +static inline enum LDKUtxoLookupError CResult_TxOutUtxoLookupErrorZ_get_err(LDKCResult_TxOutUtxoLookupErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return UtxoLookupError_clone(&*owner->contents.err); } -int64_t __attribute__((export_name("TS_C2Tuple_u64u64Z_get_b"))) TS_C2Tuple_u64u64Z_get_b(uint64_t owner) { - LDKC2Tuple_u64u64Z* owner_conv = (LDKC2Tuple_u64u64Z*)untag_ptr(owner); - int64_t ret_conv = C2Tuple_u64u64Z_get_b(owner_conv); +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_LDKCOption_C2Tuple_u64u64ZZ_ty_from_ptr"))) TS_LDKCOption_C2Tuple_u64u64ZZ_ty_from_ptr(uint64_t ptr) { - LDKCOption_C2Tuple_u64u64ZZ *obj = (LDKCOption_C2Tuple_u64u64ZZ*)untag_ptr(ptr); - switch(obj->tag) { - case LDKCOption_C2Tuple_u64u64ZZ_Some: return 0; - case LDKCOption_C2Tuple_u64u64ZZ_None: return 1; - default: abort(); - } -} -uint64_t __attribute__((export_name("TS_LDKCOption_C2Tuple_u64u64ZZ_Some_get_some"))) TS_LDKCOption_C2Tuple_u64u64ZZ_Some_get_some(uint64_t ptr) { - LDKCOption_C2Tuple_u64u64ZZ *obj = (LDKCOption_C2Tuple_u64u64ZZ*)untag_ptr(ptr); - assert(obj->tag == LDKCOption_C2Tuple_u64u64ZZ_Some); - LDKC2Tuple_u64u64Z* some_conv = MALLOC(sizeof(LDKC2Tuple_u64u64Z), "LDKC2Tuple_u64u64Z"); - *some_conv = obj->some; - *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); +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 LDKCOption_C2Tuple_EightU16sEightU16sZZ_Some: return 0; - case LDKCOption_C2Tuple_EightU16sEightU16sZZ_None: return 1; + case LDKUtxoResult_Sync: return 0; + case LDKUtxoResult_Async: 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); +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); } -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++) { - ret.data[i] = NodeId_clone(&orig->data[i]); - } - return ret; +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 LDKLogger_JCalls { +typedef struct LDKUtxoLookup_JCalls { atomic_size_t refcnt; uint32_t instance_ptr; -} LDKLogger_JCalls; -static void LDKLogger_JCalls_free(void* this_arg) { - LDKLogger_JCalls *j_calls = (LDKLogger_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); } } -void log_LDKLogger_jcall(const void* this_arg, const LDKRecord * record) { - LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) this_arg; - LDKRecord record_var = *record; - uint64_t record_ref = 0; - record_var = Record_clone(&record_var); - CHECK_INNER_FIELD_ACCESS_OR_NULL(record_var); - record_ref = tag_ptr(record_var.inner, record_var.is_owned); - js_invoke_function_buuuuu(j_calls->instance_ptr, 0, record_ref, 0, 0, 0, 0, 0); +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; + 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); + LDKUtxoResult ret_conv = *(LDKUtxoResult*)(ret_ptr); + FREE(untag_ptr(ret)); + return ret_conv; } -static void LDKLogger_JCalls_cloned(LDKLogger* new_obj) { - LDKLogger_JCalls *j_calls = (LDKLogger_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 LDKLogger LDKLogger_init (JSValue o) { - LDKLogger_JCalls *calls = MALLOC(sizeof(LDKLogger_JCalls), "LDKLogger_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; - LDKLogger ret = { + LDKUtxoLookup ret = { .this_arg = (void*) calls, - .log = log_LDKLogger_jcall, - .free = LDKLogger_JCalls_free, + .get_utxo = get_utxo_LDKUtxoLookup_jcall, + .free = LDKUtxoLookup_JCalls_free, }; return ret; } -uint64_t __attribute__((export_name("TS_LDKLogger_new"))) TS_LDKLogger_new(JSValue o) { - LDKLogger *res_ptr = MALLOC(sizeof(LDKLogger), "LDKLogger"); - *res_ptr = LDKLogger_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); } -static inline struct LDKProbabilisticScorer CResult_ProbabilisticScorerDecodeErrorZ_get_ok(LDKCResult_ProbabilisticScorerDecodeErrorZ *NONNULL_PTR owner){ - LDKProbabilisticScorer ret = *owner->contents.result; +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); } + 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); + 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_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_UtxoLookupZ_Some: return 0; + case LDKCOption_UtxoLookupZ_None: return 1; + default: abort(); + } +} +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 == LDKUtxoLookup_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKUtxoLookup_JCalls_cloned(&(*some_ret)); + } + return tag_ptr(some_ret, true); +} +static inline bool CResult_boolLightningErrorZ_get_ok(LDKCResult_boolLightningErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return *owner->contents.result; +} +jboolean __attribute__((export_name("TS_CResult_boolLightningErrorZ_get_ok"))) TS_CResult_boolLightningErrorZ_get_ok(uint64_t owner) { + LDKCResult_boolLightningErrorZ* owner_conv = (LDKCResult_boolLightningErrorZ*)untag_ptr(owner); + jboolean ret_conv = CResult_boolLightningErrorZ_get_ok(owner_conv); + return ret_conv; +} + +static inline struct LDKLightningError CResult_boolLightningErrorZ_get_err(LDKCResult_boolLightningErrorZ *NONNULL_PTR owner){ + LDKLightningError ret = *owner->contents.err; ret.is_owned = false; return ret; } -uint64_t __attribute__((export_name("TS_CResult_ProbabilisticScorerDecodeErrorZ_get_ok"))) TS_CResult_ProbabilisticScorerDecodeErrorZ_get_ok(uint64_t owner) { - LDKCResult_ProbabilisticScorerDecodeErrorZ* owner_conv = (LDKCResult_ProbabilisticScorerDecodeErrorZ*)untag_ptr(owner); - LDKProbabilisticScorer ret_var = CResult_ProbabilisticScorerDecodeErrorZ_get_ok(owner_conv); +uint64_t __attribute__((export_name("TS_CResult_boolLightningErrorZ_get_err"))) TS_CResult_boolLightningErrorZ_get_err(uint64_t owner) { + LDKCResult_boolLightningErrorZ* owner_conv = (LDKCResult_boolLightningErrorZ*)untag_ptr(owner); + LDKLightningError ret_var = CResult_boolLightningErrorZ_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 LDKDecodeError CResult_ProbabilisticScorerDecodeErrorZ_get_err(LDKCResult_ProbabilisticScorerDecodeErrorZ *NONNULL_PTR owner){ -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_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 LDKInitFeatures CResult_InitFeaturesDecodeErrorZ_get_ok(LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR owner){ - LDKInitFeatures ret = *owner->contents.result; +static inline struct LDKChannelAnnouncement C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR owner){ + LDKChannelAnnouncement ret = owner->a; ret.is_owned = false; return ret; } -uint64_t __attribute__((export_name("TS_CResult_InitFeaturesDecodeErrorZ_get_ok"))) TS_CResult_InitFeaturesDecodeErrorZ_get_ok(uint64_t owner) { - LDKCResult_InitFeaturesDecodeErrorZ* owner_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)untag_ptr(owner); - LDKInitFeatures ret_var = CResult_InitFeaturesDecodeErrorZ_get_ok(owner_conv); +uint64_t __attribute__((export_name("TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a"))) TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(uint64_t owner) { + LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* owner_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)untag_ptr(owner); + LDKChannelAnnouncement ret_var = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_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 LDKDecodeError CResult_InitFeaturesDecodeErrorZ_get_err(LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return DecodeError_clone(&*owner->contents.err); +static inline struct LDKChannelUpdate C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR owner){ + LDKChannelUpdate ret = owner->b; + ret.is_owned = false; + return ret; } -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_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_InitFeaturesDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); +uint64_t __attribute__((export_name("TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b"))) TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b(uint64_t owner) { + LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* owner_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)untag_ptr(owner); + LDKChannelUpdate ret_var = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b(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 LDKChannelFeatures CResult_ChannelFeaturesDecodeErrorZ_get_ok(LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR owner){ - LDKChannelFeatures ret = *owner->contents.result; +static inline struct LDKChannelUpdate C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR owner){ + LDKChannelUpdate ret = owner->c; ret.is_owned = false; return ret; } -uint64_t __attribute__((export_name("TS_CResult_ChannelFeaturesDecodeErrorZ_get_ok"))) TS_CResult_ChannelFeaturesDecodeErrorZ_get_ok(uint64_t owner) { - LDKCResult_ChannelFeaturesDecodeErrorZ* owner_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)untag_ptr(owner); - LDKChannelFeatures ret_var = CResult_ChannelFeaturesDecodeErrorZ_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_ChannelFeaturesDecodeErrorZ_get_err(LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR owner){ -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_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 LDKNodeFeatures CResult_NodeFeaturesDecodeErrorZ_get_ok(LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR owner){ - LDKNodeFeatures ret = *owner->contents.result; - ret.is_owned = false; - return ret; -} -uint64_t __attribute__((export_name("TS_CResult_NodeFeaturesDecodeErrorZ_get_ok"))) TS_CResult_NodeFeaturesDecodeErrorZ_get_ok(uint64_t owner) { - LDKCResult_NodeFeaturesDecodeErrorZ* owner_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)untag_ptr(owner); - LDKNodeFeatures ret_var = CResult_NodeFeaturesDecodeErrorZ_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_NodeFeaturesDecodeErrorZ_get_err(LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR owner){ -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_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 LDKInvoiceFeatures CResult_InvoiceFeaturesDecodeErrorZ_get_ok(LDKCResult_InvoiceFeaturesDecodeErrorZ *NONNULL_PTR owner){ - LDKInvoiceFeatures ret = *owner->contents.result; - ret.is_owned = false; - return ret; -} -uint64_t __attribute__((export_name("TS_CResult_InvoiceFeaturesDecodeErrorZ_get_ok"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_get_ok(uint64_t owner) { - LDKCResult_InvoiceFeaturesDecodeErrorZ* owner_conv = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)untag_ptr(owner); - LDKInvoiceFeatures ret_var = CResult_InvoiceFeaturesDecodeErrorZ_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_InvoiceFeaturesDecodeErrorZ_get_err(LDKCResult_InvoiceFeaturesDecodeErrorZ *NONNULL_PTR owner){ -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_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; - return ret; -} -uint64_t __attribute__((export_name("TS_CResult_ChannelTypeFeaturesDecodeErrorZ_get_ok"))) TS_CResult_ChannelTypeFeaturesDecodeErrorZ_get_ok(uint64_t owner) { - LDKCResult_ChannelTypeFeaturesDecodeErrorZ* owner_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)untag_ptr(owner); - LDKChannelTypeFeatures ret_var = CResult_ChannelTypeFeaturesDecodeErrorZ_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_ChannelTypeFeaturesDecodeErrorZ_get_err(LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR owner){ -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_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 LDKNodeId CResult_NodeIdDecodeErrorZ_get_ok(LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR owner){ - LDKNodeId ret = *owner->contents.result; - ret.is_owned = false; - return ret; -} -uint64_t __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_get_ok"))) TS_CResult_NodeIdDecodeErrorZ_get_ok(uint64_t owner) { - LDKCResult_NodeIdDecodeErrorZ* owner_conv = (LDKCResult_NodeIdDecodeErrorZ*)untag_ptr(owner); - LDKNodeId ret_var = CResult_NodeIdDecodeErrorZ_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_NodeIdDecodeErrorZ_get_err(LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR owner){ -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_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 LDKCOption_NetworkUpdateZ CResult_COption_NetworkUpdateZDecodeErrorZ_get_ok(LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return COption_NetworkUpdateZ_clone(&*owner->contents.result); -} -uint64_t __attribute__((export_name("TS_CResult_COption_NetworkUpdateZDecodeErrorZ_get_ok"))) TS_CResult_COption_NetworkUpdateZDecodeErrorZ_get_ok(uint64_t owner) { - LDKCResult_COption_NetworkUpdateZDecodeErrorZ* owner_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)untag_ptr(owner); - LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ"); - *ret_copy = CResult_COption_NetworkUpdateZDecodeErrorZ_get_ok(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){ -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_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; -} - -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; -} 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); - } -} -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; - 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); - LDKUtxoResult ret_conv = *(LDKUtxoResult*)(ret_ptr); - FREE(untag_ptr(ret)); - return ret_conv; -} -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 LDKUtxoLookup LDKUtxoLookup_init (JSValue o) { - LDKUtxoLookup_JCalls *calls = MALLOC(sizeof(LDKUtxoLookup_JCalls), "LDKUtxoLookup_JCalls"); - atomic_init(&calls->refcnt, 1); - calls->instance_ptr = o; - - LDKUtxoLookup ret = { - .this_arg = (void*) calls, - .get_utxo = get_utxo_LDKUtxoLookup_jcall, - .free = LDKUtxoLookup_JCalls_free, - }; - return ret; -} -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_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); } - 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); - 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_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_UtxoLookupZ_Some: return 0; - case LDKCOption_UtxoLookupZ_None: return 1; - default: abort(); - } -} -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 == LDKUtxoLookup_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKUtxoLookup_JCalls_cloned(&(*some_ret)); - } - return tag_ptr(some_ret, true); -} -static inline bool CResult_boolLightningErrorZ_get_ok(LDKCResult_boolLightningErrorZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return *owner->contents.result; -} -jboolean __attribute__((export_name("TS_CResult_boolLightningErrorZ_get_ok"))) TS_CResult_boolLightningErrorZ_get_ok(uint64_t owner) { - LDKCResult_boolLightningErrorZ* owner_conv = (LDKCResult_boolLightningErrorZ*)untag_ptr(owner); - jboolean ret_conv = CResult_boolLightningErrorZ_get_ok(owner_conv); - return ret_conv; -} - -static inline struct LDKLightningError CResult_boolLightningErrorZ_get_err(LDKCResult_boolLightningErrorZ *NONNULL_PTR owner){ - LDKLightningError ret = *owner->contents.err; - ret.is_owned = false; - return ret; -} -uint64_t __attribute__((export_name("TS_CResult_boolLightningErrorZ_get_err"))) TS_CResult_boolLightningErrorZ_get_err(uint64_t owner) { - LDKCResult_boolLightningErrorZ* owner_conv = (LDKCResult_boolLightningErrorZ*)untag_ptr(owner); - LDKLightningError ret_var = CResult_boolLightningErrorZ_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 LDKChannelAnnouncement C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR owner){ - LDKChannelAnnouncement ret = owner->a; - ret.is_owned = false; - return ret; -} -uint64_t __attribute__((export_name("TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a"))) TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(uint64_t owner) { - LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* owner_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)untag_ptr(owner); - LDKChannelAnnouncement ret_var = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_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 LDKChannelUpdate C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR owner){ - LDKChannelUpdate ret = owner->b; - ret.is_owned = false; - return ret; -} -uint64_t __attribute__((export_name("TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b"))) TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b(uint64_t owner) { - LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* owner_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)untag_ptr(owner); - LDKChannelUpdate ret_var = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b(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 LDKChannelUpdate C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR owner){ - LDKChannelUpdate ret = owner->c; - ret.is_owned = false; - return ret; -} -uint64_t __attribute__((export_name("TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c"))) TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c(uint64_t owner) { - LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* owner_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)untag_ptr(owner); - LDKChannelUpdate ret_var = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c(owner_conv); +uint64_t __attribute__((export_name("TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c"))) TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c(uint64_t owner) { + LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* owner_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)untag_ptr(owner); + LDKChannelUpdate ret_var = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_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); @@ -6275,6 +6469,32 @@ uint64_t __attribute__((export_name("TS_CResult_COption_APIErrorZDecodeErrorZ_g return ret_ref; } +static inline struct LDKUntrustedString CResult_UntrustedStringDecodeErrorZ_get_ok(LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR owner){ + LDKUntrustedString ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +uint64_t __attribute__((export_name("TS_CResult_UntrustedStringDecodeErrorZ_get_ok"))) TS_CResult_UntrustedStringDecodeErrorZ_get_ok(uint64_t owner) { + LDKCResult_UntrustedStringDecodeErrorZ* owner_conv = (LDKCResult_UntrustedStringDecodeErrorZ*)untag_ptr(owner); + LDKUntrustedString ret_var = CResult_UntrustedStringDecodeErrorZ_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_UntrustedStringDecodeErrorZ_get_err(LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +uint64_t __attribute__((export_name("TS_CResult_UntrustedStringDecodeErrorZ_get_err"))) TS_CResult_UntrustedStringDecodeErrorZ_get_err(uint64_t owner) { + LDKCResult_UntrustedStringDecodeErrorZ* owner_conv = (LDKCResult_UntrustedStringDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_UntrustedStringDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + static inline struct LDKOutPoint CResult_OutPointDecodeErrorZ_get_ok(LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR owner){ LDKOutPoint ret = *owner->contents.result; ret.is_owned = false; @@ -6508,27 +6728,6 @@ uint32_t __attribute__((export_name("TS_CResult_StringErrorZ_get_err"))) TS_CRe 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 LDKChannelMonitorUpdate CResult_ChannelMonitorUpdateDecodeErrorZ_get_ok(LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR owner){ LDKChannelMonitorUpdate ret = *owner->contents.result; ret.is_owned = false; @@ -7192,384 +7391,126 @@ uint64_t __attribute__((export_name("TS_CResult_NoneSendErrorZ_get_err"))) TS_C return ret_ref; } -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 *owner->contents.result; -} -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 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_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; -} - -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; -} -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; -} -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; -} -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 enum LDKSiPrefix CResult_SiPrefixParseErrorZ_get_ok(LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return SiPrefix_clone(&*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)); - return ret_conv; -} - -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_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_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; +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_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_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 LDKParseOrSemanticError CResult_InvoiceParseOrSemanticErrorZ_get_err(LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR owner){ +static inline void CResult_BlindedPathNoneZ_get_err(LDKCResult_BlindedPathNoneZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); - return ParseOrSemanticError_clone(&*owner->contents.err); + return *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; +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 LDKSignedRawInvoice CResult_SignedRawInvoiceParseErrorZ_get_ok(LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR owner){ - LDKSignedRawInvoice ret = *owner->contents.result; +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_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 __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 LDKParseError CResult_SignedRawInvoiceParseErrorZ_get_err(LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR owner){ +static inline struct LDKDecodeError CResult_BlindedPathDecodeErrorZ_get_err(LDKCResult_BlindedPathDecodeErrorZ *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_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 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; +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_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 __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 enum LDKSecp256k1Error CResult_PayeePubKeyErrorZ_get_err(LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR owner){ +static inline struct LDKDecodeError CResult_BlindedHopDecodeErrorZ_get_err(LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); - return *owner->contents.err; + return DecodeError_clone(&*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; +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_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]); +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(); } - 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); +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; } -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; +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 void CResult_NoneSemanticErrorZ_get_ok(LDKCResult_NoneSemanticErrorZ *NONNULL_PTR owner){ +static inline uint32_t CResult_u32GraphSyncErrorZ_get_ok(LDKCResult_u32GraphSyncErrorZ *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)); +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 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){ +static inline struct LDKGraphSyncError CResult_u32GraphSyncErrorZ_get_err(LDKCResult_u32GraphSyncErrorZ *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; + return GraphSyncError_clone(&*owner->contents.err); } -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); +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 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; @@ -8525,53 +8466,6 @@ uint64_t __attribute__((export_name("TS_CResult_GossipTimestampFilterDecodeErro 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) { - case LDKSignOrCreationError_SignError: return 0; - case LDKSignOrCreationError_CreationError: return 1; - default: abort(); - } -} -uint32_t __attribute__((export_name("TS_LDKSignOrCreationError_CreationError_get_creation_error"))) TS_LDKSignOrCreationError_CreationError_get_creation_error(uint64_t ptr) { - LDKSignOrCreationError *obj = (LDKSignOrCreationError*)untag_ptr(ptr); - assert(obj->tag == LDKSignOrCreationError_CreationError); - uint32_t creation_error_conv = LDKCreationError_to_js(obj->creation_error); - return creation_error_conv; -} -static inline struct LDKInvoice CResult_InvoiceSignOrCreationErrorZ_get_ok(LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR owner){ - LDKInvoice ret = *owner->contents.result; - ret.is_owned = false; - return ret; -} -uint64_t __attribute__((export_name("TS_CResult_InvoiceSignOrCreationErrorZ_get_ok"))) TS_CResult_InvoiceSignOrCreationErrorZ_get_ok(uint64_t owner) { - LDKCResult_InvoiceSignOrCreationErrorZ* owner_conv = (LDKCResult_InvoiceSignOrCreationErrorZ*)untag_ptr(owner); - LDKInvoice ret_var = CResult_InvoiceSignOrCreationErrorZ_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 LDKSignOrCreationError CResult_InvoiceSignOrCreationErrorZ_get_err(LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return SignOrCreationError_clone(&*owner->contents.err); -} -uint64_t __attribute__((export_name("TS_CResult_InvoiceSignOrCreationErrorZ_get_err"))) TS_CResult_InvoiceSignOrCreationErrorZ_get_err(uint64_t owner) { - LDKCResult_InvoiceSignOrCreationErrorZ* owner_conv = (LDKCResult_InvoiceSignOrCreationErrorZ*)untag_ptr(owner); - LDKSignOrCreationError *ret_copy = MALLOC(sizeof(LDKSignOrCreationError), "LDKSignOrCreationError"); - *ret_copy = CResult_InvoiceSignOrCreationErrorZ_get_err(owner_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - typedef struct LDKFilter_JCalls { atomic_size_t refcnt; uint32_t instance_ptr; @@ -8747,349 +8641,470 @@ static inline LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ CVec_C2Tuple_OutPo } return ret; } -typedef struct LDKMessageSendEventsProvider_JCalls { - atomic_size_t refcnt; - uint32_t instance_ptr; -} LDKMessageSendEventsProvider_JCalls; -static void LDKMessageSendEventsProvider_JCalls_free(void* this_arg) { - LDKMessageSendEventsProvider_JCalls *j_calls = (LDKMessageSendEventsProvider_JCalls*) this_arg; - if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) { - FREE(j_calls); +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; } -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, 42, 0, 0, 0, 0, 0, 0); - LDKCVec_MessageSendEventZ ret_constr; - ret_constr.datalen = ret->arr_len; - if (ret_constr.datalen > 0) - ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKMessageSendEvent), "LDKCVec_MessageSendEventZ 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]; - void* ret_conv_18_ptr = untag_ptr(ret_conv_18); - CHECK_ACCESS(ret_conv_18_ptr); - LDKMessageSendEvent ret_conv_18_conv = *(LDKMessageSendEvent*)(ret_conv_18_ptr); - FREE(untag_ptr(ret_conv_18)); - ret_constr.data[s] = ret_conv_18_conv; +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) { + case LDKSignOrCreationError_SignError: return 0; + case LDKSignOrCreationError_CreationError: return 1; + default: abort(); } - FREE(ret); - return ret_constr; } -static void LDKMessageSendEventsProvider_JCalls_cloned(LDKMessageSendEventsProvider* new_obj) { - LDKMessageSendEventsProvider_JCalls *j_calls = (LDKMessageSendEventsProvider_JCalls*) new_obj->this_arg; - atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); +uint32_t __attribute__((export_name("TS_LDKSignOrCreationError_CreationError_get_creation_error"))) TS_LDKSignOrCreationError_CreationError_get_creation_error(uint64_t ptr) { + LDKSignOrCreationError *obj = (LDKSignOrCreationError*)untag_ptr(ptr); + assert(obj->tag == LDKSignOrCreationError_CreationError); + uint32_t creation_error_conv = LDKCreationError_to_js(obj->creation_error); + return creation_error_conv; } -static inline LDKMessageSendEventsProvider LDKMessageSendEventsProvider_init (JSValue o) { - LDKMessageSendEventsProvider_JCalls *calls = MALLOC(sizeof(LDKMessageSendEventsProvider_JCalls), "LDKMessageSendEventsProvider_JCalls"); - atomic_init(&calls->refcnt, 1); - calls->instance_ptr = o; - - LDKMessageSendEventsProvider ret = { - .this_arg = (void*) calls, - .get_and_clear_pending_msg_events = get_and_clear_pending_msg_events_LDKMessageSendEventsProvider_jcall, - .free = LDKMessageSendEventsProvider_JCalls_free, - }; +static inline struct LDKInvoice CResult_InvoiceSignOrCreationErrorZ_get_ok(LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR owner){ + LDKInvoice ret = *owner->contents.result; + ret.is_owned = false; return ret; } -uint64_t __attribute__((export_name("TS_LDKMessageSendEventsProvider_new"))) TS_LDKMessageSendEventsProvider_new(JSValue o) { - LDKMessageSendEventsProvider *res_ptr = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider"); - *res_ptr = LDKMessageSendEventsProvider_init(o); - return tag_ptr(res_ptr, true); +uint64_t __attribute__((export_name("TS_CResult_InvoiceSignOrCreationErrorZ_get_ok"))) TS_CResult_InvoiceSignOrCreationErrorZ_get_ok(uint64_t owner) { + LDKCResult_InvoiceSignOrCreationErrorZ* owner_conv = (LDKCResult_InvoiceSignOrCreationErrorZ*)untag_ptr(owner); + LDKInvoice ret_var = CResult_InvoiceSignOrCreationErrorZ_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; } -uint64_tArray __attribute__((export_name("TS_MessageSendEventsProvider_get_and_clear_pending_msg_events"))) TS_MessageSendEventsProvider_get_and_clear_pending_msg_events(uint64_t this_arg) { - void* this_arg_ptr = untag_ptr(this_arg); - if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } - LDKMessageSendEventsProvider* this_arg_conv = (LDKMessageSendEventsProvider*)this_arg_ptr; - LDKCVec_MessageSendEventZ ret_var = (this_arg_conv->get_and_clear_pending_msg_events)(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 s = 0; s < ret_var.datalen; s++) { - LDKMessageSendEvent *ret_conv_18_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_conv_18_copy = ret_var.data[s]; - uint64_t ret_conv_18_ref = tag_ptr(ret_conv_18_copy, true); - ret_arr_ptr[s] = ret_conv_18_ref; - } - - FREE(ret_var.data); - return ret_arr; + +static inline struct LDKSignOrCreationError CResult_InvoiceSignOrCreationErrorZ_get_err(LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return SignOrCreationError_clone(&*owner->contents.err); +} +uint64_t __attribute__((export_name("TS_CResult_InvoiceSignOrCreationErrorZ_get_err"))) TS_CResult_InvoiceSignOrCreationErrorZ_get_err(uint64_t owner) { + LDKCResult_InvoiceSignOrCreationErrorZ* owner_conv = (LDKCResult_InvoiceSignOrCreationErrorZ*)untag_ptr(owner); + LDKSignOrCreationError *ret_copy = MALLOC(sizeof(LDKSignOrCreationError), "LDKSignOrCreationError"); + *ret_copy = CResult_InvoiceSignOrCreationErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -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); +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(); } } -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); +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; +} +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; +} +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; +} +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 enum LDKSiPrefix CResult_SiPrefixParseErrorZ_get_ok(LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return SiPrefix_clone(&*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)); 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 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_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 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; +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_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_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; } -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); +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_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; } -typedef struct LDKEventHandler_JCalls { - atomic_size_t refcnt; - uint32_t instance_ptr; -} LDKEventHandler_JCalls; -static void LDKEventHandler_JCalls_free(void* this_arg) { - LDKEventHandler_JCalls *j_calls = (LDKEventHandler_JCalls*) this_arg; - if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) { - FREE(j_calls); - } -} -void handle_event_LDKEventHandler_jcall(const void* this_arg, LDKEvent event) { - LDKEventHandler_JCalls *j_calls = (LDKEventHandler_JCalls*) this_arg; - 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 inline struct LDKParseOrSemanticError CResult_InvoiceParseOrSemanticErrorZ_get_err(LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return ParseOrSemanticError_clone(&*owner->contents.err); } -static void LDKEventHandler_JCalls_cloned(LDKEventHandler* new_obj) { - LDKEventHandler_JCalls *j_calls = (LDKEventHandler_JCalls*) new_obj->this_arg; - atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); +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 LDKEventHandler LDKEventHandler_init (JSValue o) { - LDKEventHandler_JCalls *calls = MALLOC(sizeof(LDKEventHandler_JCalls), "LDKEventHandler_JCalls"); - atomic_init(&calls->refcnt, 1); - calls->instance_ptr = o; - LDKEventHandler ret = { - .this_arg = (void*) calls, - .handle_event = handle_event_LDKEventHandler_jcall, - .free = LDKEventHandler_JCalls_free, - }; +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_LDKEventHandler_new"))) TS_LDKEventHandler_new(JSValue o) { - LDKEventHandler *res_ptr = MALLOC(sizeof(LDKEventHandler), "LDKEventHandler"); - *res_ptr = LDKEventHandler_init(o); - return tag_ptr(res_ptr, true); +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; } -void __attribute__((export_name("TS_EventHandler_handle_event"))) TS_EventHandler_handle_event(uint64_t this_arg, uint64_t event) { - 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; - 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); + +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; } -typedef struct LDKEventsProvider_JCalls { - atomic_size_t refcnt; - uint32_t instance_ptr; -} LDKEventsProvider_JCalls; -static void LDKEventsProvider_JCalls_free(void* this_arg) { - LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) this_arg; - if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) { - FREE(j_calls); - } +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; } -void process_pending_events_LDKEventsProvider_jcall(const void* this_arg, LDKEventHandler handler) { - 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, 45, tag_ptr(handler_ret, true), 0, 0, 0, 0, 0); +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 void LDKEventsProvider_JCalls_cloned(LDKEventsProvider* new_obj) { - LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) new_obj->this_arg; - atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); + +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 LDKEventsProvider LDKEventsProvider_init (JSValue o) { - LDKEventsProvider_JCalls *calls = MALLOC(sizeof(LDKEventsProvider_JCalls), "LDKEventsProvider_JCalls"); - atomic_init(&calls->refcnt, 1); - calls->instance_ptr = o; - LDKEventsProvider ret = { - .this_arg = (void*) calls, - .process_pending_events = process_pending_events_LDKEventsProvider_jcall, - .free = LDKEventsProvider_JCalls_free, - }; +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_LDKEventsProvider_new"))) TS_LDKEventsProvider_new(JSValue o) { - LDKEventsProvider *res_ptr = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider"); - *res_ptr = LDKEventsProvider_init(o); - return tag_ptr(res_ptr, true); -} -void __attribute__((export_name("TS_EventsProvider_process_pending_events"))) TS_EventsProvider_process_pending_events(uint64_t this_arg, uint64_t handler) { - void* this_arg_ptr = untag_ptr(this_arg); - if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } - LDKEventsProvider* this_arg_conv = (LDKEventsProvider*)this_arg_ptr; - void* handler_ptr = untag_ptr(handler); - CHECK_ACCESS(handler_ptr); - LDKEventHandler handler_conv = *(LDKEventHandler*)(handler_ptr); - if (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(&handler_conv); - } - (this_arg_conv->process_pending_events)(this_arg_conv->this_arg, handler_conv); +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; } -typedef struct LDKScore_JCalls { - atomic_size_t refcnt; - uint32_t instance_ptr; -} LDKScore_JCalls; -static void LDKScore_JCalls_free(void* this_arg) { - LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg; - if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) { - FREE(j_calls); - } +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 channel_penalty_msat_LDKScore_jcall(const void* this_arg, uint64_t short_channel_id, const LDKNodeId * source, const LDKNodeId * target, LDKChannelUsage usage) { - LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg; - int64_t short_channel_id_conv = short_channel_id; - LDKNodeId source_var = *source; - uint64_t source_ref = 0; - source_var = NodeId_clone(&source_var); - CHECK_INNER_FIELD_ACCESS_OR_NULL(source_var); - source_ref = tag_ptr(source_var.inner, source_var.is_owned); - LDKNodeId target_var = *target; - uint64_t target_ref = 0; - target_var = NodeId_clone(&target_var); - CHECK_INNER_FIELD_ACCESS_OR_NULL(target_var); - target_ref = tag_ptr(target_var.inner, target_var.is_owned); - LDKChannelUsage usage_var = usage; - 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, 46, short_channel_id_conv, source_ref, target_ref, usage_ref, 0, 0); +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; } -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; - LDKCVec_RouteHopZ path_var = path; - uint64_tArray path_arr = NULL; - path_arr = init_uint64_tArray(path_var.datalen, __LINE__); - uint64_t *path_arr_ptr = (uint64_t*)(((uint8_t*)path_arr) + 8); - for (size_t k = 0; k < path_var.datalen; k++) { - LDKRouteHop path_conv_10_var = path_var.data[k]; - uint64_t path_conv_10_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var); - path_conv_10_ref = tag_ptr(path_conv_10_var.inner, path_conv_10_var.is_owned); - path_arr_ptr[k] = path_conv_10_ref; - } - - FREE(path_var.data); - int64_t short_channel_id_conv = short_channel_id; - js_invoke_function_ubuuuu(j_calls->instance_ptr, 47, (uint32_t)path_arr, short_channel_id_conv, 0, 0, 0, 0); + +static inline enum LDKSecp256k1Error CResult_PayeePubKeyErrorZ_get_err(LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return *owner->contents.err; } -void payment_path_successful_LDKScore_jcall(void* this_arg, LDKCVec_RouteHopZ path) { - LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg; - LDKCVec_RouteHopZ path_var = path; - uint64_tArray path_arr = NULL; - path_arr = init_uint64_tArray(path_var.datalen, __LINE__); - uint64_t *path_arr_ptr = (uint64_t*)(((uint8_t*)path_arr) + 8); - for (size_t k = 0; k < path_var.datalen; k++) { - LDKRouteHop path_conv_10_var = path_var.data[k]; - uint64_t path_conv_10_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var); - path_conv_10_ref = tag_ptr(path_conv_10_var.inner, path_conv_10_var.is_owned); - path_arr_ptr[k] = path_conv_10_ref; - } - - FREE(path_var.data); - js_invoke_function_uuuuuu(j_calls->instance_ptr, 48, (uint32_t)path_arr, 0, 0, 0, 0, 0); +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; } -void probe_failed_LDKScore_jcall(void* this_arg, LDKCVec_RouteHopZ path, uint64_t short_channel_id) { - LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg; - LDKCVec_RouteHopZ path_var = path; - uint64_tArray path_arr = NULL; - path_arr = init_uint64_tArray(path_var.datalen, __LINE__); - uint64_t *path_arr_ptr = (uint64_t*)(((uint8_t*)path_arr) + 8); - for (size_t k = 0; k < path_var.datalen; k++) { - LDKRouteHop path_conv_10_var = path_var.data[k]; - uint64_t path_conv_10_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var); - path_conv_10_ref = tag_ptr(path_conv_10_var.inner, path_conv_10_var.is_owned); - path_arr_ptr[k] = path_conv_10_ref; + +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]); } - - FREE(path_var.data); - int64_t short_channel_id_conv = short_channel_id; - js_invoke_function_ubuuuu(j_calls->instance_ptr, 49, (uint32_t)path_arr, short_channel_id_conv, 0, 0, 0, 0); + return ret; } -void probe_successful_LDKScore_jcall(void* this_arg, LDKCVec_RouteHopZ path) { - LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg; - LDKCVec_RouteHopZ path_var = path; - uint64_tArray path_arr = NULL; - path_arr = init_uint64_tArray(path_var.datalen, __LINE__); - uint64_t *path_arr_ptr = (uint64_t*)(((uint8_t*)path_arr) + 8); - for (size_t k = 0; k < path_var.datalen; k++) { - LDKRouteHop path_conv_10_var = path_var.data[k]; - uint64_t path_conv_10_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var); - path_conv_10_ref = tag_ptr(path_conv_10_var.inner, path_conv_10_var.is_owned); - path_arr_ptr[k] = path_conv_10_ref; - } - - FREE(path_var.data); - js_invoke_function_uuuuuu(j_calls->instance_ptr, 50, (uint32_t)path_arr, 0, 0, 0, 0, 0); +static inline struct LDKPositiveTimestamp CResult_PositiveTimestampCreationErrorZ_get_ok(LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR owner){ + LDKPositiveTimestamp ret = *owner->contents.result; + ret.is_owned = false; + return ret; } -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, 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"); - memcpy(ret_ref.data, ret->elems, ret_ref.datalen); FREE(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 void LDKScore_JCalls_cloned(LDKScore* new_obj) { - LDKScore_JCalls *j_calls = (LDKScore_JCalls*) new_obj->this_arg; - atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); -} -static inline LDKScore LDKScore_init (JSValue o) { - LDKScore_JCalls *calls = MALLOC(sizeof(LDKScore_JCalls), "LDKScore_JCalls"); - atomic_init(&calls->refcnt, 1); - calls->instance_ptr = o; + +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; +} + +typedef struct LDKScore_JCalls { + atomic_size_t refcnt; + uint32_t instance_ptr; +} LDKScore_JCalls; +static void LDKScore_JCalls_free(void* this_arg) { + LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg; + if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) { + FREE(j_calls); + } +} +uint64_t channel_penalty_msat_LDKScore_jcall(const void* this_arg, uint64_t short_channel_id, const LDKNodeId * source, const LDKNodeId * target, LDKChannelUsage usage) { + LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg; + int64_t short_channel_id_conv = short_channel_id; + LDKNodeId source_var = *source; + uint64_t source_ref = 0; + source_var = NodeId_clone(&source_var); + CHECK_INNER_FIELD_ACCESS_OR_NULL(source_var); + source_ref = tag_ptr(source_var.inner, source_var.is_owned); + LDKNodeId target_var = *target; + uint64_t target_ref = 0; + target_var = NodeId_clone(&target_var); + CHECK_INNER_FIELD_ACCESS_OR_NULL(target_var); + target_ref = tag_ptr(target_var.inner, target_var.is_owned); + LDKChannelUsage usage_var = usage; + 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, 42, short_channel_id_conv, source_ref, target_ref, usage_ref, 0, 0); +} +void payment_path_failed_LDKScore_jcall(void* this_arg, const LDKPath * path, uint64_t short_channel_id) { + LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg; + LDKPath path_var = *path; + uint64_t path_ref = 0; + path_var = Path_clone(&path_var); + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_var); + path_ref = tag_ptr(path_var.inner, path_var.is_owned); + int64_t short_channel_id_conv = short_channel_id; + js_invoke_function_bbuuuu(j_calls->instance_ptr, 43, path_ref, short_channel_id_conv, 0, 0, 0, 0); +} +void payment_path_successful_LDKScore_jcall(void* this_arg, const LDKPath * path) { + LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg; + LDKPath path_var = *path; + uint64_t path_ref = 0; + path_var = Path_clone(&path_var); + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_var); + path_ref = tag_ptr(path_var.inner, path_var.is_owned); + js_invoke_function_buuuuu(j_calls->instance_ptr, 44, path_ref, 0, 0, 0, 0, 0); +} +void probe_failed_LDKScore_jcall(void* this_arg, const LDKPath * path, uint64_t short_channel_id) { + LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg; + LDKPath path_var = *path; + uint64_t path_ref = 0; + path_var = Path_clone(&path_var); + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_var); + path_ref = tag_ptr(path_var.inner, path_var.is_owned); + int64_t short_channel_id_conv = short_channel_id; + js_invoke_function_bbuuuu(j_calls->instance_ptr, 45, path_ref, short_channel_id_conv, 0, 0, 0, 0); +} +void probe_successful_LDKScore_jcall(void* this_arg, const LDKPath * path) { + LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg; + LDKPath path_var = *path; + uint64_t path_ref = 0; + path_var = Path_clone(&path_var); + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_var); + path_ref = tag_ptr(path_var.inner, path_var.is_owned); + js_invoke_function_buuuuu(j_calls->instance_ptr, 46, path_ref, 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, 47, 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 LDKScore_JCalls_cloned(LDKScore* new_obj) { + LDKScore_JCalls *j_calls = (LDKScore_JCalls*) new_obj->this_arg; + atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); +} +static inline LDKScore LDKScore_init (JSValue o) { + LDKScore_JCalls *calls = MALLOC(sizeof(LDKScore_JCalls), "LDKScore_JCalls"); + atomic_init(&calls->refcnt, 1); + calls->instance_ptr = o; LDKScore ret = { .this_arg = (void*) calls, @@ -9131,100 +9146,52 @@ int64_t __attribute__((export_name("TS_Score_channel_penalty_msat"))) TS_Score_ return ret_conv; } -void __attribute__((export_name("TS_Score_payment_path_failed"))) TS_Score_payment_path_failed(uint64_t this_arg, uint64_tArray path, int64_t short_channel_id) { +void __attribute__((export_name("TS_Score_payment_path_failed"))) TS_Score_payment_path_failed(uint64_t this_arg, uint64_t path, int64_t short_channel_id) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr; - LDKCVec_RouteHopZ path_constr; - path_constr.datalen = path->arr_len; - if (path_constr.datalen > 0) - path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements"); - else - path_constr.data = NULL; - uint64_t* path_vals = path->elems; - for (size_t k = 0; k < path_constr.datalen; k++) { - uint64_t path_conv_10 = path_vals[k]; - LDKRouteHop path_conv_10_conv; - path_conv_10_conv.inner = untag_ptr(path_conv_10); - path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10); - CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv); - path_conv_10_conv = RouteHop_clone(&path_conv_10_conv); - path_constr.data[k] = path_conv_10_conv; - } - FREE(path); - (this_arg_conv->payment_path_failed)(this_arg_conv->this_arg, path_constr, short_channel_id); -} - -void __attribute__((export_name("TS_Score_payment_path_successful"))) TS_Score_payment_path_successful(uint64_t this_arg, uint64_tArray path) { + LDKPath path_conv; + path_conv.inner = untag_ptr(path); + path_conv.is_owned = ptr_is_owned(path); + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); + path_conv.is_owned = false; + (this_arg_conv->payment_path_failed)(this_arg_conv->this_arg, &path_conv, short_channel_id); +} + +void __attribute__((export_name("TS_Score_payment_path_successful"))) TS_Score_payment_path_successful(uint64_t this_arg, uint64_t path) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr; - LDKCVec_RouteHopZ path_constr; - path_constr.datalen = path->arr_len; - if (path_constr.datalen > 0) - path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements"); - else - path_constr.data = NULL; - uint64_t* path_vals = path->elems; - for (size_t k = 0; k < path_constr.datalen; k++) { - uint64_t path_conv_10 = path_vals[k]; - LDKRouteHop path_conv_10_conv; - path_conv_10_conv.inner = untag_ptr(path_conv_10); - path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10); - CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv); - path_conv_10_conv = RouteHop_clone(&path_conv_10_conv); - path_constr.data[k] = path_conv_10_conv; - } - FREE(path); - (this_arg_conv->payment_path_successful)(this_arg_conv->this_arg, path_constr); -} - -void __attribute__((export_name("TS_Score_probe_failed"))) TS_Score_probe_failed(uint64_t this_arg, uint64_tArray path, int64_t short_channel_id) { + LDKPath path_conv; + path_conv.inner = untag_ptr(path); + path_conv.is_owned = ptr_is_owned(path); + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); + path_conv.is_owned = false; + (this_arg_conv->payment_path_successful)(this_arg_conv->this_arg, &path_conv); +} + +void __attribute__((export_name("TS_Score_probe_failed"))) TS_Score_probe_failed(uint64_t this_arg, uint64_t path, int64_t short_channel_id) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr; - LDKCVec_RouteHopZ path_constr; - path_constr.datalen = path->arr_len; - if (path_constr.datalen > 0) - path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements"); - else - path_constr.data = NULL; - uint64_t* path_vals = path->elems; - for (size_t k = 0; k < path_constr.datalen; k++) { - uint64_t path_conv_10 = path_vals[k]; - LDKRouteHop path_conv_10_conv; - path_conv_10_conv.inner = untag_ptr(path_conv_10); - path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10); - CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv); - path_conv_10_conv = RouteHop_clone(&path_conv_10_conv); - path_constr.data[k] = path_conv_10_conv; - } - FREE(path); - (this_arg_conv->probe_failed)(this_arg_conv->this_arg, path_constr, short_channel_id); -} - -void __attribute__((export_name("TS_Score_probe_successful"))) TS_Score_probe_successful(uint64_t this_arg, uint64_tArray path) { + LDKPath path_conv; + path_conv.inner = untag_ptr(path); + path_conv.is_owned = ptr_is_owned(path); + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); + path_conv.is_owned = false; + (this_arg_conv->probe_failed)(this_arg_conv->this_arg, &path_conv, short_channel_id); +} + +void __attribute__((export_name("TS_Score_probe_successful"))) TS_Score_probe_successful(uint64_t this_arg, uint64_t path) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr; - LDKCVec_RouteHopZ path_constr; - path_constr.datalen = path->arr_len; - if (path_constr.datalen > 0) - path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements"); - else - path_constr.data = NULL; - uint64_t* path_vals = path->elems; - for (size_t k = 0; k < path_constr.datalen; k++) { - uint64_t path_conv_10 = path_vals[k]; - LDKRouteHop path_conv_10_conv; - path_conv_10_conv.inner = untag_ptr(path_conv_10); - path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10); - CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv); - path_conv_10_conv = RouteHop_clone(&path_conv_10_conv); - path_constr.data[k] = path_conv_10_conv; - } - FREE(path); - (this_arg_conv->probe_successful)(this_arg_conv->this_arg, path_constr); + LDKPath path_conv; + path_conv.inner = untag_ptr(path); + path_conv.is_owned = ptr_is_owned(path); + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); + path_conv.is_owned = false; + (this_arg_conv->probe_successful)(this_arg_conv->this_arg, &path_conv); } int8_tArray __attribute__((export_name("TS_Score_write"))) TS_Score_write(uint64_t this_arg) { @@ -9250,7 +9217,7 @@ static void LDKLockableScore_JCalls_free(void* this_arg) { } 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); + uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 48, 0, 0, 0, 0, 0, 0); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKScore ret_conv = *(LDKScore*)(ret_ptr); @@ -9304,7 +9271,7 @@ static void LDKWriteableScore_JCalls_free(void* this_arg) { } 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); + int8_tArray ret = (int8_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 49, 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"); @@ -9363,7 +9330,7 @@ LDKCResult_NoneErrorZ persist_manager_LDKPersister_jcall(const void* this_arg, c // 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); - uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 54, channel_manager_ref, 0, 0, 0, 0, 0); + uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 50, 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); @@ -9377,7 +9344,7 @@ LDKCResult_NoneErrorZ persist_graph_LDKPersister_jcall(const void* this_arg, con // 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); - uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 55, network_graph_ref, 0, 0, 0, 0, 0); + uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 51, 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); @@ -9388,7 +9355,7 @@ LDKCResult_NoneErrorZ persist_scorer_LDKPersister_jcall(const void* this_arg, co LDKPersister_JCalls *j_calls = (LDKPersister_JCalls*) this_arg; // 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); + uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 52, 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); @@ -9470,7 +9437,7 @@ static void LDKFutureCallback_JCalls_free(void* this_arg) { } 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); + js_invoke_function_uuuuuu(j_calls->instance_ptr, 53, 0, 0, 0, 0, 0, 0); } static void LDKFutureCallback_JCalls_cloned(LDKFutureCallback* new_obj) { LDKFutureCallback_JCalls *j_calls = (LDKFutureCallback_JCalls*) new_obj->this_arg; @@ -9526,7 +9493,7 @@ void filtered_block_connected_LDKListen_jcall(const void* this_arg, const uint8_ FREE(txdata_var.data); int32_t height_conv = height; - js_invoke_function_uuuuuu(j_calls->instance_ptr, 58, (uint32_t)header_arr, (uint32_t)txdata_arr, height_conv, 0, 0, 0); + js_invoke_function_uuuuuu(j_calls->instance_ptr, 54, (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; @@ -9534,14 +9501,14 @@ void block_connected_LDKListen_jcall(const void* this_arg, LDKu8slice block, uin 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, 59, (uint32_t)block_arr, height_conv, 0, 0, 0, 0); + js_invoke_function_uuuuuu(j_calls->instance_ptr, 55, (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, 60, (uint32_t)header_arr, height_conv, 0, 0, 0, 0); + js_invoke_function_uuuuuu(j_calls->instance_ptr, 56, (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; @@ -9641,24 +9608,24 @@ void transactions_confirmed_LDKConfirm_jcall(const void* this_arg, const uint8_t FREE(txdata_var.data); int32_t height_conv = height; - js_invoke_function_uuuuuu(j_calls->instance_ptr, 61, (uint32_t)header_arr, (uint32_t)txdata_arr, height_conv, 0, 0, 0); + js_invoke_function_uuuuuu(j_calls->instance_ptr, 57, (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, 62, (uint32_t)txid_arr, 0, 0, 0, 0, 0); + js_invoke_function_uuuuuu(j_calls->instance_ptr, 58, (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, 63, (uint32_t)header_arr, height_conv, 0, 0, 0, 0); + js_invoke_function_uuuuuu(j_calls->instance_ptr, 59, (uint32_t)header_arr, height_conv, 0, 0, 0, 0); } LDKCVec_C2Tuple_TxidBlockHashZZ get_relevant_txids_LDKConfirm_jcall(const void* this_arg) { LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) this_arg; - uint64_tArray ret = (uint64_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 64, 0, 0, 0, 0, 0, 0); + uint64_tArray ret = (uint64_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 60, 0, 0, 0, 0, 0, 0); LDKCVec_C2Tuple_TxidBlockHashZZ ret_constr; ret_constr.datalen = ret->arr_len; if (ret_constr.datalen > 0) @@ -9793,7 +9760,7 @@ LDKChannelMonitorUpdateStatus persist_new_channel_LDKPersist_jcall(const void* t 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); - uint64_t ret = js_invoke_function_bbbuuu(j_calls->instance_ptr, 65, channel_id_ref, data_ref, update_id_ref, 0, 0, 0); + uint64_t ret = js_invoke_function_bbbuuu(j_calls->instance_ptr, 61, channel_id_ref, data_ref, update_id_ref, 0, 0, 0); LDKChannelMonitorUpdateStatus ret_conv = LDKChannelMonitorUpdateStatus_from_js(ret); return ret_conv; } @@ -9816,7 +9783,7 @@ LDKChannelMonitorUpdateStatus update_persisted_channel_LDKPersist_jcall(const vo 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); - uint64_t ret = js_invoke_function_bbbbuu(j_calls->instance_ptr, 66, channel_id_ref, update_ref, data_ref, update_id_ref, 0, 0); + uint64_t ret = js_invoke_function_bbbbuu(j_calls->instance_ptr, 62, channel_id_ref, update_ref, data_ref, update_id_ref, 0, 0); LDKChannelMonitorUpdateStatus ret_conv = LDKChannelMonitorUpdateStatus_from_js(ret); return ret_conv; } @@ -9893,6 +9860,106 @@ uint32_t __attribute__((export_name("TS_Persist_update_persisted_channel"))) TS return ret_conv; } +typedef struct LDKEventHandler_JCalls { + atomic_size_t refcnt; + uint32_t instance_ptr; +} LDKEventHandler_JCalls; +static void LDKEventHandler_JCalls_free(void* this_arg) { + LDKEventHandler_JCalls *j_calls = (LDKEventHandler_JCalls*) this_arg; + if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) { + FREE(j_calls); + } +} +void handle_event_LDKEventHandler_jcall(const void* this_arg, LDKEvent event) { + LDKEventHandler_JCalls *j_calls = (LDKEventHandler_JCalls*) this_arg; + 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, 63, 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; + atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); +} +static inline LDKEventHandler LDKEventHandler_init (JSValue o) { + LDKEventHandler_JCalls *calls = MALLOC(sizeof(LDKEventHandler_JCalls), "LDKEventHandler_JCalls"); + atomic_init(&calls->refcnt, 1); + calls->instance_ptr = o; + + LDKEventHandler ret = { + .this_arg = (void*) calls, + .handle_event = handle_event_LDKEventHandler_jcall, + .free = LDKEventHandler_JCalls_free, + }; + return ret; +} +uint64_t __attribute__((export_name("TS_LDKEventHandler_new"))) TS_LDKEventHandler_new(JSValue o) { + LDKEventHandler *res_ptr = MALLOC(sizeof(LDKEventHandler), "LDKEventHandler"); + *res_ptr = LDKEventHandler_init(o); + return tag_ptr(res_ptr, true); +} +void __attribute__((export_name("TS_EventHandler_handle_event"))) TS_EventHandler_handle_event(uint64_t this_arg, uint64_t event) { + 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; + 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); +} + +typedef struct LDKEventsProvider_JCalls { + atomic_size_t refcnt; + uint32_t instance_ptr; +} LDKEventsProvider_JCalls; +static void LDKEventsProvider_JCalls_free(void* this_arg) { + LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) this_arg; + if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) { + FREE(j_calls); + } +} +void process_pending_events_LDKEventsProvider_jcall(const void* this_arg, LDKEventHandler handler) { + 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, 64, 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; + atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); +} +static inline LDKEventsProvider LDKEventsProvider_init (JSValue o) { + LDKEventsProvider_JCalls *calls = MALLOC(sizeof(LDKEventsProvider_JCalls), "LDKEventsProvider_JCalls"); + atomic_init(&calls->refcnt, 1); + calls->instance_ptr = o; + + LDKEventsProvider ret = { + .this_arg = (void*) calls, + .process_pending_events = process_pending_events_LDKEventsProvider_jcall, + .free = LDKEventsProvider_JCalls_free, + }; + return ret; +} +uint64_t __attribute__((export_name("TS_LDKEventsProvider_new"))) TS_LDKEventsProvider_new(JSValue o) { + LDKEventsProvider *res_ptr = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider"); + *res_ptr = LDKEventsProvider_init(o); + return tag_ptr(res_ptr, true); +} +void __attribute__((export_name("TS_EventsProvider_process_pending_events"))) TS_EventsProvider_process_pending_events(uint64_t this_arg, uint64_t handler) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKEventsProvider* this_arg_conv = (LDKEventsProvider*)this_arg_ptr; + void* handler_ptr = untag_ptr(handler); + CHECK_ACCESS(handler_ptr); + LDKEventHandler handler_conv = *(LDKEventHandler*)(handler_ptr); + if (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(&handler_conv); + } + (this_arg_conv->process_pending_events)(this_arg_conv->this_arg, handler_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) { @@ -9906,6 +9973,77 @@ uint32_t __attribute__((export_name("TS_LDKRetry_Attempts_get_attempts"))) TS_LD uint32_t attempts_conv = obj->attempts; return attempts_conv; } +typedef struct LDKMessageSendEventsProvider_JCalls { + atomic_size_t refcnt; + uint32_t instance_ptr; +} LDKMessageSendEventsProvider_JCalls; +static void LDKMessageSendEventsProvider_JCalls_free(void* this_arg) { + LDKMessageSendEventsProvider_JCalls *j_calls = (LDKMessageSendEventsProvider_JCalls*) this_arg; + if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) { + FREE(j_calls); + } +} +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, 65, 0, 0, 0, 0, 0, 0); + LDKCVec_MessageSendEventZ ret_constr; + ret_constr.datalen = ret->arr_len; + if (ret_constr.datalen > 0) + ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKMessageSendEvent), "LDKCVec_MessageSendEventZ 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]; + void* ret_conv_18_ptr = untag_ptr(ret_conv_18); + CHECK_ACCESS(ret_conv_18_ptr); + LDKMessageSendEvent ret_conv_18_conv = *(LDKMessageSendEvent*)(ret_conv_18_ptr); + FREE(untag_ptr(ret_conv_18)); + ret_constr.data[s] = ret_conv_18_conv; + } + FREE(ret); + return ret_constr; +} +static void LDKMessageSendEventsProvider_JCalls_cloned(LDKMessageSendEventsProvider* new_obj) { + LDKMessageSendEventsProvider_JCalls *j_calls = (LDKMessageSendEventsProvider_JCalls*) new_obj->this_arg; + atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); +} +static inline LDKMessageSendEventsProvider LDKMessageSendEventsProvider_init (JSValue o) { + LDKMessageSendEventsProvider_JCalls *calls = MALLOC(sizeof(LDKMessageSendEventsProvider_JCalls), "LDKMessageSendEventsProvider_JCalls"); + atomic_init(&calls->refcnt, 1); + calls->instance_ptr = o; + + LDKMessageSendEventsProvider ret = { + .this_arg = (void*) calls, + .get_and_clear_pending_msg_events = get_and_clear_pending_msg_events_LDKMessageSendEventsProvider_jcall, + .free = LDKMessageSendEventsProvider_JCalls_free, + }; + return ret; +} +uint64_t __attribute__((export_name("TS_LDKMessageSendEventsProvider_new"))) TS_LDKMessageSendEventsProvider_new(JSValue o) { + LDKMessageSendEventsProvider *res_ptr = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider"); + *res_ptr = LDKMessageSendEventsProvider_init(o); + return tag_ptr(res_ptr, true); +} +uint64_tArray __attribute__((export_name("TS_MessageSendEventsProvider_get_and_clear_pending_msg_events"))) TS_MessageSendEventsProvider_get_and_clear_pending_msg_events(uint64_t this_arg) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKMessageSendEventsProvider* this_arg_conv = (LDKMessageSendEventsProvider*)this_arg_ptr; + LDKCVec_MessageSendEventZ ret_var = (this_arg_conv->get_and_clear_pending_msg_events)(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 s = 0; s < ret_var.datalen; s++) { + LDKMessageSendEvent *ret_conv_18_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_conv_18_copy = ret_var.data[s]; + uint64_t ret_conv_18_ref = tag_ptr(ret_conv_18_copy, true); + ret_arr_ptr[s] = ret_conv_18_ref; + } + + FREE(ret_var.data); + return ret_arr; +} + typedef struct LDKChannelMessageHandler_JCalls { atomic_size_t refcnt; uint32_t instance_ptr; @@ -9926,7 +10064,7 @@ void handle_open_channel_LDKChannelMessageHandler_jcall(const void* this_arg, LD 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_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, 66, (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, const LDKAcceptChannel * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -9937,7 +10075,7 @@ void handle_accept_channel_LDKChannelMessageHandler_jcall(const void* this_arg, 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_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, 67, (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; @@ -9948,7 +10086,7 @@ void handle_funding_created_LDKChannelMessageHandler_jcall(const void* 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, 69, (uint32_t)their_node_id_arr, msg_ref, 0, 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_signed_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingSigned * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -9959,7 +10097,7 @@ void handle_funding_signed_LDKChannelMessageHandler_jcall(const void* 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, 70, (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_channel_ready_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKChannelReady * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -9970,7 +10108,7 @@ void handle_channel_ready_LDKChannelMessageHandler_jcall(const void* this_arg, L 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, 71, (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_shutdown_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKShutdown * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -9981,7 +10119,7 @@ void handle_shutdown_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPub 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_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, 71, (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; @@ -9992,7 +10130,7 @@ void handle_closing_signed_LDKChannelMessageHandler_jcall(const void* 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, 73, (uint32_t)their_node_id_arr, msg_ref, 0, 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_update_add_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateAddHTLC * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -10003,7 +10141,7 @@ void handle_update_add_htlc_LDKChannelMessageHandler_jcall(const void* 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, 74, (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_fulfill_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFulfillHTLC * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -10014,7 +10152,7 @@ void handle_update_fulfill_htlc_LDKChannelMessageHandler_jcall(const void* this_ 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, 75, (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_fail_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFailHTLC * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -10025,7 +10163,7 @@ void handle_update_fail_htlc_LDKChannelMessageHandler_jcall(const void* 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, 76, (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_malformed_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFailMalformedHTLC * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -10036,7 +10174,7 @@ void handle_update_fail_malformed_htlc_LDKChannelMessageHandler_jcall(const void 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, 77, (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_commitment_signed_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKCommitmentSigned * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -10047,7 +10185,7 @@ void handle_commitment_signed_LDKChannelMessageHandler_jcall(const void* this_ar 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, 78, (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_revoke_and_ack_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKRevokeAndACK * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -10058,7 +10196,7 @@ void handle_revoke_and_ack_LDKChannelMessageHandler_jcall(const void* 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, 79, (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_update_fee_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFee * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -10069,7 +10207,7 @@ void handle_update_fee_LDKChannelMessageHandler_jcall(const void* this_arg, LDKP 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, 80, (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_announcement_signatures_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKAnnouncementSignatures * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -10080,13 +10218,13 @@ void handle_announcement_signatures_LDKChannelMessageHandler_jcall(const void* t 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, 81, (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 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); - js_invoke_function_uuuuuu(j_calls->instance_ptr, 82, (uint32_t)their_node_id_arr, 0, 0, 0, 0, 0); + js_invoke_function_uuuuuu(j_calls->instance_ptr, 81, (uint32_t)their_node_id_arr, 0, 0, 0, 0, 0); } 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; @@ -10098,7 +10236,7 @@ LDKCResult_NoneNoneZ peer_connected_LDKChannelMessageHandler_jcall(const void* t CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); 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); + uint64_t ret = js_invoke_function_ubuuuu(j_calls->instance_ptr, 82, (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); @@ -10114,7 +10252,7 @@ void handle_channel_reestablish_LDKChannelMessageHandler_jcall(const void* this_ 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, 84, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0); + js_invoke_function_ubuuuu(j_calls->instance_ptr, 83, (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; @@ -10125,7 +10263,7 @@ void handle_channel_update_LDKChannelMessageHandler_jcall(const void* 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, 85, (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_error_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKErrorMessage * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -10136,11 +10274,11 @@ void handle_error_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublic 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, 86, (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); } 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); + uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 86, 0, 0, 0, 0, 0, 0); LDKNodeFeatures ret_conv; ret_conv.inner = untag_ptr(ret); ret_conv.is_owned = ptr_is_owned(ret); @@ -10151,7 +10289,7 @@ LDKInitFeatures provided_init_features_LDKChannelMessageHandler_jcall(const void 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); + uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 87, (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); @@ -10543,7 +10681,7 @@ LDKCResult_boolLightningErrorZ handle_node_announcement_LDKRoutingMessageHandler 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); - uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 89, msg_ref, 0, 0, 0, 0, 0); + uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 88, 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); @@ -10557,7 +10695,7 @@ LDKCResult_boolLightningErrorZ handle_channel_announcement_LDKRoutingMessageHand 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); - uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 90, 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); @@ -10571,7 +10709,7 @@ LDKCResult_boolLightningErrorZ handle_channel_update_LDKRoutingMessageHandler_jc 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); - uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 91, 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); @@ -10581,7 +10719,7 @@ LDKCResult_boolLightningErrorZ handle_channel_update_LDKRoutingMessageHandler_jc 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; - uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 92, starting_point_conv, 0, 0, 0, 0, 0); + uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 91, 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); @@ -10594,7 +10732,7 @@ LDKNodeAnnouncement get_next_node_announcement_LDKRoutingMessageHandler_jcall(co 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); + uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 92, 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); @@ -10611,7 +10749,7 @@ LDKCResult_NoneNoneZ peer_connected_LDKRoutingMessageHandler_jcall(const void* t 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, 94, (uint32_t)their_node_id_arr, init_ref, inbound_conv, 0, 0, 0); + uint64_t ret = js_invoke_function_ubuuuu(j_calls->instance_ptr, 93, (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); @@ -10626,7 +10764,7 @@ LDKCResult_NoneLightningErrorZ handle_reply_channel_range_LDKRoutingMessageHandl uint64_t msg_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - uint64_t ret = js_invoke_function_ubuuuu(j_calls->instance_ptr, 95, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0); + uint64_t ret = js_invoke_function_ubuuuu(j_calls->instance_ptr, 94, (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); @@ -10641,7 +10779,7 @@ LDKCResult_NoneLightningErrorZ handle_reply_short_channel_ids_end_LDKRoutingMess uint64_t msg_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - uint64_t ret = js_invoke_function_ubuuuu(j_calls->instance_ptr, 96, (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); @@ -10656,7 +10794,7 @@ LDKCResult_NoneLightningErrorZ handle_query_channel_range_LDKRoutingMessageHandl uint64_t msg_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - uint64_t ret = js_invoke_function_ubuuuu(j_calls->instance_ptr, 97, (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); @@ -10671,7 +10809,7 @@ LDKCResult_NoneLightningErrorZ handle_query_short_channel_ids_LDKRoutingMessageH uint64_t msg_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - uint64_t ret = js_invoke_function_ubuuuu(j_calls->instance_ptr, 98, (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); @@ -10680,11 +10818,11 @@ LDKCResult_NoneLightningErrorZ handle_query_short_channel_ids_LDKRoutingMessageH } 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); + return js_invoke_function_uuuuuu(j_calls->instance_ptr, 98, 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); + uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 99, 0, 0, 0, 0, 0, 0); LDKNodeFeatures ret_conv; ret_conv.inner = untag_ptr(ret); ret_conv.is_owned = ptr_is_owned(ret); @@ -10695,7 +10833,7 @@ LDKInitFeatures provided_init_features_LDKRoutingMessageHandler_jcall(const void 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); + uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 100, (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); @@ -10924,6 +11062,62 @@ uint64_t __attribute__((export_name("TS_RoutingMessageHandler_provided_init_fea return ret_ref; } +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, 101, (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 LDKOnionMessageHandler_JCalls { atomic_size_t refcnt; uint32_t instance_ptr; @@ -11445,6 +11639,47 @@ int64_t __attribute__((export_name("TS_LDKEffectiveCapacity_Total_get_htlc_maxim int64_t htlc_maximum_msat_conv = obj->total.htlc_maximum_msat; return htlc_maximum_msat_conv; } +uint32_t __attribute__((export_name("TS_LDKHints_ty_from_ptr"))) TS_LDKHints_ty_from_ptr(uint64_t ptr) { + LDKHints *obj = (LDKHints*)untag_ptr(ptr); + switch(obj->tag) { + case LDKHints_Blinded: return 0; + case LDKHints_Clear: return 1; + default: abort(); + } +} +uint64_tArray __attribute__((export_name("TS_LDKHints_Blinded_get_blinded"))) TS_LDKHints_Blinded_get_blinded(uint64_t ptr) { + LDKHints *obj = (LDKHints*)untag_ptr(ptr); + assert(obj->tag == LDKHints_Blinded); + LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ blinded_var = obj->blinded; + uint64_tArray blinded_arr = NULL; + blinded_arr = init_uint64_tArray(blinded_var.datalen, __LINE__); + uint64_t *blinded_arr_ptr = (uint64_t*)(((uint8_t*)blinded_arr) + 8); + for (size_t l = 0; l < blinded_var.datalen; l++) { + LDKC2Tuple_BlindedPayInfoBlindedPathZ* blinded_conv_37_conv = MALLOC(sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKC2Tuple_BlindedPayInfoBlindedPathZ"); + *blinded_conv_37_conv = blinded_var.data[l]; + *blinded_conv_37_conv = C2Tuple_BlindedPayInfoBlindedPathZ_clone(blinded_conv_37_conv); + blinded_arr_ptr[l] = tag_ptr(blinded_conv_37_conv, true); + } + + return blinded_arr; +} +uint64_tArray __attribute__((export_name("TS_LDKHints_Clear_get_clear"))) TS_LDKHints_Clear_get_clear(uint64_t ptr) { + LDKHints *obj = (LDKHints*)untag_ptr(ptr); + assert(obj->tag == LDKHints_Clear); + LDKCVec_RouteHintZ clear_var = obj->clear; + uint64_tArray clear_arr = NULL; + clear_arr = init_uint64_tArray(clear_var.datalen, __LINE__); + uint64_t *clear_arr_ptr = (uint64_t*)(((uint8_t*)clear_arr) + 8); + for (size_t l = 0; l < clear_var.datalen; l++) { + LDKRouteHint clear_conv_11_var = clear_var.data[l]; + uint64_t clear_conv_11_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(clear_conv_11_var); + clear_conv_11_ref = tag_ptr(clear_conv_11_var.inner, false); + clear_arr_ptr[l] = clear_conv_11_ref; + } + + return clear_arr; +} 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) { @@ -11677,6 +11912,112 @@ void __attribute__((export_name("TS_Str_free"))) TS_Str_free(jstring _res) { Str_free(dummy); } +uint64_t __attribute__((export_name("TS_COption_DurationZ_some"))) TS_COption_DurationZ_some(int64_t o) { + LDKCOption_DurationZ *ret_copy = MALLOC(sizeof(LDKCOption_DurationZ), "LDKCOption_DurationZ"); + *ret_copy = COption_DurationZ_some(o); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +uint64_t __attribute__((export_name("TS_COption_DurationZ_none"))) TS_COption_DurationZ_none() { + LDKCOption_DurationZ *ret_copy = MALLOC(sizeof(LDKCOption_DurationZ), "LDKCOption_DurationZ"); + *ret_copy = COption_DurationZ_none(); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void __attribute__((export_name("TS_COption_DurationZ_free"))) TS_COption_DurationZ_free(uint64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCOption_DurationZ _res_conv = *(LDKCOption_DurationZ*)(_res_ptr); + FREE(untag_ptr(_res)); + COption_DurationZ_free(_res_conv); +} + +static inline uint64_t COption_DurationZ_clone_ptr(LDKCOption_DurationZ *NONNULL_PTR arg) { + LDKCOption_DurationZ *ret_copy = MALLOC(sizeof(LDKCOption_DurationZ), "LDKCOption_DurationZ"); + *ret_copy = COption_DurationZ_clone(arg); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t __attribute__((export_name("TS_COption_DurationZ_clone_ptr"))) TS_COption_DurationZ_clone_ptr(uint64_t arg) { + LDKCOption_DurationZ* arg_conv = (LDKCOption_DurationZ*)untag_ptr(arg); + int64_t ret_conv = COption_DurationZ_clone_ptr(arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_COption_DurationZ_clone"))) TS_COption_DurationZ_clone(uint64_t orig) { + LDKCOption_DurationZ* orig_conv = (LDKCOption_DurationZ*)untag_ptr(orig); + LDKCOption_DurationZ *ret_copy = MALLOC(sizeof(LDKCOption_DurationZ), "LDKCOption_DurationZ"); + *ret_copy = COption_DurationZ_clone(orig_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void __attribute__((export_name("TS_CVec_BlindedPathZ_free"))) TS_CVec_BlindedPathZ_free(uint64_tArray _res) { + LDKCVec_BlindedPathZ _res_constr; + _res_constr.datalen = _res->arr_len; + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKBlindedPath), "LDKCVec_BlindedPathZ Elements"); + else + _res_constr.data = NULL; + uint64_t* _res_vals = _res->elems; + for (size_t n = 0; n < _res_constr.datalen; n++) { + uint64_t _res_conv_13 = _res_vals[n]; + LDKBlindedPath _res_conv_13_conv; + _res_conv_13_conv.inner = untag_ptr(_res_conv_13); + _res_conv_13_conv.is_owned = ptr_is_owned(_res_conv_13); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_13_conv); + _res_constr.data[n] = _res_conv_13_conv; + } + FREE(_res); + CVec_BlindedPathZ_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_NoneAPIErrorZ_ok"))) TS_CResult_NoneAPIErrorZ_ok() { LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); *ret_conv = CResult_NoneAPIErrorZ_ok(); @@ -11766,6 +12107,115 @@ void __attribute__((export_name("TS_CVec_APIErrorZ_free"))) TS_CVec_APIErrorZ_f CVec_APIErrorZ_free(_res_constr); } +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; + _res_ref.data = MALLOC(_res_ref.datalen, "LDKCVec_u8Z Bytes"); + memcpy(_res_ref.data, _res->elems, _res_ref.datalen); FREE(_res); + CVec_u8Z_free(_res_ref); +} + +uint64_t __attribute__((export_name("TS_COption_CVec_u8ZZ_some"))) TS_COption_CVec_u8ZZ_some(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); + LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); + *ret_copy = COption_CVec_u8ZZ_some(o_ref); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +uint64_t __attribute__((export_name("TS_COption_CVec_u8ZZ_none"))) TS_COption_CVec_u8ZZ_none() { + LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); + *ret_copy = COption_CVec_u8ZZ_none(); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void __attribute__((export_name("TS_COption_CVec_u8ZZ_free"))) TS_COption_CVec_u8ZZ_free(uint64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCOption_CVec_u8ZZ _res_conv = *(LDKCOption_CVec_u8ZZ*)(_res_ptr); + FREE(untag_ptr(_res)); + COption_CVec_u8ZZ_free(_res_conv); +} + +static inline uint64_t COption_CVec_u8ZZ_clone_ptr(LDKCOption_CVec_u8ZZ *NONNULL_PTR arg) { + LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); + *ret_copy = COption_CVec_u8ZZ_clone(arg); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t __attribute__((export_name("TS_COption_CVec_u8ZZ_clone_ptr"))) TS_COption_CVec_u8ZZ_clone_ptr(uint64_t arg) { + LDKCOption_CVec_u8ZZ* arg_conv = (LDKCOption_CVec_u8ZZ*)untag_ptr(arg); + int64_t ret_conv = COption_CVec_u8ZZ_clone_ptr(arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_COption_CVec_u8ZZ_clone"))) TS_COption_CVec_u8ZZ_clone(uint64_t orig) { + LDKCOption_CVec_u8ZZ* orig_conv = (LDKCOption_CVec_u8ZZ*)untag_ptr(orig); + LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); + *ret_copy = COption_CVec_u8ZZ_clone(orig_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +uint64_t __attribute__((export_name("TS_CResult_RecipientOnionFieldsDecodeErrorZ_ok"))) TS_CResult_RecipientOnionFieldsDecodeErrorZ_ok(uint64_t o) { + LDKRecipientOnionFields 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 = RecipientOnionFields_clone(&o_conv); + LDKCResult_RecipientOnionFieldsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RecipientOnionFieldsDecodeErrorZ), "LDKCResult_RecipientOnionFieldsDecodeErrorZ"); + *ret_conv = CResult_RecipientOnionFieldsDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +uint64_t __attribute__((export_name("TS_CResult_RecipientOnionFieldsDecodeErrorZ_err"))) TS_CResult_RecipientOnionFieldsDecodeErrorZ_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_RecipientOnionFieldsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RecipientOnionFieldsDecodeErrorZ), "LDKCResult_RecipientOnionFieldsDecodeErrorZ"); + *ret_conv = CResult_RecipientOnionFieldsDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean __attribute__((export_name("TS_CResult_RecipientOnionFieldsDecodeErrorZ_is_ok"))) TS_CResult_RecipientOnionFieldsDecodeErrorZ_is_ok(uint64_t o) { + LDKCResult_RecipientOnionFieldsDecodeErrorZ* o_conv = (LDKCResult_RecipientOnionFieldsDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_RecipientOnionFieldsDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_CResult_RecipientOnionFieldsDecodeErrorZ_free"))) TS_CResult_RecipientOnionFieldsDecodeErrorZ_free(uint64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_RecipientOnionFieldsDecodeErrorZ _res_conv = *(LDKCResult_RecipientOnionFieldsDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_RecipientOnionFieldsDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_RecipientOnionFieldsDecodeErrorZ_clone_ptr(LDKCResult_RecipientOnionFieldsDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_RecipientOnionFieldsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RecipientOnionFieldsDecodeErrorZ), "LDKCResult_RecipientOnionFieldsDecodeErrorZ"); + *ret_conv = CResult_RecipientOnionFieldsDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t __attribute__((export_name("TS_CResult_RecipientOnionFieldsDecodeErrorZ_clone_ptr"))) TS_CResult_RecipientOnionFieldsDecodeErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_RecipientOnionFieldsDecodeErrorZ* arg_conv = (LDKCResult_RecipientOnionFieldsDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_RecipientOnionFieldsDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_CResult_RecipientOnionFieldsDecodeErrorZ_clone"))) TS_CResult_RecipientOnionFieldsDecodeErrorZ_clone(uint64_t orig) { + LDKCResult_RecipientOnionFieldsDecodeErrorZ* orig_conv = (LDKCResult_RecipientOnionFieldsDecodeErrorZ*)untag_ptr(orig); + LDKCResult_RecipientOnionFieldsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RecipientOnionFieldsDecodeErrorZ), "LDKCResult_RecipientOnionFieldsDecodeErrorZ"); + *ret_conv = CResult_RecipientOnionFieldsDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + 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"); @@ -12633,180 +13083,57 @@ uint64_t __attribute__((export_name("TS_CResult_ShutdownScriptInvalidShutdownSc 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_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 = 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_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; +uint64_t __attribute__((export_name("TS_CResult_BlindedPayInfoDecodeErrorZ_ok"))) TS_CResult_BlindedPayInfoDecodeErrorZ_ok(uint64_t o) { + LDKBlindedPayInfo 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); + o_conv = BlindedPayInfo_clone(&o_conv); + LDKCResult_BlindedPayInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPayInfoDecodeErrorZ), "LDKCResult_BlindedPayInfoDecodeErrorZ"); + *ret_conv = CResult_BlindedPayInfoDecodeErrorZ_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) { +uint64_t __attribute__((export_name("TS_CResult_BlindedPayInfoDecodeErrorZ_err"))) TS_CResult_BlindedPayInfoDecodeErrorZ_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); + LDKCResult_BlindedPayInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPayInfoDecodeErrorZ), "LDKCResult_BlindedPayInfoDecodeErrorZ"); + *ret_conv = CResult_BlindedPayInfoDecodeErrorZ_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); +jboolean __attribute__((export_name("TS_CResult_BlindedPayInfoDecodeErrorZ_is_ok"))) TS_CResult_BlindedPayInfoDecodeErrorZ_is_ok(uint64_t o) { + LDKCResult_BlindedPayInfoDecodeErrorZ* o_conv = (LDKCResult_BlindedPayInfoDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_BlindedPayInfoDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void __attribute__((export_name("TS_CResult_BlindedHopDecodeErrorZ_free"))) TS_CResult_BlindedHopDecodeErrorZ_free(uint64_t _res) { +void __attribute__((export_name("TS_CResult_BlindedPayInfoDecodeErrorZ_free"))) TS_CResult_BlindedPayInfoDecodeErrorZ_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); + LDKCResult_BlindedPayInfoDecodeErrorZ _res_conv = *(LDKCResult_BlindedPayInfoDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_BlindedHopDecodeErrorZ_free(_res_conv); + CResult_BlindedPayInfoDecodeErrorZ_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); +static inline uint64_t CResult_BlindedPayInfoDecodeErrorZ_clone_ptr(LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_BlindedPayInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPayInfoDecodeErrorZ), "LDKCResult_BlindedPayInfoDecodeErrorZ"); + *ret_conv = CResult_BlindedPayInfoDecodeErrorZ_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); +int64_t __attribute__((export_name("TS_CResult_BlindedPayInfoDecodeErrorZ_clone_ptr"))) TS_CResult_BlindedPayInfoDecodeErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_BlindedPayInfoDecodeErrorZ* arg_conv = (LDKCResult_BlindedPayInfoDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_BlindedPayInfoDecodeErrorZ_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); +uint64_t __attribute__((export_name("TS_CResult_BlindedPayInfoDecodeErrorZ_clone"))) TS_CResult_BlindedPayInfoDecodeErrorZ_clone(uint64_t orig) { + LDKCResult_BlindedPayInfoDecodeErrorZ* orig_conv = (LDKCResult_BlindedPayInfoDecodeErrorZ*)untag_ptr(orig); + LDKCResult_BlindedPayInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPayInfoDecodeErrorZ), "LDKCResult_BlindedPayInfoDecodeErrorZ"); + *ret_conv = CResult_BlindedPayInfoDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } @@ -12885,69 +13212,6 @@ uint64_t __attribute__((export_name("TS_CResult_RouteLightningErrorZ_clone"))) return tag_ptr(ret_conv, true); } -void __attribute__((export_name("TS_CVec_RouteHopZ_free"))) TS_CVec_RouteHopZ_free(uint64_tArray _res) { - LDKCVec_RouteHopZ _res_constr; - _res_constr.datalen = _res->arr_len; - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ 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]; - LDKRouteHop _res_conv_10_conv; - _res_conv_10_conv.inner = untag_ptr(_res_conv_10); - _res_conv_10_conv.is_owned = ptr_is_owned(_res_conv_10); - CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_10_conv); - _res_constr.data[k] = _res_conv_10_conv; - } - FREE(_res); - 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); @@ -13056,36 +13320,118 @@ uint64_t __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_clone"))) 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; +void __attribute__((export_name("TS_CVec_BlindedHopZ_free"))) TS_CVec_BlindedHopZ_free(uint64_tArray _res) { + LDKCVec_BlindedHopZ _res_constr; _res_constr.datalen = _res->arr_len; if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKCVec_RouteHopZ), "LDKCVec_CVec_RouteHopZZ Elements"); + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKBlindedHop), "LDKCVec_BlindedHopZ Elements"); else _res_constr.data = NULL; - uint64_tArray* _res_vals = (void*) _res->elems; + uint64_t* _res_vals = _res->elems; for (size_t m = 0; m < _res_constr.datalen; m++) { - uint64_tArray _res_conv_12 = _res_vals[m]; - LDKCVec_RouteHopZ _res_conv_12_constr; - _res_conv_12_constr.datalen = _res_conv_12->arr_len; - if (_res_conv_12_constr.datalen > 0) - _res_conv_12_constr.data = MALLOC(_res_conv_12_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements"); - else - _res_conv_12_constr.data = NULL; - uint64_t* _res_conv_12_vals = _res_conv_12->elems; - for (size_t k = 0; k < _res_conv_12_constr.datalen; k++) { - uint64_t _res_conv_12_conv_10 = _res_conv_12_vals[k]; - LDKRouteHop _res_conv_12_conv_10_conv; - _res_conv_12_conv_10_conv.inner = untag_ptr(_res_conv_12_conv_10); - _res_conv_12_conv_10_conv.is_owned = ptr_is_owned(_res_conv_12_conv_10); - CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_12_conv_10_conv); - _res_conv_12_constr.data[k] = _res_conv_12_conv_10_conv; - } - FREE(_res_conv_12); - _res_constr.data[m] = _res_conv_12_constr; + uint64_t _res_conv_12 = _res_vals[m]; + LDKBlindedHop _res_conv_12_conv; + _res_conv_12_conv.inner = untag_ptr(_res_conv_12); + _res_conv_12_conv.is_owned = ptr_is_owned(_res_conv_12); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_12_conv); + _res_constr.data[m] = _res_conv_12_conv; + } + FREE(_res); + CVec_BlindedHopZ_free(_res_constr); +} + +uint64_t __attribute__((export_name("TS_CResult_BlindedTailDecodeErrorZ_ok"))) TS_CResult_BlindedTailDecodeErrorZ_ok(uint64_t o) { + LDKBlindedTail 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 = BlindedTail_clone(&o_conv); + LDKCResult_BlindedTailDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedTailDecodeErrorZ), "LDKCResult_BlindedTailDecodeErrorZ"); + *ret_conv = CResult_BlindedTailDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +uint64_t __attribute__((export_name("TS_CResult_BlindedTailDecodeErrorZ_err"))) TS_CResult_BlindedTailDecodeErrorZ_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_BlindedTailDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedTailDecodeErrorZ), "LDKCResult_BlindedTailDecodeErrorZ"); + *ret_conv = CResult_BlindedTailDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean __attribute__((export_name("TS_CResult_BlindedTailDecodeErrorZ_is_ok"))) TS_CResult_BlindedTailDecodeErrorZ_is_ok(uint64_t o) { + LDKCResult_BlindedTailDecodeErrorZ* o_conv = (LDKCResult_BlindedTailDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_BlindedTailDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_CResult_BlindedTailDecodeErrorZ_free"))) TS_CResult_BlindedTailDecodeErrorZ_free(uint64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_BlindedTailDecodeErrorZ _res_conv = *(LDKCResult_BlindedTailDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_BlindedTailDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_BlindedTailDecodeErrorZ_clone_ptr(LDKCResult_BlindedTailDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_BlindedTailDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedTailDecodeErrorZ), "LDKCResult_BlindedTailDecodeErrorZ"); + *ret_conv = CResult_BlindedTailDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t __attribute__((export_name("TS_CResult_BlindedTailDecodeErrorZ_clone_ptr"))) TS_CResult_BlindedTailDecodeErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_BlindedTailDecodeErrorZ* arg_conv = (LDKCResult_BlindedTailDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_BlindedTailDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_CResult_BlindedTailDecodeErrorZ_clone"))) TS_CResult_BlindedTailDecodeErrorZ_clone(uint64_t orig) { + LDKCResult_BlindedTailDecodeErrorZ* orig_conv = (LDKCResult_BlindedTailDecodeErrorZ*)untag_ptr(orig); + LDKCResult_BlindedTailDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedTailDecodeErrorZ), "LDKCResult_BlindedTailDecodeErrorZ"); + *ret_conv = CResult_BlindedTailDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +void __attribute__((export_name("TS_CVec_RouteHopZ_free"))) TS_CVec_RouteHopZ_free(uint64_tArray _res) { + LDKCVec_RouteHopZ _res_constr; + _res_constr.datalen = _res->arr_len; + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ 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]; + LDKRouteHop _res_conv_10_conv; + _res_conv_10_conv.inner = untag_ptr(_res_conv_10); + _res_conv_10_conv.is_owned = ptr_is_owned(_res_conv_10); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_10_conv); + _res_constr.data[k] = _res_conv_10_conv; + } + FREE(_res); + CVec_RouteHopZ_free(_res_constr); +} + +void __attribute__((export_name("TS_CVec_PathZ_free"))) TS_CVec_PathZ_free(uint64_tArray _res) { + LDKCVec_PathZ _res_constr; + _res_constr.datalen = _res->arr_len; + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKPath), "LDKCVec_PathZ Elements"); + else + _res_constr.data = NULL; + uint64_t* _res_vals = _res->elems; + for (size_t g = 0; g < _res_constr.datalen; g++) { + uint64_t _res_conv_6 = _res_vals[g]; + LDKPath _res_conv_6_conv; + _res_conv_6_conv.inner = untag_ptr(_res_conv_6); + _res_conv_6_conv.is_owned = ptr_is_owned(_res_conv_6); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_6_conv); + _res_constr.data[g] = _res_conv_6_conv; } FREE(_res); - CVec_CVec_RouteHopZZ_free(_res_constr); + CVec_PathZ_free(_res_constr); } uint64_t __attribute__((export_name("TS_CResult_RouteDecodeErrorZ_ok"))) TS_CResult_RouteDecodeErrorZ_ok(uint64_t o) { @@ -13196,26 +13542,6 @@ uint64_t __attribute__((export_name("TS_CResult_RouteParametersDecodeErrorZ_clo return tag_ptr(ret_conv, true); } -void __attribute__((export_name("TS_CVec_RouteHintZ_free"))) TS_CVec_RouteHintZ_free(uint64_tArray _res) { - LDKCVec_RouteHintZ _res_constr; - _res_constr.datalen = _res->arr_len; - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKRouteHint), "LDKCVec_RouteHintZ Elements"); - else - _res_constr.data = NULL; - uint64_t* _res_vals = _res->elems; - for (size_t l = 0; l < _res_constr.datalen; l++) { - uint64_t _res_conv_11 = _res_vals[l]; - LDKRouteHint _res_conv_11_conv; - _res_conv_11_conv.inner = untag_ptr(_res_conv_11); - _res_conv_11_conv.is_owned = ptr_is_owned(_res_conv_11); - CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_11_conv); - _res_constr.data[l] = _res_conv_11_conv; - } - FREE(_res); - CVec_RouteHintZ_free(_res_constr); -} - 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; @@ -13286,6 +13612,89 @@ uint64_t __attribute__((export_name("TS_CResult_PaymentParametersDecodeErrorZ_c return tag_ptr(ret_conv, true); } +static inline uint64_t C2Tuple_BlindedPayInfoBlindedPathZ_clone_ptr(LDKC2Tuple_BlindedPayInfoBlindedPathZ *NONNULL_PTR arg) { + LDKC2Tuple_BlindedPayInfoBlindedPathZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKC2Tuple_BlindedPayInfoBlindedPathZ"); + *ret_conv = C2Tuple_BlindedPayInfoBlindedPathZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t __attribute__((export_name("TS_C2Tuple_BlindedPayInfoBlindedPathZ_clone_ptr"))) TS_C2Tuple_BlindedPayInfoBlindedPathZ_clone_ptr(uint64_t arg) { + LDKC2Tuple_BlindedPayInfoBlindedPathZ* arg_conv = (LDKC2Tuple_BlindedPayInfoBlindedPathZ*)untag_ptr(arg); + int64_t ret_conv = C2Tuple_BlindedPayInfoBlindedPathZ_clone_ptr(arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_C2Tuple_BlindedPayInfoBlindedPathZ_clone"))) TS_C2Tuple_BlindedPayInfoBlindedPathZ_clone(uint64_t orig) { + LDKC2Tuple_BlindedPayInfoBlindedPathZ* orig_conv = (LDKC2Tuple_BlindedPayInfoBlindedPathZ*)untag_ptr(orig); + LDKC2Tuple_BlindedPayInfoBlindedPathZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKC2Tuple_BlindedPayInfoBlindedPathZ"); + *ret_conv = C2Tuple_BlindedPayInfoBlindedPathZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +uint64_t __attribute__((export_name("TS_C2Tuple_BlindedPayInfoBlindedPathZ_new"))) TS_C2Tuple_BlindedPayInfoBlindedPathZ_new(uint64_t a, uint64_t b) { + LDKBlindedPayInfo 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 = BlindedPayInfo_clone(&a_conv); + LDKBlindedPath 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 = BlindedPath_clone(&b_conv); + LDKC2Tuple_BlindedPayInfoBlindedPathZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKC2Tuple_BlindedPayInfoBlindedPathZ"); + *ret_conv = C2Tuple_BlindedPayInfoBlindedPathZ_new(a_conv, b_conv); + return tag_ptr(ret_conv, true); +} + +void __attribute__((export_name("TS_C2Tuple_BlindedPayInfoBlindedPathZ_free"))) TS_C2Tuple_BlindedPayInfoBlindedPathZ_free(uint64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKC2Tuple_BlindedPayInfoBlindedPathZ _res_conv = *(LDKC2Tuple_BlindedPayInfoBlindedPathZ*)(_res_ptr); + FREE(untag_ptr(_res)); + C2Tuple_BlindedPayInfoBlindedPathZ_free(_res_conv); +} + +void __attribute__((export_name("TS_CVec_C2Tuple_BlindedPayInfoBlindedPathZZ_free"))) TS_CVec_C2Tuple_BlindedPayInfoBlindedPathZZ_free(uint64_tArray _res) { + LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ _res_constr; + _res_constr.datalen = _res->arr_len; + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ Elements"); + else + _res_constr.data = NULL; + uint64_t* _res_vals = _res->elems; + for (size_t l = 0; l < _res_constr.datalen; l++) { + uint64_t _res_conv_37 = _res_vals[l]; + void* _res_conv_37_ptr = untag_ptr(_res_conv_37); + CHECK_ACCESS(_res_conv_37_ptr); + LDKC2Tuple_BlindedPayInfoBlindedPathZ _res_conv_37_conv = *(LDKC2Tuple_BlindedPayInfoBlindedPathZ*)(_res_conv_37_ptr); + FREE(untag_ptr(_res_conv_37)); + _res_constr.data[l] = _res_conv_37_conv; + } + FREE(_res); + CVec_C2Tuple_BlindedPayInfoBlindedPathZZ_free(_res_constr); +} + +void __attribute__((export_name("TS_CVec_RouteHintZ_free"))) TS_CVec_RouteHintZ_free(uint64_tArray _res) { + LDKCVec_RouteHintZ _res_constr; + _res_constr.datalen = _res->arr_len; + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKRouteHint), "LDKCVec_RouteHintZ Elements"); + else + _res_constr.data = NULL; + uint64_t* _res_vals = _res->elems; + for (size_t l = 0; l < _res_constr.datalen; l++) { + uint64_t _res_conv_11 = _res_vals[l]; + LDKRouteHint _res_conv_11_conv; + _res_conv_11_conv.inner = untag_ptr(_res_conv_11); + _res_conv_11_conv.is_owned = ptr_is_owned(_res_conv_11); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_11_conv); + _res_constr.data[l] = _res_conv_11_conv; + } + FREE(_res); + CVec_RouteHintZ_free(_res_constr); +} + void __attribute__((export_name("TS_CVec_RouteHintHopZ_free"))) TS_CVec_RouteHintHopZ_free(uint64_tArray _res) { LDKCVec_RouteHintHopZ _res_constr; _res_constr.datalen = _res->arr_len; @@ -13414,1489 +13823,1670 @@ uint64_t __attribute__((export_name("TS_CResult_RouteHintHopDecodeErrorZ_clone" return tag_ptr(ret_conv, true); } -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); +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); +} + +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); return tag_ptr(ret_conv, true); } +int64_t __attribute__((export_name("TS_C2Tuple_usizeTransactionZ_clone_ptr"))) TS_C2Tuple_usizeTransactionZ_clone_ptr(uint64_t arg) { + LDKC2Tuple_usizeTransactionZ* arg_conv = (LDKC2Tuple_usizeTransactionZ*)untag_ptr(arg); + int64_t ret_conv = C2Tuple_usizeTransactionZ_clone_ptr(arg_conv); + return ret_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); +uint64_t __attribute__((export_name("TS_C2Tuple_usizeTransactionZ_clone"))) TS_C2Tuple_usizeTransactionZ_clone(uint64_t orig) { + LDKC2Tuple_usizeTransactionZ* orig_conv = (LDKC2Tuple_usizeTransactionZ*)untag_ptr(orig); + LDKC2Tuple_usizeTransactionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ"); + *ret_conv = C2Tuple_usizeTransactionZ_clone(orig_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); - return ret_conv; +uint64_t __attribute__((export_name("TS_C2Tuple_usizeTransactionZ_new"))) TS_C2Tuple_usizeTransactionZ_new(uint32_t a, int8_tArray b) { + LDKTransaction b_ref; + b_ref.datalen = b->arr_len; + b_ref.data = MALLOC(b_ref.datalen, "LDKTransaction Bytes"); + memcpy(b_ref.data, b->elems, b_ref.datalen); FREE(b); + b_ref.data_is_owned = true; + LDKC2Tuple_usizeTransactionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ"); + *ret_conv = C2Tuple_usizeTransactionZ_new(a, b_ref); + return tag_ptr(ret_conv, true); } -void __attribute__((export_name("TS_CResult_PaymentPurposeDecodeErrorZ_free"))) TS_CResult_PaymentPurposeDecodeErrorZ_free(uint64_t _res) { +void __attribute__((export_name("TS_C2Tuple_usizeTransactionZ_free"))) TS_C2Tuple_usizeTransactionZ_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); + LDKC2Tuple_usizeTransactionZ _res_conv = *(LDKC2Tuple_usizeTransactionZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_PaymentPurposeDecodeErrorZ_free(_res_conv); + C2Tuple_usizeTransactionZ_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); +void __attribute__((export_name("TS_CVec_C2Tuple_usizeTransactionZZ_free"))) TS_CVec_C2Tuple_usizeTransactionZZ_free(uint64_tArray _res) { + LDKCVec_C2Tuple_usizeTransactionZZ _res_constr; + _res_constr.datalen = _res->arr_len; + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements"); + else + _res_constr.data = NULL; + uint64_t* _res_vals = _res->elems; + for (size_t c = 0; c < _res_constr.datalen; c++) { + uint64_t _res_conv_28 = _res_vals[c]; + void* _res_conv_28_ptr = untag_ptr(_res_conv_28); + CHECK_ACCESS(_res_conv_28_ptr); + LDKC2Tuple_usizeTransactionZ _res_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(_res_conv_28_ptr); + FREE(untag_ptr(_res_conv_28)); + _res_constr.data[c] = _res_conv_28_conv; + } + FREE(_res); + CVec_C2Tuple_usizeTransactionZZ_free(_res_constr); +} + +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_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_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_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_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); } -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_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; +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_COption_NetworkUpdateZ_free"))) TS_COption_NetworkUpdateZ_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); - LDKCOption_NetworkUpdateZ _res_conv = *(LDKCOption_NetworkUpdateZ*)(_res_ptr); + LDKC2Tuple_TxidBlockHashZ _res_conv = *(LDKC2Tuple_TxidBlockHashZ*)(_res_ptr); FREE(untag_ptr(_res)); - COption_NetworkUpdateZ_free(_res_conv); + C2Tuple_TxidBlockHashZ_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; +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); } -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; + +void __attribute__((export_name("TS_CVec_MonitorEventZ_free"))) TS_CVec_MonitorEventZ_free(uint64_tArray _res) { + LDKCVec_MonitorEventZ _res_constr; + _res_constr.datalen = _res->arr_len; + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKMonitorEvent), "LDKCVec_MonitorEventZ 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]; + void* _res_conv_14_ptr = untag_ptr(_res_conv_14); + CHECK_ACCESS(_res_conv_14_ptr); + LDKMonitorEvent _res_conv_14_conv = *(LDKMonitorEvent*)(_res_conv_14_ptr); + FREE(untag_ptr(_res_conv_14)); + _res_constr.data[o] = _res_conv_14_conv; + } + FREE(_res); + CVec_MonitorEventZ_free(_res_constr); } -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; +static inline uint64_t C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone_ptr(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *NONNULL_PTR arg) { + LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ), "LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ"); + *ret_conv = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t __attribute__((export_name("TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone_ptr"))) TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone_ptr(uint64_t arg) { + LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* arg_conv = (LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)untag_ptr(arg); + int64_t ret_conv = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone_ptr(arg_conv); + return ret_conv; } -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); - 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_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone"))) TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone(uint64_t orig) { + LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* orig_conv = (LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)untag_ptr(orig); + LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ), "LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ"); + *ret_conv = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone(orig_conv); + return tag_ptr(ret_conv, true); } -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; +uint64_t __attribute__((export_name("TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_new"))) TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_new(uint64_t a, uint64_tArray b, int8_tArray c) { + 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_MonitorEventZ b_constr; + b_constr.datalen = b->arr_len; + if (b_constr.datalen > 0) + b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKMonitorEvent), "LDKCVec_MonitorEventZ Elements"); + else + b_constr.data = NULL; + uint64_t* b_vals = b->elems; + for (size_t o = 0; o < b_constr.datalen; o++) { + uint64_t b_conv_14 = b_vals[o]; + void* b_conv_14_ptr = untag_ptr(b_conv_14); + CHECK_ACCESS(b_conv_14_ptr); + LDKMonitorEvent b_conv_14_conv = *(LDKMonitorEvent*)(b_conv_14_ptr); + b_conv_14_conv = MonitorEvent_clone((LDKMonitorEvent*)untag_ptr(b_conv_14)); + b_constr.data[o] = b_conv_14_conv; + } + FREE(b); + LDKPublicKey c_ref; + CHECK(c->arr_len == 33); + memcpy(c_ref.compressed_form, c->elems, 33); FREE(c); + LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ), "LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ"); + *ret_conv = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_new(a_conv, b_constr, c_ref); + return tag_ptr(ret_conv, true); } -void __attribute__((export_name("TS_COption_PathFailureZ_free"))) TS_COption_PathFailureZ_free(uint64_t _res) { +void __attribute__((export_name("TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_free"))) TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_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); + LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ _res_conv = *(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)(_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; + C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_free(_res_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; +void __attribute__((export_name("TS_CVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ_free"))) TS_CVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ_free(uint64_tArray _res) { + LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ _res_constr; + _res_constr.datalen = _res->arr_len; + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ), "LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ Elements"); + else + _res_constr.data = NULL; + uint64_t* _res_vals = _res->elems; + for (size_t x = 0; x < _res_constr.datalen; x++) { + uint64_t _res_conv_49 = _res_vals[x]; + void* _res_conv_49_ptr = untag_ptr(_res_conv_49); + CHECK_ACCESS(_res_conv_49_ptr); + LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ _res_conv_49_conv = *(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)(_res_conv_49_ptr); + FREE(untag_ptr(_res_conv_49)); + _res_constr.data[x] = _res_conv_49_conv; + } + FREE(_res); + CVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ_free(_res_constr); } -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); +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); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = FixedPenaltyScorer_clone(&o_conv); + LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ"); + *ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_CResult_COption_PathFailureZDecodeErrorZ_err"))) TS_CResult_COption_PathFailureZDecodeErrorZ_err(uint64_t e) { +uint64_t __attribute__((export_name("TS_CResult_FixedPenaltyScorerDecodeErrorZ_err"))) TS_CResult_FixedPenaltyScorerDecodeErrorZ_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); + LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ"); + *ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -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; -} +jboolean __attribute__((export_name("TS_CResult_FixedPenaltyScorerDecodeErrorZ_is_ok"))) TS_CResult_FixedPenaltyScorerDecodeErrorZ_is_ok(uint64_t o) { + LDKCResult_FixedPenaltyScorerDecodeErrorZ* o_conv = (LDKCResult_FixedPenaltyScorerDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} -void __attribute__((export_name("TS_CResult_COption_PathFailureZDecodeErrorZ_free"))) TS_CResult_COption_PathFailureZDecodeErrorZ_free(uint64_t _res) { +void __attribute__((export_name("TS_CResult_FixedPenaltyScorerDecodeErrorZ_free"))) TS_CResult_FixedPenaltyScorerDecodeErrorZ_free(uint64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_COption_PathFailureZDecodeErrorZ _res_conv = *(LDKCResult_COption_PathFailureZDecodeErrorZ*)(_res_ptr); + LDKCResult_FixedPenaltyScorerDecodeErrorZ _res_conv = *(LDKCResult_FixedPenaltyScorerDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_COption_PathFailureZDecodeErrorZ_free(_res_conv); + CResult_FixedPenaltyScorerDecodeErrorZ_free(_res_conv); } -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); +static inline uint64_t CResult_FixedPenaltyScorerDecodeErrorZ_clone_ptr(LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ"); + *ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -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); +int64_t __attribute__((export_name("TS_CResult_FixedPenaltyScorerDecodeErrorZ_clone_ptr"))) TS_CResult_FixedPenaltyScorerDecodeErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_FixedPenaltyScorerDecodeErrorZ* arg_conv = (LDKCResult_FixedPenaltyScorerDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_clone_ptr(arg_conv); return ret_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); +uint64_t __attribute__((export_name("TS_CResult_FixedPenaltyScorerDecodeErrorZ_clone"))) TS_CResult_FixedPenaltyScorerDecodeErrorZ_clone(uint64_t orig) { + LDKCResult_FixedPenaltyScorerDecodeErrorZ* orig_conv = (LDKCResult_FixedPenaltyScorerDecodeErrorZ*)untag_ptr(orig); + LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ"); + *ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_COption_ClosureReasonZ_some"))) TS_COption_ClosureReasonZ_some(uint64_t o) { +static inline uint64_t C2Tuple_u64u64Z_clone_ptr(LDKC2Tuple_u64u64Z *NONNULL_PTR arg) { + LDKC2Tuple_u64u64Z* ret_conv = MALLOC(sizeof(LDKC2Tuple_u64u64Z), "LDKC2Tuple_u64u64Z"); + *ret_conv = C2Tuple_u64u64Z_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t __attribute__((export_name("TS_C2Tuple_u64u64Z_clone_ptr"))) TS_C2Tuple_u64u64Z_clone_ptr(uint64_t arg) { + LDKC2Tuple_u64u64Z* arg_conv = (LDKC2Tuple_u64u64Z*)untag_ptr(arg); + int64_t ret_conv = C2Tuple_u64u64Z_clone_ptr(arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_C2Tuple_u64u64Z_clone"))) TS_C2Tuple_u64u64Z_clone(uint64_t orig) { + LDKC2Tuple_u64u64Z* orig_conv = (LDKC2Tuple_u64u64Z*)untag_ptr(orig); + LDKC2Tuple_u64u64Z* ret_conv = MALLOC(sizeof(LDKC2Tuple_u64u64Z), "LDKC2Tuple_u64u64Z"); + *ret_conv = C2Tuple_u64u64Z_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +uint64_t __attribute__((export_name("TS_C2Tuple_u64u64Z_new"))) TS_C2Tuple_u64u64Z_new(int64_t a, int64_t b) { + LDKC2Tuple_u64u64Z* ret_conv = MALLOC(sizeof(LDKC2Tuple_u64u64Z), "LDKC2Tuple_u64u64Z"); + *ret_conv = C2Tuple_u64u64Z_new(a, b); + return tag_ptr(ret_conv, true); +} + +void __attribute__((export_name("TS_C2Tuple_u64u64Z_free"))) TS_C2Tuple_u64u64Z_free(uint64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKC2Tuple_u64u64Z _res_conv = *(LDKC2Tuple_u64u64Z*)(_res_ptr); + FREE(untag_ptr(_res)); + C2Tuple_u64u64Z_free(_res_conv); +} + +uint64_t __attribute__((export_name("TS_COption_C2Tuple_u64u64ZZ_some"))) TS_COption_C2Tuple_u64u64ZZ_some(uint64_t o) { void* o_ptr = untag_ptr(o); CHECK_ACCESS(o_ptr); - LDKClosureReason o_conv = *(LDKClosureReason*)(o_ptr); - o_conv = ClosureReason_clone((LDKClosureReason*)untag_ptr(o)); - LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ"); - *ret_copy = COption_ClosureReasonZ_some(o_conv); + LDKC2Tuple_u64u64Z o_conv = *(LDKC2Tuple_u64u64Z*)(o_ptr); + o_conv = C2Tuple_u64u64Z_clone((LDKC2Tuple_u64u64Z*)untag_ptr(o)); + LDKCOption_C2Tuple_u64u64ZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_u64u64ZZ), "LDKCOption_C2Tuple_u64u64ZZ"); + *ret_copy = COption_C2Tuple_u64u64ZZ_some(o_conv); uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -uint64_t __attribute__((export_name("TS_COption_ClosureReasonZ_none"))) TS_COption_ClosureReasonZ_none() { - LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ"); - *ret_copy = COption_ClosureReasonZ_none(); +uint64_t __attribute__((export_name("TS_COption_C2Tuple_u64u64ZZ_none"))) TS_COption_C2Tuple_u64u64ZZ_none() { + LDKCOption_C2Tuple_u64u64ZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_u64u64ZZ), "LDKCOption_C2Tuple_u64u64ZZ"); + *ret_copy = COption_C2Tuple_u64u64ZZ_none(); uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -void __attribute__((export_name("TS_COption_ClosureReasonZ_free"))) TS_COption_ClosureReasonZ_free(uint64_t _res) { +void __attribute__((export_name("TS_COption_C2Tuple_u64u64ZZ_free"))) TS_COption_C2Tuple_u64u64ZZ_free(uint64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCOption_ClosureReasonZ _res_conv = *(LDKCOption_ClosureReasonZ*)(_res_ptr); + LDKCOption_C2Tuple_u64u64ZZ _res_conv = *(LDKCOption_C2Tuple_u64u64ZZ*)(_res_ptr); FREE(untag_ptr(_res)); - COption_ClosureReasonZ_free(_res_conv); + COption_C2Tuple_u64u64ZZ_free(_res_conv); } -static inline uint64_t COption_ClosureReasonZ_clone_ptr(LDKCOption_ClosureReasonZ *NONNULL_PTR arg) { - LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ"); - *ret_copy = COption_ClosureReasonZ_clone(arg); +static inline uint64_t COption_C2Tuple_u64u64ZZ_clone_ptr(LDKCOption_C2Tuple_u64u64ZZ *NONNULL_PTR arg) { + LDKCOption_C2Tuple_u64u64ZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_u64u64ZZ), "LDKCOption_C2Tuple_u64u64ZZ"); + *ret_copy = COption_C2Tuple_u64u64ZZ_clone(arg); uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t __attribute__((export_name("TS_COption_ClosureReasonZ_clone_ptr"))) TS_COption_ClosureReasonZ_clone_ptr(uint64_t arg) { - LDKCOption_ClosureReasonZ* arg_conv = (LDKCOption_ClosureReasonZ*)untag_ptr(arg); - int64_t ret_conv = COption_ClosureReasonZ_clone_ptr(arg_conv); +int64_t __attribute__((export_name("TS_COption_C2Tuple_u64u64ZZ_clone_ptr"))) TS_COption_C2Tuple_u64u64ZZ_clone_ptr(uint64_t arg) { + LDKCOption_C2Tuple_u64u64ZZ* arg_conv = (LDKCOption_C2Tuple_u64u64ZZ*)untag_ptr(arg); + int64_t ret_conv = COption_C2Tuple_u64u64ZZ_clone_ptr(arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_COption_ClosureReasonZ_clone"))) TS_COption_ClosureReasonZ_clone(uint64_t orig) { - LDKCOption_ClosureReasonZ* orig_conv = (LDKCOption_ClosureReasonZ*)untag_ptr(orig); - LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ"); - *ret_copy = COption_ClosureReasonZ_clone(orig_conv); +uint64_t __attribute__((export_name("TS_COption_C2Tuple_u64u64ZZ_clone"))) TS_COption_C2Tuple_u64u64ZZ_clone(uint64_t orig) { + LDKCOption_C2Tuple_u64u64ZZ* orig_conv = (LDKCOption_C2Tuple_u64u64ZZ*)untag_ptr(orig); + LDKCOption_C2Tuple_u64u64ZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_u64u64ZZ), "LDKCOption_C2Tuple_u64u64ZZ"); + *ret_copy = COption_C2Tuple_u64u64ZZ_clone(orig_conv); uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -uint64_t __attribute__((export_name("TS_CResult_COption_ClosureReasonZDecodeErrorZ_ok"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_ok(uint64_t o) { - void* o_ptr = untag_ptr(o); - CHECK_ACCESS(o_ptr); - LDKCOption_ClosureReasonZ o_conv = *(LDKCOption_ClosureReasonZ*)(o_ptr); - o_conv = COption_ClosureReasonZ_clone((LDKCOption_ClosureReasonZ*)untag_ptr(o)); - LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ"); - *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_ok(o_conv); +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_CResult_COption_ClosureReasonZDecodeErrorZ_err"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_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_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ"); - *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_err(e_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); } -jboolean __attribute__((export_name("TS_CResult_COption_ClosureReasonZDecodeErrorZ_is_ok"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_is_ok(uint64_t o) { - LDKCResult_COption_ClosureReasonZDecodeErrorZ* o_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_is_ok(o_conv); - return ret_conv; +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_CResult_COption_ClosureReasonZDecodeErrorZ_free"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_free(uint64_t _res) { +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); - LDKCResult_COption_ClosureReasonZDecodeErrorZ _res_conv = *(LDKCResult_COption_ClosureReasonZDecodeErrorZ*)(_res_ptr); + LDKC2Tuple_Z _res_conv = *(LDKC2Tuple_Z*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_COption_ClosureReasonZDecodeErrorZ_free(_res_conv); + C2Tuple_Z_free(_res_conv); } -static inline uint64_t CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr(LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ"); - *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_clone(arg); +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_CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr(uint64_t arg) { - LDKCResult_COption_ClosureReasonZDecodeErrorZ* arg_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr(arg_conv); +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_CResult_COption_ClosureReasonZDecodeErrorZ_clone"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_clone(uint64_t orig) { - LDKCResult_COption_ClosureReasonZDecodeErrorZ* orig_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)untag_ptr(orig); - LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ"); - *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_clone(orig_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_COption_HTLCDestinationZ_some"))) TS_COption_HTLCDestinationZ_some(uint64_t o) { +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); - LDKHTLCDestination o_conv = *(LDKHTLCDestination*)(o_ptr); - o_conv = HTLCDestination_clone((LDKHTLCDestination*)untag_ptr(o)); - LDKCOption_HTLCDestinationZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCDestinationZ), "LDKCOption_HTLCDestinationZ"); - *ret_copy = COption_HTLCDestinationZ_some(o_conv); + 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_HTLCDestinationZ_none"))) TS_COption_HTLCDestinationZ_none() { - LDKCOption_HTLCDestinationZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCDestinationZ), "LDKCOption_HTLCDestinationZ"); - *ret_copy = COption_HTLCDestinationZ_none(); +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_HTLCDestinationZ_free"))) TS_COption_HTLCDestinationZ_free(uint64_t _res) { +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_HTLCDestinationZ _res_conv = *(LDKCOption_HTLCDestinationZ*)(_res_ptr); + LDKCOption_C2Tuple_EightU16sEightU16sZZ _res_conv = *(LDKCOption_C2Tuple_EightU16sEightU16sZZ*)(_res_ptr); FREE(untag_ptr(_res)); - COption_HTLCDestinationZ_free(_res_conv); + COption_C2Tuple_EightU16sEightU16sZZ_free(_res_conv); } -static inline uint64_t COption_HTLCDestinationZ_clone_ptr(LDKCOption_HTLCDestinationZ *NONNULL_PTR arg) { - LDKCOption_HTLCDestinationZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCDestinationZ), "LDKCOption_HTLCDestinationZ"); - *ret_copy = COption_HTLCDestinationZ_clone(arg); +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_HTLCDestinationZ_clone_ptr"))) TS_COption_HTLCDestinationZ_clone_ptr(uint64_t arg) { - LDKCOption_HTLCDestinationZ* arg_conv = (LDKCOption_HTLCDestinationZ*)untag_ptr(arg); - int64_t ret_conv = COption_HTLCDestinationZ_clone_ptr(arg_conv); +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_HTLCDestinationZ_clone"))) TS_COption_HTLCDestinationZ_clone(uint64_t orig) { - LDKCOption_HTLCDestinationZ* orig_conv = (LDKCOption_HTLCDestinationZ*)untag_ptr(orig); - LDKCOption_HTLCDestinationZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCDestinationZ), "LDKCOption_HTLCDestinationZ"); - *ret_copy = COption_HTLCDestinationZ_clone(orig_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; } -uint64_t __attribute__((export_name("TS_CResult_COption_HTLCDestinationZDecodeErrorZ_ok"))) TS_CResult_COption_HTLCDestinationZDecodeErrorZ_ok(uint64_t o) { - void* o_ptr = untag_ptr(o); - CHECK_ACCESS(o_ptr); - LDKCOption_HTLCDestinationZ o_conv = *(LDKCOption_HTLCDestinationZ*)(o_ptr); - o_conv = COption_HTLCDestinationZ_clone((LDKCOption_HTLCDestinationZ*)untag_ptr(o)); - LDKCResult_COption_HTLCDestinationZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_HTLCDestinationZDecodeErrorZ), "LDKCResult_COption_HTLCDestinationZDecodeErrorZ"); - *ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_ok(o_conv); +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; + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKNodeId), "LDKCVec_NodeIdZ Elements"); + else + _res_constr.data = NULL; + uint64_t* _res_vals = _res->elems; + for (size_t i = 0; i < _res_constr.datalen; i++) { + uint64_t _res_conv_8 = _res_vals[i]; + LDKNodeId _res_conv_8_conv; + _res_conv_8_conv.inner = untag_ptr(_res_conv_8); + _res_conv_8_conv.is_owned = ptr_is_owned(_res_conv_8); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_8_conv); + _res_constr.data[i] = _res_conv_8_conv; + } + FREE(_res); + CVec_NodeIdZ_free(_res_constr); +} + +uint64_t __attribute__((export_name("TS_CResult_ProbabilisticScorerDecodeErrorZ_ok"))) TS_CResult_ProbabilisticScorerDecodeErrorZ_ok(uint64_t o) { + LDKProbabilisticScorer o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + // WARNING: we need a move here but no clone is available for LDKProbabilisticScorer + + LDKCResult_ProbabilisticScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ProbabilisticScorerDecodeErrorZ), "LDKCResult_ProbabilisticScorerDecodeErrorZ"); + *ret_conv = CResult_ProbabilisticScorerDecodeErrorZ_ok(o_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) { +uint64_t __attribute__((export_name("TS_CResult_ProbabilisticScorerDecodeErrorZ_err"))) TS_CResult_ProbabilisticScorerDecodeErrorZ_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_HTLCDestinationZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_HTLCDestinationZDecodeErrorZ), "LDKCResult_COption_HTLCDestinationZDecodeErrorZ"); - *ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_err(e_conv); + LDKCResult_ProbabilisticScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ProbabilisticScorerDecodeErrorZ), "LDKCResult_ProbabilisticScorerDecodeErrorZ"); + *ret_conv = CResult_ProbabilisticScorerDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean __attribute__((export_name("TS_CResult_COption_HTLCDestinationZDecodeErrorZ_is_ok"))) TS_CResult_COption_HTLCDestinationZDecodeErrorZ_is_ok(uint64_t o) { - LDKCResult_COption_HTLCDestinationZDecodeErrorZ* o_conv = (LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_is_ok(o_conv); +jboolean __attribute__((export_name("TS_CResult_ProbabilisticScorerDecodeErrorZ_is_ok"))) TS_CResult_ProbabilisticScorerDecodeErrorZ_is_ok(uint64_t o) { + LDKCResult_ProbabilisticScorerDecodeErrorZ* o_conv = (LDKCResult_ProbabilisticScorerDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_ProbabilisticScorerDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void __attribute__((export_name("TS_CResult_COption_HTLCDestinationZDecodeErrorZ_free"))) TS_CResult_COption_HTLCDestinationZDecodeErrorZ_free(uint64_t _res) { +void __attribute__((export_name("TS_CResult_ProbabilisticScorerDecodeErrorZ_free"))) TS_CResult_ProbabilisticScorerDecodeErrorZ_free(uint64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_COption_HTLCDestinationZDecodeErrorZ _res_conv = *(LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)(_res_ptr); + LDKCResult_ProbabilisticScorerDecodeErrorZ _res_conv = *(LDKCResult_ProbabilisticScorerDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_COption_HTLCDestinationZDecodeErrorZ_free(_res_conv); + CResult_ProbabilisticScorerDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_COption_HTLCDestinationZDecodeErrorZ_clone_ptr(LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_COption_HTLCDestinationZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_HTLCDestinationZDecodeErrorZ), "LDKCResult_COption_HTLCDestinationZDecodeErrorZ"); - *ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_clone(arg); +uint64_t __attribute__((export_name("TS_CResult_InitFeaturesDecodeErrorZ_ok"))) TS_CResult_InitFeaturesDecodeErrorZ_ok(uint64_t o) { + LDKInitFeatures 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 = InitFeatures_clone(&o_conv); + LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ"); + *ret_conv = CResult_InitFeaturesDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t __attribute__((export_name("TS_CResult_COption_HTLCDestinationZDecodeErrorZ_clone_ptr"))) TS_CResult_COption_HTLCDestinationZDecodeErrorZ_clone_ptr(uint64_t arg) { - LDKCResult_COption_HTLCDestinationZDecodeErrorZ* arg_conv = (LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_clone_ptr(arg_conv); - return ret_conv; -} -uint64_t __attribute__((export_name("TS_CResult_COption_HTLCDestinationZDecodeErrorZ_clone"))) TS_CResult_COption_HTLCDestinationZDecodeErrorZ_clone(uint64_t orig) { - LDKCResult_COption_HTLCDestinationZDecodeErrorZ* orig_conv = (LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)untag_ptr(orig); - LDKCResult_COption_HTLCDestinationZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_HTLCDestinationZDecodeErrorZ), "LDKCResult_COption_HTLCDestinationZDecodeErrorZ"); - *ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_clone(orig_conv); +uint64_t __attribute__((export_name("TS_CResult_InitFeaturesDecodeErrorZ_err"))) TS_CResult_InitFeaturesDecodeErrorZ_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_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_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_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; +jboolean __attribute__((export_name("TS_CResult_InitFeaturesDecodeErrorZ_is_ok"))) TS_CResult_InitFeaturesDecodeErrorZ_is_ok(uint64_t o) { + LDKCResult_InitFeaturesDecodeErrorZ* o_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_InitFeaturesDecodeErrorZ_is_ok(o_conv); + return ret_conv; } -void __attribute__((export_name("TS_COption_u128Z_free"))) TS_COption_u128Z_free(uint64_t _res) { +void __attribute__((export_name("TS_CResult_InitFeaturesDecodeErrorZ_free"))) TS_CResult_InitFeaturesDecodeErrorZ_free(uint64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCOption_u128Z _res_conv = *(LDKCOption_u128Z*)(_res_ptr); + LDKCResult_InitFeaturesDecodeErrorZ _res_conv = *(LDKCResult_InitFeaturesDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - COption_u128Z_free(_res_conv); + CResult_InitFeaturesDecodeErrorZ_free(_res_conv); } -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; +static inline uint64_t CResult_InitFeaturesDecodeErrorZ_clone_ptr(LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ"); + *ret_conv = CResult_InitFeaturesDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); } -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); +int64_t __attribute__((export_name("TS_CResult_InitFeaturesDecodeErrorZ_clone_ptr"))) TS_CResult_InitFeaturesDecodeErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_InitFeaturesDecodeErrorZ* arg_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_InitFeaturesDecodeErrorZ_clone_ptr(arg_conv); return ret_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_InitFeaturesDecodeErrorZ_clone"))) TS_CResult_InitFeaturesDecodeErrorZ_clone(uint64_t orig) { + LDKCResult_InitFeaturesDecodeErrorZ* orig_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)untag_ptr(orig); + LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ"); + *ret_conv = CResult_InitFeaturesDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); } -void __attribute__((export_name("TS_CVec_SpendableOutputDescriptorZ_free"))) TS_CVec_SpendableOutputDescriptorZ_free(uint64_tArray _res) { - LDKCVec_SpendableOutputDescriptorZ _res_constr; - _res_constr.datalen = _res->arr_len; - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements"); - else - _res_constr.data = NULL; - uint64_t* _res_vals = _res->elems; - for (size_t b = 0; b < _res_constr.datalen; b++) { - uint64_t _res_conv_27 = _res_vals[b]; - void* _res_conv_27_ptr = untag_ptr(_res_conv_27); - CHECK_ACCESS(_res_conv_27_ptr); - LDKSpendableOutputDescriptor _res_conv_27_conv = *(LDKSpendableOutputDescriptor*)(_res_conv_27_ptr); - FREE(untag_ptr(_res_conv_27)); - _res_constr.data[b] = _res_conv_27_conv; - } - FREE(_res); - CVec_SpendableOutputDescriptorZ_free(_res_constr); +uint64_t __attribute__((export_name("TS_CResult_ChannelFeaturesDecodeErrorZ_ok"))) TS_CResult_ChannelFeaturesDecodeErrorZ_ok(uint64_t o) { + LDKChannelFeatures 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 = ChannelFeatures_clone(&o_conv); + LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ"); + *ret_conv = CResult_ChannelFeaturesDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_COption_EventZ_some"))) TS_COption_EventZ_some(uint64_t o) { - void* o_ptr = untag_ptr(o); - CHECK_ACCESS(o_ptr); - LDKEvent o_conv = *(LDKEvent*)(o_ptr); - o_conv = Event_clone((LDKEvent*)untag_ptr(o)); - LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ"); - *ret_copy = COption_EventZ_some(o_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +uint64_t __attribute__((export_name("TS_CResult_ChannelFeaturesDecodeErrorZ_err"))) TS_CResult_ChannelFeaturesDecodeErrorZ_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_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_COption_EventZ_none"))) TS_COption_EventZ_none() { - LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ"); - *ret_copy = COption_EventZ_none(); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jboolean __attribute__((export_name("TS_CResult_ChannelFeaturesDecodeErrorZ_is_ok"))) TS_CResult_ChannelFeaturesDecodeErrorZ_is_ok(uint64_t o) { + LDKCResult_ChannelFeaturesDecodeErrorZ* o_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_ChannelFeaturesDecodeErrorZ_is_ok(o_conv); + return ret_conv; } -void __attribute__((export_name("TS_COption_EventZ_free"))) TS_COption_EventZ_free(uint64_t _res) { +void __attribute__((export_name("TS_CResult_ChannelFeaturesDecodeErrorZ_free"))) TS_CResult_ChannelFeaturesDecodeErrorZ_free(uint64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCOption_EventZ _res_conv = *(LDKCOption_EventZ*)(_res_ptr); + LDKCResult_ChannelFeaturesDecodeErrorZ _res_conv = *(LDKCResult_ChannelFeaturesDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - COption_EventZ_free(_res_conv); + CResult_ChannelFeaturesDecodeErrorZ_free(_res_conv); } -static inline uint64_t COption_EventZ_clone_ptr(LDKCOption_EventZ *NONNULL_PTR arg) { - LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ"); - *ret_copy = COption_EventZ_clone(arg); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +static inline uint64_t CResult_ChannelFeaturesDecodeErrorZ_clone_ptr(LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ"); + *ret_conv = CResult_ChannelFeaturesDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); } -int64_t __attribute__((export_name("TS_COption_EventZ_clone_ptr"))) TS_COption_EventZ_clone_ptr(uint64_t arg) { - LDKCOption_EventZ* arg_conv = (LDKCOption_EventZ*)untag_ptr(arg); - int64_t ret_conv = COption_EventZ_clone_ptr(arg_conv); +int64_t __attribute__((export_name("TS_CResult_ChannelFeaturesDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelFeaturesDecodeErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_ChannelFeaturesDecodeErrorZ* arg_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_ChannelFeaturesDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_COption_EventZ_clone"))) TS_COption_EventZ_clone(uint64_t orig) { - LDKCOption_EventZ* orig_conv = (LDKCOption_EventZ*)untag_ptr(orig); - LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ"); - *ret_copy = COption_EventZ_clone(orig_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +uint64_t __attribute__((export_name("TS_CResult_ChannelFeaturesDecodeErrorZ_clone"))) TS_CResult_ChannelFeaturesDecodeErrorZ_clone(uint64_t orig) { + LDKCResult_ChannelFeaturesDecodeErrorZ* orig_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)untag_ptr(orig); + LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ"); + *ret_conv = CResult_ChannelFeaturesDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_CResult_COption_EventZDecodeErrorZ_ok"))) TS_CResult_COption_EventZDecodeErrorZ_ok(uint64_t o) { - void* o_ptr = untag_ptr(o); - CHECK_ACCESS(o_ptr); - LDKCOption_EventZ o_conv = *(LDKCOption_EventZ*)(o_ptr); - o_conv = COption_EventZ_clone((LDKCOption_EventZ*)untag_ptr(o)); - LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ"); - *ret_conv = CResult_COption_EventZDecodeErrorZ_ok(o_conv); +uint64_t __attribute__((export_name("TS_CResult_NodeFeaturesDecodeErrorZ_ok"))) TS_CResult_NodeFeaturesDecodeErrorZ_ok(uint64_t o) { + LDKNodeFeatures 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 = NodeFeatures_clone(&o_conv); + LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ"); + *ret_conv = CResult_NodeFeaturesDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_CResult_COption_EventZDecodeErrorZ_err"))) TS_CResult_COption_EventZDecodeErrorZ_err(uint64_t e) { +uint64_t __attribute__((export_name("TS_CResult_NodeFeaturesDecodeErrorZ_err"))) TS_CResult_NodeFeaturesDecodeErrorZ_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_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ"); - *ret_conv = CResult_COption_EventZDecodeErrorZ_err(e_conv); + LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ"); + *ret_conv = CResult_NodeFeaturesDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean __attribute__((export_name("TS_CResult_COption_EventZDecodeErrorZ_is_ok"))) TS_CResult_COption_EventZDecodeErrorZ_is_ok(uint64_t o) { - LDKCResult_COption_EventZDecodeErrorZ* o_conv = (LDKCResult_COption_EventZDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_COption_EventZDecodeErrorZ_is_ok(o_conv); +jboolean __attribute__((export_name("TS_CResult_NodeFeaturesDecodeErrorZ_is_ok"))) TS_CResult_NodeFeaturesDecodeErrorZ_is_ok(uint64_t o) { + LDKCResult_NodeFeaturesDecodeErrorZ* o_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_NodeFeaturesDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void __attribute__((export_name("TS_CResult_COption_EventZDecodeErrorZ_free"))) TS_CResult_COption_EventZDecodeErrorZ_free(uint64_t _res) { +void __attribute__((export_name("TS_CResult_NodeFeaturesDecodeErrorZ_free"))) TS_CResult_NodeFeaturesDecodeErrorZ_free(uint64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_COption_EventZDecodeErrorZ _res_conv = *(LDKCResult_COption_EventZDecodeErrorZ*)(_res_ptr); + LDKCResult_NodeFeaturesDecodeErrorZ _res_conv = *(LDKCResult_NodeFeaturesDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_COption_EventZDecodeErrorZ_free(_res_conv); + CResult_NodeFeaturesDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_COption_EventZDecodeErrorZ_clone_ptr(LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ"); - *ret_conv = CResult_COption_EventZDecodeErrorZ_clone(arg); +static inline uint64_t CResult_NodeFeaturesDecodeErrorZ_clone_ptr(LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ"); + *ret_conv = CResult_NodeFeaturesDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t __attribute__((export_name("TS_CResult_COption_EventZDecodeErrorZ_clone_ptr"))) TS_CResult_COption_EventZDecodeErrorZ_clone_ptr(uint64_t arg) { - LDKCResult_COption_EventZDecodeErrorZ* arg_conv = (LDKCResult_COption_EventZDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_COption_EventZDecodeErrorZ_clone_ptr(arg_conv); +int64_t __attribute__((export_name("TS_CResult_NodeFeaturesDecodeErrorZ_clone_ptr"))) TS_CResult_NodeFeaturesDecodeErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_NodeFeaturesDecodeErrorZ* arg_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_NodeFeaturesDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_CResult_COption_EventZDecodeErrorZ_clone"))) TS_CResult_COption_EventZDecodeErrorZ_clone(uint64_t orig) { - LDKCResult_COption_EventZDecodeErrorZ* orig_conv = (LDKCResult_COption_EventZDecodeErrorZ*)untag_ptr(orig); - LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ"); - *ret_conv = CResult_COption_EventZDecodeErrorZ_clone(orig_conv); +uint64_t __attribute__((export_name("TS_CResult_NodeFeaturesDecodeErrorZ_clone"))) TS_CResult_NodeFeaturesDecodeErrorZ_clone(uint64_t orig) { + LDKCResult_NodeFeaturesDecodeErrorZ* orig_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)untag_ptr(orig); + LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ"); + *ret_conv = CResult_NodeFeaturesDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -void __attribute__((export_name("TS_CVec_MessageSendEventZ_free"))) TS_CVec_MessageSendEventZ_free(uint64_tArray _res) { - LDKCVec_MessageSendEventZ _res_constr; - _res_constr.datalen = _res->arr_len; - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKMessageSendEvent), "LDKCVec_MessageSendEventZ 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]; - void* _res_conv_18_ptr = untag_ptr(_res_conv_18); - CHECK_ACCESS(_res_conv_18_ptr); - LDKMessageSendEvent _res_conv_18_conv = *(LDKMessageSendEvent*)(_res_conv_18_ptr); - FREE(untag_ptr(_res_conv_18)); - _res_constr.data[s] = _res_conv_18_conv; - } - FREE(_res); - CVec_MessageSendEventZ_free(_res_constr); -} - -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); +uint64_t __attribute__((export_name("TS_CResult_InvoiceFeaturesDecodeErrorZ_ok"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_ok(uint64_t o) { + LDKInvoiceFeatures 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 = InvoiceFeatures_clone(&o_conv); + LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ"); + *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t __attribute__((export_name("TS_C2Tuple_usizeTransactionZ_clone_ptr"))) TS_C2Tuple_usizeTransactionZ_clone_ptr(uint64_t arg) { - LDKC2Tuple_usizeTransactionZ* arg_conv = (LDKC2Tuple_usizeTransactionZ*)untag_ptr(arg); - int64_t ret_conv = C2Tuple_usizeTransactionZ_clone_ptr(arg_conv); - return ret_conv; -} -uint64_t __attribute__((export_name("TS_C2Tuple_usizeTransactionZ_clone"))) TS_C2Tuple_usizeTransactionZ_clone(uint64_t orig) { - LDKC2Tuple_usizeTransactionZ* orig_conv = (LDKC2Tuple_usizeTransactionZ*)untag_ptr(orig); - LDKC2Tuple_usizeTransactionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ"); - *ret_conv = C2Tuple_usizeTransactionZ_clone(orig_conv); +uint64_t __attribute__((export_name("TS_CResult_InvoiceFeaturesDecodeErrorZ_err"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_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_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ"); + *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_C2Tuple_usizeTransactionZ_new"))) TS_C2Tuple_usizeTransactionZ_new(uint32_t a, int8_tArray b) { - LDKTransaction b_ref; - b_ref.datalen = b->arr_len; - b_ref.data = MALLOC(b_ref.datalen, "LDKTransaction Bytes"); - memcpy(b_ref.data, b->elems, b_ref.datalen); FREE(b); - b_ref.data_is_owned = true; - LDKC2Tuple_usizeTransactionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ"); - *ret_conv = C2Tuple_usizeTransactionZ_new(a, b_ref); - return tag_ptr(ret_conv, true); +jboolean __attribute__((export_name("TS_CResult_InvoiceFeaturesDecodeErrorZ_is_ok"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_is_ok(uint64_t o) { + LDKCResult_InvoiceFeaturesDecodeErrorZ* o_conv = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_is_ok(o_conv); + return ret_conv; } -void __attribute__((export_name("TS_C2Tuple_usizeTransactionZ_free"))) TS_C2Tuple_usizeTransactionZ_free(uint64_t _res) { +void __attribute__((export_name("TS_CResult_InvoiceFeaturesDecodeErrorZ_free"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_free(uint64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKC2Tuple_usizeTransactionZ _res_conv = *(LDKC2Tuple_usizeTransactionZ*)(_res_ptr); + LDKCResult_InvoiceFeaturesDecodeErrorZ _res_conv = *(LDKCResult_InvoiceFeaturesDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - C2Tuple_usizeTransactionZ_free(_res_conv); -} - -void __attribute__((export_name("TS_CVec_C2Tuple_usizeTransactionZZ_free"))) TS_CVec_C2Tuple_usizeTransactionZZ_free(uint64_tArray _res) { - LDKCVec_C2Tuple_usizeTransactionZZ _res_constr; - _res_constr.datalen = _res->arr_len; - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements"); - else - _res_constr.data = NULL; - uint64_t* _res_vals = _res->elems; - for (size_t c = 0; c < _res_constr.datalen; c++) { - uint64_t _res_conv_28 = _res_vals[c]; - void* _res_conv_28_ptr = untag_ptr(_res_conv_28); - CHECK_ACCESS(_res_conv_28_ptr); - LDKC2Tuple_usizeTransactionZ _res_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(_res_conv_28_ptr); - FREE(untag_ptr(_res_conv_28)); - _res_constr.data[c] = _res_conv_28_conv; - } - FREE(_res); - CVec_C2Tuple_usizeTransactionZZ_free(_res_constr); + CResult_InvoiceFeaturesDecodeErrorZ_free(_res_conv); } -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); +static inline uint64_t CResult_InvoiceFeaturesDecodeErrorZ_clone_ptr(LDKCResult_InvoiceFeaturesDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ"); + *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_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); +int64_t __attribute__((export_name("TS_CResult_InvoiceFeaturesDecodeErrorZ_clone_ptr"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_InvoiceFeaturesDecodeErrorZ* arg_conv = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_clone_ptr(arg_conv); return ret_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); +uint64_t __attribute__((export_name("TS_CResult_InvoiceFeaturesDecodeErrorZ_clone"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_clone(uint64_t orig) { + LDKCResult_InvoiceFeaturesDecodeErrorZ* orig_conv = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)untag_ptr(orig); + LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ"); + *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -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); +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); } -void __attribute__((export_name("TS_C2Tuple_TxidBlockHashZ_free"))) TS_C2Tuple_TxidBlockHashZ_free(uint64_t _res) { +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); - LDKC2Tuple_TxidBlockHashZ _res_conv = *(LDKC2Tuple_TxidBlockHashZ*)(_res_ptr); + LDKCResult_BlindedHopFeaturesDecodeErrorZ _res_conv = *(LDKCResult_BlindedHopFeaturesDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - C2Tuple_TxidBlockHashZ_free(_res_conv); + CResult_BlindedHopFeaturesDecodeErrorZ_free(_res_conv); } -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); +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); } - -void __attribute__((export_name("TS_CVec_MonitorEventZ_free"))) TS_CVec_MonitorEventZ_free(uint64_tArray _res) { - LDKCVec_MonitorEventZ _res_constr; - _res_constr.datalen = _res->arr_len; - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKMonitorEvent), "LDKCVec_MonitorEventZ 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]; - void* _res_conv_14_ptr = untag_ptr(_res_conv_14); - CHECK_ACCESS(_res_conv_14_ptr); - LDKMonitorEvent _res_conv_14_conv = *(LDKMonitorEvent*)(_res_conv_14_ptr); - FREE(untag_ptr(_res_conv_14)); - _res_constr.data[o] = _res_conv_14_conv; - } - FREE(_res); - CVec_MonitorEventZ_free(_res_constr); +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; } -static inline uint64_t C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone_ptr(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *NONNULL_PTR arg) { - LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ), "LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ"); - *ret_conv = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone(arg); +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); } -int64_t __attribute__((export_name("TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone_ptr"))) TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone_ptr(uint64_t arg) { - LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* arg_conv = (LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)untag_ptr(arg); - int64_t ret_conv = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone_ptr(arg_conv); - return ret_conv; -} -uint64_t __attribute__((export_name("TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone"))) TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone(uint64_t orig) { - LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* orig_conv = (LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)untag_ptr(orig); - LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ), "LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ"); - *ret_conv = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone(orig_conv); +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); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = ChannelTypeFeatures_clone(&o_conv); + LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ"); + *ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_new"))) TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_new(uint64_t a, uint64_tArray b, int8_tArray c) { - 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_MonitorEventZ b_constr; - b_constr.datalen = b->arr_len; - if (b_constr.datalen > 0) - b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKMonitorEvent), "LDKCVec_MonitorEventZ Elements"); - else - b_constr.data = NULL; - uint64_t* b_vals = b->elems; - for (size_t o = 0; o < b_constr.datalen; o++) { - uint64_t b_conv_14 = b_vals[o]; - void* b_conv_14_ptr = untag_ptr(b_conv_14); - CHECK_ACCESS(b_conv_14_ptr); - LDKMonitorEvent b_conv_14_conv = *(LDKMonitorEvent*)(b_conv_14_ptr); - b_conv_14_conv = MonitorEvent_clone((LDKMonitorEvent*)untag_ptr(b_conv_14)); - b_constr.data[o] = b_conv_14_conv; - } - FREE(b); - LDKPublicKey c_ref; - CHECK(c->arr_len == 33); - memcpy(c_ref.compressed_form, c->elems, 33); FREE(c); - LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ), "LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ"); - *ret_conv = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_new(a_conv, b_constr, c_ref); +uint64_t __attribute__((export_name("TS_CResult_ChannelTypeFeaturesDecodeErrorZ_err"))) TS_CResult_ChannelTypeFeaturesDecodeErrorZ_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_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ"); + *ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -void __attribute__((export_name("TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_free"))) TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_free(uint64_t _res) { +jboolean __attribute__((export_name("TS_CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok"))) TS_CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok(uint64_t o) { + LDKCResult_ChannelTypeFeaturesDecodeErrorZ* o_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_CResult_ChannelTypeFeaturesDecodeErrorZ_free"))) TS_CResult_ChannelTypeFeaturesDecodeErrorZ_free(uint64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ _res_conv = *(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)(_res_ptr); + LDKCResult_ChannelTypeFeaturesDecodeErrorZ _res_conv = *(LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_free(_res_conv); + CResult_ChannelTypeFeaturesDecodeErrorZ_free(_res_conv); } -void __attribute__((export_name("TS_CVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ_free"))) TS_CVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ_free(uint64_tArray _res) { - LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ _res_constr; - _res_constr.datalen = _res->arr_len; - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ), "LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ Elements"); - else - _res_constr.data = NULL; - uint64_t* _res_vals = _res->elems; - for (size_t x = 0; x < _res_constr.datalen; x++) { - uint64_t _res_conv_49 = _res_vals[x]; - void* _res_conv_49_ptr = untag_ptr(_res_conv_49); - CHECK_ACCESS(_res_conv_49_ptr); - LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ _res_conv_49_conv = *(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)(_res_conv_49_ptr); - FREE(untag_ptr(_res_conv_49)); - _res_constr.data[x] = _res_conv_49_conv; - } - FREE(_res); - CVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ_free(_res_constr); +static inline uint64_t CResult_ChannelTypeFeaturesDecodeErrorZ_clone_ptr(LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ"); + *ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t __attribute__((export_name("TS_CResult_ChannelTypeFeaturesDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelTypeFeaturesDecodeErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_ChannelTypeFeaturesDecodeErrorZ* arg_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; } -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); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = FixedPenaltyScorer_clone(&o_conv); - LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ"); - *ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_ok(o_conv); +uint64_t __attribute__((export_name("TS_CResult_ChannelTypeFeaturesDecodeErrorZ_clone"))) TS_CResult_ChannelTypeFeaturesDecodeErrorZ_clone(uint64_t orig) { + LDKCResult_ChannelTypeFeaturesDecodeErrorZ* orig_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)untag_ptr(orig); + LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ"); + *ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_CResult_FixedPenaltyScorerDecodeErrorZ_err"))) TS_CResult_FixedPenaltyScorerDecodeErrorZ_err(uint64_t e) { +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_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_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ"); - *ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_err(e_conv); + 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_FixedPenaltyScorerDecodeErrorZ_is_ok"))) TS_CResult_FixedPenaltyScorerDecodeErrorZ_is_ok(uint64_t o) { - LDKCResult_FixedPenaltyScorerDecodeErrorZ* o_conv = (LDKCResult_FixedPenaltyScorerDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_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_FixedPenaltyScorerDecodeErrorZ_free"))) TS_CResult_FixedPenaltyScorerDecodeErrorZ_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_FixedPenaltyScorerDecodeErrorZ _res_conv = *(LDKCResult_FixedPenaltyScorerDecodeErrorZ*)(_res_ptr); + LDKCResult_PaymentPurposeDecodeErrorZ _res_conv = *(LDKCResult_PaymentPurposeDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_FixedPenaltyScorerDecodeErrorZ_free(_res_conv); + CResult_PaymentPurposeDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_FixedPenaltyScorerDecodeErrorZ_clone_ptr(LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ"); - *ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_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_FixedPenaltyScorerDecodeErrorZ_clone_ptr"))) TS_CResult_FixedPenaltyScorerDecodeErrorZ_clone_ptr(uint64_t arg) { - LDKCResult_FixedPenaltyScorerDecodeErrorZ* arg_conv = (LDKCResult_FixedPenaltyScorerDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_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_FixedPenaltyScorerDecodeErrorZ_clone"))) TS_CResult_FixedPenaltyScorerDecodeErrorZ_clone(uint64_t orig) { - LDKCResult_FixedPenaltyScorerDecodeErrorZ* orig_conv = (LDKCResult_FixedPenaltyScorerDecodeErrorZ*)untag_ptr(orig); - LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ"); - *ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -static inline uint64_t C2Tuple_u64u64Z_clone_ptr(LDKC2Tuple_u64u64Z *NONNULL_PTR arg) { - LDKC2Tuple_u64u64Z* ret_conv = MALLOC(sizeof(LDKC2Tuple_u64u64Z), "LDKC2Tuple_u64u64Z"); - *ret_conv = C2Tuple_u64u64Z_clone(arg); +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); } -int64_t __attribute__((export_name("TS_C2Tuple_u64u64Z_clone_ptr"))) TS_C2Tuple_u64u64Z_clone_ptr(uint64_t arg) { - LDKC2Tuple_u64u64Z* arg_conv = (LDKC2Tuple_u64u64Z*)untag_ptr(arg); - int64_t ret_conv = C2Tuple_u64u64Z_clone_ptr(arg_conv); - return ret_conv; -} -uint64_t __attribute__((export_name("TS_C2Tuple_u64u64Z_clone"))) TS_C2Tuple_u64u64Z_clone(uint64_t orig) { - LDKC2Tuple_u64u64Z* orig_conv = (LDKC2Tuple_u64u64Z*)untag_ptr(orig); - LDKC2Tuple_u64u64Z* ret_conv = MALLOC(sizeof(LDKC2Tuple_u64u64Z), "LDKC2Tuple_u64u64Z"); - *ret_conv = C2Tuple_u64u64Z_clone(orig_conv); - 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 ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -uint64_t __attribute__((export_name("TS_C2Tuple_u64u64Z_new"))) TS_C2Tuple_u64u64Z_new(int64_t a, int64_t b) { - LDKC2Tuple_u64u64Z* ret_conv = MALLOC(sizeof(LDKC2Tuple_u64u64Z), "LDKC2Tuple_u64u64Z"); - *ret_conv = C2Tuple_u64u64Z_new(a, b); - return tag_ptr(ret_conv, true); +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_C2Tuple_u64u64Z_free"))) TS_C2Tuple_u64u64Z_free(uint64_t _res) { +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); - LDKC2Tuple_u64u64Z _res_conv = *(LDKC2Tuple_u64u64Z*)(_res_ptr); + LDKCOption_NetworkUpdateZ _res_conv = *(LDKCOption_NetworkUpdateZ*)(_res_ptr); FREE(untag_ptr(_res)); - C2Tuple_u64u64Z_free(_res_conv); + COption_NetworkUpdateZ_free(_res_conv); } -uint64_t __attribute__((export_name("TS_COption_C2Tuple_u64u64ZZ_some"))) TS_COption_C2Tuple_u64u64ZZ_some(uint64_t o) { +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); - LDKC2Tuple_u64u64Z o_conv = *(LDKC2Tuple_u64u64Z*)(o_ptr); - o_conv = C2Tuple_u64u64Z_clone((LDKC2Tuple_u64u64Z*)untag_ptr(o)); - LDKCOption_C2Tuple_u64u64ZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_u64u64ZZ), "LDKCOption_C2Tuple_u64u64ZZ"); - *ret_copy = COption_C2Tuple_u64u64ZZ_some(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_C2Tuple_u64u64ZZ_none"))) TS_COption_C2Tuple_u64u64ZZ_none() { - LDKCOption_C2Tuple_u64u64ZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_u64u64ZZ), "LDKCOption_C2Tuple_u64u64ZZ"); - *ret_copy = COption_C2Tuple_u64u64ZZ_none(); +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_C2Tuple_u64u64ZZ_free"))) TS_COption_C2Tuple_u64u64ZZ_free(uint64_t _res) { +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_C2Tuple_u64u64ZZ _res_conv = *(LDKCOption_C2Tuple_u64u64ZZ*)(_res_ptr); + LDKCOption_PathFailureZ _res_conv = *(LDKCOption_PathFailureZ*)(_res_ptr); FREE(untag_ptr(_res)); - COption_C2Tuple_u64u64ZZ_free(_res_conv); + COption_PathFailureZ_free(_res_conv); } -static inline uint64_t COption_C2Tuple_u64u64ZZ_clone_ptr(LDKCOption_C2Tuple_u64u64ZZ *NONNULL_PTR arg) { - LDKCOption_C2Tuple_u64u64ZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_u64u64ZZ), "LDKCOption_C2Tuple_u64u64ZZ"); - *ret_copy = COption_C2Tuple_u64u64ZZ_clone(arg); +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_C2Tuple_u64u64ZZ_clone_ptr"))) TS_COption_C2Tuple_u64u64ZZ_clone_ptr(uint64_t arg) { - LDKCOption_C2Tuple_u64u64ZZ* arg_conv = (LDKCOption_C2Tuple_u64u64ZZ*)untag_ptr(arg); - int64_t ret_conv = COption_C2Tuple_u64u64ZZ_clone_ptr(arg_conv); +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_C2Tuple_u64u64ZZ_clone"))) TS_COption_C2Tuple_u64u64ZZ_clone(uint64_t orig) { - LDKCOption_C2Tuple_u64u64ZZ* orig_conv = (LDKCOption_C2Tuple_u64u64ZZ*)untag_ptr(orig); - LDKCOption_C2Tuple_u64u64ZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_u64u64ZZ), "LDKCOption_C2Tuple_u64u64ZZ"); - *ret_copy = COption_C2Tuple_u64u64ZZ_clone(orig_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; } -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); +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); } -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); +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); } -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); +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_C2Tuple_Z_free"))) TS_C2Tuple_Z_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); - LDKC2Tuple_Z _res_conv = *(LDKC2Tuple_Z*)(_res_ptr); + LDKCResult_COption_PathFailureZDecodeErrorZ _res_conv = *(LDKCResult_COption_PathFailureZDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - C2Tuple_Z_free(_res_conv); + CResult_COption_PathFailureZDecodeErrorZ_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); +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_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); +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_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); +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_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) { +uint64_t __attribute__((export_name("TS_COption_ClosureReasonZ_some"))) TS_COption_ClosureReasonZ_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); + LDKClosureReason o_conv = *(LDKClosureReason*)(o_ptr); + o_conv = ClosureReason_clone((LDKClosureReason*)untag_ptr(o)); + LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ"); + *ret_copy = COption_ClosureReasonZ_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 __attribute__((export_name("TS_COption_ClosureReasonZ_none"))) TS_COption_ClosureReasonZ_none() { + LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ"); + *ret_copy = COption_ClosureReasonZ_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) { +void __attribute__((export_name("TS_COption_ClosureReasonZ_free"))) TS_COption_ClosureReasonZ_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); + LDKCOption_ClosureReasonZ _res_conv = *(LDKCOption_ClosureReasonZ*)(_res_ptr); FREE(untag_ptr(_res)); - COption_C2Tuple_EightU16sEightU16sZZ_free(_res_conv); + COption_ClosureReasonZ_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); +static inline uint64_t COption_ClosureReasonZ_clone_ptr(LDKCOption_ClosureReasonZ *NONNULL_PTR arg) { + LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ"); + *ret_copy = COption_ClosureReasonZ_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); +int64_t __attribute__((export_name("TS_COption_ClosureReasonZ_clone_ptr"))) TS_COption_ClosureReasonZ_clone_ptr(uint64_t arg) { + LDKCOption_ClosureReasonZ* arg_conv = (LDKCOption_ClosureReasonZ*)untag_ptr(arg); + int64_t ret_conv = COption_ClosureReasonZ_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 __attribute__((export_name("TS_COption_ClosureReasonZ_clone"))) TS_COption_ClosureReasonZ_clone(uint64_t orig) { + LDKCOption_ClosureReasonZ* orig_conv = (LDKCOption_ClosureReasonZ*)untag_ptr(orig); + LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ"); + *ret_copy = COption_ClosureReasonZ_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; - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKNodeId), "LDKCVec_NodeIdZ Elements"); - else - _res_constr.data = NULL; - uint64_t* _res_vals = _res->elems; - for (size_t i = 0; i < _res_constr.datalen; i++) { - uint64_t _res_conv_8 = _res_vals[i]; - LDKNodeId _res_conv_8_conv; - _res_conv_8_conv.inner = untag_ptr(_res_conv_8); - _res_conv_8_conv.is_owned = ptr_is_owned(_res_conv_8); - CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_8_conv); - _res_constr.data[i] = _res_conv_8_conv; - } - FREE(_res); - CVec_NodeIdZ_free(_res_constr); -} - -uint64_t __attribute__((export_name("TS_CResult_ProbabilisticScorerDecodeErrorZ_ok"))) TS_CResult_ProbabilisticScorerDecodeErrorZ_ok(uint64_t o) { - LDKProbabilisticScorer o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - // WARNING: we need a move here but no clone is available for LDKProbabilisticScorer - - LDKCResult_ProbabilisticScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ProbabilisticScorerDecodeErrorZ), "LDKCResult_ProbabilisticScorerDecodeErrorZ"); - *ret_conv = CResult_ProbabilisticScorerDecodeErrorZ_ok(o_conv); +uint64_t __attribute__((export_name("TS_CResult_COption_ClosureReasonZDecodeErrorZ_ok"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_ok(uint64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKCOption_ClosureReasonZ o_conv = *(LDKCOption_ClosureReasonZ*)(o_ptr); + o_conv = COption_ClosureReasonZ_clone((LDKCOption_ClosureReasonZ*)untag_ptr(o)); + LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ"); + *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_CResult_ProbabilisticScorerDecodeErrorZ_err"))) TS_CResult_ProbabilisticScorerDecodeErrorZ_err(uint64_t e) { +uint64_t __attribute__((export_name("TS_CResult_COption_ClosureReasonZDecodeErrorZ_err"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_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_ProbabilisticScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ProbabilisticScorerDecodeErrorZ), "LDKCResult_ProbabilisticScorerDecodeErrorZ"); - *ret_conv = CResult_ProbabilisticScorerDecodeErrorZ_err(e_conv); + 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); } -jboolean __attribute__((export_name("TS_CResult_ProbabilisticScorerDecodeErrorZ_is_ok"))) TS_CResult_ProbabilisticScorerDecodeErrorZ_is_ok(uint64_t o) { - LDKCResult_ProbabilisticScorerDecodeErrorZ* o_conv = (LDKCResult_ProbabilisticScorerDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_ProbabilisticScorerDecodeErrorZ_is_ok(o_conv); +jboolean __attribute__((export_name("TS_CResult_COption_ClosureReasonZDecodeErrorZ_is_ok"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_is_ok(uint64_t o) { + LDKCResult_COption_ClosureReasonZDecodeErrorZ* o_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void __attribute__((export_name("TS_CResult_ProbabilisticScorerDecodeErrorZ_free"))) TS_CResult_ProbabilisticScorerDecodeErrorZ_free(uint64_t _res) { +void __attribute__((export_name("TS_CResult_COption_ClosureReasonZDecodeErrorZ_free"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_free(uint64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_ProbabilisticScorerDecodeErrorZ _res_conv = *(LDKCResult_ProbabilisticScorerDecodeErrorZ*)(_res_ptr); + LDKCResult_COption_ClosureReasonZDecodeErrorZ _res_conv = *(LDKCResult_COption_ClosureReasonZDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_ProbabilisticScorerDecodeErrorZ_free(_res_conv); + CResult_COption_ClosureReasonZDecodeErrorZ_free(_res_conv); } -uint64_t __attribute__((export_name("TS_CResult_InitFeaturesDecodeErrorZ_ok"))) TS_CResult_InitFeaturesDecodeErrorZ_ok(uint64_t o) { - LDKInitFeatures 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 = InitFeatures_clone(&o_conv); - LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ"); - *ret_conv = CResult_InitFeaturesDecodeErrorZ_ok(o_conv); +static inline uint64_t CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr(LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ"); + *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } +int64_t __attribute__((export_name("TS_CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_COption_ClosureReasonZDecodeErrorZ* arg_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} -uint64_t __attribute__((export_name("TS_CResult_InitFeaturesDecodeErrorZ_err"))) TS_CResult_InitFeaturesDecodeErrorZ_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_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ"); - *ret_conv = CResult_InitFeaturesDecodeErrorZ_err(e_conv); +uint64_t __attribute__((export_name("TS_CResult_COption_ClosureReasonZDecodeErrorZ_clone"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_clone(uint64_t orig) { + LDKCResult_COption_ClosureReasonZDecodeErrorZ* orig_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)untag_ptr(orig); + LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ"); + *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -jboolean __attribute__((export_name("TS_CResult_InitFeaturesDecodeErrorZ_is_ok"))) TS_CResult_InitFeaturesDecodeErrorZ_is_ok(uint64_t o) { - LDKCResult_InitFeaturesDecodeErrorZ* o_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_InitFeaturesDecodeErrorZ_is_ok(o_conv); - return ret_conv; +uint64_t __attribute__((export_name("TS_COption_HTLCDestinationZ_some"))) TS_COption_HTLCDestinationZ_some(uint64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKHTLCDestination o_conv = *(LDKHTLCDestination*)(o_ptr); + o_conv = HTLCDestination_clone((LDKHTLCDestination*)untag_ptr(o)); + LDKCOption_HTLCDestinationZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCDestinationZ), "LDKCOption_HTLCDestinationZ"); + *ret_copy = COption_HTLCDestinationZ_some(o_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void __attribute__((export_name("TS_CResult_InitFeaturesDecodeErrorZ_free"))) TS_CResult_InitFeaturesDecodeErrorZ_free(uint64_t _res) { +uint64_t __attribute__((export_name("TS_COption_HTLCDestinationZ_none"))) TS_COption_HTLCDestinationZ_none() { + LDKCOption_HTLCDestinationZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCDestinationZ), "LDKCOption_HTLCDestinationZ"); + *ret_copy = COption_HTLCDestinationZ_none(); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void __attribute__((export_name("TS_COption_HTLCDestinationZ_free"))) TS_COption_HTLCDestinationZ_free(uint64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_InitFeaturesDecodeErrorZ _res_conv = *(LDKCResult_InitFeaturesDecodeErrorZ*)(_res_ptr); + LDKCOption_HTLCDestinationZ _res_conv = *(LDKCOption_HTLCDestinationZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_InitFeaturesDecodeErrorZ_free(_res_conv); + COption_HTLCDestinationZ_free(_res_conv); } -static inline uint64_t CResult_InitFeaturesDecodeErrorZ_clone_ptr(LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ"); - *ret_conv = CResult_InitFeaturesDecodeErrorZ_clone(arg); - return tag_ptr(ret_conv, true); +static inline uint64_t COption_HTLCDestinationZ_clone_ptr(LDKCOption_HTLCDestinationZ *NONNULL_PTR arg) { + LDKCOption_HTLCDestinationZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCDestinationZ), "LDKCOption_HTLCDestinationZ"); + *ret_copy = COption_HTLCDestinationZ_clone(arg); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t __attribute__((export_name("TS_CResult_InitFeaturesDecodeErrorZ_clone_ptr"))) TS_CResult_InitFeaturesDecodeErrorZ_clone_ptr(uint64_t arg) { - LDKCResult_InitFeaturesDecodeErrorZ* arg_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_InitFeaturesDecodeErrorZ_clone_ptr(arg_conv); +int64_t __attribute__((export_name("TS_COption_HTLCDestinationZ_clone_ptr"))) TS_COption_HTLCDestinationZ_clone_ptr(uint64_t arg) { + LDKCOption_HTLCDestinationZ* arg_conv = (LDKCOption_HTLCDestinationZ*)untag_ptr(arg); + int64_t ret_conv = COption_HTLCDestinationZ_clone_ptr(arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_CResult_InitFeaturesDecodeErrorZ_clone"))) TS_CResult_InitFeaturesDecodeErrorZ_clone(uint64_t orig) { - LDKCResult_InitFeaturesDecodeErrorZ* orig_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)untag_ptr(orig); - LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ"); - *ret_conv = CResult_InitFeaturesDecodeErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); +uint64_t __attribute__((export_name("TS_COption_HTLCDestinationZ_clone"))) TS_COption_HTLCDestinationZ_clone(uint64_t orig) { + LDKCOption_HTLCDestinationZ* orig_conv = (LDKCOption_HTLCDestinationZ*)untag_ptr(orig); + LDKCOption_HTLCDestinationZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCDestinationZ), "LDKCOption_HTLCDestinationZ"); + *ret_copy = COption_HTLCDestinationZ_clone(orig_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -uint64_t __attribute__((export_name("TS_CResult_ChannelFeaturesDecodeErrorZ_ok"))) TS_CResult_ChannelFeaturesDecodeErrorZ_ok(uint64_t o) { - LDKChannelFeatures 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 = ChannelFeatures_clone(&o_conv); - LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ"); - *ret_conv = CResult_ChannelFeaturesDecodeErrorZ_ok(o_conv); +uint64_t __attribute__((export_name("TS_CResult_COption_HTLCDestinationZDecodeErrorZ_ok"))) TS_CResult_COption_HTLCDestinationZDecodeErrorZ_ok(uint64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKCOption_HTLCDestinationZ o_conv = *(LDKCOption_HTLCDestinationZ*)(o_ptr); + o_conv = COption_HTLCDestinationZ_clone((LDKCOption_HTLCDestinationZ*)untag_ptr(o)); + LDKCResult_COption_HTLCDestinationZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_HTLCDestinationZDecodeErrorZ), "LDKCResult_COption_HTLCDestinationZDecodeErrorZ"); + *ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_CResult_ChannelFeaturesDecodeErrorZ_err"))) TS_CResult_ChannelFeaturesDecodeErrorZ_err(uint64_t e) { +uint64_t __attribute__((export_name("TS_CResult_COption_HTLCDestinationZDecodeErrorZ_err"))) TS_CResult_COption_HTLCDestinationZDecodeErrorZ_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_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ"); - *ret_conv = CResult_ChannelFeaturesDecodeErrorZ_err(e_conv); + 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); } -jboolean __attribute__((export_name("TS_CResult_ChannelFeaturesDecodeErrorZ_is_ok"))) TS_CResult_ChannelFeaturesDecodeErrorZ_is_ok(uint64_t o) { - LDKCResult_ChannelFeaturesDecodeErrorZ* o_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_ChannelFeaturesDecodeErrorZ_is_ok(o_conv); +jboolean __attribute__((export_name("TS_CResult_COption_HTLCDestinationZDecodeErrorZ_is_ok"))) TS_CResult_COption_HTLCDestinationZDecodeErrorZ_is_ok(uint64_t o) { + LDKCResult_COption_HTLCDestinationZDecodeErrorZ* o_conv = (LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void __attribute__((export_name("TS_CResult_ChannelFeaturesDecodeErrorZ_free"))) TS_CResult_ChannelFeaturesDecodeErrorZ_free(uint64_t _res) { +void __attribute__((export_name("TS_CResult_COption_HTLCDestinationZDecodeErrorZ_free"))) TS_CResult_COption_HTLCDestinationZDecodeErrorZ_free(uint64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_ChannelFeaturesDecodeErrorZ _res_conv = *(LDKCResult_ChannelFeaturesDecodeErrorZ*)(_res_ptr); + LDKCResult_COption_HTLCDestinationZDecodeErrorZ _res_conv = *(LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_ChannelFeaturesDecodeErrorZ_free(_res_conv); + CResult_COption_HTLCDestinationZDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_ChannelFeaturesDecodeErrorZ_clone_ptr(LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ"); - *ret_conv = CResult_ChannelFeaturesDecodeErrorZ_clone(arg); +static inline uint64_t CResult_COption_HTLCDestinationZDecodeErrorZ_clone_ptr(LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_COption_HTLCDestinationZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_HTLCDestinationZDecodeErrorZ), "LDKCResult_COption_HTLCDestinationZDecodeErrorZ"); + *ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t __attribute__((export_name("TS_CResult_ChannelFeaturesDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelFeaturesDecodeErrorZ_clone_ptr(uint64_t arg) { - LDKCResult_ChannelFeaturesDecodeErrorZ* arg_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_ChannelFeaturesDecodeErrorZ_clone_ptr(arg_conv); +int64_t __attribute__((export_name("TS_CResult_COption_HTLCDestinationZDecodeErrorZ_clone_ptr"))) TS_CResult_COption_HTLCDestinationZDecodeErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_COption_HTLCDestinationZDecodeErrorZ* arg_conv = (LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_CResult_ChannelFeaturesDecodeErrorZ_clone"))) TS_CResult_ChannelFeaturesDecodeErrorZ_clone(uint64_t orig) { - LDKCResult_ChannelFeaturesDecodeErrorZ* orig_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)untag_ptr(orig); - LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ"); - *ret_conv = CResult_ChannelFeaturesDecodeErrorZ_clone(orig_conv); +uint64_t __attribute__((export_name("TS_CResult_COption_HTLCDestinationZDecodeErrorZ_clone"))) TS_CResult_COption_HTLCDestinationZDecodeErrorZ_clone(uint64_t orig) { + LDKCResult_COption_HTLCDestinationZDecodeErrorZ* orig_conv = (LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)untag_ptr(orig); + LDKCResult_COption_HTLCDestinationZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_HTLCDestinationZDecodeErrorZ), "LDKCResult_COption_HTLCDestinationZDecodeErrorZ"); + *ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_CResult_NodeFeaturesDecodeErrorZ_ok"))) TS_CResult_NodeFeaturesDecodeErrorZ_ok(uint64_t o) { - LDKNodeFeatures 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 = NodeFeatures_clone(&o_conv); - LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ"); - *ret_conv = CResult_NodeFeaturesDecodeErrorZ_ok(o_conv); +uint64_t __attribute__((export_name("TS_CResult_PaymentFailureReasonDecodeErrorZ_ok"))) TS_CResult_PaymentFailureReasonDecodeErrorZ_ok(uint32_t o) { + LDKPaymentFailureReason o_conv = LDKPaymentFailureReason_from_js(o); + LDKCResult_PaymentFailureReasonDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentFailureReasonDecodeErrorZ), "LDKCResult_PaymentFailureReasonDecodeErrorZ"); + *ret_conv = CResult_PaymentFailureReasonDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_CResult_NodeFeaturesDecodeErrorZ_err"))) TS_CResult_NodeFeaturesDecodeErrorZ_err(uint64_t e) { +uint64_t __attribute__((export_name("TS_CResult_PaymentFailureReasonDecodeErrorZ_err"))) TS_CResult_PaymentFailureReasonDecodeErrorZ_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_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ"); - *ret_conv = CResult_NodeFeaturesDecodeErrorZ_err(e_conv); + LDKCResult_PaymentFailureReasonDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentFailureReasonDecodeErrorZ), "LDKCResult_PaymentFailureReasonDecodeErrorZ"); + *ret_conv = CResult_PaymentFailureReasonDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean __attribute__((export_name("TS_CResult_NodeFeaturesDecodeErrorZ_is_ok"))) TS_CResult_NodeFeaturesDecodeErrorZ_is_ok(uint64_t o) { - LDKCResult_NodeFeaturesDecodeErrorZ* o_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_NodeFeaturesDecodeErrorZ_is_ok(o_conv); +jboolean __attribute__((export_name("TS_CResult_PaymentFailureReasonDecodeErrorZ_is_ok"))) TS_CResult_PaymentFailureReasonDecodeErrorZ_is_ok(uint64_t o) { + LDKCResult_PaymentFailureReasonDecodeErrorZ* o_conv = (LDKCResult_PaymentFailureReasonDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_PaymentFailureReasonDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void __attribute__((export_name("TS_CResult_NodeFeaturesDecodeErrorZ_free"))) TS_CResult_NodeFeaturesDecodeErrorZ_free(uint64_t _res) { +void __attribute__((export_name("TS_CResult_PaymentFailureReasonDecodeErrorZ_free"))) TS_CResult_PaymentFailureReasonDecodeErrorZ_free(uint64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_NodeFeaturesDecodeErrorZ _res_conv = *(LDKCResult_NodeFeaturesDecodeErrorZ*)(_res_ptr); + LDKCResult_PaymentFailureReasonDecodeErrorZ _res_conv = *(LDKCResult_PaymentFailureReasonDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_NodeFeaturesDecodeErrorZ_free(_res_conv); + CResult_PaymentFailureReasonDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_NodeFeaturesDecodeErrorZ_clone_ptr(LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ"); - *ret_conv = CResult_NodeFeaturesDecodeErrorZ_clone(arg); +static inline uint64_t CResult_PaymentFailureReasonDecodeErrorZ_clone_ptr(LDKCResult_PaymentFailureReasonDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_PaymentFailureReasonDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentFailureReasonDecodeErrorZ), "LDKCResult_PaymentFailureReasonDecodeErrorZ"); + *ret_conv = CResult_PaymentFailureReasonDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t __attribute__((export_name("TS_CResult_NodeFeaturesDecodeErrorZ_clone_ptr"))) TS_CResult_NodeFeaturesDecodeErrorZ_clone_ptr(uint64_t arg) { - LDKCResult_NodeFeaturesDecodeErrorZ* arg_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_NodeFeaturesDecodeErrorZ_clone_ptr(arg_conv); +int64_t __attribute__((export_name("TS_CResult_PaymentFailureReasonDecodeErrorZ_clone_ptr"))) TS_CResult_PaymentFailureReasonDecodeErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_PaymentFailureReasonDecodeErrorZ* arg_conv = (LDKCResult_PaymentFailureReasonDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_PaymentFailureReasonDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_CResult_NodeFeaturesDecodeErrorZ_clone"))) TS_CResult_NodeFeaturesDecodeErrorZ_clone(uint64_t orig) { - LDKCResult_NodeFeaturesDecodeErrorZ* orig_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)untag_ptr(orig); - LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ"); - *ret_conv = CResult_NodeFeaturesDecodeErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -uint64_t __attribute__((export_name("TS_CResult_InvoiceFeaturesDecodeErrorZ_ok"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_ok(uint64_t o) { - LDKInvoiceFeatures 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 = InvoiceFeatures_clone(&o_conv); - LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ"); - *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_ok(o_conv); +uint64_t __attribute__((export_name("TS_CResult_PaymentFailureReasonDecodeErrorZ_clone"))) TS_CResult_PaymentFailureReasonDecodeErrorZ_clone(uint64_t orig) { + LDKCResult_PaymentFailureReasonDecodeErrorZ* orig_conv = (LDKCResult_PaymentFailureReasonDecodeErrorZ*)untag_ptr(orig); + LDKCResult_PaymentFailureReasonDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentFailureReasonDecodeErrorZ), "LDKCResult_PaymentFailureReasonDecodeErrorZ"); + *ret_conv = CResult_PaymentFailureReasonDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_CResult_InvoiceFeaturesDecodeErrorZ_err"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_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_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ"); - *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); +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; } -jboolean __attribute__((export_name("TS_CResult_InvoiceFeaturesDecodeErrorZ_is_ok"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_is_ok(uint64_t o) { - LDKCResult_InvoiceFeaturesDecodeErrorZ* o_conv = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_is_ok(o_conv); - return ret_conv; +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_CResult_InvoiceFeaturesDecodeErrorZ_free"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_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); - LDKCResult_InvoiceFeaturesDecodeErrorZ _res_conv = *(LDKCResult_InvoiceFeaturesDecodeErrorZ*)(_res_ptr); + LDKCOption_u128Z _res_conv = *(LDKCOption_u128Z*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_InvoiceFeaturesDecodeErrorZ_free(_res_conv); + COption_u128Z_free(_res_conv); } -static inline uint64_t CResult_InvoiceFeaturesDecodeErrorZ_clone_ptr(LDKCResult_InvoiceFeaturesDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ"); - *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_clone(arg); - return tag_ptr(ret_conv, true); +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_CResult_InvoiceFeaturesDecodeErrorZ_clone_ptr"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_clone_ptr(uint64_t arg) { - LDKCResult_InvoiceFeaturesDecodeErrorZ* arg_conv = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_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_CResult_InvoiceFeaturesDecodeErrorZ_clone"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_clone(uint64_t orig) { - LDKCResult_InvoiceFeaturesDecodeErrorZ* orig_conv = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)untag_ptr(orig); - LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ"); - *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_clone(orig_conv); - 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_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_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); +uint64_t __attribute__((export_name("TS_COption_PaymentFailureReasonZ_some"))) TS_COption_PaymentFailureReasonZ_some(uint32_t o) { + LDKPaymentFailureReason o_conv = LDKPaymentFailureReason_from_js(o); + LDKCOption_PaymentFailureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_PaymentFailureReasonZ), "LDKCOption_PaymentFailureReasonZ"); + *ret_copy = COption_PaymentFailureReasonZ_some(o_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -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; +uint64_t __attribute__((export_name("TS_COption_PaymentFailureReasonZ_none"))) TS_COption_PaymentFailureReasonZ_none() { + LDKCOption_PaymentFailureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_PaymentFailureReasonZ), "LDKCOption_PaymentFailureReasonZ"); + *ret_copy = COption_PaymentFailureReasonZ_none(); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void __attribute__((export_name("TS_CResult_BlindedHopFeaturesDecodeErrorZ_free"))) TS_CResult_BlindedHopFeaturesDecodeErrorZ_free(uint64_t _res) { +void __attribute__((export_name("TS_COption_PaymentFailureReasonZ_free"))) TS_COption_PaymentFailureReasonZ_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); + LDKCOption_PaymentFailureReasonZ _res_conv = *(LDKCOption_PaymentFailureReasonZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_BlindedHopFeaturesDecodeErrorZ_free(_res_conv); + COption_PaymentFailureReasonZ_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); +static inline uint64_t COption_PaymentFailureReasonZ_clone_ptr(LDKCOption_PaymentFailureReasonZ *NONNULL_PTR arg) { + LDKCOption_PaymentFailureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_PaymentFailureReasonZ), "LDKCOption_PaymentFailureReasonZ"); + *ret_copy = COption_PaymentFailureReasonZ_clone(arg); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -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); +int64_t __attribute__((export_name("TS_COption_PaymentFailureReasonZ_clone_ptr"))) TS_COption_PaymentFailureReasonZ_clone_ptr(uint64_t arg) { + LDKCOption_PaymentFailureReasonZ* arg_conv = (LDKCOption_PaymentFailureReasonZ*)untag_ptr(arg); + int64_t ret_conv = COption_PaymentFailureReasonZ_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_COption_PaymentFailureReasonZ_clone"))) TS_COption_PaymentFailureReasonZ_clone(uint64_t orig) { + LDKCOption_PaymentFailureReasonZ* orig_conv = (LDKCOption_PaymentFailureReasonZ*)untag_ptr(orig); + LDKCOption_PaymentFailureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_PaymentFailureReasonZ), "LDKCOption_PaymentFailureReasonZ"); + *ret_copy = COption_PaymentFailureReasonZ_clone(orig_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -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); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = ChannelTypeFeatures_clone(&o_conv); - LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ"); - *ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_ok(o_conv); - return tag_ptr(ret_conv, true); +void __attribute__((export_name("TS_CVec_SpendableOutputDescriptorZ_free"))) TS_CVec_SpendableOutputDescriptorZ_free(uint64_tArray _res) { + LDKCVec_SpendableOutputDescriptorZ _res_constr; + _res_constr.datalen = _res->arr_len; + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements"); + else + _res_constr.data = NULL; + uint64_t* _res_vals = _res->elems; + for (size_t b = 0; b < _res_constr.datalen; b++) { + uint64_t _res_conv_27 = _res_vals[b]; + void* _res_conv_27_ptr = untag_ptr(_res_conv_27); + CHECK_ACCESS(_res_conv_27_ptr); + LDKSpendableOutputDescriptor _res_conv_27_conv = *(LDKSpendableOutputDescriptor*)(_res_conv_27_ptr); + FREE(untag_ptr(_res_conv_27)); + _res_constr.data[b] = _res_conv_27_conv; + } + FREE(_res); + CVec_SpendableOutputDescriptorZ_free(_res_constr); } -uint64_t __attribute__((export_name("TS_CResult_ChannelTypeFeaturesDecodeErrorZ_err"))) TS_CResult_ChannelTypeFeaturesDecodeErrorZ_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_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_COption_EventZ_some"))) TS_COption_EventZ_some(uint64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKEvent o_conv = *(LDKEvent*)(o_ptr); + o_conv = Event_clone((LDKEvent*)untag_ptr(o)); + LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ"); + *ret_copy = COption_EventZ_some(o_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -jboolean __attribute__((export_name("TS_CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok"))) TS_CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok(uint64_t o) { - LDKCResult_ChannelTypeFeaturesDecodeErrorZ* o_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok(o_conv); - return ret_conv; +uint64_t __attribute__((export_name("TS_COption_EventZ_none"))) TS_COption_EventZ_none() { + LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ"); + *ret_copy = COption_EventZ_none(); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void __attribute__((export_name("TS_CResult_ChannelTypeFeaturesDecodeErrorZ_free"))) TS_CResult_ChannelTypeFeaturesDecodeErrorZ_free(uint64_t _res) { +void __attribute__((export_name("TS_COption_EventZ_free"))) TS_COption_EventZ_free(uint64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_ChannelTypeFeaturesDecodeErrorZ _res_conv = *(LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)(_res_ptr); + LDKCOption_EventZ _res_conv = *(LDKCOption_EventZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_ChannelTypeFeaturesDecodeErrorZ_free(_res_conv); + COption_EventZ_free(_res_conv); } -static inline uint64_t CResult_ChannelTypeFeaturesDecodeErrorZ_clone_ptr(LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ"); - *ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_clone(arg); - return tag_ptr(ret_conv, true); +static inline uint64_t COption_EventZ_clone_ptr(LDKCOption_EventZ *NONNULL_PTR arg) { + LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ"); + *ret_copy = COption_EventZ_clone(arg); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t __attribute__((export_name("TS_CResult_ChannelTypeFeaturesDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelTypeFeaturesDecodeErrorZ_clone_ptr(uint64_t arg) { - LDKCResult_ChannelTypeFeaturesDecodeErrorZ* arg_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_clone_ptr(arg_conv); +int64_t __attribute__((export_name("TS_COption_EventZ_clone_ptr"))) TS_COption_EventZ_clone_ptr(uint64_t arg) { + LDKCOption_EventZ* arg_conv = (LDKCOption_EventZ*)untag_ptr(arg); + int64_t ret_conv = COption_EventZ_clone_ptr(arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_CResult_ChannelTypeFeaturesDecodeErrorZ_clone"))) TS_CResult_ChannelTypeFeaturesDecodeErrorZ_clone(uint64_t orig) { - LDKCResult_ChannelTypeFeaturesDecodeErrorZ* orig_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)untag_ptr(orig); - LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ"); - *ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); +uint64_t __attribute__((export_name("TS_COption_EventZ_clone"))) TS_COption_EventZ_clone(uint64_t orig) { + LDKCOption_EventZ* orig_conv = (LDKCOption_EventZ*)untag_ptr(orig); + LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ"); + *ret_copy = COption_EventZ_clone(orig_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -uint64_t __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_ok"))) TS_CResult_NodeIdDecodeErrorZ_ok(uint64_t o) { - LDKNodeId 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 = NodeId_clone(&o_conv); - LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ"); - *ret_conv = CResult_NodeIdDecodeErrorZ_ok(o_conv); +uint64_t __attribute__((export_name("TS_CResult_COption_EventZDecodeErrorZ_ok"))) TS_CResult_COption_EventZDecodeErrorZ_ok(uint64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKCOption_EventZ o_conv = *(LDKCOption_EventZ*)(o_ptr); + o_conv = COption_EventZ_clone((LDKCOption_EventZ*)untag_ptr(o)); + LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ"); + *ret_conv = CResult_COption_EventZDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_err"))) TS_CResult_NodeIdDecodeErrorZ_err(uint64_t e) { +uint64_t __attribute__((export_name("TS_CResult_COption_EventZDecodeErrorZ_err"))) TS_CResult_COption_EventZDecodeErrorZ_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_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ"); - *ret_conv = CResult_NodeIdDecodeErrorZ_err(e_conv); + 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); } -jboolean __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_is_ok"))) TS_CResult_NodeIdDecodeErrorZ_is_ok(uint64_t o) { - LDKCResult_NodeIdDecodeErrorZ* o_conv = (LDKCResult_NodeIdDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_NodeIdDecodeErrorZ_is_ok(o_conv); +jboolean __attribute__((export_name("TS_CResult_COption_EventZDecodeErrorZ_is_ok"))) TS_CResult_COption_EventZDecodeErrorZ_is_ok(uint64_t o) { + LDKCResult_COption_EventZDecodeErrorZ* o_conv = (LDKCResult_COption_EventZDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_COption_EventZDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_free"))) TS_CResult_NodeIdDecodeErrorZ_free(uint64_t _res) { +void __attribute__((export_name("TS_CResult_COption_EventZDecodeErrorZ_free"))) TS_CResult_COption_EventZDecodeErrorZ_free(uint64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_NodeIdDecodeErrorZ _res_conv = *(LDKCResult_NodeIdDecodeErrorZ*)(_res_ptr); + LDKCResult_COption_EventZDecodeErrorZ _res_conv = *(LDKCResult_COption_EventZDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_NodeIdDecodeErrorZ_free(_res_conv); + CResult_COption_EventZDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_NodeIdDecodeErrorZ_clone_ptr(LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ"); - *ret_conv = CResult_NodeIdDecodeErrorZ_clone(arg); +static inline uint64_t CResult_COption_EventZDecodeErrorZ_clone_ptr(LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ"); + *ret_conv = CResult_COption_EventZDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_clone_ptr"))) TS_CResult_NodeIdDecodeErrorZ_clone_ptr(uint64_t arg) { - LDKCResult_NodeIdDecodeErrorZ* arg_conv = (LDKCResult_NodeIdDecodeErrorZ*)untag_ptr(arg); +int64_t __attribute__((export_name("TS_CResult_COption_EventZDecodeErrorZ_clone_ptr"))) TS_CResult_COption_EventZDecodeErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_COption_EventZDecodeErrorZ* arg_conv = (LDKCResult_COption_EventZDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_COption_EventZDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_CResult_COption_EventZDecodeErrorZ_clone"))) TS_CResult_COption_EventZDecodeErrorZ_clone(uint64_t orig) { + LDKCResult_COption_EventZDecodeErrorZ* orig_conv = (LDKCResult_COption_EventZDecodeErrorZ*)untag_ptr(orig); + LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ"); + *ret_conv = CResult_COption_EventZDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +void __attribute__((export_name("TS_CVec_MessageSendEventZ_free"))) TS_CVec_MessageSendEventZ_free(uint64_tArray _res) { + LDKCVec_MessageSendEventZ _res_constr; + _res_constr.datalen = _res->arr_len; + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKMessageSendEvent), "LDKCVec_MessageSendEventZ 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]; + void* _res_conv_18_ptr = untag_ptr(_res_conv_18); + CHECK_ACCESS(_res_conv_18_ptr); + LDKMessageSendEvent _res_conv_18_conv = *(LDKMessageSendEvent*)(_res_conv_18_ptr); + FREE(untag_ptr(_res_conv_18)); + _res_constr.data[s] = _res_conv_18_conv; + } + FREE(_res); + CVec_MessageSendEventZ_free(_res_constr); +} + +void __attribute__((export_name("TS_CVec_ChainHashZ_free"))) TS_CVec_ChainHashZ_free(ptrArray _res) { + LDKCVec_ChainHashZ _res_constr; + _res_constr.datalen = _res->arr_len; + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_ChainHashZ 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_ChainHashZ_free(_res_constr); +} + +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_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_NodeIdDecodeErrorZ_ok"))) TS_CResult_NodeIdDecodeErrorZ_ok(uint64_t o) { + LDKNodeId 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 = NodeId_clone(&o_conv); + LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ"); + *ret_conv = CResult_NodeIdDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +uint64_t __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_err"))) TS_CResult_NodeIdDecodeErrorZ_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_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ"); + *ret_conv = CResult_NodeIdDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_is_ok"))) TS_CResult_NodeIdDecodeErrorZ_is_ok(uint64_t o) { + LDKCResult_NodeIdDecodeErrorZ* o_conv = (LDKCResult_NodeIdDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_NodeIdDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_free"))) TS_CResult_NodeIdDecodeErrorZ_free(uint64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_NodeIdDecodeErrorZ _res_conv = *(LDKCResult_NodeIdDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_NodeIdDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_NodeIdDecodeErrorZ_clone_ptr(LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ"); + *ret_conv = CResult_NodeIdDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_clone_ptr"))) TS_CResult_NodeIdDecodeErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_NodeIdDecodeErrorZ* arg_conv = (LDKCResult_NodeIdDecodeErrorZ*)untag_ptr(arg); int64_t ret_conv = CResult_NodeIdDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } @@ -16198,14 +16788,6 @@ uint64_t __attribute__((export_name("TS_CResult_WriteableEcdsaChannelSignerDeco 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; - _res_ref.data = MALLOC(_res_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(_res_ref.data, _res->elems, _res_ref.datalen); FREE(_res); - CVec_u8Z_free(_res_ref); -} - void __attribute__((export_name("TS_CVec_CVec_u8ZZ_free"))) TS_CVec_CVec_u8ZZ_free(ptrArray _res) { LDKCVec_CVec_u8ZZ _res_constr; _res_constr.datalen = _res->arr_len; @@ -17575,6 +18157,60 @@ uint64_t __attribute__((export_name("TS_CResult_COption_APIErrorZDecodeErrorZ_c return tag_ptr(ret_conv, true); } +uint64_t __attribute__((export_name("TS_CResult_UntrustedStringDecodeErrorZ_ok"))) TS_CResult_UntrustedStringDecodeErrorZ_ok(uint64_t o) { + LDKUntrustedString 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 = UntrustedString_clone(&o_conv); + LDKCResult_UntrustedStringDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UntrustedStringDecodeErrorZ), "LDKCResult_UntrustedStringDecodeErrorZ"); + *ret_conv = CResult_UntrustedStringDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +uint64_t __attribute__((export_name("TS_CResult_UntrustedStringDecodeErrorZ_err"))) TS_CResult_UntrustedStringDecodeErrorZ_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_UntrustedStringDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UntrustedStringDecodeErrorZ), "LDKCResult_UntrustedStringDecodeErrorZ"); + *ret_conv = CResult_UntrustedStringDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean __attribute__((export_name("TS_CResult_UntrustedStringDecodeErrorZ_is_ok"))) TS_CResult_UntrustedStringDecodeErrorZ_is_ok(uint64_t o) { + LDKCResult_UntrustedStringDecodeErrorZ* o_conv = (LDKCResult_UntrustedStringDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_UntrustedStringDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_CResult_UntrustedStringDecodeErrorZ_free"))) TS_CResult_UntrustedStringDecodeErrorZ_free(uint64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_UntrustedStringDecodeErrorZ _res_conv = *(LDKCResult_UntrustedStringDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_UntrustedStringDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_UntrustedStringDecodeErrorZ_clone_ptr(LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_UntrustedStringDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UntrustedStringDecodeErrorZ), "LDKCResult_UntrustedStringDecodeErrorZ"); + *ret_conv = CResult_UntrustedStringDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t __attribute__((export_name("TS_CResult_UntrustedStringDecodeErrorZ_clone_ptr"))) TS_CResult_UntrustedStringDecodeErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_UntrustedStringDecodeErrorZ* arg_conv = (LDKCResult_UntrustedStringDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_UntrustedStringDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_CResult_UntrustedStringDecodeErrorZ_clone"))) TS_CResult_UntrustedStringDecodeErrorZ_clone(uint64_t orig) { + LDKCResult_UntrustedStringDecodeErrorZ* orig_conv = (LDKCResult_UntrustedStringDecodeErrorZ*)untag_ptr(orig); + LDKCResult_UntrustedStringDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UntrustedStringDecodeErrorZ), "LDKCResult_UntrustedStringDecodeErrorZ"); + *ret_conv = CResult_UntrustedStringDecodeErrorZ_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); @@ -17880,55 +18516,6 @@ uint64_t __attribute__((export_name("TS_CResult_StringErrorZ_clone"))) TS_CResu 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); - 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_ChannelMonitorUpdateDecodeErrorZ_ok"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_ok(uint64_t o) { LDKChannelMonitorUpdate o_conv; o_conv.inner = untag_ptr(o); @@ -19100,6 +19687,164 @@ void __attribute__((export_name("TS_CResult_NoneSendErrorZ_free"))) TS_CResult_ CResult_NoneSendErrorZ_free(_res_conv); } +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 = 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_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); +} + 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); @@ -19131,1430 +19876,905 @@ void __attribute__((export_name("TS_CResult_u32GraphSyncErrorZ_free"))) TS_CRes 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); +uint64_t __attribute__((export_name("TS_CResult_NoneErrorZ_ok"))) TS_CResult_NoneErrorZ_ok() { + LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ"); + *ret_conv = CResult_NoneErrorZ_ok(); 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); +uint64_t __attribute__((export_name("TS_CResult_NoneErrorZ_err"))) TS_CResult_NoneErrorZ_err(uint32_t e) { + LDKIOError e_conv = LDKIOError_from_js(e); + LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ"); + *ret_conv = CResult_NoneErrorZ_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_NoneErrorZ_is_ok"))) TS_CResult_NoneErrorZ_is_ok(uint64_t o) { + LDKCResult_NoneErrorZ* o_conv = (LDKCResult_NoneErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_NoneErrorZ_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_NoneErrorZ_free"))) TS_CResult_NoneErrorZ_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_NoneErrorZ _res_conv = *(LDKCResult_NoneErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_SiPrefixParseErrorZ_free(_res_conv); + CResult_NoneErrorZ_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_NoneErrorZ_clone_ptr(LDKCResult_NoneErrorZ *NONNULL_PTR arg) { + LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ"); + *ret_conv = CResult_NoneErrorZ_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_NoneErrorZ_clone_ptr"))) TS_CResult_NoneErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_NoneErrorZ* arg_conv = (LDKCResult_NoneErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_NoneErrorZ_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_NoneErrorZ_clone"))) TS_CResult_NoneErrorZ_clone(uint64_t orig) { + LDKCResult_NoneErrorZ* orig_conv = (LDKCResult_NoneErrorZ*)untag_ptr(orig); + LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ"); + *ret_conv = CResult_NoneErrorZ_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_NetAddressDecodeErrorZ_ok"))) TS_CResult_NetAddressDecodeErrorZ_ok(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)); + LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ"); + *ret_conv = CResult_NetAddressDecodeErrorZ_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) { +uint64_t __attribute__((export_name("TS_CResult_NetAddressDecodeErrorZ_err"))) TS_CResult_NetAddressDecodeErrorZ_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); + 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); } -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_NetAddressDecodeErrorZ_is_ok"))) TS_CResult_NetAddressDecodeErrorZ_is_ok(uint64_t o) { + LDKCResult_NetAddressDecodeErrorZ* o_conv = (LDKCResult_NetAddressDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_NetAddressDecodeErrorZ_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_NetAddressDecodeErrorZ_free"))) TS_CResult_NetAddressDecodeErrorZ_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_NetAddressDecodeErrorZ _res_conv = *(LDKCResult_NetAddressDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_InvoiceParseOrSemanticErrorZ_free(_res_conv); + CResult_NetAddressDecodeErrorZ_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_NetAddressDecodeErrorZ_clone_ptr(LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ"); + *ret_conv = CResult_NetAddressDecodeErrorZ_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_NetAddressDecodeErrorZ_clone_ptr"))) TS_CResult_NetAddressDecodeErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_NetAddressDecodeErrorZ* arg_conv = (LDKCResult_NetAddressDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_NetAddressDecodeErrorZ_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_NetAddressDecodeErrorZ_clone"))) TS_CResult_NetAddressDecodeErrorZ_clone(uint64_t orig) { + LDKCResult_NetAddressDecodeErrorZ* orig_conv = (LDKCResult_NetAddressDecodeErrorZ*)untag_ptr(orig); + LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ"); + *ret_conv = CResult_NetAddressDecodeErrorZ_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; +void __attribute__((export_name("TS_CVec_UpdateAddHTLCZ_free"))) TS_CVec_UpdateAddHTLCZ_free(uint64_tArray _res) { + LDKCVec_UpdateAddHTLCZ _res_constr; + _res_constr.datalen = _res->arr_len; + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKUpdateAddHTLC), "LDKCVec_UpdateAddHTLCZ 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_15 = _res_vals[p]; + LDKUpdateAddHTLC _res_conv_15_conv; + _res_conv_15_conv.inner = untag_ptr(_res_conv_15); + _res_conv_15_conv.is_owned = ptr_is_owned(_res_conv_15); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_15_conv); + _res_constr.data[p] = _res_conv_15_conv; + } + FREE(_res); + CVec_UpdateAddHTLCZ_free(_res_constr); +} + +void __attribute__((export_name("TS_CVec_UpdateFulfillHTLCZ_free"))) TS_CVec_UpdateFulfillHTLCZ_free(uint64_tArray _res) { + LDKCVec_UpdateFulfillHTLCZ _res_constr; + _res_constr.datalen = _res->arr_len; + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKUpdateFulfillHTLC), "LDKCVec_UpdateFulfillHTLCZ 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]; + LDKUpdateFulfillHTLC _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_UpdateFulfillHTLCZ_free(_res_constr); +} + +void __attribute__((export_name("TS_CVec_UpdateFailHTLCZ_free"))) TS_CVec_UpdateFailHTLCZ_free(uint64_tArray _res) { + LDKCVec_UpdateFailHTLCZ _res_constr; + _res_constr.datalen = _res->arr_len; + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKUpdateFailHTLC), "LDKCVec_UpdateFailHTLCZ 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]; + LDKUpdateFailHTLC _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_UpdateFailHTLCZ_free(_res_constr); +} + +void __attribute__((export_name("TS_CVec_UpdateFailMalformedHTLCZ_free"))) TS_CVec_UpdateFailMalformedHTLCZ_free(uint64_tArray _res) { + LDKCVec_UpdateFailMalformedHTLCZ _res_constr; + _res_constr.datalen = _res->arr_len; + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKUpdateFailMalformedHTLC), "LDKCVec_UpdateFailMalformedHTLCZ 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]; + LDKUpdateFailMalformedHTLC _res_conv_25_conv; + _res_conv_25_conv.inner = untag_ptr(_res_conv_25); + _res_conv_25_conv.is_owned = ptr_is_owned(_res_conv_25); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_25_conv); + _res_constr.data[z] = _res_conv_25_conv; + } + FREE(_res); + CVec_UpdateFailMalformedHTLCZ_free(_res_constr); +} + +uint64_t __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_ok"))) TS_CResult_AcceptChannelDecodeErrorZ_ok(uint64_t o) { + LDKAcceptChannel 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); + o_conv = AcceptChannel_clone(&o_conv); + LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ"); + *ret_conv = CResult_AcceptChannelDecodeErrorZ_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) { +uint64_t __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_err"))) TS_CResult_AcceptChannelDecodeErrorZ_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); + 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); } -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_AcceptChannelDecodeErrorZ_is_ok"))) TS_CResult_AcceptChannelDecodeErrorZ_is_ok(uint64_t o) { + LDKCResult_AcceptChannelDecodeErrorZ* o_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_AcceptChannelDecodeErrorZ_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_AcceptChannelDecodeErrorZ_free"))) TS_CResult_AcceptChannelDecodeErrorZ_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_AcceptChannelDecodeErrorZ _res_conv = *(LDKCResult_AcceptChannelDecodeErrorZ*)(_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); + CResult_AcceptChannelDecodeErrorZ_free(_res_conv); } -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); +static inline uint64_t CResult_AcceptChannelDecodeErrorZ_clone_ptr(LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ"); + *ret_conv = CResult_AcceptChannelDecodeErrorZ_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); +int64_t __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_clone_ptr"))) TS_CResult_AcceptChannelDecodeErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_AcceptChannelDecodeErrorZ* arg_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_AcceptChannelDecodeErrorZ_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); +uint64_t __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_clone"))) TS_CResult_AcceptChannelDecodeErrorZ_clone(uint64_t orig) { + LDKCResult_AcceptChannelDecodeErrorZ* orig_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)untag_ptr(orig); + LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ"); + *ret_conv = CResult_AcceptChannelDecodeErrorZ_clone(orig_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; +uint64_t __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErrorZ_ok"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_ok(uint64_t o) { + LDKAnnouncementSignatures 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); + o_conv = AnnouncementSignatures_clone(&o_conv); + LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ"); + *ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_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); +uint64_t __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErrorZ_err"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_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_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ"); + *ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_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); +jboolean __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErrorZ_is_ok"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_is_ok(uint64_t o) { + LDKCResult_AnnouncementSignaturesDecodeErrorZ* o_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void __attribute__((export_name("TS_CResult_PayeePubKeyErrorZ_free"))) TS_CResult_PayeePubKeyErrorZ_free(uint64_t _res) { +void __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErrorZ_free"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_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); + LDKCResult_AnnouncementSignaturesDecodeErrorZ _res_conv = *(LDKCResult_AnnouncementSignaturesDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_PayeePubKeyErrorZ_free(_res_conv); + CResult_AnnouncementSignaturesDecodeErrorZ_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); +static inline uint64_t CResult_AnnouncementSignaturesDecodeErrorZ_clone_ptr(LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ"); + *ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_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); +int64_t __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErrorZ_clone_ptr"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_AnnouncementSignaturesDecodeErrorZ* arg_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_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); +uint64_t __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErrorZ_clone"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_clone(uint64_t orig) { + LDKCResult_AnnouncementSignaturesDecodeErrorZ* orig_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)untag_ptr(orig); + LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ"); + *ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_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; +uint64_t __attribute__((export_name("TS_CResult_ChannelReestablishDecodeErrorZ_ok"))) TS_CResult_ChannelReestablishDecodeErrorZ_ok(uint64_t o) { + LDKChannelReestablish 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); + o_conv = ChannelReestablish_clone(&o_conv); + LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ"); + *ret_conv = CResult_ChannelReestablishDecodeErrorZ_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_ChannelReestablishDecodeErrorZ_err"))) TS_CResult_ChannelReestablishDecodeErrorZ_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_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ"); + *ret_conv = CResult_ChannelReestablishDecodeErrorZ_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_ChannelReestablishDecodeErrorZ_is_ok"))) TS_CResult_ChannelReestablishDecodeErrorZ_is_ok(uint64_t o) { + LDKCResult_ChannelReestablishDecodeErrorZ* o_conv = (LDKCResult_ChannelReestablishDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_ChannelReestablishDecodeErrorZ_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_ChannelReestablishDecodeErrorZ_free"))) TS_CResult_ChannelReestablishDecodeErrorZ_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_ChannelReestablishDecodeErrorZ _res_conv = *(LDKCResult_ChannelReestablishDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_PositiveTimestampCreationErrorZ_free(_res_conv); + CResult_ChannelReestablishDecodeErrorZ_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_ChannelReestablishDecodeErrorZ_clone_ptr(LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ"); + *ret_conv = CResult_ChannelReestablishDecodeErrorZ_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_ChannelReestablishDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelReestablishDecodeErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_ChannelReestablishDecodeErrorZ* arg_conv = (LDKCResult_ChannelReestablishDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_ChannelReestablishDecodeErrorZ_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_ChannelReestablishDecodeErrorZ_clone"))) TS_CResult_ChannelReestablishDecodeErrorZ_clone(uint64_t orig) { + LDKCResult_ChannelReestablishDecodeErrorZ* orig_conv = (LDKCResult_ChannelReestablishDecodeErrorZ*)untag_ptr(orig); + LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ"); + *ret_conv = CResult_ChannelReestablishDecodeErrorZ_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_ClosingSignedDecodeErrorZ_ok"))) TS_CResult_ClosingSignedDecodeErrorZ_ok(uint64_t o) { + LDKClosingSigned 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 = ClosingSigned_clone(&o_conv); + LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ"); + *ret_conv = CResult_ClosingSignedDecodeErrorZ_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); +uint64_t __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_err"))) TS_CResult_ClosingSignedDecodeErrorZ_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_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ"); + *ret_conv = CResult_ClosingSignedDecodeErrorZ_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); +jboolean __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_is_ok"))) TS_CResult_ClosingSignedDecodeErrorZ_is_ok(uint64_t o) { + LDKCResult_ClosingSignedDecodeErrorZ* o_conv = (LDKCResult_ClosingSignedDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_ClosingSignedDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void __attribute__((export_name("TS_CResult_NoneSemanticErrorZ_free"))) TS_CResult_NoneSemanticErrorZ_free(uint64_t _res) { +void __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_free"))) TS_CResult_ClosingSignedDecodeErrorZ_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); + LDKCResult_ClosingSignedDecodeErrorZ _res_conv = *(LDKCResult_ClosingSignedDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_NoneSemanticErrorZ_free(_res_conv); + CResult_ClosingSignedDecodeErrorZ_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); +static inline uint64_t CResult_ClosingSignedDecodeErrorZ_clone_ptr(LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ"); + *ret_conv = CResult_ClosingSignedDecodeErrorZ_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); +int64_t __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_clone_ptr"))) TS_CResult_ClosingSignedDecodeErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_ClosingSignedDecodeErrorZ* arg_conv = (LDKCResult_ClosingSignedDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_ClosingSignedDecodeErrorZ_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); +uint64_t __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_clone"))) TS_CResult_ClosingSignedDecodeErrorZ_clone(uint64_t orig) { + LDKCResult_ClosingSignedDecodeErrorZ* orig_conv = (LDKCResult_ClosingSignedDecodeErrorZ*)untag_ptr(orig); + LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ"); + *ret_conv = CResult_ClosingSignedDecodeErrorZ_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; +uint64_t __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_ok"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_ok(uint64_t o) { + LDKClosingSignedFeeRange 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); + o_conv = ClosingSignedFeeRange_clone(&o_conv); + LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ"); + *ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_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); +uint64_t __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_err"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_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_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ"); + *ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_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); +jboolean __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_is_ok"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_is_ok(uint64_t o) { + LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* o_conv = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void __attribute__((export_name("TS_CResult_InvoiceSemanticErrorZ_free"))) TS_CResult_InvoiceSemanticErrorZ_free(uint64_t _res) { +void __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_free"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_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); + LDKCResult_ClosingSignedFeeRangeDecodeErrorZ _res_conv = *(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_InvoiceSemanticErrorZ_free(_res_conv); + CResult_ClosingSignedFeeRangeDecodeErrorZ_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); +static inline uint64_t CResult_ClosingSignedFeeRangeDecodeErrorZ_clone_ptr(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ"); + *ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_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); +int64_t __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_clone_ptr"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* arg_conv = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_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); +uint64_t __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_clone"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(uint64_t orig) { + LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* orig_conv = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)untag_ptr(orig); + LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ"); + *ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_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; +uint64_t __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_ok"))) TS_CResult_CommitmentSignedDecodeErrorZ_ok(uint64_t o) { + LDKCommitmentSigned 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); + o_conv = CommitmentSigned_clone(&o_conv); + LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ"); + *ret_conv = CResult_CommitmentSignedDecodeErrorZ_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); +uint64_t __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_err"))) TS_CResult_CommitmentSignedDecodeErrorZ_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_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ"); + *ret_conv = CResult_CommitmentSignedDecodeErrorZ_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); +jboolean __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_is_ok"))) TS_CResult_CommitmentSignedDecodeErrorZ_is_ok(uint64_t o) { + LDKCResult_CommitmentSignedDecodeErrorZ* o_conv = (LDKCResult_CommitmentSignedDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_CommitmentSignedDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void __attribute__((export_name("TS_CResult_DescriptionCreationErrorZ_free"))) TS_CResult_DescriptionCreationErrorZ_free(uint64_t _res) { +void __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_free"))) TS_CResult_CommitmentSignedDecodeErrorZ_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); + LDKCResult_CommitmentSignedDecodeErrorZ _res_conv = *(LDKCResult_CommitmentSignedDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_DescriptionCreationErrorZ_free(_res_conv); + CResult_CommitmentSignedDecodeErrorZ_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); +static inline uint64_t CResult_CommitmentSignedDecodeErrorZ_clone_ptr(LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ"); + *ret_conv = CResult_CommitmentSignedDecodeErrorZ_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); +int64_t __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_clone_ptr"))) TS_CResult_CommitmentSignedDecodeErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_CommitmentSignedDecodeErrorZ* arg_conv = (LDKCResult_CommitmentSignedDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_CommitmentSignedDecodeErrorZ_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); +uint64_t __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_clone"))) TS_CResult_CommitmentSignedDecodeErrorZ_clone(uint64_t orig) { + LDKCResult_CommitmentSignedDecodeErrorZ* orig_conv = (LDKCResult_CommitmentSignedDecodeErrorZ*)untag_ptr(orig); + LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ"); + *ret_conv = CResult_CommitmentSignedDecodeErrorZ_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; +uint64_t __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_ok"))) TS_CResult_FundingCreatedDecodeErrorZ_ok(uint64_t o) { + LDKFundingCreated 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); + o_conv = FundingCreated_clone(&o_conv); + LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ"); + *ret_conv = CResult_FundingCreatedDecodeErrorZ_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); +uint64_t __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_err"))) TS_CResult_FundingCreatedDecodeErrorZ_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_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ"); + *ret_conv = CResult_FundingCreatedDecodeErrorZ_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); +jboolean __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_is_ok"))) TS_CResult_FundingCreatedDecodeErrorZ_is_ok(uint64_t o) { + LDKCResult_FundingCreatedDecodeErrorZ* o_conv = (LDKCResult_FundingCreatedDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_FundingCreatedDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void __attribute__((export_name("TS_CResult_PrivateRouteCreationErrorZ_free"))) TS_CResult_PrivateRouteCreationErrorZ_free(uint64_t _res) { +void __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_free"))) TS_CResult_FundingCreatedDecodeErrorZ_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); + LDKCResult_FundingCreatedDecodeErrorZ _res_conv = *(LDKCResult_FundingCreatedDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_PrivateRouteCreationErrorZ_free(_res_conv); + CResult_FundingCreatedDecodeErrorZ_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); +static inline uint64_t CResult_FundingCreatedDecodeErrorZ_clone_ptr(LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ"); + *ret_conv = CResult_FundingCreatedDecodeErrorZ_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); +int64_t __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_clone_ptr"))) TS_CResult_FundingCreatedDecodeErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_FundingCreatedDecodeErrorZ* arg_conv = (LDKCResult_FundingCreatedDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_FundingCreatedDecodeErrorZ_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); +uint64_t __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_clone"))) TS_CResult_FundingCreatedDecodeErrorZ_clone(uint64_t orig) { + LDKCResult_FundingCreatedDecodeErrorZ* orig_conv = (LDKCResult_FundingCreatedDecodeErrorZ*)untag_ptr(orig); + LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ"); + *ret_conv = CResult_FundingCreatedDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_CResult_NoneErrorZ_ok"))) TS_CResult_NoneErrorZ_ok() { - LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ"); - *ret_conv = CResult_NoneErrorZ_ok(); +uint64_t __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_ok"))) TS_CResult_FundingSignedDecodeErrorZ_ok(uint64_t o) { + LDKFundingSigned 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 = FundingSigned_clone(&o_conv); + LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ"); + *ret_conv = CResult_FundingSignedDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_CResult_NoneErrorZ_err"))) TS_CResult_NoneErrorZ_err(uint32_t e) { - LDKIOError e_conv = LDKIOError_from_js(e); - LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ"); - *ret_conv = CResult_NoneErrorZ_err(e_conv); +uint64_t __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_err"))) TS_CResult_FundingSignedDecodeErrorZ_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_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ"); + *ret_conv = CResult_FundingSignedDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean __attribute__((export_name("TS_CResult_NoneErrorZ_is_ok"))) TS_CResult_NoneErrorZ_is_ok(uint64_t o) { - LDKCResult_NoneErrorZ* o_conv = (LDKCResult_NoneErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_NoneErrorZ_is_ok(o_conv); +jboolean __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_is_ok"))) TS_CResult_FundingSignedDecodeErrorZ_is_ok(uint64_t o) { + LDKCResult_FundingSignedDecodeErrorZ* o_conv = (LDKCResult_FundingSignedDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_FundingSignedDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void __attribute__((export_name("TS_CResult_NoneErrorZ_free"))) TS_CResult_NoneErrorZ_free(uint64_t _res) { +void __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_free"))) TS_CResult_FundingSignedDecodeErrorZ_free(uint64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_NoneErrorZ _res_conv = *(LDKCResult_NoneErrorZ*)(_res_ptr); + LDKCResult_FundingSignedDecodeErrorZ _res_conv = *(LDKCResult_FundingSignedDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_NoneErrorZ_free(_res_conv); + CResult_FundingSignedDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_NoneErrorZ_clone_ptr(LDKCResult_NoneErrorZ *NONNULL_PTR arg) { - LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ"); - *ret_conv = CResult_NoneErrorZ_clone(arg); +static inline uint64_t CResult_FundingSignedDecodeErrorZ_clone_ptr(LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ"); + *ret_conv = CResult_FundingSignedDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t __attribute__((export_name("TS_CResult_NoneErrorZ_clone_ptr"))) TS_CResult_NoneErrorZ_clone_ptr(uint64_t arg) { - LDKCResult_NoneErrorZ* arg_conv = (LDKCResult_NoneErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_NoneErrorZ_clone_ptr(arg_conv); +int64_t __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_clone_ptr"))) TS_CResult_FundingSignedDecodeErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_FundingSignedDecodeErrorZ* arg_conv = (LDKCResult_FundingSignedDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_FundingSignedDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_CResult_NoneErrorZ_clone"))) TS_CResult_NoneErrorZ_clone(uint64_t orig) { - LDKCResult_NoneErrorZ* orig_conv = (LDKCResult_NoneErrorZ*)untag_ptr(orig); - LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ"); - *ret_conv = CResult_NoneErrorZ_clone(orig_conv); +uint64_t __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_clone"))) TS_CResult_FundingSignedDecodeErrorZ_clone(uint64_t orig) { + LDKCResult_FundingSignedDecodeErrorZ* orig_conv = (LDKCResult_FundingSignedDecodeErrorZ*)untag_ptr(orig); + LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ"); + *ret_conv = CResult_FundingSignedDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_CResult_NetAddressDecodeErrorZ_ok"))) TS_CResult_NetAddressDecodeErrorZ_ok(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)); - LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ"); - *ret_conv = CResult_NetAddressDecodeErrorZ_ok(o_conv); +uint64_t __attribute__((export_name("TS_CResult_ChannelReadyDecodeErrorZ_ok"))) TS_CResult_ChannelReadyDecodeErrorZ_ok(uint64_t o) { + LDKChannelReady 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 = ChannelReady_clone(&o_conv); + LDKCResult_ChannelReadyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReadyDecodeErrorZ), "LDKCResult_ChannelReadyDecodeErrorZ"); + *ret_conv = CResult_ChannelReadyDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_CResult_NetAddressDecodeErrorZ_err"))) TS_CResult_NetAddressDecodeErrorZ_err(uint64_t e) { +uint64_t __attribute__((export_name("TS_CResult_ChannelReadyDecodeErrorZ_err"))) TS_CResult_ChannelReadyDecodeErrorZ_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_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ"); - *ret_conv = CResult_NetAddressDecodeErrorZ_err(e_conv); + LDKCResult_ChannelReadyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReadyDecodeErrorZ), "LDKCResult_ChannelReadyDecodeErrorZ"); + *ret_conv = CResult_ChannelReadyDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean __attribute__((export_name("TS_CResult_NetAddressDecodeErrorZ_is_ok"))) TS_CResult_NetAddressDecodeErrorZ_is_ok(uint64_t o) { - LDKCResult_NetAddressDecodeErrorZ* o_conv = (LDKCResult_NetAddressDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_NetAddressDecodeErrorZ_is_ok(o_conv); +jboolean __attribute__((export_name("TS_CResult_ChannelReadyDecodeErrorZ_is_ok"))) TS_CResult_ChannelReadyDecodeErrorZ_is_ok(uint64_t o) { + LDKCResult_ChannelReadyDecodeErrorZ* o_conv = (LDKCResult_ChannelReadyDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_ChannelReadyDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void __attribute__((export_name("TS_CResult_NetAddressDecodeErrorZ_free"))) TS_CResult_NetAddressDecodeErrorZ_free(uint64_t _res) { +void __attribute__((export_name("TS_CResult_ChannelReadyDecodeErrorZ_free"))) TS_CResult_ChannelReadyDecodeErrorZ_free(uint64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_NetAddressDecodeErrorZ _res_conv = *(LDKCResult_NetAddressDecodeErrorZ*)(_res_ptr); + LDKCResult_ChannelReadyDecodeErrorZ _res_conv = *(LDKCResult_ChannelReadyDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_NetAddressDecodeErrorZ_free(_res_conv); + CResult_ChannelReadyDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_NetAddressDecodeErrorZ_clone_ptr(LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ"); - *ret_conv = CResult_NetAddressDecodeErrorZ_clone(arg); +static inline uint64_t CResult_ChannelReadyDecodeErrorZ_clone_ptr(LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelReadyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReadyDecodeErrorZ), "LDKCResult_ChannelReadyDecodeErrorZ"); + *ret_conv = CResult_ChannelReadyDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t __attribute__((export_name("TS_CResult_NetAddressDecodeErrorZ_clone_ptr"))) TS_CResult_NetAddressDecodeErrorZ_clone_ptr(uint64_t arg) { - LDKCResult_NetAddressDecodeErrorZ* arg_conv = (LDKCResult_NetAddressDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_NetAddressDecodeErrorZ_clone_ptr(arg_conv); +int64_t __attribute__((export_name("TS_CResult_ChannelReadyDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelReadyDecodeErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_ChannelReadyDecodeErrorZ* arg_conv = (LDKCResult_ChannelReadyDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_ChannelReadyDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_CResult_NetAddressDecodeErrorZ_clone"))) TS_CResult_NetAddressDecodeErrorZ_clone(uint64_t orig) { - LDKCResult_NetAddressDecodeErrorZ* orig_conv = (LDKCResult_NetAddressDecodeErrorZ*)untag_ptr(orig); - LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ"); - *ret_conv = CResult_NetAddressDecodeErrorZ_clone(orig_conv); +uint64_t __attribute__((export_name("TS_CResult_ChannelReadyDecodeErrorZ_clone"))) TS_CResult_ChannelReadyDecodeErrorZ_clone(uint64_t orig) { + LDKCResult_ChannelReadyDecodeErrorZ* orig_conv = (LDKCResult_ChannelReadyDecodeErrorZ*)untag_ptr(orig); + LDKCResult_ChannelReadyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReadyDecodeErrorZ), "LDKCResult_ChannelReadyDecodeErrorZ"); + *ret_conv = CResult_ChannelReadyDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -void __attribute__((export_name("TS_CVec_UpdateAddHTLCZ_free"))) TS_CVec_UpdateAddHTLCZ_free(uint64_tArray _res) { - LDKCVec_UpdateAddHTLCZ _res_constr; - _res_constr.datalen = _res->arr_len; - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKUpdateAddHTLC), "LDKCVec_UpdateAddHTLCZ 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_15 = _res_vals[p]; - LDKUpdateAddHTLC _res_conv_15_conv; - _res_conv_15_conv.inner = untag_ptr(_res_conv_15); - _res_conv_15_conv.is_owned = ptr_is_owned(_res_conv_15); - CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_15_conv); - _res_constr.data[p] = _res_conv_15_conv; - } - FREE(_res); - CVec_UpdateAddHTLCZ_free(_res_constr); -} - -void __attribute__((export_name("TS_CVec_UpdateFulfillHTLCZ_free"))) TS_CVec_UpdateFulfillHTLCZ_free(uint64_tArray _res) { - LDKCVec_UpdateFulfillHTLCZ _res_constr; - _res_constr.datalen = _res->arr_len; - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKUpdateFulfillHTLC), "LDKCVec_UpdateFulfillHTLCZ 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]; - LDKUpdateFulfillHTLC _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_UpdateFulfillHTLCZ_free(_res_constr); -} - -void __attribute__((export_name("TS_CVec_UpdateFailHTLCZ_free"))) TS_CVec_UpdateFailHTLCZ_free(uint64_tArray _res) { - LDKCVec_UpdateFailHTLCZ _res_constr; - _res_constr.datalen = _res->arr_len; - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKUpdateFailHTLC), "LDKCVec_UpdateFailHTLCZ 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]; - LDKUpdateFailHTLC _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_UpdateFailHTLCZ_free(_res_constr); -} - -void __attribute__((export_name("TS_CVec_UpdateFailMalformedHTLCZ_free"))) TS_CVec_UpdateFailMalformedHTLCZ_free(uint64_tArray _res) { - LDKCVec_UpdateFailMalformedHTLCZ _res_constr; - _res_constr.datalen = _res->arr_len; - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKUpdateFailMalformedHTLC), "LDKCVec_UpdateFailMalformedHTLCZ 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]; - LDKUpdateFailMalformedHTLC _res_conv_25_conv; - _res_conv_25_conv.inner = untag_ptr(_res_conv_25); - _res_conv_25_conv.is_owned = ptr_is_owned(_res_conv_25); - CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_25_conv); - _res_constr.data[z] = _res_conv_25_conv; - } - FREE(_res); - CVec_UpdateFailMalformedHTLCZ_free(_res_constr); -} - -uint64_t __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_ok"))) TS_CResult_AcceptChannelDecodeErrorZ_ok(uint64_t o) { - LDKAcceptChannel o_conv; +uint64_t __attribute__((export_name("TS_CResult_InitDecodeErrorZ_ok"))) TS_CResult_InitDecodeErrorZ_ok(uint64_t o) { + LDKInit 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 = AcceptChannel_clone(&o_conv); - LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ"); - *ret_conv = CResult_AcceptChannelDecodeErrorZ_ok(o_conv); + o_conv = Init_clone(&o_conv); + LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ"); + *ret_conv = CResult_InitDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_err"))) TS_CResult_AcceptChannelDecodeErrorZ_err(uint64_t e) { +uint64_t __attribute__((export_name("TS_CResult_InitDecodeErrorZ_err"))) TS_CResult_InitDecodeErrorZ_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_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ"); - *ret_conv = CResult_AcceptChannelDecodeErrorZ_err(e_conv); + LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ"); + *ret_conv = CResult_InitDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_is_ok"))) TS_CResult_AcceptChannelDecodeErrorZ_is_ok(uint64_t o) { - LDKCResult_AcceptChannelDecodeErrorZ* o_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_AcceptChannelDecodeErrorZ_is_ok(o_conv); +jboolean __attribute__((export_name("TS_CResult_InitDecodeErrorZ_is_ok"))) TS_CResult_InitDecodeErrorZ_is_ok(uint64_t o) { + LDKCResult_InitDecodeErrorZ* o_conv = (LDKCResult_InitDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_InitDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_free"))) TS_CResult_AcceptChannelDecodeErrorZ_free(uint64_t _res) { +void __attribute__((export_name("TS_CResult_InitDecodeErrorZ_free"))) TS_CResult_InitDecodeErrorZ_free(uint64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_AcceptChannelDecodeErrorZ _res_conv = *(LDKCResult_AcceptChannelDecodeErrorZ*)(_res_ptr); + LDKCResult_InitDecodeErrorZ _res_conv = *(LDKCResult_InitDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_AcceptChannelDecodeErrorZ_free(_res_conv); + CResult_InitDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_AcceptChannelDecodeErrorZ_clone_ptr(LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ"); - *ret_conv = CResult_AcceptChannelDecodeErrorZ_clone(arg); +static inline uint64_t CResult_InitDecodeErrorZ_clone_ptr(LDKCResult_InitDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ"); + *ret_conv = CResult_InitDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_clone_ptr"))) TS_CResult_AcceptChannelDecodeErrorZ_clone_ptr(uint64_t arg) { - LDKCResult_AcceptChannelDecodeErrorZ* arg_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_AcceptChannelDecodeErrorZ_clone_ptr(arg_conv); +int64_t __attribute__((export_name("TS_CResult_InitDecodeErrorZ_clone_ptr"))) TS_CResult_InitDecodeErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_InitDecodeErrorZ* arg_conv = (LDKCResult_InitDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_InitDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_clone"))) TS_CResult_AcceptChannelDecodeErrorZ_clone(uint64_t orig) { - LDKCResult_AcceptChannelDecodeErrorZ* orig_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)untag_ptr(orig); - LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ"); - *ret_conv = CResult_AcceptChannelDecodeErrorZ_clone(orig_conv); +uint64_t __attribute__((export_name("TS_CResult_InitDecodeErrorZ_clone"))) TS_CResult_InitDecodeErrorZ_clone(uint64_t orig) { + LDKCResult_InitDecodeErrorZ* orig_conv = (LDKCResult_InitDecodeErrorZ*)untag_ptr(orig); + LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ"); + *ret_conv = CResult_InitDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErrorZ_ok"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_ok(uint64_t o) { - LDKAnnouncementSignatures o_conv; +uint64_t __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_ok"))) TS_CResult_OpenChannelDecodeErrorZ_ok(uint64_t o) { + LDKOpenChannel 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 = AnnouncementSignatures_clone(&o_conv); - LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ"); - *ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_ok(o_conv); + o_conv = OpenChannel_clone(&o_conv); + LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ"); + *ret_conv = CResult_OpenChannelDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErrorZ_err"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_err(uint64_t e) { +uint64_t __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_err"))) TS_CResult_OpenChannelDecodeErrorZ_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_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ"); - *ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_err(e_conv); + LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ"); + *ret_conv = CResult_OpenChannelDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErrorZ_is_ok"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_is_ok(uint64_t o) { - LDKCResult_AnnouncementSignaturesDecodeErrorZ* o_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_is_ok(o_conv); +jboolean __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_is_ok"))) TS_CResult_OpenChannelDecodeErrorZ_is_ok(uint64_t o) { + LDKCResult_OpenChannelDecodeErrorZ* o_conv = (LDKCResult_OpenChannelDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_OpenChannelDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErrorZ_free"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_free(uint64_t _res) { +void __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_free"))) TS_CResult_OpenChannelDecodeErrorZ_free(uint64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_AnnouncementSignaturesDecodeErrorZ _res_conv = *(LDKCResult_AnnouncementSignaturesDecodeErrorZ*)(_res_ptr); + LDKCResult_OpenChannelDecodeErrorZ _res_conv = *(LDKCResult_OpenChannelDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_AnnouncementSignaturesDecodeErrorZ_free(_res_conv); + CResult_OpenChannelDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_AnnouncementSignaturesDecodeErrorZ_clone_ptr(LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ"); - *ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_clone(arg); +static inline uint64_t CResult_OpenChannelDecodeErrorZ_clone_ptr(LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ"); + *ret_conv = CResult_OpenChannelDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErrorZ_clone_ptr"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_clone_ptr(uint64_t arg) { - LDKCResult_AnnouncementSignaturesDecodeErrorZ* arg_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_clone_ptr(arg_conv); +int64_t __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_clone_ptr"))) TS_CResult_OpenChannelDecodeErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_OpenChannelDecodeErrorZ* arg_conv = (LDKCResult_OpenChannelDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_OpenChannelDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErrorZ_clone"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_clone(uint64_t orig) { - LDKCResult_AnnouncementSignaturesDecodeErrorZ* orig_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)untag_ptr(orig); - LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ"); - *ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_clone(orig_conv); +uint64_t __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_clone"))) TS_CResult_OpenChannelDecodeErrorZ_clone(uint64_t orig) { + LDKCResult_OpenChannelDecodeErrorZ* orig_conv = (LDKCResult_OpenChannelDecodeErrorZ*)untag_ptr(orig); + LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ"); + *ret_conv = CResult_OpenChannelDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_CResult_ChannelReestablishDecodeErrorZ_ok"))) TS_CResult_ChannelReestablishDecodeErrorZ_ok(uint64_t o) { - LDKChannelReestablish o_conv; +uint64_t __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_ok"))) TS_CResult_RevokeAndACKDecodeErrorZ_ok(uint64_t o) { + LDKRevokeAndACK 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 = ChannelReestablish_clone(&o_conv); - LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ"); - *ret_conv = CResult_ChannelReestablishDecodeErrorZ_ok(o_conv); + o_conv = RevokeAndACK_clone(&o_conv); + LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ"); + *ret_conv = CResult_RevokeAndACKDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_CResult_ChannelReestablishDecodeErrorZ_err"))) TS_CResult_ChannelReestablishDecodeErrorZ_err(uint64_t e) { +uint64_t __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_err"))) TS_CResult_RevokeAndACKDecodeErrorZ_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_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ"); - *ret_conv = CResult_ChannelReestablishDecodeErrorZ_err(e_conv); + LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ"); + *ret_conv = CResult_RevokeAndACKDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean __attribute__((export_name("TS_CResult_ChannelReestablishDecodeErrorZ_is_ok"))) TS_CResult_ChannelReestablishDecodeErrorZ_is_ok(uint64_t o) { - LDKCResult_ChannelReestablishDecodeErrorZ* o_conv = (LDKCResult_ChannelReestablishDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_ChannelReestablishDecodeErrorZ_is_ok(o_conv); +jboolean __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_is_ok"))) TS_CResult_RevokeAndACKDecodeErrorZ_is_ok(uint64_t o) { + LDKCResult_RevokeAndACKDecodeErrorZ* o_conv = (LDKCResult_RevokeAndACKDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_RevokeAndACKDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void __attribute__((export_name("TS_CResult_ChannelReestablishDecodeErrorZ_free"))) TS_CResult_ChannelReestablishDecodeErrorZ_free(uint64_t _res) { +void __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_free"))) TS_CResult_RevokeAndACKDecodeErrorZ_free(uint64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_ChannelReestablishDecodeErrorZ _res_conv = *(LDKCResult_ChannelReestablishDecodeErrorZ*)(_res_ptr); + LDKCResult_RevokeAndACKDecodeErrorZ _res_conv = *(LDKCResult_RevokeAndACKDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_ChannelReestablishDecodeErrorZ_free(_res_conv); + CResult_RevokeAndACKDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_ChannelReestablishDecodeErrorZ_clone_ptr(LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ"); - *ret_conv = CResult_ChannelReestablishDecodeErrorZ_clone(arg); +static inline uint64_t CResult_RevokeAndACKDecodeErrorZ_clone_ptr(LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ"); + *ret_conv = CResult_RevokeAndACKDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t __attribute__((export_name("TS_CResult_ChannelReestablishDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelReestablishDecodeErrorZ_clone_ptr(uint64_t arg) { - LDKCResult_ChannelReestablishDecodeErrorZ* arg_conv = (LDKCResult_ChannelReestablishDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_ChannelReestablishDecodeErrorZ_clone_ptr(arg_conv); +int64_t __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_clone_ptr"))) TS_CResult_RevokeAndACKDecodeErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_RevokeAndACKDecodeErrorZ* arg_conv = (LDKCResult_RevokeAndACKDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_RevokeAndACKDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_CResult_ChannelReestablishDecodeErrorZ_clone"))) TS_CResult_ChannelReestablishDecodeErrorZ_clone(uint64_t orig) { - LDKCResult_ChannelReestablishDecodeErrorZ* orig_conv = (LDKCResult_ChannelReestablishDecodeErrorZ*)untag_ptr(orig); - LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ"); - *ret_conv = CResult_ChannelReestablishDecodeErrorZ_clone(orig_conv); +uint64_t __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_clone"))) TS_CResult_RevokeAndACKDecodeErrorZ_clone(uint64_t orig) { + LDKCResult_RevokeAndACKDecodeErrorZ* orig_conv = (LDKCResult_RevokeAndACKDecodeErrorZ*)untag_ptr(orig); + LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ"); + *ret_conv = CResult_RevokeAndACKDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_ok"))) TS_CResult_ClosingSignedDecodeErrorZ_ok(uint64_t o) { - LDKClosingSigned o_conv; +uint64_t __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_ok"))) TS_CResult_ShutdownDecodeErrorZ_ok(uint64_t o) { + LDKShutdown 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 = ClosingSigned_clone(&o_conv); - LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ"); - *ret_conv = CResult_ClosingSignedDecodeErrorZ_ok(o_conv); + o_conv = Shutdown_clone(&o_conv); + LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ"); + *ret_conv = CResult_ShutdownDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_err"))) TS_CResult_ClosingSignedDecodeErrorZ_err(uint64_t e) { +uint64_t __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_err"))) TS_CResult_ShutdownDecodeErrorZ_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_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ"); - *ret_conv = CResult_ClosingSignedDecodeErrorZ_err(e_conv); + LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ"); + *ret_conv = CResult_ShutdownDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_is_ok"))) TS_CResult_ClosingSignedDecodeErrorZ_is_ok(uint64_t o) { - LDKCResult_ClosingSignedDecodeErrorZ* o_conv = (LDKCResult_ClosingSignedDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_ClosingSignedDecodeErrorZ_is_ok(o_conv); +jboolean __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_is_ok"))) TS_CResult_ShutdownDecodeErrorZ_is_ok(uint64_t o) { + LDKCResult_ShutdownDecodeErrorZ* o_conv = (LDKCResult_ShutdownDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_ShutdownDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_free"))) TS_CResult_ClosingSignedDecodeErrorZ_free(uint64_t _res) { +void __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_free"))) TS_CResult_ShutdownDecodeErrorZ_free(uint64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_ClosingSignedDecodeErrorZ _res_conv = *(LDKCResult_ClosingSignedDecodeErrorZ*)(_res_ptr); + LDKCResult_ShutdownDecodeErrorZ _res_conv = *(LDKCResult_ShutdownDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_ClosingSignedDecodeErrorZ_free(_res_conv); + CResult_ShutdownDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_ClosingSignedDecodeErrorZ_clone_ptr(LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ"); - *ret_conv = CResult_ClosingSignedDecodeErrorZ_clone(arg); +static inline uint64_t CResult_ShutdownDecodeErrorZ_clone_ptr(LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ"); + *ret_conv = CResult_ShutdownDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_clone_ptr"))) TS_CResult_ClosingSignedDecodeErrorZ_clone_ptr(uint64_t arg) { - LDKCResult_ClosingSignedDecodeErrorZ* arg_conv = (LDKCResult_ClosingSignedDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_ClosingSignedDecodeErrorZ_clone_ptr(arg_conv); +int64_t __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_clone_ptr"))) TS_CResult_ShutdownDecodeErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_ShutdownDecodeErrorZ* arg_conv = (LDKCResult_ShutdownDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_ShutdownDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_clone"))) TS_CResult_ClosingSignedDecodeErrorZ_clone(uint64_t orig) { - LDKCResult_ClosingSignedDecodeErrorZ* orig_conv = (LDKCResult_ClosingSignedDecodeErrorZ*)untag_ptr(orig); - LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ"); - *ret_conv = CResult_ClosingSignedDecodeErrorZ_clone(orig_conv); +uint64_t __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_clone"))) TS_CResult_ShutdownDecodeErrorZ_clone(uint64_t orig) { + LDKCResult_ShutdownDecodeErrorZ* orig_conv = (LDKCResult_ShutdownDecodeErrorZ*)untag_ptr(orig); + LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ"); + *ret_conv = CResult_ShutdownDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_ok"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_ok(uint64_t o) { - LDKClosingSignedFeeRange o_conv; +uint64_t __attribute__((export_name("TS_CResult_UpdateFailHTLCDecodeErrorZ_ok"))) TS_CResult_UpdateFailHTLCDecodeErrorZ_ok(uint64_t o) { + LDKUpdateFailHTLC 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 = ClosingSignedFeeRange_clone(&o_conv); - LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ"); - *ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_ok(o_conv); + o_conv = UpdateFailHTLC_clone(&o_conv); + LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ"); + *ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_err"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_err(uint64_t e) { +uint64_t __attribute__((export_name("TS_CResult_UpdateFailHTLCDecodeErrorZ_err"))) TS_CResult_UpdateFailHTLCDecodeErrorZ_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_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ"); - *ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); -} - -jboolean __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_is_ok"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_is_ok(uint64_t o) { - LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* o_conv = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_is_ok(o_conv); - return ret_conv; -} - -void __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_free"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_free(uint64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_ClosingSignedFeeRangeDecodeErrorZ _res_conv = *(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_ClosingSignedFeeRangeDecodeErrorZ_free(_res_conv); -} - -static inline uint64_t CResult_ClosingSignedFeeRangeDecodeErrorZ_clone_ptr(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ"); - *ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(arg); - return tag_ptr(ret_conv, true); -} -int64_t __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_clone_ptr"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_clone_ptr(uint64_t arg) { - LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* arg_conv = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_clone_ptr(arg_conv); - return ret_conv; -} - -uint64_t __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_clone"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(uint64_t orig) { - LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* orig_conv = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)untag_ptr(orig); - LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ"); - *ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -uint64_t __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_ok"))) TS_CResult_CommitmentSignedDecodeErrorZ_ok(uint64_t o) { - LDKCommitmentSigned 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 = CommitmentSigned_clone(&o_conv); - LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ"); - *ret_conv = CResult_CommitmentSignedDecodeErrorZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -uint64_t __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_err"))) TS_CResult_CommitmentSignedDecodeErrorZ_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_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ"); - *ret_conv = CResult_CommitmentSignedDecodeErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); -} - -jboolean __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_is_ok"))) TS_CResult_CommitmentSignedDecodeErrorZ_is_ok(uint64_t o) { - LDKCResult_CommitmentSignedDecodeErrorZ* o_conv = (LDKCResult_CommitmentSignedDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_CommitmentSignedDecodeErrorZ_is_ok(o_conv); - return ret_conv; -} - -void __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_free"))) TS_CResult_CommitmentSignedDecodeErrorZ_free(uint64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_CommitmentSignedDecodeErrorZ _res_conv = *(LDKCResult_CommitmentSignedDecodeErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_CommitmentSignedDecodeErrorZ_free(_res_conv); -} - -static inline uint64_t CResult_CommitmentSignedDecodeErrorZ_clone_ptr(LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ"); - *ret_conv = CResult_CommitmentSignedDecodeErrorZ_clone(arg); - return tag_ptr(ret_conv, true); -} -int64_t __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_clone_ptr"))) TS_CResult_CommitmentSignedDecodeErrorZ_clone_ptr(uint64_t arg) { - LDKCResult_CommitmentSignedDecodeErrorZ* arg_conv = (LDKCResult_CommitmentSignedDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_CommitmentSignedDecodeErrorZ_clone_ptr(arg_conv); - return ret_conv; -} - -uint64_t __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_clone"))) TS_CResult_CommitmentSignedDecodeErrorZ_clone(uint64_t orig) { - LDKCResult_CommitmentSignedDecodeErrorZ* orig_conv = (LDKCResult_CommitmentSignedDecodeErrorZ*)untag_ptr(orig); - LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ"); - *ret_conv = CResult_CommitmentSignedDecodeErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -uint64_t __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_ok"))) TS_CResult_FundingCreatedDecodeErrorZ_ok(uint64_t o) { - LDKFundingCreated 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 = FundingCreated_clone(&o_conv); - LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ"); - *ret_conv = CResult_FundingCreatedDecodeErrorZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -uint64_t __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_err"))) TS_CResult_FundingCreatedDecodeErrorZ_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_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ"); - *ret_conv = CResult_FundingCreatedDecodeErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); -} - -jboolean __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_is_ok"))) TS_CResult_FundingCreatedDecodeErrorZ_is_ok(uint64_t o) { - LDKCResult_FundingCreatedDecodeErrorZ* o_conv = (LDKCResult_FundingCreatedDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_FundingCreatedDecodeErrorZ_is_ok(o_conv); - return ret_conv; -} - -void __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_free"))) TS_CResult_FundingCreatedDecodeErrorZ_free(uint64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_FundingCreatedDecodeErrorZ _res_conv = *(LDKCResult_FundingCreatedDecodeErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_FundingCreatedDecodeErrorZ_free(_res_conv); -} - -static inline uint64_t CResult_FundingCreatedDecodeErrorZ_clone_ptr(LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ"); - *ret_conv = CResult_FundingCreatedDecodeErrorZ_clone(arg); - return tag_ptr(ret_conv, true); -} -int64_t __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_clone_ptr"))) TS_CResult_FundingCreatedDecodeErrorZ_clone_ptr(uint64_t arg) { - LDKCResult_FundingCreatedDecodeErrorZ* arg_conv = (LDKCResult_FundingCreatedDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_FundingCreatedDecodeErrorZ_clone_ptr(arg_conv); - return ret_conv; -} - -uint64_t __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_clone"))) TS_CResult_FundingCreatedDecodeErrorZ_clone(uint64_t orig) { - LDKCResult_FundingCreatedDecodeErrorZ* orig_conv = (LDKCResult_FundingCreatedDecodeErrorZ*)untag_ptr(orig); - LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ"); - *ret_conv = CResult_FundingCreatedDecodeErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -uint64_t __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_ok"))) TS_CResult_FundingSignedDecodeErrorZ_ok(uint64_t o) { - LDKFundingSigned 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 = FundingSigned_clone(&o_conv); - LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ"); - *ret_conv = CResult_FundingSignedDecodeErrorZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -uint64_t __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_err"))) TS_CResult_FundingSignedDecodeErrorZ_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_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ"); - *ret_conv = CResult_FundingSignedDecodeErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); -} - -jboolean __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_is_ok"))) TS_CResult_FundingSignedDecodeErrorZ_is_ok(uint64_t o) { - LDKCResult_FundingSignedDecodeErrorZ* o_conv = (LDKCResult_FundingSignedDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_FundingSignedDecodeErrorZ_is_ok(o_conv); - return ret_conv; -} - -void __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_free"))) TS_CResult_FundingSignedDecodeErrorZ_free(uint64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_FundingSignedDecodeErrorZ _res_conv = *(LDKCResult_FundingSignedDecodeErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_FundingSignedDecodeErrorZ_free(_res_conv); -} - -static inline uint64_t CResult_FundingSignedDecodeErrorZ_clone_ptr(LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ"); - *ret_conv = CResult_FundingSignedDecodeErrorZ_clone(arg); - return tag_ptr(ret_conv, true); -} -int64_t __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_clone_ptr"))) TS_CResult_FundingSignedDecodeErrorZ_clone_ptr(uint64_t arg) { - LDKCResult_FundingSignedDecodeErrorZ* arg_conv = (LDKCResult_FundingSignedDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_FundingSignedDecodeErrorZ_clone_ptr(arg_conv); - return ret_conv; -} - -uint64_t __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_clone"))) TS_CResult_FundingSignedDecodeErrorZ_clone(uint64_t orig) { - LDKCResult_FundingSignedDecodeErrorZ* orig_conv = (LDKCResult_FundingSignedDecodeErrorZ*)untag_ptr(orig); - LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ"); - *ret_conv = CResult_FundingSignedDecodeErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -uint64_t __attribute__((export_name("TS_CResult_ChannelReadyDecodeErrorZ_ok"))) TS_CResult_ChannelReadyDecodeErrorZ_ok(uint64_t o) { - LDKChannelReady 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 = ChannelReady_clone(&o_conv); - LDKCResult_ChannelReadyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReadyDecodeErrorZ), "LDKCResult_ChannelReadyDecodeErrorZ"); - *ret_conv = CResult_ChannelReadyDecodeErrorZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -uint64_t __attribute__((export_name("TS_CResult_ChannelReadyDecodeErrorZ_err"))) TS_CResult_ChannelReadyDecodeErrorZ_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_ChannelReadyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReadyDecodeErrorZ), "LDKCResult_ChannelReadyDecodeErrorZ"); - *ret_conv = CResult_ChannelReadyDecodeErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); -} - -jboolean __attribute__((export_name("TS_CResult_ChannelReadyDecodeErrorZ_is_ok"))) TS_CResult_ChannelReadyDecodeErrorZ_is_ok(uint64_t o) { - LDKCResult_ChannelReadyDecodeErrorZ* o_conv = (LDKCResult_ChannelReadyDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_ChannelReadyDecodeErrorZ_is_ok(o_conv); - return ret_conv; -} - -void __attribute__((export_name("TS_CResult_ChannelReadyDecodeErrorZ_free"))) TS_CResult_ChannelReadyDecodeErrorZ_free(uint64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_ChannelReadyDecodeErrorZ _res_conv = *(LDKCResult_ChannelReadyDecodeErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_ChannelReadyDecodeErrorZ_free(_res_conv); -} - -static inline uint64_t CResult_ChannelReadyDecodeErrorZ_clone_ptr(LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_ChannelReadyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReadyDecodeErrorZ), "LDKCResult_ChannelReadyDecodeErrorZ"); - *ret_conv = CResult_ChannelReadyDecodeErrorZ_clone(arg); - return tag_ptr(ret_conv, true); -} -int64_t __attribute__((export_name("TS_CResult_ChannelReadyDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelReadyDecodeErrorZ_clone_ptr(uint64_t arg) { - LDKCResult_ChannelReadyDecodeErrorZ* arg_conv = (LDKCResult_ChannelReadyDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_ChannelReadyDecodeErrorZ_clone_ptr(arg_conv); - return ret_conv; -} - -uint64_t __attribute__((export_name("TS_CResult_ChannelReadyDecodeErrorZ_clone"))) TS_CResult_ChannelReadyDecodeErrorZ_clone(uint64_t orig) { - LDKCResult_ChannelReadyDecodeErrorZ* orig_conv = (LDKCResult_ChannelReadyDecodeErrorZ*)untag_ptr(orig); - LDKCResult_ChannelReadyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReadyDecodeErrorZ), "LDKCResult_ChannelReadyDecodeErrorZ"); - *ret_conv = CResult_ChannelReadyDecodeErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -uint64_t __attribute__((export_name("TS_CResult_InitDecodeErrorZ_ok"))) TS_CResult_InitDecodeErrorZ_ok(uint64_t o) { - LDKInit 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 = Init_clone(&o_conv); - LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ"); - *ret_conv = CResult_InitDecodeErrorZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -uint64_t __attribute__((export_name("TS_CResult_InitDecodeErrorZ_err"))) TS_CResult_InitDecodeErrorZ_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_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ"); - *ret_conv = CResult_InitDecodeErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); -} - -jboolean __attribute__((export_name("TS_CResult_InitDecodeErrorZ_is_ok"))) TS_CResult_InitDecodeErrorZ_is_ok(uint64_t o) { - LDKCResult_InitDecodeErrorZ* o_conv = (LDKCResult_InitDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_InitDecodeErrorZ_is_ok(o_conv); - return ret_conv; -} - -void __attribute__((export_name("TS_CResult_InitDecodeErrorZ_free"))) TS_CResult_InitDecodeErrorZ_free(uint64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_InitDecodeErrorZ _res_conv = *(LDKCResult_InitDecodeErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_InitDecodeErrorZ_free(_res_conv); -} - -static inline uint64_t CResult_InitDecodeErrorZ_clone_ptr(LDKCResult_InitDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ"); - *ret_conv = CResult_InitDecodeErrorZ_clone(arg); - return tag_ptr(ret_conv, true); -} -int64_t __attribute__((export_name("TS_CResult_InitDecodeErrorZ_clone_ptr"))) TS_CResult_InitDecodeErrorZ_clone_ptr(uint64_t arg) { - LDKCResult_InitDecodeErrorZ* arg_conv = (LDKCResult_InitDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_InitDecodeErrorZ_clone_ptr(arg_conv); - return ret_conv; -} - -uint64_t __attribute__((export_name("TS_CResult_InitDecodeErrorZ_clone"))) TS_CResult_InitDecodeErrorZ_clone(uint64_t orig) { - LDKCResult_InitDecodeErrorZ* orig_conv = (LDKCResult_InitDecodeErrorZ*)untag_ptr(orig); - LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ"); - *ret_conv = CResult_InitDecodeErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -uint64_t __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_ok"))) TS_CResult_OpenChannelDecodeErrorZ_ok(uint64_t o) { - LDKOpenChannel 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 = OpenChannel_clone(&o_conv); - LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ"); - *ret_conv = CResult_OpenChannelDecodeErrorZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -uint64_t __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_err"))) TS_CResult_OpenChannelDecodeErrorZ_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_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ"); - *ret_conv = CResult_OpenChannelDecodeErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); -} - -jboolean __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_is_ok"))) TS_CResult_OpenChannelDecodeErrorZ_is_ok(uint64_t o) { - LDKCResult_OpenChannelDecodeErrorZ* o_conv = (LDKCResult_OpenChannelDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_OpenChannelDecodeErrorZ_is_ok(o_conv); - return ret_conv; -} - -void __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_free"))) TS_CResult_OpenChannelDecodeErrorZ_free(uint64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_OpenChannelDecodeErrorZ _res_conv = *(LDKCResult_OpenChannelDecodeErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_OpenChannelDecodeErrorZ_free(_res_conv); -} - -static inline uint64_t CResult_OpenChannelDecodeErrorZ_clone_ptr(LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ"); - *ret_conv = CResult_OpenChannelDecodeErrorZ_clone(arg); - return tag_ptr(ret_conv, true); -} -int64_t __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_clone_ptr"))) TS_CResult_OpenChannelDecodeErrorZ_clone_ptr(uint64_t arg) { - LDKCResult_OpenChannelDecodeErrorZ* arg_conv = (LDKCResult_OpenChannelDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_OpenChannelDecodeErrorZ_clone_ptr(arg_conv); - return ret_conv; -} - -uint64_t __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_clone"))) TS_CResult_OpenChannelDecodeErrorZ_clone(uint64_t orig) { - LDKCResult_OpenChannelDecodeErrorZ* orig_conv = (LDKCResult_OpenChannelDecodeErrorZ*)untag_ptr(orig); - LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ"); - *ret_conv = CResult_OpenChannelDecodeErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -uint64_t __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_ok"))) TS_CResult_RevokeAndACKDecodeErrorZ_ok(uint64_t o) { - LDKRevokeAndACK 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 = RevokeAndACK_clone(&o_conv); - LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ"); - *ret_conv = CResult_RevokeAndACKDecodeErrorZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -uint64_t __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_err"))) TS_CResult_RevokeAndACKDecodeErrorZ_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_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ"); - *ret_conv = CResult_RevokeAndACKDecodeErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); -} - -jboolean __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_is_ok"))) TS_CResult_RevokeAndACKDecodeErrorZ_is_ok(uint64_t o) { - LDKCResult_RevokeAndACKDecodeErrorZ* o_conv = (LDKCResult_RevokeAndACKDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_RevokeAndACKDecodeErrorZ_is_ok(o_conv); - return ret_conv; -} - -void __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_free"))) TS_CResult_RevokeAndACKDecodeErrorZ_free(uint64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_RevokeAndACKDecodeErrorZ _res_conv = *(LDKCResult_RevokeAndACKDecodeErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_RevokeAndACKDecodeErrorZ_free(_res_conv); -} - -static inline uint64_t CResult_RevokeAndACKDecodeErrorZ_clone_ptr(LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ"); - *ret_conv = CResult_RevokeAndACKDecodeErrorZ_clone(arg); - return tag_ptr(ret_conv, true); -} -int64_t __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_clone_ptr"))) TS_CResult_RevokeAndACKDecodeErrorZ_clone_ptr(uint64_t arg) { - LDKCResult_RevokeAndACKDecodeErrorZ* arg_conv = (LDKCResult_RevokeAndACKDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_RevokeAndACKDecodeErrorZ_clone_ptr(arg_conv); - return ret_conv; -} - -uint64_t __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_clone"))) TS_CResult_RevokeAndACKDecodeErrorZ_clone(uint64_t orig) { - LDKCResult_RevokeAndACKDecodeErrorZ* orig_conv = (LDKCResult_RevokeAndACKDecodeErrorZ*)untag_ptr(orig); - LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ"); - *ret_conv = CResult_RevokeAndACKDecodeErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -uint64_t __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_ok"))) TS_CResult_ShutdownDecodeErrorZ_ok(uint64_t o) { - LDKShutdown 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 = Shutdown_clone(&o_conv); - LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ"); - *ret_conv = CResult_ShutdownDecodeErrorZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -uint64_t __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_err"))) TS_CResult_ShutdownDecodeErrorZ_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_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ"); - *ret_conv = CResult_ShutdownDecodeErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); -} - -jboolean __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_is_ok"))) TS_CResult_ShutdownDecodeErrorZ_is_ok(uint64_t o) { - LDKCResult_ShutdownDecodeErrorZ* o_conv = (LDKCResult_ShutdownDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_ShutdownDecodeErrorZ_is_ok(o_conv); - return ret_conv; -} - -void __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_free"))) TS_CResult_ShutdownDecodeErrorZ_free(uint64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_ShutdownDecodeErrorZ _res_conv = *(LDKCResult_ShutdownDecodeErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_ShutdownDecodeErrorZ_free(_res_conv); -} - -static inline uint64_t CResult_ShutdownDecodeErrorZ_clone_ptr(LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ"); - *ret_conv = CResult_ShutdownDecodeErrorZ_clone(arg); - return tag_ptr(ret_conv, true); -} -int64_t __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_clone_ptr"))) TS_CResult_ShutdownDecodeErrorZ_clone_ptr(uint64_t arg) { - LDKCResult_ShutdownDecodeErrorZ* arg_conv = (LDKCResult_ShutdownDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_ShutdownDecodeErrorZ_clone_ptr(arg_conv); - return ret_conv; -} - -uint64_t __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_clone"))) TS_CResult_ShutdownDecodeErrorZ_clone(uint64_t orig) { - LDKCResult_ShutdownDecodeErrorZ* orig_conv = (LDKCResult_ShutdownDecodeErrorZ*)untag_ptr(orig); - LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ"); - *ret_conv = CResult_ShutdownDecodeErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -uint64_t __attribute__((export_name("TS_CResult_UpdateFailHTLCDecodeErrorZ_ok"))) TS_CResult_UpdateFailHTLCDecodeErrorZ_ok(uint64_t o) { - LDKUpdateFailHTLC 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 = UpdateFailHTLC_clone(&o_conv); - LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ"); - *ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -uint64_t __attribute__((export_name("TS_CResult_UpdateFailHTLCDecodeErrorZ_err"))) TS_CResult_UpdateFailHTLCDecodeErrorZ_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_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ"); - *ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_err(e_conv); + LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ"); + *ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } @@ -21671,80 +21891,6 @@ uint64_t __attribute__((export_name("TS_CResult_GossipTimestampFilterDecodeErro 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); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = Invoice_clone(&o_conv); - LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ"); - *ret_conv = CResult_InvoiceSignOrCreationErrorZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -uint64_t __attribute__((export_name("TS_CResult_InvoiceSignOrCreationErrorZ_err"))) TS_CResult_InvoiceSignOrCreationErrorZ_err(uint64_t e) { - void* e_ptr = untag_ptr(e); - CHECK_ACCESS(e_ptr); - LDKSignOrCreationError e_conv = *(LDKSignOrCreationError*)(e_ptr); - e_conv = SignOrCreationError_clone((LDKSignOrCreationError*)untag_ptr(e)); - LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ"); - *ret_conv = CResult_InvoiceSignOrCreationErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); -} - -jboolean __attribute__((export_name("TS_CResult_InvoiceSignOrCreationErrorZ_is_ok"))) TS_CResult_InvoiceSignOrCreationErrorZ_is_ok(uint64_t o) { - LDKCResult_InvoiceSignOrCreationErrorZ* o_conv = (LDKCResult_InvoiceSignOrCreationErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_InvoiceSignOrCreationErrorZ_is_ok(o_conv); - return ret_conv; -} - -void __attribute__((export_name("TS_CResult_InvoiceSignOrCreationErrorZ_free"))) TS_CResult_InvoiceSignOrCreationErrorZ_free(uint64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_InvoiceSignOrCreationErrorZ _res_conv = *(LDKCResult_InvoiceSignOrCreationErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_InvoiceSignOrCreationErrorZ_free(_res_conv); -} - -static inline uint64_t CResult_InvoiceSignOrCreationErrorZ_clone_ptr(LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR arg) { - LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ"); - *ret_conv = CResult_InvoiceSignOrCreationErrorZ_clone(arg); - return tag_ptr(ret_conv, true); -} -int64_t __attribute__((export_name("TS_CResult_InvoiceSignOrCreationErrorZ_clone_ptr"))) TS_CResult_InvoiceSignOrCreationErrorZ_clone_ptr(uint64_t arg) { - LDKCResult_InvoiceSignOrCreationErrorZ* arg_conv = (LDKCResult_InvoiceSignOrCreationErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_InvoiceSignOrCreationErrorZ_clone_ptr(arg_conv); - return ret_conv; -} - -uint64_t __attribute__((export_name("TS_CResult_InvoiceSignOrCreationErrorZ_clone"))) TS_CResult_InvoiceSignOrCreationErrorZ_clone(uint64_t orig) { - LDKCResult_InvoiceSignOrCreationErrorZ* orig_conv = (LDKCResult_InvoiceSignOrCreationErrorZ*)untag_ptr(orig); - LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ"); - *ret_conv = CResult_InvoiceSignOrCreationErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - uint64_t __attribute__((export_name("TS_COption_FilterZ_some"))) TS_COption_FilterZ_some(uint64_t o) { void* o_ptr = untag_ptr(o); CHECK_ACCESS(o_ptr); @@ -21923,1175 +22069,620 @@ void __attribute__((export_name("TS_CVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZ 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); - CHECK_ACCESS(this_ptr_ptr); - LDKPaymentPurpose this_ptr_conv = *(LDKPaymentPurpose*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - PaymentPurpose_free(this_ptr_conv); +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); } -static inline uint64_t PaymentPurpose_clone_ptr(LDKPaymentPurpose *NONNULL_PTR arg) { - LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose"); - *ret_copy = PaymentPurpose_clone(arg); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} -int64_t __attribute__((export_name("TS_PaymentPurpose_clone_ptr"))) TS_PaymentPurpose_clone_ptr(uint64_t arg) { - LDKPaymentPurpose* arg_conv = (LDKPaymentPurpose*)untag_ptr(arg); - int64_t ret_conv = PaymentPurpose_clone_ptr(arg_conv); - return ret_conv; +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); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = Invoice_clone(&o_conv); + LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ"); + *ret_conv = CResult_InvoiceSignOrCreationErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_PaymentPurpose_clone"))) TS_PaymentPurpose_clone(uint64_t orig) { - LDKPaymentPurpose* orig_conv = (LDKPaymentPurpose*)untag_ptr(orig); - LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose"); - *ret_copy = PaymentPurpose_clone(orig_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +uint64_t __attribute__((export_name("TS_CResult_InvoiceSignOrCreationErrorZ_err"))) TS_CResult_InvoiceSignOrCreationErrorZ_err(uint64_t e) { + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKSignOrCreationError e_conv = *(LDKSignOrCreationError*)(e_ptr); + e_conv = SignOrCreationError_clone((LDKSignOrCreationError*)untag_ptr(e)); + LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ"); + *ret_conv = CResult_InvoiceSignOrCreationErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_PaymentPurpose_invoice_payment"))) TS_PaymentPurpose_invoice_payment(int8_tArray payment_preimage, int8_tArray payment_secret) { - LDKThirtyTwoBytes payment_preimage_ref; - CHECK(payment_preimage->arr_len == 32); - memcpy(payment_preimage_ref.data, payment_preimage->elems, 32); FREE(payment_preimage); - LDKThirtyTwoBytes payment_secret_ref; - CHECK(payment_secret->arr_len == 32); - memcpy(payment_secret_ref.data, payment_secret->elems, 32); FREE(payment_secret); - LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose"); - *ret_copy = PaymentPurpose_invoice_payment(payment_preimage_ref, payment_secret_ref); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jboolean __attribute__((export_name("TS_CResult_InvoiceSignOrCreationErrorZ_is_ok"))) TS_CResult_InvoiceSignOrCreationErrorZ_is_ok(uint64_t o) { + LDKCResult_InvoiceSignOrCreationErrorZ* o_conv = (LDKCResult_InvoiceSignOrCreationErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_InvoiceSignOrCreationErrorZ_is_ok(o_conv); + return ret_conv; } -uint64_t __attribute__((export_name("TS_PaymentPurpose_spontaneous_payment"))) TS_PaymentPurpose_spontaneous_payment(int8_tArray a) { - LDKThirtyTwoBytes a_ref; - CHECK(a->arr_len == 32); - memcpy(a_ref.data, a->elems, 32); FREE(a); - LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose"); - *ret_copy = PaymentPurpose_spontaneous_payment(a_ref); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void __attribute__((export_name("TS_CResult_InvoiceSignOrCreationErrorZ_free"))) TS_CResult_InvoiceSignOrCreationErrorZ_free(uint64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_InvoiceSignOrCreationErrorZ _res_conv = *(LDKCResult_InvoiceSignOrCreationErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_InvoiceSignOrCreationErrorZ_free(_res_conv); } -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); +static inline uint64_t CResult_InvoiceSignOrCreationErrorZ_clone_ptr(LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR arg) { + LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ"); + *ret_conv = CResult_InvoiceSignOrCreationErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t __attribute__((export_name("TS_CResult_InvoiceSignOrCreationErrorZ_clone_ptr"))) TS_CResult_InvoiceSignOrCreationErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_InvoiceSignOrCreationErrorZ* arg_conv = (LDKCResult_InvoiceSignOrCreationErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_InvoiceSignOrCreationErrorZ_clone_ptr(arg_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); - 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_CResult_InvoiceSignOrCreationErrorZ_clone"))) TS_CResult_InvoiceSignOrCreationErrorZ_clone(uint64_t orig) { + LDKCResult_InvoiceSignOrCreationErrorZ* orig_conv = (LDKCResult_InvoiceSignOrCreationErrorZ*)untag_ptr(orig); + LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ"); + *ret_conv = CResult_InvoiceSignOrCreationErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_PaymentPurpose_read"))) TS_PaymentPurpose_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ"); - *ret_conv = PaymentPurpose_read(ser_ref); - FREE(ser); +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); } -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); +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); } -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); +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; } -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; +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); } -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; +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); } - -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); +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; } -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_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_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); +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); } -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); - CHECK_ACCESS(this_ptr_ptr); - LDKClosureReason this_ptr_conv = *(LDKClosureReason*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - ClosureReason_free(this_ptr_conv); +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); } -static inline uint64_t ClosureReason_clone_ptr(LDKClosureReason *NONNULL_PTR arg) { - LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); - *ret_copy = ClosureReason_clone(arg); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} -int64_t __attribute__((export_name("TS_ClosureReason_clone_ptr"))) TS_ClosureReason_clone_ptr(uint64_t arg) { - LDKClosureReason* arg_conv = (LDKClosureReason*)untag_ptr(arg); - int64_t ret_conv = ClosureReason_clone_ptr(arg_conv); +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; } -uint64_t __attribute__((export_name("TS_ClosureReason_clone"))) TS_ClosureReason_clone(uint64_t orig) { - LDKClosureReason* orig_conv = (LDKClosureReason*)untag_ptr(orig); - LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); - *ret_copy = ClosureReason_clone(orig_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +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); } -uint64_t __attribute__((export_name("TS_ClosureReason_counterparty_force_closed"))) TS_ClosureReason_counterparty_force_closed(jstring peer_msg) { - LDKStr peer_msg_conv = str_ref_to_owned_c(peer_msg); - LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); - *ret_copy = ClosureReason_counterparty_force_closed(peer_msg_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +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); } - -uint64_t __attribute__((export_name("TS_ClosureReason_holder_force_closed"))) TS_ClosureReason_holder_force_closed() { - LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); - *ret_copy = ClosureReason_holder_force_closed(); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +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_ClosureReason_cooperative_closure"))) TS_ClosureReason_cooperative_closure() { - LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); - *ret_copy = ClosureReason_cooperative_closure(); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +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_ClosureReason_commitment_tx_confirmed"))) TS_ClosureReason_commitment_tx_confirmed() { - LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); - *ret_copy = ClosureReason_commitment_tx_confirmed(); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +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_ClosureReason_funding_timed_out"))) TS_ClosureReason_funding_timed_out() { - LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); - *ret_copy = ClosureReason_funding_timed_out(); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +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); } -uint64_t __attribute__((export_name("TS_ClosureReason_processing_error"))) TS_ClosureReason_processing_error(jstring err) { - LDKStr err_conv = str_ref_to_owned_c(err); - LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); - *ret_copy = ClosureReason_processing_error(err_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +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; } -uint64_t __attribute__((export_name("TS_ClosureReason_disconnected_peer"))) TS_ClosureReason_disconnected_peer() { - LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); - *ret_copy = ClosureReason_disconnected_peer(); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +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); } -uint64_t __attribute__((export_name("TS_ClosureReason_outdated_channel_manager"))) TS_ClosureReason_outdated_channel_manager() { - LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); - *ret_copy = ClosureReason_outdated_channel_manager(); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +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); } - -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); +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; } -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); - 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_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); } -uint64_t __attribute__((export_name("TS_ClosureReason_read"))) TS_ClosureReason_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ"); - *ret_conv = ClosureReason_read(ser_ref); - FREE(ser); +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); } - -void __attribute__((export_name("TS_HTLCDestination_free"))) TS_HTLCDestination_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); - LDKHTLCDestination this_ptr_conv = *(LDKHTLCDestination*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - HTLCDestination_free(this_ptr_conv); +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; } -static inline uint64_t HTLCDestination_clone_ptr(LDKHTLCDestination *NONNULL_PTR arg) { - LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination"); - *ret_copy = HTLCDestination_clone(arg); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +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); } -int64_t __attribute__((export_name("TS_HTLCDestination_clone_ptr"))) TS_HTLCDestination_clone_ptr(uint64_t arg) { - LDKHTLCDestination* arg_conv = (LDKHTLCDestination*)untag_ptr(arg); - int64_t ret_conv = HTLCDestination_clone_ptr(arg_conv); - return ret_conv; + +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); } -uint64_t __attribute__((export_name("TS_HTLCDestination_clone"))) TS_HTLCDestination_clone(uint64_t orig) { - LDKHTLCDestination* orig_conv = (LDKHTLCDestination*)untag_ptr(orig); - LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination"); - *ret_copy = HTLCDestination_clone(orig_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +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_HTLCDestination_next_hop_channel"))) TS_HTLCDestination_next_hop_channel(int8_tArray node_id, int8_tArray channel_id) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - LDKThirtyTwoBytes channel_id_ref; - CHECK(channel_id->arr_len == 32); - memcpy(channel_id_ref.data, channel_id->elems, 32); FREE(channel_id); - LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination"); - *ret_copy = HTLCDestination_next_hop_channel(node_id_ref, channel_id_ref); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +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_HTLCDestination_unknown_next_hop"))) TS_HTLCDestination_unknown_next_hop(int64_t requested_forward_scid) { - LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination"); - *ret_copy = HTLCDestination_unknown_next_hop(requested_forward_scid); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +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); } -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; +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_HTLCDestination_failed_payment"))) TS_HTLCDestination_failed_payment(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); - LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination"); - *ret_copy = HTLCDestination_failed_payment(payment_hash_ref); - 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) { + 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); } -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); +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; } -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); - 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_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); } -uint64_t __attribute__((export_name("TS_HTLCDestination_read"))) TS_HTLCDestination_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_COption_HTLCDestinationZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_HTLCDestinationZDecodeErrorZ), "LDKCResult_COption_HTLCDestinationZDecodeErrorZ"); - *ret_conv = HTLCDestination_read(ser_ref); - FREE(ser); - 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); } -void __attribute__((export_name("TS_Event_free"))) TS_Event_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); - LDKEvent this_ptr_conv = *(LDKEvent*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - Event_free(this_ptr_conv); +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); } -static inline uint64_t Event_clone_ptr(LDKEvent *NONNULL_PTR arg) { - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_clone(arg); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +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); } -int64_t __attribute__((export_name("TS_Event_clone_ptr"))) TS_Event_clone_ptr(uint64_t arg) { - LDKEvent* arg_conv = (LDKEvent*)untag_ptr(arg); - int64_t ret_conv = Event_clone_ptr(arg_conv); + +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; } -uint64_t __attribute__((export_name("TS_Event_clone"))) TS_Event_clone(uint64_t orig) { - LDKEvent* orig_conv = (LDKEvent*)untag_ptr(orig); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_clone(orig_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +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); + LDKCResult_PositiveTimestampCreationErrorZ _res_conv = *(LDKCResult_PositiveTimestampCreationErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_PositiveTimestampCreationErrorZ_free(_res_conv); } -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); - 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); - LDKCVec_u8Z output_script_ref; - 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_ref); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +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); } - -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); - void* purpose_ptr = untag_ptr(purpose); - 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_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; +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_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); - void* purpose_ptr = untag_ptr(purpose); - CHECK_ACCESS(purpose_ptr); - 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(receiver_node_id_ref, payment_hash_ref, amount_msat, purpose_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_Event_payment_sent"))) TS_Event_payment_sent(int8_tArray payment_id, int8_tArray payment_preimage, int8_tArray payment_hash, uint64_t fee_paid_msat) { - LDKThirtyTwoBytes payment_id_ref; - CHECK(payment_id->arr_len == 32); - memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); - LDKThirtyTwoBytes payment_preimage_ref; - CHECK(payment_preimage->arr_len == 32); - memcpy(payment_preimage_ref.data, payment_preimage->elems, 32); FREE(payment_preimage); - LDKThirtyTwoBytes payment_hash_ref; - CHECK(payment_hash->arr_len == 32); - memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); - void* fee_paid_msat_ptr = untag_ptr(fee_paid_msat); - CHECK_ACCESS(fee_paid_msat_ptr); - LDKCOption_u64Z fee_paid_msat_conv = *(LDKCOption_u64Z*)(fee_paid_msat_ptr); - fee_paid_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(fee_paid_msat)); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_payment_sent(payment_id_ref, payment_preimage_ref, payment_hash_ref, fee_paid_msat_conv); - 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); } -uint64_t __attribute__((export_name("TS_Event_payment_failed"))) TS_Event_payment_failed(int8_tArray payment_id, int8_tArray payment_hash) { - 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); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_payment_failed(payment_id_ref, payment_hash_ref); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +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); } -uint64_t __attribute__((export_name("TS_Event_payment_path_successful"))) TS_Event_payment_path_successful(int8_tArray payment_id, int8_tArray payment_hash, uint64_tArray path) { - 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); - LDKCVec_RouteHopZ path_constr; - path_constr.datalen = path->arr_len; - if (path_constr.datalen > 0) - path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements"); - else - path_constr.data = NULL; - uint64_t* path_vals = path->elems; - for (size_t k = 0; k < path_constr.datalen; k++) { - uint64_t path_conv_10 = path_vals[k]; - LDKRouteHop path_conv_10_conv; - path_conv_10_conv.inner = untag_ptr(path_conv_10); - path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10); - CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv); - path_conv_10_conv = RouteHop_clone(&path_conv_10_conv); - path_constr.data[k] = path_conv_10_conv; - } - FREE(path); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_payment_path_successful(payment_id_ref, payment_hash_ref, path_constr); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +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; } -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* 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) - path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements"); - else - path_constr.data = NULL; - uint64_t* path_vals = path->elems; - for (size_t k = 0; k < path_constr.datalen; k++) { - uint64_t path_conv_10 = path_vals[k]; - LDKRouteHop path_conv_10_conv; - path_conv_10_conv.inner = untag_ptr(path_conv_10); - path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10); - CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv); - path_conv_10_conv = RouteHop_clone(&path_conv_10_conv); - path_constr.data[k] = path_conv_10_conv; - } - FREE(path); - void* short_channel_id_ptr = untag_ptr(short_channel_id); - CHECK_ACCESS(short_channel_id_ptr); - LDKCOption_u64Z short_channel_id_conv = *(LDKCOption_u64Z*)(short_channel_id_ptr); - short_channel_id_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(short_channel_id)); - LDKRouteParameters retry_conv; - retry_conv.inner = untag_ptr(retry); - retry_conv.is_owned = ptr_is_owned(retry); - 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, 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; +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); } -uint64_t __attribute__((export_name("TS_Event_probe_successful"))) TS_Event_probe_successful(int8_tArray payment_id, int8_tArray payment_hash, uint64_tArray path) { - 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); - LDKCVec_RouteHopZ path_constr; - path_constr.datalen = path->arr_len; - if (path_constr.datalen > 0) - path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements"); - else - path_constr.data = NULL; - uint64_t* path_vals = path->elems; - for (size_t k = 0; k < path_constr.datalen; k++) { - uint64_t path_conv_10 = path_vals[k]; - LDKRouteHop path_conv_10_conv; - path_conv_10_conv.inner = untag_ptr(path_conv_10); - path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10); - CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv); - path_conv_10_conv = RouteHop_clone(&path_conv_10_conv); - path_constr.data[k] = path_conv_10_conv; - } - FREE(path); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_probe_successful(payment_id_ref, payment_hash_ref, path_constr); - 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); } - -uint64_t __attribute__((export_name("TS_Event_probe_failed"))) TS_Event_probe_failed(int8_tArray payment_id, int8_tArray payment_hash, uint64_tArray path, uint64_t short_channel_id) { - 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); - LDKCVec_RouteHopZ path_constr; - path_constr.datalen = path->arr_len; - if (path_constr.datalen > 0) - path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements"); - else - path_constr.data = NULL; - uint64_t* path_vals = path->elems; - for (size_t k = 0; k < path_constr.datalen; k++) { - uint64_t path_conv_10 = path_vals[k]; - LDKRouteHop path_conv_10_conv; - path_conv_10_conv.inner = untag_ptr(path_conv_10); - path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10); - CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv); - path_conv_10_conv = RouteHop_clone(&path_conv_10_conv); - path_constr.data[k] = path_conv_10_conv; - } - FREE(path); - void* short_channel_id_ptr = untag_ptr(short_channel_id); - CHECK_ACCESS(short_channel_id_ptr); - LDKCOption_u64Z short_channel_id_conv = *(LDKCOption_u64Z*)(short_channel_id_ptr); - short_channel_id_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(short_channel_id)); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_probe_failed(payment_id_ref, payment_hash_ref, path_constr, short_channel_id_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +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_Event_pending_htlcs_forwardable"))) TS_Event_pending_htlcs_forwardable(int64_t time_forwardable) { - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_pending_htlcs_forwardable(time_forwardable); - 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_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_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_Event_spendable_outputs"))) TS_Event_spendable_outputs(uint64_tArray outputs) { - LDKCVec_SpendableOutputDescriptorZ outputs_constr; - outputs_constr.datalen = outputs->arr_len; - if (outputs_constr.datalen > 0) - outputs_constr.data = MALLOC(outputs_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements"); - else - outputs_constr.data = NULL; - uint64_t* outputs_vals = outputs->elems; - for (size_t b = 0; b < outputs_constr.datalen; b++) { - uint64_t outputs_conv_27 = outputs_vals[b]; - void* outputs_conv_27_ptr = untag_ptr(outputs_conv_27); - CHECK_ACCESS(outputs_conv_27_ptr); - LDKSpendableOutputDescriptor outputs_conv_27_conv = *(LDKSpendableOutputDescriptor*)(outputs_conv_27_ptr); - outputs_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)untag_ptr(outputs_conv_27)); - outputs_constr.data[b] = outputs_conv_27_conv; - } - FREE(outputs); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_spendable_outputs(outputs_constr); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +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); } -uint64_t __attribute__((export_name("TS_Event_payment_forwarded"))) TS_Event_payment_forwarded(int8_tArray prev_channel_id, int8_tArray next_channel_id, uint64_t fee_earned_msat, jboolean claim_from_onchain_tx) { - LDKThirtyTwoBytes prev_channel_id_ref; - CHECK(prev_channel_id->arr_len == 32); - memcpy(prev_channel_id_ref.data, prev_channel_id->elems, 32); FREE(prev_channel_id); - LDKThirtyTwoBytes next_channel_id_ref; - CHECK(next_channel_id->arr_len == 32); - memcpy(next_channel_id_ref.data, next_channel_id->elems, 32); FREE(next_channel_id); - void* fee_earned_msat_ptr = untag_ptr(fee_earned_msat); - CHECK_ACCESS(fee_earned_msat_ptr); - LDKCOption_u64Z fee_earned_msat_conv = *(LDKCOption_u64Z*)(fee_earned_msat_ptr); - fee_earned_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(fee_earned_msat)); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_payment_forwarded(prev_channel_id_ref, next_channel_id_ref, fee_earned_msat_conv, claim_from_onchain_tx); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +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; } -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; +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); } -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_ref, reason_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +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); } - -uint64_t __attribute__((export_name("TS_Event_discard_funding"))) TS_Event_discard_funding(int8_tArray channel_id, int8_tArray transaction) { - LDKThirtyTwoBytes channel_id_ref; - CHECK(channel_id->arr_len == 32); - memcpy(channel_id_ref.data, channel_id->elems, 32); FREE(channel_id); - LDKTransaction transaction_ref; - transaction_ref.datalen = transaction->arr_len; - transaction_ref.data = MALLOC(transaction_ref.datalen, "LDKTransaction Bytes"); - memcpy(transaction_ref.data, transaction->elems, transaction_ref.datalen); FREE(transaction); - transaction_ref.data_is_owned = true; - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_discard_funding(channel_id_ref, transaction_ref); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +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_Event_open_channel_request"))) TS_Event_open_channel_request(int8_tArray temporary_channel_id, int8_tArray counterparty_node_id, int64_t funding_satoshis, int64_t push_msat, uint64_t channel_type) { - 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); - 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_open_channel_request(temporary_channel_id_ref, counterparty_node_id_ref, funding_satoshis, push_msat, channel_type_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +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_Event_htlchandling_failed"))) TS_Event_htlchandling_failed(int8_tArray prev_channel_id, uint64_t failed_next_destination) { - LDKThirtyTwoBytes prev_channel_id_ref; - CHECK(prev_channel_id->arr_len == 32); - memcpy(prev_channel_id_ref.data, prev_channel_id->elems, 32); FREE(prev_channel_id); - void* failed_next_destination_ptr = untag_ptr(failed_next_destination); - CHECK_ACCESS(failed_next_destination_ptr); - LDKHTLCDestination failed_next_destination_conv = *(LDKHTLCDestination*)(failed_next_destination_ptr); - failed_next_destination_conv = HTLCDestination_clone((LDKHTLCDestination*)untag_ptr(failed_next_destination)); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_htlchandling_failed(prev_channel_id_ref, failed_next_destination_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void __attribute__((export_name("TS_CVec_AddressZ_free"))) TS_CVec_AddressZ_free(ptrArray _res) { + LDKCVec_AddressZ _res_constr; + _res_constr.datalen = _res->arr_len; + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKStr), "LDKCVec_AddressZ Elements"); + else + _res_constr.data = NULL; + jstring* _res_vals = (void*) _res->elems; + for (size_t i = 0; i < _res_constr.datalen; i++) { + jstring _res_conv_8 = _res_vals[i]; + LDKStr dummy = { .chars = NULL, .len = 0, .chars_is_owned = false }; + _res_constr.data[i] = dummy; + } + FREE(_res); + CVec_AddressZ_free(_res_constr); } -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; +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); } -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); - 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_Event_read"))) TS_Event_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ"); - *ret_conv = Event_read(ser_ref); - FREE(ser); +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); } -void __attribute__((export_name("TS_MessageSendEvent_free"))) TS_MessageSendEvent_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); - LDKMessageSendEvent this_ptr_conv = *(LDKMessageSendEvent*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - MessageSendEvent_free(this_ptr_conv); -} - -static inline uint64_t MessageSendEvent_clone_ptr(LDKMessageSendEvent *NONNULL_PTR arg) { - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_clone(arg); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} -int64_t __attribute__((export_name("TS_MessageSendEvent_clone_ptr"))) TS_MessageSendEvent_clone_ptr(uint64_t arg) { - LDKMessageSendEvent* arg_conv = (LDKMessageSendEvent*)untag_ptr(arg); - int64_t ret_conv = MessageSendEvent_clone_ptr(arg_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; } -uint64_t __attribute__((export_name("TS_MessageSendEvent_clone"))) TS_MessageSendEvent_clone(uint64_t orig) { - LDKMessageSendEvent* orig_conv = (LDKMessageSendEvent*)untag_ptr(orig); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_clone(orig_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -uint64_t __attribute__((export_name("TS_MessageSendEvent_send_accept_channel"))) TS_MessageSendEvent_send_accept_channel(int8_tArray node_id, uint64_t msg) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - 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 = AcceptChannel_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_accept_channel(node_id_ref, msg_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -uint64_t __attribute__((export_name("TS_MessageSendEvent_send_open_channel"))) TS_MessageSendEvent_send_open_channel(int8_tArray node_id, uint64_t msg) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - 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 = OpenChannel_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_open_channel(node_id_ref, msg_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -uint64_t __attribute__((export_name("TS_MessageSendEvent_send_funding_created"))) TS_MessageSendEvent_send_funding_created(int8_tArray node_id, uint64_t msg) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - LDKFundingCreated 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 = FundingCreated_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_funding_created(node_id_ref, msg_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -uint64_t __attribute__((export_name("TS_MessageSendEvent_send_funding_signed"))) TS_MessageSendEvent_send_funding_signed(int8_tArray node_id, uint64_t msg) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - LDKFundingSigned 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 = FundingSigned_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_funding_signed(node_id_ref, msg_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -uint64_t __attribute__((export_name("TS_MessageSendEvent_send_channel_ready"))) TS_MessageSendEvent_send_channel_ready(int8_tArray node_id, uint64_t msg) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - LDKChannelReady 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 = ChannelReady_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_channel_ready(node_id_ref, msg_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -uint64_t __attribute__((export_name("TS_MessageSendEvent_send_announcement_signatures"))) TS_MessageSendEvent_send_announcement_signatures(int8_tArray node_id, uint64_t msg) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - LDKAnnouncementSignatures 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 = AnnouncementSignatures_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_announcement_signatures(node_id_ref, msg_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -uint64_t __attribute__((export_name("TS_MessageSendEvent_update_htlcs"))) TS_MessageSendEvent_update_htlcs(int8_tArray node_id, uint64_t updates) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - LDKCommitmentUpdate updates_conv; - updates_conv.inner = untag_ptr(updates); - updates_conv.is_owned = ptr_is_owned(updates); - CHECK_INNER_FIELD_ACCESS_OR_NULL(updates_conv); - updates_conv = CommitmentUpdate_clone(&updates_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_update_htlcs(node_id_ref, updates_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -uint64_t __attribute__((export_name("TS_MessageSendEvent_send_revoke_and_ack"))) TS_MessageSendEvent_send_revoke_and_ack(int8_tArray node_id, uint64_t msg) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - LDKRevokeAndACK 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 = RevokeAndACK_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_revoke_and_ack(node_id_ref, msg_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -uint64_t __attribute__((export_name("TS_MessageSendEvent_send_closing_signed"))) TS_MessageSendEvent_send_closing_signed(int8_tArray node_id, uint64_t msg) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - LDKClosingSigned 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 = ClosingSigned_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_closing_signed(node_id_ref, msg_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -uint64_t __attribute__((export_name("TS_MessageSendEvent_send_shutdown"))) TS_MessageSendEvent_send_shutdown(int8_tArray node_id, uint64_t msg) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - 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 = Shutdown_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_shutdown(node_id_ref, msg_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -uint64_t __attribute__((export_name("TS_MessageSendEvent_send_channel_reestablish"))) TS_MessageSendEvent_send_channel_reestablish(int8_tArray node_id, uint64_t msg) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - LDKChannelReestablish 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 = ChannelReestablish_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_channel_reestablish(node_id_ref, msg_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -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(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_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_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 = 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_channel_announcement(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_channel_update"))) TS_MessageSendEvent_broadcast_channel_update(uint64_t msg) { - LDKChannelUpdate 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 = ChannelUpdate_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_broadcast_channel_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; - 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; +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); } -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); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - LDKChannelUpdate 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 = ChannelUpdate_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_channel_update(node_id_ref, msg_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +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); } - -uint64_t __attribute__((export_name("TS_MessageSendEvent_handle_error"))) TS_MessageSendEvent_handle_error(int8_tArray node_id, uint64_t action) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - void* action_ptr = untag_ptr(action); - CHECK_ACCESS(action_ptr); - LDKErrorAction action_conv = *(LDKErrorAction*)(action_ptr); - action_conv = ErrorAction_clone((LDKErrorAction*)untag_ptr(action)); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_handle_error(node_id_ref, action_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +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_MessageSendEvent_send_channel_range_query"))) TS_MessageSendEvent_send_channel_range_query(int8_tArray node_id, uint64_t msg) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - LDKQueryChannelRange 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 = QueryChannelRange_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_channel_range_query(node_id_ref, msg_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +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_MessageSendEvent_send_short_ids_query"))) TS_MessageSendEvent_send_short_ids_query(int8_tArray node_id, uint64_t msg) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - LDKQueryShortChannelIds 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 = QueryShortChannelIds_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_short_ids_query(node_id_ref, msg_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +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_MessageSendEvent_send_reply_channel_range"))) TS_MessageSendEvent_send_reply_channel_range(int8_tArray node_id, uint64_t msg) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - LDKReplyChannelRange 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 = ReplyChannelRange_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_reply_channel_range(node_id_ref, msg_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +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); } -uint64_t __attribute__((export_name("TS_MessageSendEvent_send_gossip_timestamp_filter"))) TS_MessageSendEvent_send_gossip_timestamp_filter(int8_tArray node_id, uint64_t msg) { - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - LDKGossipTimestampFilter 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 = GossipTimestampFilter_clone(&msg_conv); - LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_gossip_timestamp_filter(node_id_ref, msg_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +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_MessageSendEventsProvider_free"))) TS_MessageSendEventsProvider_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); - LDKMessageSendEventsProvider this_ptr_conv = *(LDKMessageSendEventsProvider*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - MessageSendEventsProvider_free(this_ptr_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); } -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); +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); } - -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); - CHECK_ACCESS(this_ptr_ptr); - LDKEventsProvider this_ptr_conv = *(LDKEventsProvider*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - EventsProvider_free(this_ptr_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; } -void __attribute__((export_name("TS_EventHandler_free"))) TS_EventHandler_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); - LDKEventHandler this_ptr_conv = *(LDKEventHandler*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - EventHandler_free(this_ptr_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); } void __attribute__((export_name("TS_APIError_free"))) TS_APIError_free(uint64_t this_ptr) { @@ -23370,91 +22961,228 @@ void __attribute__((export_name("TS_Persister_free"))) TS_Persister_free(uint64 Persister_free(this_ptr_conv); } -void __attribute__((export_name("TS_PrintableString_free"))) TS_PrintableString_free(uint64_t this_obj) { - LDKPrintableString this_obj_conv; +void __attribute__((export_name("TS_UntrustedString_free"))) TS_UntrustedString_free(uint64_t this_obj) { + LDKUntrustedString 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); + UntrustedString_free(this_obj_conv); } -jstring __attribute__((export_name("TS_PrintableString_get_a"))) TS_PrintableString_get_a(uint64_t this_ptr) { - LDKPrintableString this_ptr_conv; +jstring __attribute__((export_name("TS_UntrustedString_get_a"))) TS_UntrustedString_get_a(uint64_t this_ptr) { + LDKUntrustedString 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); + LDKStr ret_str = UntrustedString_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; +void __attribute__((export_name("TS_UntrustedString_set_a"))) TS_UntrustedString_set_a(uint64_t this_ptr, jstring val) { + LDKUntrustedString 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); + UntrustedString_set_a(&this_ptr_conv, val_conv); } -uint64_t __attribute__((export_name("TS_PrintableString_new"))) TS_PrintableString_new(jstring a_arg) { +uint64_t __attribute__((export_name("TS_UntrustedString_new"))) TS_UntrustedString_new(jstring a_arg) { LDKStr a_arg_conv = str_ref_to_owned_c(a_arg); - LDKPrintableString ret_var = PrintableString_new(a_arg_conv); + LDKUntrustedString ret_var = UntrustedString_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); +static inline uint64_t UntrustedString_clone_ptr(LDKUntrustedString *NONNULL_PTR arg) { + LDKUntrustedString ret_var = UntrustedString_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; } - -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); +int64_t __attribute__((export_name("TS_UntrustedString_clone_ptr"))) TS_UntrustedString_clone_ptr(uint64_t arg) { + LDKUntrustedString 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 = UntrustedString_clone_ptr(&arg_conv); + return ret_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)); - return ret_conv; +uint64_t __attribute__((export_name("TS_UntrustedString_clone"))) TS_UntrustedString_clone(uint64_t orig) { + LDKUntrustedString 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; + LDKUntrustedString ret_var = UntrustedString_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; } -uint32_t __attribute__((export_name("TS_Level_gossip"))) TS_Level_gossip() { - uint32_t ret_conv = LDKLevel_to_js(Level_gossip()); +jboolean __attribute__((export_name("TS_UntrustedString_eq"))) TS_UntrustedString_eq(uint64_t a, uint64_t b) { + LDKUntrustedString 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; + LDKUntrustedString 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 = UntrustedString_eq(&a_conv, &b_conv); return ret_conv; } -uint32_t __attribute__((export_name("TS_Level_trace"))) TS_Level_trace() { - uint32_t ret_conv = LDKLevel_to_js(Level_trace()); +int8_tArray __attribute__((export_name("TS_UntrustedString_write"))) TS_UntrustedString_write(uint64_t obj) { + LDKUntrustedString 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 = UntrustedString_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_UntrustedString_read"))) TS_UntrustedString_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_UntrustedStringDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UntrustedStringDecodeErrorZ), "LDKCResult_UntrustedStringDecodeErrorZ"); + *ret_conv = UntrustedString_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +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); +} + +static inline uint64_t Future_clone_ptr(LDKFuture *NONNULL_PTR arg) { + LDKFuture ret_var = Future_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_Future_clone_ptr"))) TS_Future_clone_ptr(uint64_t arg) { + LDKFuture 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 = Future_clone_ptr(&arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_Future_clone"))) TS_Future_clone(uint64_t orig) { + LDKFuture 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; + LDKFuture ret_var = Future_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_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)); + return ret_conv; +} + +uint32_t __attribute__((export_name("TS_Level_gossip"))) TS_Level_gossip() { + uint32_t ret_conv = LDKLevel_to_js(Level_gossip()); + return ret_conv; +} + +uint32_t __attribute__((export_name("TS_Level_trace"))) TS_Level_trace() { + uint32_t ret_conv = LDKLevel_to_js(Level_trace()); return ret_conv; } @@ -23808,8 +23536,27 @@ void __attribute__((export_name("TS_ChannelHandshakeConfig_set_their_channel_re 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); +int16_t __attribute__((export_name("TS_ChannelHandshakeConfig_get_our_max_accepted_htlcs"))) TS_ChannelHandshakeConfig_get_our_max_accepted_htlcs(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; + int16_t ret_conv = ChannelHandshakeConfig_get_our_max_accepted_htlcs(&this_ptr_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_ChannelHandshakeConfig_set_our_max_accepted_htlcs"))) TS_ChannelHandshakeConfig_set_our_max_accepted_htlcs(uint64_t this_ptr, int16_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_our_max_accepted_htlcs(&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, int16_t our_max_accepted_htlcs_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, our_max_accepted_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); @@ -25131,6 +24878,28 @@ uint64_t __attribute__((export_name("TS_ChainMonitor_channel_monitor_updated")) return tag_ptr(ret_conv, true); } +uint64_t __attribute__((export_name("TS_ChainMonitor_get_update_future"))) TS_ChainMonitor_get_update_future(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; + LDKFuture ret_var = ChainMonitor_get_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; +} + +void __attribute__((export_name("TS_ChainMonitor_rebroadcast_pending_claims"))) TS_ChainMonitor_rebroadcast_pending_claims(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; + ChainMonitor_rebroadcast_pending_claims(&this_arg_conv); +} + uint64_t __attribute__((export_name("TS_ChainMonitor_as_Listen"))) TS_ChainMonitor_as_Listen(uint64_t this_arg) { LDKChainMonitor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -25232,6 +25001,21 @@ uint64_t __attribute__((export_name("TS_ChannelMonitorUpdate_clone"))) TS_Chann return ret_ref; } +jboolean __attribute__((export_name("TS_ChannelMonitorUpdate_eq"))) TS_ChannelMonitorUpdate_eq(uint64_t a, uint64_t b) { + LDKChannelMonitorUpdate 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; + LDKChannelMonitorUpdate 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 = ChannelMonitorUpdate_eq(&a_conv, &b_conv); + return ret_conv; +} + int8_tArray __attribute__((export_name("TS_ChannelMonitorUpdate_write"))) TS_ChannelMonitorUpdate_write(uint64_t obj) { LDKChannelMonitorUpdate obj_conv; obj_conv.inner = untag_ptr(obj); @@ -25991,6 +25775,36 @@ uint64_t __attribute__((export_name("TS_ChannelMonitor_current_best_block"))) T return ret_ref; } +void __attribute__((export_name("TS_ChannelMonitor_rebroadcast_pending_claims"))) TS_ChannelMonitor_rebroadcast_pending_claims(uint64_t this_arg, uint64_t broadcaster, uint64_t fee_estimator, uint64_t logger) { + 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; + void* broadcaster_ptr = untag_ptr(broadcaster); + CHECK_ACCESS(broadcaster_ptr); + LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr); + if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv); + } + void* fee_estimator_ptr = untag_ptr(fee_estimator); + CHECK_ACCESS(fee_estimator_ptr); + LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr); + if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKFeeEstimator_JCalls_cloned(&fee_estimator_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); + } + ChannelMonitor_rebroadcast_pending_claims(&this_arg_conv, broadcaster_conv, fee_estimator_conv, logger_conv); +} + uint64_tArray __attribute__((export_name("TS_ChannelMonitor_get_claimable_balances"))) TS_ChannelMonitor_get_claimable_balances(uint64_t this_arg) { LDKChannelMonitor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -26990,7 +26804,7 @@ uint64_t __attribute__((export_name("TS_InMemorySigner_clone"))) TS_InMemorySig return ret_ref; } -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) { +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, int8_tArray rand_bytes_unique_start) { LDKSecretKey funding_key_ref; CHECK(funding_key->arr_len == 32); memcpy(funding_key_ref.bytes, funding_key->elems, 32); FREE(funding_key); @@ -27012,7 +26826,10 @@ uint64_t __attribute__((export_name("TS_InMemorySigner_new"))) TS_InMemorySigne 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(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); + LDKThirtyTwoBytes rand_bytes_unique_start_ref; + CHECK(rand_bytes_unique_start->arr_len == 32); + memcpy(rand_bytes_unique_start_ref.data, rand_bytes_unique_start->elems, 32); FREE(rand_bytes_unique_start); + 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, rand_bytes_unique_start_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); @@ -27140,6 +26957,17 @@ uint64_t __attribute__((export_name("TS_InMemorySigner_sign_dynamic_p2wsh_input return tag_ptr(ret_conv, true); } +uint64_t __attribute__((export_name("TS_InMemorySigner_as_EntropySource"))) TS_InMemorySigner_as_EntropySource(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; + LDKEntropySource* ret_ret = MALLOC(sizeof(LDKEntropySource), "LDKEntropySource"); + *ret_ret = InMemorySigner_as_EntropySource(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + 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); @@ -27186,12 +27014,19 @@ int8_tArray __attribute__((export_name("TS_InMemorySigner_write"))) TS_InMemory return ret_arr; } -uint64_t __attribute__((export_name("TS_InMemorySigner_read"))) TS_InMemorySigner_read(int8_tArray ser) { +uint64_t __attribute__((export_name("TS_InMemorySigner_read"))) TS_InMemorySigner_read(int8_tArray ser, uint64_t arg) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; ser_ref.data = ser->elems; + void* arg_ptr = untag_ptr(arg); + CHECK_ACCESS(arg_ptr); + LDKEntropySource arg_conv = *(LDKEntropySource*)(arg_ptr); + if (arg_conv.free == LDKEntropySource_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKEntropySource_JCalls_cloned(&arg_conv); + } LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ"); - *ret_conv = InMemorySigner_read(ser_ref); + *ret_conv = InMemorySigner_read(ser_ref, arg_conv); FREE(ser); return tag_ptr(ret_conv, true); } @@ -28165,6 +28000,31 @@ void __attribute__((export_name("TS_ChannelDetails_set_user_channel_id"))) TS_C ChannelDetails_set_user_channel_id(&this_ptr_conv, val_ref); } +uint64_t __attribute__((export_name("TS_ChannelDetails_get_feerate_sat_per_1000_weight"))) TS_ChannelDetails_get_feerate_sat_per_1000_weight(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_feerate_sat_per_1000_weight(&this_ptr_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void __attribute__((export_name("TS_ChannelDetails_set_feerate_sat_per_1000_weight"))) TS_ChannelDetails_set_feerate_sat_per_1000_weight(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_feerate_sat_per_1000_weight(&this_ptr_conv, val_conv); +} + int64_t __attribute__((export_name("TS_ChannelDetails_get_balance_msat"))) TS_ChannelDetails_get_balance_msat(uint64_t this_ptr) { LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); @@ -28469,7 +28329,7 @@ void __attribute__((export_name("TS_ChannelDetails_set_config"))) TS_ChannelDet 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, 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) { +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, uint64_t feerate_sat_per_1000_weight_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); @@ -28506,6 +28366,10 @@ uint64_t __attribute__((export_name("TS_ChannelDetails_new"))) TS_ChannelDetail 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* feerate_sat_per_1000_weight_arg_ptr = untag_ptr(feerate_sat_per_1000_weight_arg); + CHECK_ACCESS(feerate_sat_per_1000_weight_arg_ptr); + LDKCOption_u32Z feerate_sat_per_1000_weight_arg_conv = *(LDKCOption_u32Z*)(feerate_sat_per_1000_weight_arg_ptr); + feerate_sat_per_1000_weight_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(feerate_sat_per_1000_weight_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); @@ -28531,7 +28395,7 @@ uint64_t __attribute__((export_name("TS_ChannelDetails_new"))) TS_ChannelDetail 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_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); + 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, feerate_sat_per_1000_weight_arg_conv, 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); @@ -28960,6 +28824,31 @@ uint64_tArray __attribute__((export_name("TS_ChannelManager_list_usable_channel return ret_arr; } +uint64_tArray __attribute__((export_name("TS_ChannelManager_list_channels_with_counterparty"))) TS_ChannelManager_list_channels_with_counterparty(uint64_t this_arg, 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; + 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); + LDKCVec_ChannelDetailsZ ret_var = ChannelManager_list_channels_with_counterparty(&this_arg_conv, counterparty_node_id_ref); + 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_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); @@ -29071,7 +28960,7 @@ void __attribute__((export_name("TS_ChannelManager_force_close_all_channels_wit 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, int8_tArray payment_id) { +uint64_t __attribute__((export_name("TS_ChannelManager_send_payment_with_route"))) TS_ChannelManager_send_payment_with_route(uint64_t this_arg, uint64_t route, int8_tArray payment_hash, uint64_t recipient_onion, 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); @@ -29085,18 +28974,20 @@ uint64_t __attribute__((export_name("TS_ChannelManager_send_payment"))) TS_Chan 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); + LDKRecipientOnionFields recipient_onion_conv; + recipient_onion_conv.inner = untag_ptr(recipient_onion); + recipient_onion_conv.is_owned = ptr_is_owned(recipient_onion); + CHECK_INNER_FIELD_ACCESS_OR_NULL(recipient_onion_conv); + recipient_onion_conv = RecipientOnionFields_clone(&recipient_onion_conv); 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); + *ret_conv = ChannelManager_send_payment_with_route(&this_arg_conv, &route_conv, payment_hash_ref, recipient_onion_conv, payment_id_ref); return tag_ptr(ret_conv, true); } -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) { +uint64_t __attribute__((export_name("TS_ChannelManager_send_payment"))) TS_ChannelManager_send_payment(uint64_t this_arg, int8_tArray payment_hash, uint64_t recipient_onion, 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); @@ -29105,9 +28996,11 @@ uint64_t __attribute__((export_name("TS_ChannelManager_send_payment_with_retry" 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); + LDKRecipientOnionFields recipient_onion_conv; + recipient_onion_conv.inner = untag_ptr(recipient_onion); + recipient_onion_conv.is_owned = ptr_is_owned(recipient_onion); + CHECK_INNER_FIELD_ACCESS_OR_NULL(recipient_onion_conv); + recipient_onion_conv = RecipientOnionFields_clone(&recipient_onion_conv); LDKThirtyTwoBytes payment_id_ref; CHECK(payment_id->arr_len == 32); memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); @@ -29121,7 +29014,7 @@ uint64_t __attribute__((export_name("TS_ChannelManager_send_payment_with_retry" 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); + *ret_conv = ChannelManager_send_payment(&this_arg_conv, payment_hash_ref, recipient_onion_conv, payment_id_ref, route_params_conv, retry_strategy_conv); return tag_ptr(ret_conv, true); } @@ -29137,7 +29030,7 @@ void __attribute__((export_name("TS_ChannelManager_abandon_payment"))) TS_Chann 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, int8_tArray payment_id) { +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 recipient_onion, 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); @@ -29151,15 +29044,20 @@ uint64_t __attribute__((export_name("TS_ChannelManager_send_spontaneous_payment LDKThirtyTwoBytes payment_preimage_ref; CHECK(payment_preimage->arr_len == 32); memcpy(payment_preimage_ref.data, payment_preimage->elems, 32); FREE(payment_preimage); + LDKRecipientOnionFields recipient_onion_conv; + recipient_onion_conv.inner = untag_ptr(recipient_onion); + recipient_onion_conv.is_owned = ptr_is_owned(recipient_onion); + CHECK_INNER_FIELD_ACCESS_OR_NULL(recipient_onion_conv); + recipient_onion_conv = RecipientOnionFields_clone(&recipient_onion_conv); 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); + *ret_conv = ChannelManager_send_spontaneous_payment(&this_arg_conv, &route_conv, payment_preimage_ref, recipient_onion_conv, 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) { +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, uint64_t recipient_onion, 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); @@ -29168,6 +29066,11 @@ uint64_t __attribute__((export_name("TS_ChannelManager_send_spontaneous_payment LDKThirtyTwoBytes payment_preimage_ref; CHECK(payment_preimage->arr_len == 32); memcpy(payment_preimage_ref.data, payment_preimage->elems, 32); FREE(payment_preimage); + LDKRecipientOnionFields recipient_onion_conv; + recipient_onion_conv.inner = untag_ptr(recipient_onion); + recipient_onion_conv.is_owned = ptr_is_owned(recipient_onion); + CHECK_INNER_FIELD_ACCESS_OR_NULL(recipient_onion_conv); + recipient_onion_conv = RecipientOnionFields_clone(&recipient_onion_conv); LDKThirtyTwoBytes payment_id_ref; CHECK(payment_id->arr_len == 32); memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); @@ -29181,35 +29084,23 @@ uint64_t __attribute__((export_name("TS_ChannelManager_send_spontaneous_payment 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); + *ret_conv = ChannelManager_send_spontaneous_payment_with_retry(&this_arg_conv, payment_preimage_ref, recipient_onion_conv, payment_id_ref, route_params_conv, retry_strategy_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_ChannelManager_send_probe"))) TS_ChannelManager_send_probe(uint64_t this_arg, uint64_tArray hops) { +uint64_t __attribute__((export_name("TS_ChannelManager_send_probe"))) TS_ChannelManager_send_probe(uint64_t this_arg, uint64_t path) { 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_RouteHopZ hops_constr; - hops_constr.datalen = hops->arr_len; - if (hops_constr.datalen > 0) - hops_constr.data = MALLOC(hops_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements"); - else - hops_constr.data = NULL; - uint64_t* hops_vals = hops->elems; - for (size_t k = 0; k < hops_constr.datalen; k++) { - uint64_t hops_conv_10 = hops_vals[k]; - LDKRouteHop hops_conv_10_conv; - hops_conv_10_conv.inner = untag_ptr(hops_conv_10); - hops_conv_10_conv.is_owned = ptr_is_owned(hops_conv_10); - CHECK_INNER_FIELD_ACCESS_OR_NULL(hops_conv_10_conv); - hops_conv_10_conv = RouteHop_clone(&hops_conv_10_conv); - hops_constr.data[k] = hops_conv_10_conv; - } - FREE(hops); + LDKPath path_conv; + path_conv.inner = untag_ptr(path); + path_conv.is_owned = ptr_is_owned(path); + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); + path_conv = Path_clone(&path_conv); LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ"); - *ret_conv = ChannelManager_send_probe(&this_arg_conv, hops_constr); + *ret_conv = ChannelManager_send_probe(&this_arg_conv, path_conv); return tag_ptr(ret_conv, true); } @@ -29596,15 +29487,6 @@ uint64_t __attribute__((export_name("TS_ChannelManager_as_Confirm"))) TS_Channe return tag_ptr(ret_ret, true); } -void __attribute__((export_name("TS_ChannelManager_await_persistable_update"))) TS_ChannelManager_await_persistable_update(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; - 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); @@ -34115,27 +33997,31 @@ void __attribute__((export_name("TS_UnsignedNodeAnnouncement_set_rgb"))) TS_Uns UnsignedNodeAnnouncement_set_rgb(&this_ptr_conv, val_ref); } -int8_tArray __attribute__((export_name("TS_UnsignedNodeAnnouncement_get_alias"))) TS_UnsignedNodeAnnouncement_get_alias(uint64_t this_ptr) { +uint64_t __attribute__((export_name("TS_UnsignedNodeAnnouncement_get_alias"))) TS_UnsignedNodeAnnouncement_get_alias(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(32, __LINE__); - memcpy(ret_arr->elems, *UnsignedNodeAnnouncement_get_alias(&this_ptr_conv), 32); - return ret_arr; + LDKNodeAlias ret_var = UnsignedNodeAnnouncement_get_alias(&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_alias"))) TS_UnsignedNodeAnnouncement_set_alias(uint64_t this_ptr, int8_tArray val) { +void __attribute__((export_name("TS_UnsignedNodeAnnouncement_set_alias"))) TS_UnsignedNodeAnnouncement_set_alias(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; - LDKThirtyTwoBytes val_ref; - CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); FREE(val); - UnsignedNodeAnnouncement_set_alias(&this_ptr_conv, val_ref); + LDKNodeAlias 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 = NodeAlias_clone(&val_conv); + UnsignedNodeAnnouncement_set_alias(&this_ptr_conv, val_conv); } uint64_tArray __attribute__((export_name("TS_UnsignedNodeAnnouncement_get_addresses"))) TS_UnsignedNodeAnnouncement_get_addresses(uint64_t this_ptr) { @@ -34783,10134 +34669,13339 @@ void __attribute__((export_name("TS_UnsignedChannelUpdate_free"))) TS_UnsignedC UnsignedChannelUpdate_free(this_obj_conv); } -int8_tArray __attribute__((export_name("TS_UnsignedChannelUpdate_get_chain_hash"))) TS_UnsignedChannelUpdate_get_chain_hash(uint64_t this_ptr) { - LDKUnsignedChannelUpdate 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(32, __LINE__); - memcpy(ret_arr->elems, *UnsignedChannelUpdate_get_chain_hash(&this_ptr_conv), 32); +int8_tArray __attribute__((export_name("TS_UnsignedChannelUpdate_get_chain_hash"))) TS_UnsignedChannelUpdate_get_chain_hash(uint64_t this_ptr) { + LDKUnsignedChannelUpdate 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(32, __LINE__); + memcpy(ret_arr->elems, *UnsignedChannelUpdate_get_chain_hash(&this_ptr_conv), 32); + return ret_arr; +} + +void __attribute__((export_name("TS_UnsignedChannelUpdate_set_chain_hash"))) TS_UnsignedChannelUpdate_set_chain_hash(uint64_t this_ptr, int8_tArray val) { + LDKUnsignedChannelUpdate 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; + LDKThirtyTwoBytes val_ref; + CHECK(val->arr_len == 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); + UnsignedChannelUpdate_set_chain_hash(&this_ptr_conv, val_ref); +} + +int64_t __attribute__((export_name("TS_UnsignedChannelUpdate_get_short_channel_id"))) TS_UnsignedChannelUpdate_get_short_channel_id(uint64_t this_ptr) { + LDKUnsignedChannelUpdate 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 = UnsignedChannelUpdate_get_short_channel_id(&this_ptr_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_UnsignedChannelUpdate_set_short_channel_id"))) TS_UnsignedChannelUpdate_set_short_channel_id(uint64_t this_ptr, int64_t val) { + LDKUnsignedChannelUpdate 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; + UnsignedChannelUpdate_set_short_channel_id(&this_ptr_conv, val); +} + +int32_t __attribute__((export_name("TS_UnsignedChannelUpdate_get_timestamp"))) TS_UnsignedChannelUpdate_get_timestamp(uint64_t this_ptr) { + LDKUnsignedChannelUpdate 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 = UnsignedChannelUpdate_get_timestamp(&this_ptr_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_UnsignedChannelUpdate_set_timestamp"))) TS_UnsignedChannelUpdate_set_timestamp(uint64_t this_ptr, int32_t val) { + LDKUnsignedChannelUpdate 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; + UnsignedChannelUpdate_set_timestamp(&this_ptr_conv, val); +} + +int8_t __attribute__((export_name("TS_UnsignedChannelUpdate_get_flags"))) TS_UnsignedChannelUpdate_get_flags(uint64_t this_ptr) { + LDKUnsignedChannelUpdate 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_t ret_conv = UnsignedChannelUpdate_get_flags(&this_ptr_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_UnsignedChannelUpdate_set_flags"))) TS_UnsignedChannelUpdate_set_flags(uint64_t this_ptr, int8_t val) { + LDKUnsignedChannelUpdate 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; + UnsignedChannelUpdate_set_flags(&this_ptr_conv, val); +} + +int16_t __attribute__((export_name("TS_UnsignedChannelUpdate_get_cltv_expiry_delta"))) TS_UnsignedChannelUpdate_get_cltv_expiry_delta(uint64_t this_ptr) { + LDKUnsignedChannelUpdate 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; + int16_t ret_conv = UnsignedChannelUpdate_get_cltv_expiry_delta(&this_ptr_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_UnsignedChannelUpdate_set_cltv_expiry_delta"))) TS_UnsignedChannelUpdate_set_cltv_expiry_delta(uint64_t this_ptr, int16_t val) { + LDKUnsignedChannelUpdate 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; + UnsignedChannelUpdate_set_cltv_expiry_delta(&this_ptr_conv, val); +} + +int64_t __attribute__((export_name("TS_UnsignedChannelUpdate_get_htlc_minimum_msat"))) TS_UnsignedChannelUpdate_get_htlc_minimum_msat(uint64_t this_ptr) { + LDKUnsignedChannelUpdate 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 = UnsignedChannelUpdate_get_htlc_minimum_msat(&this_ptr_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_UnsignedChannelUpdate_set_htlc_minimum_msat"))) TS_UnsignedChannelUpdate_set_htlc_minimum_msat(uint64_t this_ptr, int64_t val) { + LDKUnsignedChannelUpdate 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; + UnsignedChannelUpdate_set_htlc_minimum_msat(&this_ptr_conv, val); +} + +int64_t __attribute__((export_name("TS_UnsignedChannelUpdate_get_htlc_maximum_msat"))) TS_UnsignedChannelUpdate_get_htlc_maximum_msat(uint64_t this_ptr) { + LDKUnsignedChannelUpdate 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 = UnsignedChannelUpdate_get_htlc_maximum_msat(&this_ptr_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_UnsignedChannelUpdate_set_htlc_maximum_msat"))) TS_UnsignedChannelUpdate_set_htlc_maximum_msat(uint64_t this_ptr, int64_t val) { + LDKUnsignedChannelUpdate 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; + UnsignedChannelUpdate_set_htlc_maximum_msat(&this_ptr_conv, val); +} + +int32_t __attribute__((export_name("TS_UnsignedChannelUpdate_get_fee_base_msat"))) TS_UnsignedChannelUpdate_get_fee_base_msat(uint64_t this_ptr) { + LDKUnsignedChannelUpdate 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 = UnsignedChannelUpdate_get_fee_base_msat(&this_ptr_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_UnsignedChannelUpdate_set_fee_base_msat"))) TS_UnsignedChannelUpdate_set_fee_base_msat(uint64_t this_ptr, int32_t val) { + LDKUnsignedChannelUpdate 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; + UnsignedChannelUpdate_set_fee_base_msat(&this_ptr_conv, val); +} + +int32_t __attribute__((export_name("TS_UnsignedChannelUpdate_get_fee_proportional_millionths"))) TS_UnsignedChannelUpdate_get_fee_proportional_millionths(uint64_t this_ptr) { + LDKUnsignedChannelUpdate 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 = UnsignedChannelUpdate_get_fee_proportional_millionths(&this_ptr_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_UnsignedChannelUpdate_set_fee_proportional_millionths"))) TS_UnsignedChannelUpdate_set_fee_proportional_millionths(uint64_t this_ptr, int32_t val) { + LDKUnsignedChannelUpdate 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; + UnsignedChannelUpdate_set_fee_proportional_millionths(&this_ptr_conv, val); +} + +int8_tArray __attribute__((export_name("TS_UnsignedChannelUpdate_get_excess_data"))) TS_UnsignedChannelUpdate_get_excess_data(uint64_t this_ptr) { + LDKUnsignedChannelUpdate 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; + LDKCVec_u8Z ret_var = UnsignedChannelUpdate_get_excess_data(&this_ptr_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_UnsignedChannelUpdate_set_excess_data"))) TS_UnsignedChannelUpdate_set_excess_data(uint64_t this_ptr, int8_tArray val) { + LDKUnsignedChannelUpdate 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; + LDKCVec_u8Z val_ref; + val_ref.datalen = val->arr_len; + val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes"); + memcpy(val_ref.data, val->elems, val_ref.datalen); FREE(val); + UnsignedChannelUpdate_set_excess_data(&this_ptr_conv, val_ref); +} + +uint64_t __attribute__((export_name("TS_UnsignedChannelUpdate_new"))) TS_UnsignedChannelUpdate_new(int8_tArray chain_hash_arg, int64_t short_channel_id_arg, int32_t timestamp_arg, int8_t flags_arg, int16_t cltv_expiry_delta_arg, int64_t htlc_minimum_msat_arg, int64_t htlc_maximum_msat_arg, int32_t fee_base_msat_arg, int32_t fee_proportional_millionths_arg, int8_tArray excess_data_arg) { + LDKThirtyTwoBytes chain_hash_arg_ref; + CHECK(chain_hash_arg->arr_len == 32); + memcpy(chain_hash_arg_ref.data, chain_hash_arg->elems, 32); FREE(chain_hash_arg); + LDKCVec_u8Z excess_data_arg_ref; + excess_data_arg_ref.datalen = excess_data_arg->arr_len; + excess_data_arg_ref.data = MALLOC(excess_data_arg_ref.datalen, "LDKCVec_u8Z Bytes"); + memcpy(excess_data_arg_ref.data, excess_data_arg->elems, excess_data_arg_ref.datalen); FREE(excess_data_arg); + LDKUnsignedChannelUpdate ret_var = UnsignedChannelUpdate_new(chain_hash_arg_ref, short_channel_id_arg, timestamp_arg, flags_arg, cltv_expiry_delta_arg, htlc_minimum_msat_arg, htlc_maximum_msat_arg, fee_base_msat_arg, fee_proportional_millionths_arg, excess_data_arg_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; +} + +static inline uint64_t UnsignedChannelUpdate_clone_ptr(LDKUnsignedChannelUpdate *NONNULL_PTR arg) { + LDKUnsignedChannelUpdate ret_var = UnsignedChannelUpdate_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_UnsignedChannelUpdate_clone_ptr"))) TS_UnsignedChannelUpdate_clone_ptr(uint64_t arg) { + LDKUnsignedChannelUpdate 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 = UnsignedChannelUpdate_clone_ptr(&arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_UnsignedChannelUpdate_clone"))) TS_UnsignedChannelUpdate_clone(uint64_t orig) { + LDKUnsignedChannelUpdate 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; + LDKUnsignedChannelUpdate ret_var = UnsignedChannelUpdate_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_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); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ChannelUpdate_free(this_obj_conv); +} + +int8_tArray __attribute__((export_name("TS_ChannelUpdate_get_signature"))) TS_ChannelUpdate_get_signature(uint64_t this_ptr) { + LDKChannelUpdate 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(64, __LINE__); + memcpy(ret_arr->elems, ChannelUpdate_get_signature(&this_ptr_conv).compact_form, 64); + return ret_arr; +} + +void __attribute__((export_name("TS_ChannelUpdate_set_signature"))) TS_ChannelUpdate_set_signature(uint64_t this_ptr, int8_tArray val) { + LDKChannelUpdate 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; + LDKSignature val_ref; + CHECK(val->arr_len == 64); + memcpy(val_ref.compact_form, val->elems, 64); FREE(val); + ChannelUpdate_set_signature(&this_ptr_conv, val_ref); +} + +uint64_t __attribute__((export_name("TS_ChannelUpdate_get_contents"))) TS_ChannelUpdate_get_contents(uint64_t this_ptr) { + LDKChannelUpdate 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; + LDKUnsignedChannelUpdate ret_var = ChannelUpdate_get_contents(&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_ChannelUpdate_set_contents"))) TS_ChannelUpdate_set_contents(uint64_t this_ptr, uint64_t val) { + LDKChannelUpdate 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; + LDKUnsignedChannelUpdate 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 = UnsignedChannelUpdate_clone(&val_conv); + ChannelUpdate_set_contents(&this_ptr_conv, val_conv); +} + +uint64_t __attribute__((export_name("TS_ChannelUpdate_new"))) TS_ChannelUpdate_new(int8_tArray signature_arg, uint64_t contents_arg) { + LDKSignature signature_arg_ref; + CHECK(signature_arg->arr_len == 64); + memcpy(signature_arg_ref.compact_form, signature_arg->elems, 64); FREE(signature_arg); + LDKUnsignedChannelUpdate contents_arg_conv; + contents_arg_conv.inner = untag_ptr(contents_arg); + contents_arg_conv.is_owned = ptr_is_owned(contents_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(contents_arg_conv); + contents_arg_conv = UnsignedChannelUpdate_clone(&contents_arg_conv); + LDKChannelUpdate ret_var = ChannelUpdate_new(signature_arg_ref, contents_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; +} + +static inline uint64_t ChannelUpdate_clone_ptr(LDKChannelUpdate *NONNULL_PTR arg) { + LDKChannelUpdate ret_var = ChannelUpdate_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_ChannelUpdate_clone_ptr"))) TS_ChannelUpdate_clone_ptr(uint64_t arg) { + LDKChannelUpdate 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 = ChannelUpdate_clone_ptr(&arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_ChannelUpdate_clone"))) TS_ChannelUpdate_clone(uint64_t orig) { + LDKChannelUpdate 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; + LDKChannelUpdate ret_var = ChannelUpdate_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_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); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + QueryChannelRange_free(this_obj_conv); +} + +int8_tArray __attribute__((export_name("TS_QueryChannelRange_get_chain_hash"))) TS_QueryChannelRange_get_chain_hash(uint64_t this_ptr) { + LDKQueryChannelRange 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(32, __LINE__); + memcpy(ret_arr->elems, *QueryChannelRange_get_chain_hash(&this_ptr_conv), 32); + return ret_arr; +} + +void __attribute__((export_name("TS_QueryChannelRange_set_chain_hash"))) TS_QueryChannelRange_set_chain_hash(uint64_t this_ptr, int8_tArray val) { + LDKQueryChannelRange 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; + LDKThirtyTwoBytes val_ref; + CHECK(val->arr_len == 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); + QueryChannelRange_set_chain_hash(&this_ptr_conv, val_ref); +} + +int32_t __attribute__((export_name("TS_QueryChannelRange_get_first_blocknum"))) TS_QueryChannelRange_get_first_blocknum(uint64_t this_ptr) { + LDKQueryChannelRange 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 = QueryChannelRange_get_first_blocknum(&this_ptr_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_QueryChannelRange_set_first_blocknum"))) TS_QueryChannelRange_set_first_blocknum(uint64_t this_ptr, int32_t val) { + LDKQueryChannelRange 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; + QueryChannelRange_set_first_blocknum(&this_ptr_conv, val); +} + +int32_t __attribute__((export_name("TS_QueryChannelRange_get_number_of_blocks"))) TS_QueryChannelRange_get_number_of_blocks(uint64_t this_ptr) { + LDKQueryChannelRange 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 = QueryChannelRange_get_number_of_blocks(&this_ptr_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_QueryChannelRange_set_number_of_blocks"))) TS_QueryChannelRange_set_number_of_blocks(uint64_t this_ptr, int32_t val) { + LDKQueryChannelRange 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; + QueryChannelRange_set_number_of_blocks(&this_ptr_conv, val); +} + +uint64_t __attribute__((export_name("TS_QueryChannelRange_new"))) TS_QueryChannelRange_new(int8_tArray chain_hash_arg, int32_t first_blocknum_arg, int32_t number_of_blocks_arg) { + LDKThirtyTwoBytes chain_hash_arg_ref; + CHECK(chain_hash_arg->arr_len == 32); + memcpy(chain_hash_arg_ref.data, chain_hash_arg->elems, 32); FREE(chain_hash_arg); + LDKQueryChannelRange ret_var = QueryChannelRange_new(chain_hash_arg_ref, first_blocknum_arg, number_of_blocks_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 QueryChannelRange_clone_ptr(LDKQueryChannelRange *NONNULL_PTR arg) { + LDKQueryChannelRange ret_var = QueryChannelRange_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_QueryChannelRange_clone_ptr"))) TS_QueryChannelRange_clone_ptr(uint64_t arg) { + LDKQueryChannelRange 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 = QueryChannelRange_clone_ptr(&arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_QueryChannelRange_clone"))) TS_QueryChannelRange_clone(uint64_t orig) { + LDKQueryChannelRange 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; + LDKQueryChannelRange ret_var = QueryChannelRange_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_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); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ReplyChannelRange_free(this_obj_conv); +} + +int8_tArray __attribute__((export_name("TS_ReplyChannelRange_get_chain_hash"))) TS_ReplyChannelRange_get_chain_hash(uint64_t this_ptr) { + LDKReplyChannelRange 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(32, __LINE__); + memcpy(ret_arr->elems, *ReplyChannelRange_get_chain_hash(&this_ptr_conv), 32); + return ret_arr; +} + +void __attribute__((export_name("TS_ReplyChannelRange_set_chain_hash"))) TS_ReplyChannelRange_set_chain_hash(uint64_t this_ptr, int8_tArray val) { + LDKReplyChannelRange 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; + LDKThirtyTwoBytes val_ref; + CHECK(val->arr_len == 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); + ReplyChannelRange_set_chain_hash(&this_ptr_conv, val_ref); +} + +int32_t __attribute__((export_name("TS_ReplyChannelRange_get_first_blocknum"))) TS_ReplyChannelRange_get_first_blocknum(uint64_t this_ptr) { + LDKReplyChannelRange 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 = ReplyChannelRange_get_first_blocknum(&this_ptr_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_ReplyChannelRange_set_first_blocknum"))) TS_ReplyChannelRange_set_first_blocknum(uint64_t this_ptr, int32_t val) { + LDKReplyChannelRange 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; + ReplyChannelRange_set_first_blocknum(&this_ptr_conv, val); +} + +int32_t __attribute__((export_name("TS_ReplyChannelRange_get_number_of_blocks"))) TS_ReplyChannelRange_get_number_of_blocks(uint64_t this_ptr) { + LDKReplyChannelRange 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 = ReplyChannelRange_get_number_of_blocks(&this_ptr_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_ReplyChannelRange_set_number_of_blocks"))) TS_ReplyChannelRange_set_number_of_blocks(uint64_t this_ptr, int32_t val) { + LDKReplyChannelRange 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; + ReplyChannelRange_set_number_of_blocks(&this_ptr_conv, val); +} + +jboolean __attribute__((export_name("TS_ReplyChannelRange_get_sync_complete"))) TS_ReplyChannelRange_get_sync_complete(uint64_t this_ptr) { + LDKReplyChannelRange 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 = ReplyChannelRange_get_sync_complete(&this_ptr_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_ReplyChannelRange_set_sync_complete"))) TS_ReplyChannelRange_set_sync_complete(uint64_t this_ptr, jboolean val) { + LDKReplyChannelRange 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; + ReplyChannelRange_set_sync_complete(&this_ptr_conv, val); +} + +int64_tArray __attribute__((export_name("TS_ReplyChannelRange_get_short_channel_ids"))) TS_ReplyChannelRange_get_short_channel_ids(uint64_t this_ptr) { + LDKReplyChannelRange 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; + LDKCVec_u64Z ret_var = ReplyChannelRange_get_short_channel_ids(&this_ptr_conv); + int64_tArray ret_arr = NULL; + ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); + int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); + for (size_t i = 0; i < ret_var.datalen; i++) { + int64_t ret_conv_8_conv = ret_var.data[i]; + ret_arr_ptr[i] = ret_conv_8_conv; + } + + FREE(ret_var.data); + return ret_arr; +} + +void __attribute__((export_name("TS_ReplyChannelRange_set_short_channel_ids"))) TS_ReplyChannelRange_set_short_channel_ids(uint64_t this_ptr, int64_tArray val) { + LDKReplyChannelRange 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; + LDKCVec_u64Z val_constr; + val_constr.datalen = val->arr_len; + if (val_constr.datalen > 0) + val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); + else + val_constr.data = NULL; + int64_t* val_vals = val->elems; + for (size_t i = 0; i < val_constr.datalen; i++) { + int64_t val_conv_8 = val_vals[i]; + val_constr.data[i] = val_conv_8; + } + FREE(val); + ReplyChannelRange_set_short_channel_ids(&this_ptr_conv, val_constr); +} + +uint64_t __attribute__((export_name("TS_ReplyChannelRange_new"))) TS_ReplyChannelRange_new(int8_tArray chain_hash_arg, int32_t first_blocknum_arg, int32_t number_of_blocks_arg, jboolean sync_complete_arg, int64_tArray short_channel_ids_arg) { + LDKThirtyTwoBytes chain_hash_arg_ref; + CHECK(chain_hash_arg->arr_len == 32); + memcpy(chain_hash_arg_ref.data, chain_hash_arg->elems, 32); FREE(chain_hash_arg); + LDKCVec_u64Z short_channel_ids_arg_constr; + short_channel_ids_arg_constr.datalen = short_channel_ids_arg->arr_len; + if (short_channel_ids_arg_constr.datalen > 0) + short_channel_ids_arg_constr.data = MALLOC(short_channel_ids_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); + else + short_channel_ids_arg_constr.data = NULL; + int64_t* short_channel_ids_arg_vals = short_channel_ids_arg->elems; + for (size_t i = 0; i < short_channel_ids_arg_constr.datalen; i++) { + int64_t short_channel_ids_arg_conv_8 = short_channel_ids_arg_vals[i]; + short_channel_ids_arg_constr.data[i] = short_channel_ids_arg_conv_8; + } + FREE(short_channel_ids_arg); + LDKReplyChannelRange ret_var = ReplyChannelRange_new(chain_hash_arg_ref, first_blocknum_arg, number_of_blocks_arg, sync_complete_arg, short_channel_ids_arg_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); + return ret_ref; +} + +static inline uint64_t ReplyChannelRange_clone_ptr(LDKReplyChannelRange *NONNULL_PTR arg) { + LDKReplyChannelRange ret_var = ReplyChannelRange_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_ReplyChannelRange_clone_ptr"))) TS_ReplyChannelRange_clone_ptr(uint64_t arg) { + LDKReplyChannelRange 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 = ReplyChannelRange_clone_ptr(&arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_ReplyChannelRange_clone"))) TS_ReplyChannelRange_clone(uint64_t orig) { + LDKReplyChannelRange 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; + LDKReplyChannelRange ret_var = ReplyChannelRange_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_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); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + QueryShortChannelIds_free(this_obj_conv); +} + +int8_tArray __attribute__((export_name("TS_QueryShortChannelIds_get_chain_hash"))) TS_QueryShortChannelIds_get_chain_hash(uint64_t this_ptr) { + LDKQueryShortChannelIds 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(32, __LINE__); + memcpy(ret_arr->elems, *QueryShortChannelIds_get_chain_hash(&this_ptr_conv), 32); + return ret_arr; +} + +void __attribute__((export_name("TS_QueryShortChannelIds_set_chain_hash"))) TS_QueryShortChannelIds_set_chain_hash(uint64_t this_ptr, int8_tArray val) { + LDKQueryShortChannelIds 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; + LDKThirtyTwoBytes val_ref; + CHECK(val->arr_len == 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); + QueryShortChannelIds_set_chain_hash(&this_ptr_conv, val_ref); +} + +int64_tArray __attribute__((export_name("TS_QueryShortChannelIds_get_short_channel_ids"))) TS_QueryShortChannelIds_get_short_channel_ids(uint64_t this_ptr) { + LDKQueryShortChannelIds 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; + LDKCVec_u64Z ret_var = QueryShortChannelIds_get_short_channel_ids(&this_ptr_conv); + int64_tArray ret_arr = NULL; + ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); + int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); + for (size_t i = 0; i < ret_var.datalen; i++) { + int64_t ret_conv_8_conv = ret_var.data[i]; + ret_arr_ptr[i] = ret_conv_8_conv; + } + + FREE(ret_var.data); + return ret_arr; +} + +void __attribute__((export_name("TS_QueryShortChannelIds_set_short_channel_ids"))) TS_QueryShortChannelIds_set_short_channel_ids(uint64_t this_ptr, int64_tArray val) { + LDKQueryShortChannelIds 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; + LDKCVec_u64Z val_constr; + val_constr.datalen = val->arr_len; + if (val_constr.datalen > 0) + val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); + else + val_constr.data = NULL; + int64_t* val_vals = val->elems; + for (size_t i = 0; i < val_constr.datalen; i++) { + int64_t val_conv_8 = val_vals[i]; + val_constr.data[i] = val_conv_8; + } + FREE(val); + QueryShortChannelIds_set_short_channel_ids(&this_ptr_conv, val_constr); +} + +uint64_t __attribute__((export_name("TS_QueryShortChannelIds_new"))) TS_QueryShortChannelIds_new(int8_tArray chain_hash_arg, int64_tArray short_channel_ids_arg) { + LDKThirtyTwoBytes chain_hash_arg_ref; + CHECK(chain_hash_arg->arr_len == 32); + memcpy(chain_hash_arg_ref.data, chain_hash_arg->elems, 32); FREE(chain_hash_arg); + LDKCVec_u64Z short_channel_ids_arg_constr; + short_channel_ids_arg_constr.datalen = short_channel_ids_arg->arr_len; + if (short_channel_ids_arg_constr.datalen > 0) + short_channel_ids_arg_constr.data = MALLOC(short_channel_ids_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); + else + short_channel_ids_arg_constr.data = NULL; + int64_t* short_channel_ids_arg_vals = short_channel_ids_arg->elems; + for (size_t i = 0; i < short_channel_ids_arg_constr.datalen; i++) { + int64_t short_channel_ids_arg_conv_8 = short_channel_ids_arg_vals[i]; + short_channel_ids_arg_constr.data[i] = short_channel_ids_arg_conv_8; + } + FREE(short_channel_ids_arg); + LDKQueryShortChannelIds ret_var = QueryShortChannelIds_new(chain_hash_arg_ref, short_channel_ids_arg_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); + return ret_ref; +} + +static inline uint64_t QueryShortChannelIds_clone_ptr(LDKQueryShortChannelIds *NONNULL_PTR arg) { + LDKQueryShortChannelIds ret_var = QueryShortChannelIds_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_QueryShortChannelIds_clone_ptr"))) TS_QueryShortChannelIds_clone_ptr(uint64_t arg) { + LDKQueryShortChannelIds 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 = QueryShortChannelIds_clone_ptr(&arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_QueryShortChannelIds_clone"))) TS_QueryShortChannelIds_clone(uint64_t orig) { + LDKQueryShortChannelIds 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; + LDKQueryShortChannelIds ret_var = QueryShortChannelIds_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_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); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ReplyShortChannelIdsEnd_free(this_obj_conv); +} + +int8_tArray __attribute__((export_name("TS_ReplyShortChannelIdsEnd_get_chain_hash"))) TS_ReplyShortChannelIdsEnd_get_chain_hash(uint64_t this_ptr) { + LDKReplyShortChannelIdsEnd 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(32, __LINE__); + memcpy(ret_arr->elems, *ReplyShortChannelIdsEnd_get_chain_hash(&this_ptr_conv), 32); + return ret_arr; +} + +void __attribute__((export_name("TS_ReplyShortChannelIdsEnd_set_chain_hash"))) TS_ReplyShortChannelIdsEnd_set_chain_hash(uint64_t this_ptr, int8_tArray val) { + LDKReplyShortChannelIdsEnd 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; + LDKThirtyTwoBytes val_ref; + CHECK(val->arr_len == 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); + ReplyShortChannelIdsEnd_set_chain_hash(&this_ptr_conv, val_ref); +} + +jboolean __attribute__((export_name("TS_ReplyShortChannelIdsEnd_get_full_information"))) TS_ReplyShortChannelIdsEnd_get_full_information(uint64_t this_ptr) { + LDKReplyShortChannelIdsEnd 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 = ReplyShortChannelIdsEnd_get_full_information(&this_ptr_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_ReplyShortChannelIdsEnd_set_full_information"))) TS_ReplyShortChannelIdsEnd_set_full_information(uint64_t this_ptr, jboolean val) { + LDKReplyShortChannelIdsEnd 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; + ReplyShortChannelIdsEnd_set_full_information(&this_ptr_conv, val); +} + +uint64_t __attribute__((export_name("TS_ReplyShortChannelIdsEnd_new"))) TS_ReplyShortChannelIdsEnd_new(int8_tArray chain_hash_arg, jboolean full_information_arg) { + LDKThirtyTwoBytes chain_hash_arg_ref; + CHECK(chain_hash_arg->arr_len == 32); + memcpy(chain_hash_arg_ref.data, chain_hash_arg->elems, 32); FREE(chain_hash_arg); + LDKReplyShortChannelIdsEnd ret_var = ReplyShortChannelIdsEnd_new(chain_hash_arg_ref, full_information_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 ReplyShortChannelIdsEnd_clone_ptr(LDKReplyShortChannelIdsEnd *NONNULL_PTR arg) { + LDKReplyShortChannelIdsEnd ret_var = ReplyShortChannelIdsEnd_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_ReplyShortChannelIdsEnd_clone_ptr"))) TS_ReplyShortChannelIdsEnd_clone_ptr(uint64_t arg) { + LDKReplyShortChannelIdsEnd 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 = ReplyShortChannelIdsEnd_clone_ptr(&arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_ReplyShortChannelIdsEnd_clone"))) TS_ReplyShortChannelIdsEnd_clone(uint64_t orig) { + LDKReplyShortChannelIdsEnd 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; + LDKReplyShortChannelIdsEnd ret_var = ReplyShortChannelIdsEnd_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_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); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + GossipTimestampFilter_free(this_obj_conv); +} + +int8_tArray __attribute__((export_name("TS_GossipTimestampFilter_get_chain_hash"))) TS_GossipTimestampFilter_get_chain_hash(uint64_t this_ptr) { + LDKGossipTimestampFilter 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(32, __LINE__); + memcpy(ret_arr->elems, *GossipTimestampFilter_get_chain_hash(&this_ptr_conv), 32); + return ret_arr; +} + +void __attribute__((export_name("TS_GossipTimestampFilter_set_chain_hash"))) TS_GossipTimestampFilter_set_chain_hash(uint64_t this_ptr, int8_tArray val) { + LDKGossipTimestampFilter 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; + LDKThirtyTwoBytes val_ref; + CHECK(val->arr_len == 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); + GossipTimestampFilter_set_chain_hash(&this_ptr_conv, val_ref); +} + +int32_t __attribute__((export_name("TS_GossipTimestampFilter_get_first_timestamp"))) TS_GossipTimestampFilter_get_first_timestamp(uint64_t this_ptr) { + LDKGossipTimestampFilter 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 = GossipTimestampFilter_get_first_timestamp(&this_ptr_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_GossipTimestampFilter_set_first_timestamp"))) TS_GossipTimestampFilter_set_first_timestamp(uint64_t this_ptr, int32_t val) { + LDKGossipTimestampFilter 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; + GossipTimestampFilter_set_first_timestamp(&this_ptr_conv, val); +} + +int32_t __attribute__((export_name("TS_GossipTimestampFilter_get_timestamp_range"))) TS_GossipTimestampFilter_get_timestamp_range(uint64_t this_ptr) { + LDKGossipTimestampFilter 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 = GossipTimestampFilter_get_timestamp_range(&this_ptr_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_GossipTimestampFilter_set_timestamp_range"))) TS_GossipTimestampFilter_set_timestamp_range(uint64_t this_ptr, int32_t val) { + LDKGossipTimestampFilter 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; + GossipTimestampFilter_set_timestamp_range(&this_ptr_conv, val); +} + +uint64_t __attribute__((export_name("TS_GossipTimestampFilter_new"))) TS_GossipTimestampFilter_new(int8_tArray chain_hash_arg, int32_t first_timestamp_arg, int32_t timestamp_range_arg) { + LDKThirtyTwoBytes chain_hash_arg_ref; + CHECK(chain_hash_arg->arr_len == 32); + memcpy(chain_hash_arg_ref.data, chain_hash_arg->elems, 32); FREE(chain_hash_arg); + LDKGossipTimestampFilter ret_var = GossipTimestampFilter_new(chain_hash_arg_ref, first_timestamp_arg, timestamp_range_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 GossipTimestampFilter_clone_ptr(LDKGossipTimestampFilter *NONNULL_PTR arg) { + LDKGossipTimestampFilter ret_var = GossipTimestampFilter_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_GossipTimestampFilter_clone_ptr"))) TS_GossipTimestampFilter_clone_ptr(uint64_t arg) { + LDKGossipTimestampFilter 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 = GossipTimestampFilter_clone_ptr(&arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_GossipTimestampFilter_clone"))) TS_GossipTimestampFilter_clone(uint64_t orig) { + LDKGossipTimestampFilter 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; + LDKGossipTimestampFilter ret_var = GossipTimestampFilter_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_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); + CHECK_ACCESS(this_ptr_ptr); + LDKErrorAction this_ptr_conv = *(LDKErrorAction*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + ErrorAction_free(this_ptr_conv); +} + +static inline uint64_t ErrorAction_clone_ptr(LDKErrorAction *NONNULL_PTR arg) { + LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); + *ret_copy = ErrorAction_clone(arg); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t __attribute__((export_name("TS_ErrorAction_clone_ptr"))) TS_ErrorAction_clone_ptr(uint64_t arg) { + LDKErrorAction* arg_conv = (LDKErrorAction*)untag_ptr(arg); + int64_t ret_conv = ErrorAction_clone_ptr(arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_ErrorAction_clone"))) TS_ErrorAction_clone(uint64_t orig) { + LDKErrorAction* orig_conv = (LDKErrorAction*)untag_ptr(orig); + LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); + *ret_copy = ErrorAction_clone(orig_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +uint64_t __attribute__((export_name("TS_ErrorAction_disconnect_peer"))) TS_ErrorAction_disconnect_peer(uint64_t msg) { + LDKErrorMessage 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 = ErrorMessage_clone(&msg_conv); + LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); + *ret_copy = ErrorAction_disconnect_peer(msg_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +uint64_t __attribute__((export_name("TS_ErrorAction_ignore_error"))) TS_ErrorAction_ignore_error() { + LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); + *ret_copy = ErrorAction_ignore_error(); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +uint64_t __attribute__((export_name("TS_ErrorAction_ignore_and_log"))) TS_ErrorAction_ignore_and_log(uint32_t a) { + LDKLevel a_conv = LDKLevel_from_js(a); + LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); + *ret_copy = ErrorAction_ignore_and_log(a_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +uint64_t __attribute__((export_name("TS_ErrorAction_ignore_duplicate_gossip"))) TS_ErrorAction_ignore_duplicate_gossip() { + LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); + *ret_copy = ErrorAction_ignore_duplicate_gossip(); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +uint64_t __attribute__((export_name("TS_ErrorAction_send_error_message"))) TS_ErrorAction_send_error_message(uint64_t msg) { + LDKErrorMessage 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 = ErrorMessage_clone(&msg_conv); + LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); + *ret_copy = ErrorAction_send_error_message(msg_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +uint64_t __attribute__((export_name("TS_ErrorAction_send_warning_message"))) TS_ErrorAction_send_warning_message(uint64_t msg, uint32_t log_level) { + LDKWarningMessage 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 = WarningMessage_clone(&msg_conv); + LDKLevel log_level_conv = LDKLevel_from_js(log_level); + LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); + *ret_copy = ErrorAction_send_warning_message(msg_conv, log_level_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void __attribute__((export_name("TS_LightningError_free"))) TS_LightningError_free(uint64_t this_obj) { + LDKLightningError 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); + LightningError_free(this_obj_conv); +} + +jstring __attribute__((export_name("TS_LightningError_get_err"))) TS_LightningError_get_err(uint64_t this_ptr) { + LDKLightningError 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 = LightningError_get_err(&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_LightningError_set_err"))) TS_LightningError_set_err(uint64_t this_ptr, jstring val) { + LDKLightningError 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); + LightningError_set_err(&this_ptr_conv, val_conv); +} + +uint64_t __attribute__((export_name("TS_LightningError_get_action"))) TS_LightningError_get_action(uint64_t this_ptr) { + LDKLightningError 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; + LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); + *ret_copy = LightningError_get_action(&this_ptr_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void __attribute__((export_name("TS_LightningError_set_action"))) TS_LightningError_set_action(uint64_t this_ptr, uint64_t val) { + LDKLightningError 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); + LDKErrorAction val_conv = *(LDKErrorAction*)(val_ptr); + val_conv = ErrorAction_clone((LDKErrorAction*)untag_ptr(val)); + LightningError_set_action(&this_ptr_conv, val_conv); +} + +uint64_t __attribute__((export_name("TS_LightningError_new"))) TS_LightningError_new(jstring err_arg, uint64_t action_arg) { + LDKStr err_arg_conv = str_ref_to_owned_c(err_arg); + void* action_arg_ptr = untag_ptr(action_arg); + CHECK_ACCESS(action_arg_ptr); + LDKErrorAction action_arg_conv = *(LDKErrorAction*)(action_arg_ptr); + action_arg_conv = ErrorAction_clone((LDKErrorAction*)untag_ptr(action_arg)); + LDKLightningError ret_var = LightningError_new(err_arg_conv, action_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; +} + +static inline uint64_t LightningError_clone_ptr(LDKLightningError *NONNULL_PTR arg) { + LDKLightningError ret_var = LightningError_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_LightningError_clone_ptr"))) TS_LightningError_clone_ptr(uint64_t arg) { + LDKLightningError 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 = LightningError_clone_ptr(&arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_LightningError_clone"))) TS_LightningError_clone(uint64_t orig) { + LDKLightningError 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; + LDKLightningError ret_var = LightningError_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_CommitmentUpdate_free"))) TS_CommitmentUpdate_free(uint64_t this_obj) { + LDKCommitmentUpdate 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); + CommitmentUpdate_free(this_obj_conv); +} + +uint64_tArray __attribute__((export_name("TS_CommitmentUpdate_get_update_add_htlcs"))) TS_CommitmentUpdate_get_update_add_htlcs(uint64_t this_ptr) { + LDKCommitmentUpdate 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; + LDKCVec_UpdateAddHTLCZ ret_var = CommitmentUpdate_get_update_add_htlcs(&this_ptr_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++) { + LDKUpdateAddHTLC ret_conv_15_var = ret_var.data[p]; + uint64_t ret_conv_15_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_15_var); + ret_conv_15_ref = tag_ptr(ret_conv_15_var.inner, ret_conv_15_var.is_owned); + ret_arr_ptr[p] = ret_conv_15_ref; + } + + FREE(ret_var.data); + return ret_arr; +} + +void __attribute__((export_name("TS_CommitmentUpdate_set_update_add_htlcs"))) TS_CommitmentUpdate_set_update_add_htlcs(uint64_t this_ptr, uint64_tArray val) { + LDKCommitmentUpdate 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; + LDKCVec_UpdateAddHTLCZ val_constr; + val_constr.datalen = val->arr_len; + if (val_constr.datalen > 0) + val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateAddHTLC), "LDKCVec_UpdateAddHTLCZ Elements"); + else + val_constr.data = NULL; + uint64_t* val_vals = val->elems; + for (size_t p = 0; p < val_constr.datalen; p++) { + uint64_t val_conv_15 = val_vals[p]; + LDKUpdateAddHTLC val_conv_15_conv; + val_conv_15_conv.inner = untag_ptr(val_conv_15); + val_conv_15_conv.is_owned = ptr_is_owned(val_conv_15); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_15_conv); + val_conv_15_conv = UpdateAddHTLC_clone(&val_conv_15_conv); + val_constr.data[p] = val_conv_15_conv; + } + FREE(val); + CommitmentUpdate_set_update_add_htlcs(&this_ptr_conv, val_constr); +} + +uint64_tArray __attribute__((export_name("TS_CommitmentUpdate_get_update_fulfill_htlcs"))) TS_CommitmentUpdate_get_update_fulfill_htlcs(uint64_t this_ptr) { + LDKCommitmentUpdate 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; + LDKCVec_UpdateFulfillHTLCZ ret_var = CommitmentUpdate_get_update_fulfill_htlcs(&this_ptr_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 t = 0; t < ret_var.datalen; t++) { + LDKUpdateFulfillHTLC ret_conv_19_var = ret_var.data[t]; + uint64_t ret_conv_19_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_19_var); + ret_conv_19_ref = tag_ptr(ret_conv_19_var.inner, ret_conv_19_var.is_owned); + ret_arr_ptr[t] = ret_conv_19_ref; + } + + FREE(ret_var.data); + return ret_arr; +} + +void __attribute__((export_name("TS_CommitmentUpdate_set_update_fulfill_htlcs"))) TS_CommitmentUpdate_set_update_fulfill_htlcs(uint64_t this_ptr, uint64_tArray val) { + LDKCommitmentUpdate 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; + LDKCVec_UpdateFulfillHTLCZ val_constr; + val_constr.datalen = val->arr_len; + if (val_constr.datalen > 0) + val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateFulfillHTLC), "LDKCVec_UpdateFulfillHTLCZ Elements"); + else + val_constr.data = NULL; + uint64_t* val_vals = val->elems; + for (size_t t = 0; t < val_constr.datalen; t++) { + uint64_t val_conv_19 = val_vals[t]; + LDKUpdateFulfillHTLC val_conv_19_conv; + val_conv_19_conv.inner = untag_ptr(val_conv_19); + val_conv_19_conv.is_owned = ptr_is_owned(val_conv_19); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_19_conv); + val_conv_19_conv = UpdateFulfillHTLC_clone(&val_conv_19_conv); + val_constr.data[t] = val_conv_19_conv; + } + FREE(val); + CommitmentUpdate_set_update_fulfill_htlcs(&this_ptr_conv, val_constr); +} + +uint64_tArray __attribute__((export_name("TS_CommitmentUpdate_get_update_fail_htlcs"))) TS_CommitmentUpdate_get_update_fail_htlcs(uint64_t this_ptr) { + LDKCommitmentUpdate 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; + LDKCVec_UpdateFailHTLCZ ret_var = CommitmentUpdate_get_update_fail_htlcs(&this_ptr_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 q = 0; q < ret_var.datalen; q++) { + LDKUpdateFailHTLC 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; +} + +void __attribute__((export_name("TS_CommitmentUpdate_set_update_fail_htlcs"))) TS_CommitmentUpdate_set_update_fail_htlcs(uint64_t this_ptr, uint64_tArray val) { + LDKCommitmentUpdate 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; + LDKCVec_UpdateFailHTLCZ val_constr; + val_constr.datalen = val->arr_len; + if (val_constr.datalen > 0) + val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateFailHTLC), "LDKCVec_UpdateFailHTLCZ Elements"); + else + val_constr.data = NULL; + uint64_t* val_vals = val->elems; + for (size_t q = 0; q < val_constr.datalen; q++) { + uint64_t val_conv_16 = val_vals[q]; + LDKUpdateFailHTLC val_conv_16_conv; + val_conv_16_conv.inner = untag_ptr(val_conv_16); + val_conv_16_conv.is_owned = ptr_is_owned(val_conv_16); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_16_conv); + val_conv_16_conv = UpdateFailHTLC_clone(&val_conv_16_conv); + val_constr.data[q] = val_conv_16_conv; + } + FREE(val); + CommitmentUpdate_set_update_fail_htlcs(&this_ptr_conv, val_constr); +} + +uint64_tArray __attribute__((export_name("TS_CommitmentUpdate_get_update_fail_malformed_htlcs"))) TS_CommitmentUpdate_get_update_fail_malformed_htlcs(uint64_t this_ptr) { + LDKCommitmentUpdate 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; + LDKCVec_UpdateFailMalformedHTLCZ ret_var = CommitmentUpdate_get_update_fail_malformed_htlcs(&this_ptr_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++) { + LDKUpdateFailMalformedHTLC ret_conv_25_var = ret_var.data[z]; + uint64_t ret_conv_25_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_25_var); + ret_conv_25_ref = tag_ptr(ret_conv_25_var.inner, ret_conv_25_var.is_owned); + ret_arr_ptr[z] = ret_conv_25_ref; + } + + FREE(ret_var.data); + return ret_arr; +} + +void __attribute__((export_name("TS_CommitmentUpdate_set_update_fail_malformed_htlcs"))) TS_CommitmentUpdate_set_update_fail_malformed_htlcs(uint64_t this_ptr, uint64_tArray val) { + LDKCommitmentUpdate 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; + LDKCVec_UpdateFailMalformedHTLCZ val_constr; + val_constr.datalen = val->arr_len; + if (val_constr.datalen > 0) + val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateFailMalformedHTLC), "LDKCVec_UpdateFailMalformedHTLCZ Elements"); + else + val_constr.data = NULL; + uint64_t* val_vals = val->elems; + for (size_t z = 0; z < val_constr.datalen; z++) { + uint64_t val_conv_25 = val_vals[z]; + LDKUpdateFailMalformedHTLC val_conv_25_conv; + val_conv_25_conv.inner = untag_ptr(val_conv_25); + val_conv_25_conv.is_owned = ptr_is_owned(val_conv_25); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_25_conv); + val_conv_25_conv = UpdateFailMalformedHTLC_clone(&val_conv_25_conv); + val_constr.data[z] = val_conv_25_conv; + } + FREE(val); + CommitmentUpdate_set_update_fail_malformed_htlcs(&this_ptr_conv, val_constr); +} + +uint64_t __attribute__((export_name("TS_CommitmentUpdate_get_update_fee"))) TS_CommitmentUpdate_get_update_fee(uint64_t this_ptr) { + LDKCommitmentUpdate 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; + LDKUpdateFee ret_var = CommitmentUpdate_get_update_fee(&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_CommitmentUpdate_set_update_fee"))) TS_CommitmentUpdate_set_update_fee(uint64_t this_ptr, uint64_t val) { + LDKCommitmentUpdate 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; + LDKUpdateFee 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 = UpdateFee_clone(&val_conv); + CommitmentUpdate_set_update_fee(&this_ptr_conv, val_conv); +} + +uint64_t __attribute__((export_name("TS_CommitmentUpdate_get_commitment_signed"))) TS_CommitmentUpdate_get_commitment_signed(uint64_t this_ptr) { + LDKCommitmentUpdate 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; + LDKCommitmentSigned ret_var = CommitmentUpdate_get_commitment_signed(&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_CommitmentUpdate_set_commitment_signed"))) TS_CommitmentUpdate_set_commitment_signed(uint64_t this_ptr, uint64_t val) { + LDKCommitmentUpdate 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; + LDKCommitmentSigned 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 = CommitmentSigned_clone(&val_conv); + CommitmentUpdate_set_commitment_signed(&this_ptr_conv, val_conv); +} + +uint64_t __attribute__((export_name("TS_CommitmentUpdate_new"))) TS_CommitmentUpdate_new(uint64_tArray update_add_htlcs_arg, uint64_tArray update_fulfill_htlcs_arg, uint64_tArray update_fail_htlcs_arg, uint64_tArray update_fail_malformed_htlcs_arg, uint64_t update_fee_arg, uint64_t commitment_signed_arg) { + LDKCVec_UpdateAddHTLCZ update_add_htlcs_arg_constr; + update_add_htlcs_arg_constr.datalen = update_add_htlcs_arg->arr_len; + if (update_add_htlcs_arg_constr.datalen > 0) + update_add_htlcs_arg_constr.data = MALLOC(update_add_htlcs_arg_constr.datalen * sizeof(LDKUpdateAddHTLC), "LDKCVec_UpdateAddHTLCZ Elements"); + else + update_add_htlcs_arg_constr.data = NULL; + uint64_t* update_add_htlcs_arg_vals = update_add_htlcs_arg->elems; + for (size_t p = 0; p < update_add_htlcs_arg_constr.datalen; p++) { + uint64_t update_add_htlcs_arg_conv_15 = update_add_htlcs_arg_vals[p]; + LDKUpdateAddHTLC update_add_htlcs_arg_conv_15_conv; + update_add_htlcs_arg_conv_15_conv.inner = untag_ptr(update_add_htlcs_arg_conv_15); + update_add_htlcs_arg_conv_15_conv.is_owned = ptr_is_owned(update_add_htlcs_arg_conv_15); + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_add_htlcs_arg_conv_15_conv); + update_add_htlcs_arg_conv_15_conv = UpdateAddHTLC_clone(&update_add_htlcs_arg_conv_15_conv); + update_add_htlcs_arg_constr.data[p] = update_add_htlcs_arg_conv_15_conv; + } + FREE(update_add_htlcs_arg); + LDKCVec_UpdateFulfillHTLCZ update_fulfill_htlcs_arg_constr; + update_fulfill_htlcs_arg_constr.datalen = update_fulfill_htlcs_arg->arr_len; + if (update_fulfill_htlcs_arg_constr.datalen > 0) + update_fulfill_htlcs_arg_constr.data = MALLOC(update_fulfill_htlcs_arg_constr.datalen * sizeof(LDKUpdateFulfillHTLC), "LDKCVec_UpdateFulfillHTLCZ Elements"); + else + update_fulfill_htlcs_arg_constr.data = NULL; + uint64_t* update_fulfill_htlcs_arg_vals = update_fulfill_htlcs_arg->elems; + for (size_t t = 0; t < update_fulfill_htlcs_arg_constr.datalen; t++) { + uint64_t update_fulfill_htlcs_arg_conv_19 = update_fulfill_htlcs_arg_vals[t]; + LDKUpdateFulfillHTLC update_fulfill_htlcs_arg_conv_19_conv; + update_fulfill_htlcs_arg_conv_19_conv.inner = untag_ptr(update_fulfill_htlcs_arg_conv_19); + update_fulfill_htlcs_arg_conv_19_conv.is_owned = ptr_is_owned(update_fulfill_htlcs_arg_conv_19); + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fulfill_htlcs_arg_conv_19_conv); + update_fulfill_htlcs_arg_conv_19_conv = UpdateFulfillHTLC_clone(&update_fulfill_htlcs_arg_conv_19_conv); + update_fulfill_htlcs_arg_constr.data[t] = update_fulfill_htlcs_arg_conv_19_conv; + } + FREE(update_fulfill_htlcs_arg); + LDKCVec_UpdateFailHTLCZ update_fail_htlcs_arg_constr; + update_fail_htlcs_arg_constr.datalen = update_fail_htlcs_arg->arr_len; + if (update_fail_htlcs_arg_constr.datalen > 0) + update_fail_htlcs_arg_constr.data = MALLOC(update_fail_htlcs_arg_constr.datalen * sizeof(LDKUpdateFailHTLC), "LDKCVec_UpdateFailHTLCZ Elements"); + else + update_fail_htlcs_arg_constr.data = NULL; + uint64_t* update_fail_htlcs_arg_vals = update_fail_htlcs_arg->elems; + for (size_t q = 0; q < update_fail_htlcs_arg_constr.datalen; q++) { + uint64_t update_fail_htlcs_arg_conv_16 = update_fail_htlcs_arg_vals[q]; + LDKUpdateFailHTLC update_fail_htlcs_arg_conv_16_conv; + update_fail_htlcs_arg_conv_16_conv.inner = untag_ptr(update_fail_htlcs_arg_conv_16); + update_fail_htlcs_arg_conv_16_conv.is_owned = ptr_is_owned(update_fail_htlcs_arg_conv_16); + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fail_htlcs_arg_conv_16_conv); + update_fail_htlcs_arg_conv_16_conv = UpdateFailHTLC_clone(&update_fail_htlcs_arg_conv_16_conv); + update_fail_htlcs_arg_constr.data[q] = update_fail_htlcs_arg_conv_16_conv; + } + FREE(update_fail_htlcs_arg); + LDKCVec_UpdateFailMalformedHTLCZ update_fail_malformed_htlcs_arg_constr; + update_fail_malformed_htlcs_arg_constr.datalen = update_fail_malformed_htlcs_arg->arr_len; + if (update_fail_malformed_htlcs_arg_constr.datalen > 0) + update_fail_malformed_htlcs_arg_constr.data = MALLOC(update_fail_malformed_htlcs_arg_constr.datalen * sizeof(LDKUpdateFailMalformedHTLC), "LDKCVec_UpdateFailMalformedHTLCZ Elements"); + else + update_fail_malformed_htlcs_arg_constr.data = NULL; + uint64_t* update_fail_malformed_htlcs_arg_vals = update_fail_malformed_htlcs_arg->elems; + for (size_t z = 0; z < update_fail_malformed_htlcs_arg_constr.datalen; z++) { + uint64_t update_fail_malformed_htlcs_arg_conv_25 = update_fail_malformed_htlcs_arg_vals[z]; + LDKUpdateFailMalformedHTLC update_fail_malformed_htlcs_arg_conv_25_conv; + update_fail_malformed_htlcs_arg_conv_25_conv.inner = untag_ptr(update_fail_malformed_htlcs_arg_conv_25); + update_fail_malformed_htlcs_arg_conv_25_conv.is_owned = ptr_is_owned(update_fail_malformed_htlcs_arg_conv_25); + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fail_malformed_htlcs_arg_conv_25_conv); + update_fail_malformed_htlcs_arg_conv_25_conv = UpdateFailMalformedHTLC_clone(&update_fail_malformed_htlcs_arg_conv_25_conv); + update_fail_malformed_htlcs_arg_constr.data[z] = update_fail_malformed_htlcs_arg_conv_25_conv; + } + FREE(update_fail_malformed_htlcs_arg); + LDKUpdateFee update_fee_arg_conv; + update_fee_arg_conv.inner = untag_ptr(update_fee_arg); + update_fee_arg_conv.is_owned = ptr_is_owned(update_fee_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fee_arg_conv); + update_fee_arg_conv = UpdateFee_clone(&update_fee_arg_conv); + LDKCommitmentSigned commitment_signed_arg_conv; + commitment_signed_arg_conv.inner = untag_ptr(commitment_signed_arg); + commitment_signed_arg_conv.is_owned = ptr_is_owned(commitment_signed_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_signed_arg_conv); + commitment_signed_arg_conv = CommitmentSigned_clone(&commitment_signed_arg_conv); + LDKCommitmentUpdate ret_var = CommitmentUpdate_new(update_add_htlcs_arg_constr, update_fulfill_htlcs_arg_constr, update_fail_htlcs_arg_constr, update_fail_malformed_htlcs_arg_constr, update_fee_arg_conv, commitment_signed_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; +} + +static inline uint64_t CommitmentUpdate_clone_ptr(LDKCommitmentUpdate *NONNULL_PTR arg) { + LDKCommitmentUpdate ret_var = CommitmentUpdate_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_CommitmentUpdate_clone_ptr"))) TS_CommitmentUpdate_clone_ptr(uint64_t arg) { + LDKCommitmentUpdate 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 = CommitmentUpdate_clone_ptr(&arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_CommitmentUpdate_clone"))) TS_CommitmentUpdate_clone(uint64_t orig) { + LDKCommitmentUpdate 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; + LDKCommitmentUpdate ret_var = CommitmentUpdate_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_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); + CHECK_ACCESS(this_ptr_ptr); + LDKChannelMessageHandler this_ptr_conv = *(LDKChannelMessageHandler*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + ChannelMessageHandler_free(this_ptr_conv); +} + +void __attribute__((export_name("TS_RoutingMessageHandler_free"))) TS_RoutingMessageHandler_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); + LDKRoutingMessageHandler this_ptr_conv = *(LDKRoutingMessageHandler*)(this_ptr_ptr); + FREE(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); + 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 = AcceptChannel_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_AcceptChannel_read"))) TS_AcceptChannel_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ"); + *ret_conv = AcceptChannel_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +int8_tArray __attribute__((export_name("TS_AnnouncementSignatures_write"))) TS_AnnouncementSignatures_write(uint64_t obj) { + LDKAnnouncementSignatures 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 = AnnouncementSignatures_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_AnnouncementSignatures_read"))) TS_AnnouncementSignatures_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ"); + *ret_conv = AnnouncementSignatures_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +int8_tArray __attribute__((export_name("TS_ChannelReestablish_write"))) TS_ChannelReestablish_write(uint64_t obj) { + LDKChannelReestablish 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 = ChannelReestablish_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_ChannelReestablish_read"))) TS_ChannelReestablish_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ"); + *ret_conv = ChannelReestablish_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +int8_tArray __attribute__((export_name("TS_ClosingSigned_write"))) TS_ClosingSigned_write(uint64_t obj) { + LDKClosingSigned 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 = ClosingSigned_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_ClosingSigned_read"))) TS_ClosingSigned_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ"); + *ret_conv = ClosingSigned_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +int8_tArray __attribute__((export_name("TS_ClosingSignedFeeRange_write"))) TS_ClosingSignedFeeRange_write(uint64_t obj) { + LDKClosingSignedFeeRange 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 = ClosingSignedFeeRange_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_ClosingSignedFeeRange_read"))) TS_ClosingSignedFeeRange_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ"); + *ret_conv = ClosingSignedFeeRange_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +int8_tArray __attribute__((export_name("TS_CommitmentSigned_write"))) TS_CommitmentSigned_write(uint64_t obj) { + LDKCommitmentSigned 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 = CommitmentSigned_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_CommitmentSigned_read"))) TS_CommitmentSigned_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ"); + *ret_conv = CommitmentSigned_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +int8_tArray __attribute__((export_name("TS_FundingCreated_write"))) TS_FundingCreated_write(uint64_t obj) { + LDKFundingCreated 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 = FundingCreated_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_FundingCreated_read"))) TS_FundingCreated_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ"); + *ret_conv = FundingCreated_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +int8_tArray __attribute__((export_name("TS_FundingSigned_write"))) TS_FundingSigned_write(uint64_t obj) { + LDKFundingSigned 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 = FundingSigned_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_FundingSigned_read"))) TS_FundingSigned_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ"); + *ret_conv = FundingSigned_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +int8_tArray __attribute__((export_name("TS_ChannelReady_write"))) TS_ChannelReady_write(uint64_t obj) { + LDKChannelReady 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 = ChannelReady_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_ChannelReady_read"))) TS_ChannelReady_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_ChannelReadyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReadyDecodeErrorZ), "LDKCResult_ChannelReadyDecodeErrorZ"); + *ret_conv = ChannelReady_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +int8_tArray __attribute__((export_name("TS_Init_write"))) TS_Init_write(uint64_t obj) { + LDKInit 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 = Init_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_Init_read"))) TS_Init_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ"); + *ret_conv = Init_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +int8_tArray __attribute__((export_name("TS_OpenChannel_write"))) TS_OpenChannel_write(uint64_t obj) { + LDKOpenChannel 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 = OpenChannel_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_OpenChannel_read"))) TS_OpenChannel_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ"); + *ret_conv = OpenChannel_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +int8_tArray __attribute__((export_name("TS_RevokeAndACK_write"))) TS_RevokeAndACK_write(uint64_t obj) { + LDKRevokeAndACK 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 = RevokeAndACK_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_RevokeAndACK_read"))) TS_RevokeAndACK_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ"); + *ret_conv = RevokeAndACK_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +int8_tArray __attribute__((export_name("TS_Shutdown_write"))) TS_Shutdown_write(uint64_t obj) { + LDKShutdown 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 = Shutdown_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_Shutdown_read"))) TS_Shutdown_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ"); + *ret_conv = Shutdown_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +int8_tArray __attribute__((export_name("TS_UpdateFailHTLC_write"))) TS_UpdateFailHTLC_write(uint64_t obj) { + LDKUpdateFailHTLC 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 = UpdateFailHTLC_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_UpdateFailHTLC_read"))) TS_UpdateFailHTLC_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ"); + *ret_conv = UpdateFailHTLC_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +int8_tArray __attribute__((export_name("TS_UpdateFailMalformedHTLC_write"))) TS_UpdateFailMalformedHTLC_write(uint64_t obj) { + LDKUpdateFailMalformedHTLC 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 = UpdateFailMalformedHTLC_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_UpdateFailMalformedHTLC_read"))) TS_UpdateFailMalformedHTLC_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ"); + *ret_conv = UpdateFailMalformedHTLC_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +int8_tArray __attribute__((export_name("TS_UpdateFee_write"))) TS_UpdateFee_write(uint64_t obj) { + LDKUpdateFee 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 = UpdateFee_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_UpdateFee_read"))) TS_UpdateFee_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ"); + *ret_conv = UpdateFee_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +int8_tArray __attribute__((export_name("TS_UpdateFulfillHTLC_write"))) TS_UpdateFulfillHTLC_write(uint64_t obj) { + LDKUpdateFulfillHTLC 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 = UpdateFulfillHTLC_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_UpdateFulfillHTLC_read"))) TS_UpdateFulfillHTLC_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ"); + *ret_conv = UpdateFulfillHTLC_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +int8_tArray __attribute__((export_name("TS_UpdateAddHTLC_write"))) TS_UpdateAddHTLC_write(uint64_t obj) { + LDKUpdateAddHTLC 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 = UpdateAddHTLC_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_UpdateAddHTLC_read"))) TS_UpdateAddHTLC_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ"); + *ret_conv = UpdateAddHTLC_read(ser_ref); + FREE(ser); + 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); + 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 = Ping_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_Ping_read"))) TS_Ping_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ"); + *ret_conv = Ping_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +int8_tArray __attribute__((export_name("TS_Pong_write"))) TS_Pong_write(uint64_t obj) { + LDKPong 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 = Pong_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_Pong_read"))) TS_Pong_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ"); + *ret_conv = Pong_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +int8_tArray __attribute__((export_name("TS_UnsignedChannelAnnouncement_write"))) TS_UnsignedChannelAnnouncement_write(uint64_t obj) { + LDKUnsignedChannelAnnouncement 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 = UnsignedChannelAnnouncement_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_UnsignedChannelAnnouncement_read"))) TS_UnsignedChannelAnnouncement_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ"); + *ret_conv = UnsignedChannelAnnouncement_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +int8_tArray __attribute__((export_name("TS_ChannelAnnouncement_write"))) TS_ChannelAnnouncement_write(uint64_t obj) { + LDKChannelAnnouncement 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 = ChannelAnnouncement_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_ChannelAnnouncement_read"))) TS_ChannelAnnouncement_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ"); + *ret_conv = ChannelAnnouncement_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +int8_tArray __attribute__((export_name("TS_UnsignedChannelUpdate_write"))) TS_UnsignedChannelUpdate_write(uint64_t obj) { + LDKUnsignedChannelUpdate 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 = UnsignedChannelUpdate_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_UnsignedChannelUpdate_read"))) TS_UnsignedChannelUpdate_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ"); + *ret_conv = UnsignedChannelUpdate_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +int8_tArray __attribute__((export_name("TS_ChannelUpdate_write"))) TS_ChannelUpdate_write(uint64_t obj) { + LDKChannelUpdate 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 = ChannelUpdate_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_UnsignedChannelUpdate_set_chain_hash"))) TS_UnsignedChannelUpdate_set_chain_hash(uint64_t this_ptr, int8_tArray val) { - LDKUnsignedChannelUpdate 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; - LDKThirtyTwoBytes val_ref; - CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); FREE(val); - UnsignedChannelUpdate_set_chain_hash(&this_ptr_conv, val_ref); +uint64_t __attribute__((export_name("TS_ChannelUpdate_read"))) TS_ChannelUpdate_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ"); + *ret_conv = ChannelUpdate_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -int64_t __attribute__((export_name("TS_UnsignedChannelUpdate_get_short_channel_id"))) TS_UnsignedChannelUpdate_get_short_channel_id(uint64_t this_ptr) { - LDKUnsignedChannelUpdate 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 = UnsignedChannelUpdate_get_short_channel_id(&this_ptr_conv); - return ret_conv; +int8_tArray __attribute__((export_name("TS_ErrorMessage_write"))) TS_ErrorMessage_write(uint64_t obj) { + LDKErrorMessage 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 = ErrorMessage_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_UnsignedChannelUpdate_set_short_channel_id"))) TS_UnsignedChannelUpdate_set_short_channel_id(uint64_t this_ptr, int64_t val) { - LDKUnsignedChannelUpdate 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; - UnsignedChannelUpdate_set_short_channel_id(&this_ptr_conv, val); +uint64_t __attribute__((export_name("TS_ErrorMessage_read"))) TS_ErrorMessage_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ"); + *ret_conv = ErrorMessage_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -int32_t __attribute__((export_name("TS_UnsignedChannelUpdate_get_timestamp"))) TS_UnsignedChannelUpdate_get_timestamp(uint64_t this_ptr) { - LDKUnsignedChannelUpdate 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 = UnsignedChannelUpdate_get_timestamp(&this_ptr_conv); - return ret_conv; +int8_tArray __attribute__((export_name("TS_WarningMessage_write"))) TS_WarningMessage_write(uint64_t obj) { + LDKWarningMessage 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 = WarningMessage_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_UnsignedChannelUpdate_set_timestamp"))) TS_UnsignedChannelUpdate_set_timestamp(uint64_t this_ptr, int32_t val) { - LDKUnsignedChannelUpdate 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; - UnsignedChannelUpdate_set_timestamp(&this_ptr_conv, val); +uint64_t __attribute__((export_name("TS_WarningMessage_read"))) TS_WarningMessage_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_WarningMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WarningMessageDecodeErrorZ), "LDKCResult_WarningMessageDecodeErrorZ"); + *ret_conv = WarningMessage_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -int8_t __attribute__((export_name("TS_UnsignedChannelUpdate_get_flags"))) TS_UnsignedChannelUpdate_get_flags(uint64_t this_ptr) { - LDKUnsignedChannelUpdate 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_t ret_conv = UnsignedChannelUpdate_get_flags(&this_ptr_conv); - return ret_conv; +int8_tArray __attribute__((export_name("TS_UnsignedNodeAnnouncement_write"))) TS_UnsignedNodeAnnouncement_write(uint64_t obj) { + LDKUnsignedNodeAnnouncement 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 = UnsignedNodeAnnouncement_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_UnsignedChannelUpdate_set_flags"))) TS_UnsignedChannelUpdate_set_flags(uint64_t this_ptr, int8_t val) { - LDKUnsignedChannelUpdate 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; - UnsignedChannelUpdate_set_flags(&this_ptr_conv, val); +uint64_t __attribute__((export_name("TS_UnsignedNodeAnnouncement_read"))) TS_UnsignedNodeAnnouncement_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ"); + *ret_conv = UnsignedNodeAnnouncement_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -int16_t __attribute__((export_name("TS_UnsignedChannelUpdate_get_cltv_expiry_delta"))) TS_UnsignedChannelUpdate_get_cltv_expiry_delta(uint64_t this_ptr) { - LDKUnsignedChannelUpdate 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; - int16_t ret_conv = UnsignedChannelUpdate_get_cltv_expiry_delta(&this_ptr_conv); - return ret_conv; +int8_tArray __attribute__((export_name("TS_NodeAnnouncement_write"))) TS_NodeAnnouncement_write(uint64_t obj) { + LDKNodeAnnouncement 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 = NodeAnnouncement_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_UnsignedChannelUpdate_set_cltv_expiry_delta"))) TS_UnsignedChannelUpdate_set_cltv_expiry_delta(uint64_t this_ptr, int16_t val) { - LDKUnsignedChannelUpdate 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; - UnsignedChannelUpdate_set_cltv_expiry_delta(&this_ptr_conv, val); +uint64_t __attribute__((export_name("TS_NodeAnnouncement_read"))) TS_NodeAnnouncement_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ"); + *ret_conv = NodeAnnouncement_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -int64_t __attribute__((export_name("TS_UnsignedChannelUpdate_get_htlc_minimum_msat"))) TS_UnsignedChannelUpdate_get_htlc_minimum_msat(uint64_t this_ptr) { - LDKUnsignedChannelUpdate 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 = UnsignedChannelUpdate_get_htlc_minimum_msat(&this_ptr_conv); - return ret_conv; +uint64_t __attribute__((export_name("TS_QueryShortChannelIds_read"))) TS_QueryShortChannelIds_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ"); + *ret_conv = QueryShortChannelIds_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -void __attribute__((export_name("TS_UnsignedChannelUpdate_set_htlc_minimum_msat"))) TS_UnsignedChannelUpdate_set_htlc_minimum_msat(uint64_t this_ptr, int64_t val) { - LDKUnsignedChannelUpdate 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; - UnsignedChannelUpdate_set_htlc_minimum_msat(&this_ptr_conv, val); +int8_tArray __attribute__((export_name("TS_QueryShortChannelIds_write"))) TS_QueryShortChannelIds_write(uint64_t obj) { + LDKQueryShortChannelIds 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 = QueryShortChannelIds_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; } -int64_t __attribute__((export_name("TS_UnsignedChannelUpdate_get_htlc_maximum_msat"))) TS_UnsignedChannelUpdate_get_htlc_maximum_msat(uint64_t this_ptr) { - LDKUnsignedChannelUpdate 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 = UnsignedChannelUpdate_get_htlc_maximum_msat(&this_ptr_conv); - return ret_conv; +int8_tArray __attribute__((export_name("TS_ReplyShortChannelIdsEnd_write"))) TS_ReplyShortChannelIdsEnd_write(uint64_t obj) { + LDKReplyShortChannelIdsEnd 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 = ReplyShortChannelIdsEnd_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_UnsignedChannelUpdate_set_htlc_maximum_msat"))) TS_UnsignedChannelUpdate_set_htlc_maximum_msat(uint64_t this_ptr, int64_t val) { - LDKUnsignedChannelUpdate 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; - UnsignedChannelUpdate_set_htlc_maximum_msat(&this_ptr_conv, val); +uint64_t __attribute__((export_name("TS_ReplyShortChannelIdsEnd_read"))) TS_ReplyShortChannelIdsEnd_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ"); + *ret_conv = ReplyShortChannelIdsEnd_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -int32_t __attribute__((export_name("TS_UnsignedChannelUpdate_get_fee_base_msat"))) TS_UnsignedChannelUpdate_get_fee_base_msat(uint64_t this_ptr) { - LDKUnsignedChannelUpdate 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 = UnsignedChannelUpdate_get_fee_base_msat(&this_ptr_conv); +int32_t __attribute__((export_name("TS_QueryChannelRange_end_blocknum"))) TS_QueryChannelRange_end_blocknum(uint64_t this_arg) { + LDKQueryChannelRange 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; + int32_t ret_conv = QueryChannelRange_end_blocknum(&this_arg_conv); return ret_conv; } -void __attribute__((export_name("TS_UnsignedChannelUpdate_set_fee_base_msat"))) TS_UnsignedChannelUpdate_set_fee_base_msat(uint64_t this_ptr, int32_t val) { - LDKUnsignedChannelUpdate 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; - UnsignedChannelUpdate_set_fee_base_msat(&this_ptr_conv, val); +int8_tArray __attribute__((export_name("TS_QueryChannelRange_write"))) TS_QueryChannelRange_write(uint64_t obj) { + LDKQueryChannelRange 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 = QueryChannelRange_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; } -int32_t __attribute__((export_name("TS_UnsignedChannelUpdate_get_fee_proportional_millionths"))) TS_UnsignedChannelUpdate_get_fee_proportional_millionths(uint64_t this_ptr) { - LDKUnsignedChannelUpdate 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 = UnsignedChannelUpdate_get_fee_proportional_millionths(&this_ptr_conv); - return ret_conv; +uint64_t __attribute__((export_name("TS_QueryChannelRange_read"))) TS_QueryChannelRange_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ"); + *ret_conv = QueryChannelRange_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -void __attribute__((export_name("TS_UnsignedChannelUpdate_set_fee_proportional_millionths"))) TS_UnsignedChannelUpdate_set_fee_proportional_millionths(uint64_t this_ptr, int32_t val) { - LDKUnsignedChannelUpdate 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; - UnsignedChannelUpdate_set_fee_proportional_millionths(&this_ptr_conv, val); +uint64_t __attribute__((export_name("TS_ReplyChannelRange_read"))) TS_ReplyChannelRange_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ"); + *ret_conv = ReplyChannelRange_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -int8_tArray __attribute__((export_name("TS_UnsignedChannelUpdate_get_excess_data"))) TS_UnsignedChannelUpdate_get_excess_data(uint64_t this_ptr) { - LDKUnsignedChannelUpdate 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; - LDKCVec_u8Z ret_var = UnsignedChannelUpdate_get_excess_data(&this_ptr_conv); +int8_tArray __attribute__((export_name("TS_ReplyChannelRange_write"))) TS_ReplyChannelRange_write(uint64_t obj) { + LDKReplyChannelRange 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 = ReplyChannelRange_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_UnsignedChannelUpdate_set_excess_data"))) TS_UnsignedChannelUpdate_set_excess_data(uint64_t this_ptr, int8_tArray val) { - LDKUnsignedChannelUpdate 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; - LDKCVec_u8Z val_ref; - val_ref.datalen = val->arr_len; - val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(val_ref.data, val->elems, val_ref.datalen); FREE(val); - UnsignedChannelUpdate_set_excess_data(&this_ptr_conv, val_ref); +int8_tArray __attribute__((export_name("TS_GossipTimestampFilter_write"))) TS_GossipTimestampFilter_write(uint64_t obj) { + LDKGossipTimestampFilter 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 = GossipTimestampFilter_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_UnsignedChannelUpdate_new"))) TS_UnsignedChannelUpdate_new(int8_tArray chain_hash_arg, int64_t short_channel_id_arg, int32_t timestamp_arg, int8_t flags_arg, int16_t cltv_expiry_delta_arg, int64_t htlc_minimum_msat_arg, int64_t htlc_maximum_msat_arg, int32_t fee_base_msat_arg, int32_t fee_proportional_millionths_arg, int8_tArray excess_data_arg) { - LDKThirtyTwoBytes chain_hash_arg_ref; - CHECK(chain_hash_arg->arr_len == 32); - memcpy(chain_hash_arg_ref.data, chain_hash_arg->elems, 32); FREE(chain_hash_arg); - LDKCVec_u8Z excess_data_arg_ref; - excess_data_arg_ref.datalen = excess_data_arg->arr_len; - excess_data_arg_ref.data = MALLOC(excess_data_arg_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(excess_data_arg_ref.data, excess_data_arg->elems, excess_data_arg_ref.datalen); FREE(excess_data_arg); - LDKUnsignedChannelUpdate ret_var = UnsignedChannelUpdate_new(chain_hash_arg_ref, short_channel_id_arg, timestamp_arg, flags_arg, cltv_expiry_delta_arg, htlc_minimum_msat_arg, htlc_maximum_msat_arg, fee_base_msat_arg, fee_proportional_millionths_arg, excess_data_arg_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_GossipTimestampFilter_read"))) TS_GossipTimestampFilter_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ"); + *ret_conv = GossipTimestampFilter_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -static inline uint64_t UnsignedChannelUpdate_clone_ptr(LDKUnsignedChannelUpdate *NONNULL_PTR arg) { - LDKUnsignedChannelUpdate ret_var = UnsignedChannelUpdate_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; +void __attribute__((export_name("TS_CustomMessageHandler_free"))) TS_CustomMessageHandler_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); + LDKCustomMessageHandler this_ptr_conv = *(LDKCustomMessageHandler*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + CustomMessageHandler_free(this_ptr_conv); } -int64_t __attribute__((export_name("TS_UnsignedChannelUpdate_clone_ptr"))) TS_UnsignedChannelUpdate_clone_ptr(uint64_t arg) { - LDKUnsignedChannelUpdate 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 = UnsignedChannelUpdate_clone_ptr(&arg_conv); - return ret_conv; + +void __attribute__((export_name("TS_IgnoringMessageHandler_free"))) TS_IgnoringMessageHandler_free(uint64_t this_obj) { + LDKIgnoringMessageHandler 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); + IgnoringMessageHandler_free(this_obj_conv); } -uint64_t __attribute__((export_name("TS_UnsignedChannelUpdate_clone"))) TS_UnsignedChannelUpdate_clone(uint64_t orig) { - LDKUnsignedChannelUpdate 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; - LDKUnsignedChannelUpdate ret_var = UnsignedChannelUpdate_clone(&orig_conv); +uint64_t __attribute__((export_name("TS_IgnoringMessageHandler_new"))) TS_IgnoringMessageHandler_new() { + LDKIgnoringMessageHandler ret_var = IgnoringMessageHandler_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; } -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; +uint64_t __attribute__((export_name("TS_IgnoringMessageHandler_as_MessageSendEventsProvider"))) TS_IgnoringMessageHandler_as_MessageSendEventsProvider(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; + LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider"); + *ret_ret = IgnoringMessageHandler_as_MessageSendEventsProvider(&this_arg_conv); + return tag_ptr(ret_ret, true); } -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); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChannelUpdate_free(this_obj_conv); +uint64_t __attribute__((export_name("TS_IgnoringMessageHandler_as_RoutingMessageHandler"))) TS_IgnoringMessageHandler_as_RoutingMessageHandler(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; + LDKRoutingMessageHandler* ret_ret = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler"); + *ret_ret = IgnoringMessageHandler_as_RoutingMessageHandler(&this_arg_conv); + return tag_ptr(ret_ret, true); } -int8_tArray __attribute__((export_name("TS_ChannelUpdate_get_signature"))) TS_ChannelUpdate_get_signature(uint64_t this_ptr) { - LDKChannelUpdate 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(64, __LINE__); - memcpy(ret_arr->elems, ChannelUpdate_get_signature(&this_ptr_conv).compact_form, 64); - return ret_arr; +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); } -void __attribute__((export_name("TS_ChannelUpdate_set_signature"))) TS_ChannelUpdate_set_signature(uint64_t this_ptr, int8_tArray val) { - LDKChannelUpdate 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; - LDKSignature val_ref; - CHECK(val->arr_len == 64); - memcpy(val_ref.compact_form, val->elems, 64); FREE(val); - ChannelUpdate_set_signature(&this_ptr_conv, val_ref); +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_ChannelUpdate_get_contents"))) TS_ChannelUpdate_get_contents(uint64_t this_ptr) { - LDKChannelUpdate 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; - LDKUnsignedChannelUpdate ret_var = ChannelUpdate_get_contents(&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; +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); + 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; + LDKCustomMessageReader* ret_ret = MALLOC(sizeof(LDKCustomMessageReader), "LDKCustomMessageReader"); + *ret_ret = IgnoringMessageHandler_as_CustomMessageReader(&this_arg_conv); + return tag_ptr(ret_ret, true); } -void __attribute__((export_name("TS_ChannelUpdate_set_contents"))) TS_ChannelUpdate_set_contents(uint64_t this_ptr, uint64_t val) { - LDKChannelUpdate 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; - LDKUnsignedChannelUpdate 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 = UnsignedChannelUpdate_clone(&val_conv); - ChannelUpdate_set_contents(&this_ptr_conv, val_conv); +uint64_t __attribute__((export_name("TS_IgnoringMessageHandler_as_CustomMessageHandler"))) TS_IgnoringMessageHandler_as_CustomMessageHandler(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; + LDKCustomMessageHandler* ret_ret = MALLOC(sizeof(LDKCustomMessageHandler), "LDKCustomMessageHandler"); + *ret_ret = IgnoringMessageHandler_as_CustomMessageHandler(&this_arg_conv); + return tag_ptr(ret_ret, true); } -uint64_t __attribute__((export_name("TS_ChannelUpdate_new"))) TS_ChannelUpdate_new(int8_tArray signature_arg, uint64_t contents_arg) { - LDKSignature signature_arg_ref; - CHECK(signature_arg->arr_len == 64); - memcpy(signature_arg_ref.compact_form, signature_arg->elems, 64); FREE(signature_arg); - LDKUnsignedChannelUpdate contents_arg_conv; - contents_arg_conv.inner = untag_ptr(contents_arg); - contents_arg_conv.is_owned = ptr_is_owned(contents_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(contents_arg_conv); - contents_arg_conv = UnsignedChannelUpdate_clone(&contents_arg_conv); - LDKChannelUpdate ret_var = ChannelUpdate_new(signature_arg_ref, contents_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_ErroringMessageHandler_free"))) TS_ErroringMessageHandler_free(uint64_t this_obj) { + LDKErroringMessageHandler 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); + ErroringMessageHandler_free(this_obj_conv); } -static inline uint64_t ChannelUpdate_clone_ptr(LDKChannelUpdate *NONNULL_PTR arg) { - LDKChannelUpdate ret_var = ChannelUpdate_clone(arg); +uint64_t __attribute__((export_name("TS_ErroringMessageHandler_new"))) TS_ErroringMessageHandler_new() { + LDKErroringMessageHandler ret_var = ErroringMessageHandler_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; } -int64_t __attribute__((export_name("TS_ChannelUpdate_clone_ptr"))) TS_ChannelUpdate_clone_ptr(uint64_t arg) { - LDKChannelUpdate 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 = ChannelUpdate_clone_ptr(&arg_conv); - return ret_conv; -} -uint64_t __attribute__((export_name("TS_ChannelUpdate_clone"))) TS_ChannelUpdate_clone(uint64_t orig) { - LDKChannelUpdate 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; - LDKChannelUpdate ret_var = ChannelUpdate_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_ErroringMessageHandler_as_MessageSendEventsProvider"))) TS_ErroringMessageHandler_as_MessageSendEventsProvider(uint64_t this_arg) { + LDKErroringMessageHandler 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; + LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider"); + *ret_ret = ErroringMessageHandler_as_MessageSendEventsProvider(&this_arg_conv); + return tag_ptr(ret_ret, true); } -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; +uint64_t __attribute__((export_name("TS_ErroringMessageHandler_as_ChannelMessageHandler"))) TS_ErroringMessageHandler_as_ChannelMessageHandler(uint64_t this_arg) { + LDKErroringMessageHandler 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; + LDKChannelMessageHandler* ret_ret = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler"); + *ret_ret = ErroringMessageHandler_as_ChannelMessageHandler(&this_arg_conv); + return tag_ptr(ret_ret, true); } -void __attribute__((export_name("TS_QueryChannelRange_free"))) TS_QueryChannelRange_free(uint64_t this_obj) { - LDKQueryChannelRange this_obj_conv; +void __attribute__((export_name("TS_MessageHandler_free"))) TS_MessageHandler_free(uint64_t this_obj) { + LDKMessageHandler 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); - QueryChannelRange_free(this_obj_conv); + MessageHandler_free(this_obj_conv); } -int8_tArray __attribute__((export_name("TS_QueryChannelRange_get_chain_hash"))) TS_QueryChannelRange_get_chain_hash(uint64_t this_ptr) { - LDKQueryChannelRange this_ptr_conv; +uint64_t __attribute__((export_name("TS_MessageHandler_get_chan_handler"))) TS_MessageHandler_get_chan_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; - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, *QueryChannelRange_get_chain_hash(&this_ptr_conv), 32); - return ret_arr; + // WARNING: This object doesn't live past this scope, needs clone! + uint64_t ret_ret = tag_ptr(MessageHandler_get_chan_handler(&this_ptr_conv), false); + return ret_ret; } -void __attribute__((export_name("TS_QueryChannelRange_set_chain_hash"))) TS_QueryChannelRange_set_chain_hash(uint64_t this_ptr, int8_tArray val) { - LDKQueryChannelRange this_ptr_conv; +void __attribute__((export_name("TS_MessageHandler_set_chan_handler"))) TS_MessageHandler_set_chan_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; - LDKThirtyTwoBytes val_ref; - CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); FREE(val); - QueryChannelRange_set_chain_hash(&this_ptr_conv, val_ref); + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKChannelMessageHandler val_conv = *(LDKChannelMessageHandler*)(val_ptr); + if (val_conv.free == LDKChannelMessageHandler_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKChannelMessageHandler_JCalls_cloned(&val_conv); + } + MessageHandler_set_chan_handler(&this_ptr_conv, val_conv); } -int32_t __attribute__((export_name("TS_QueryChannelRange_get_first_blocknum"))) TS_QueryChannelRange_get_first_blocknum(uint64_t this_ptr) { - LDKQueryChannelRange this_ptr_conv; +uint64_t __attribute__((export_name("TS_MessageHandler_get_route_handler"))) TS_MessageHandler_get_route_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; - int32_t ret_conv = QueryChannelRange_get_first_blocknum(&this_ptr_conv); - return ret_conv; + // WARNING: This object doesn't live past this scope, needs clone! + uint64_t ret_ret = tag_ptr(MessageHandler_get_route_handler(&this_ptr_conv), false); + return ret_ret; } -void __attribute__((export_name("TS_QueryChannelRange_set_first_blocknum"))) TS_QueryChannelRange_set_first_blocknum(uint64_t this_ptr, int32_t val) { - LDKQueryChannelRange this_ptr_conv; +void __attribute__((export_name("TS_MessageHandler_set_route_handler"))) TS_MessageHandler_set_route_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; - QueryChannelRange_set_first_blocknum(&this_ptr_conv, val); + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKRoutingMessageHandler val_conv = *(LDKRoutingMessageHandler*)(val_ptr); + if (val_conv.free == LDKRoutingMessageHandler_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKRoutingMessageHandler_JCalls_cloned(&val_conv); + } + MessageHandler_set_route_handler(&this_ptr_conv, val_conv); } -int32_t __attribute__((export_name("TS_QueryChannelRange_get_number_of_blocks"))) TS_QueryChannelRange_get_number_of_blocks(uint64_t this_ptr) { - LDKQueryChannelRange this_ptr_conv; +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; - int32_t ret_conv = QueryChannelRange_get_number_of_blocks(&this_ptr_conv); - return ret_conv; + // 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_QueryChannelRange_set_number_of_blocks"))) TS_QueryChannelRange_set_number_of_blocks(uint64_t this_ptr, int32_t val) { - LDKQueryChannelRange this_ptr_conv; +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; - QueryChannelRange_set_number_of_blocks(&this_ptr_conv, val); + 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_QueryChannelRange_new"))) TS_QueryChannelRange_new(int8_tArray chain_hash_arg, int32_t first_blocknum_arg, int32_t number_of_blocks_arg) { - LDKThirtyTwoBytes chain_hash_arg_ref; - CHECK(chain_hash_arg->arr_len == 32); - memcpy(chain_hash_arg_ref.data, chain_hash_arg->elems, 32); FREE(chain_hash_arg); - LDKQueryChannelRange ret_var = QueryChannelRange_new(chain_hash_arg_ref, first_blocknum_arg, number_of_blocks_arg); +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 (chan_handler_arg_conv.free == LDKChannelMessageHandler_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKChannelMessageHandler_JCalls_cloned(&chan_handler_arg_conv); + } + void* route_handler_arg_ptr = untag_ptr(route_handler_arg); + CHECK_ACCESS(route_handler_arg_ptr); + LDKRoutingMessageHandler route_handler_arg_conv = *(LDKRoutingMessageHandler*)(route_handler_arg_ptr); + if (route_handler_arg_conv.free == LDKRoutingMessageHandler_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKRoutingMessageHandler_JCalls_cloned(&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); return ret_ref; } -static inline uint64_t QueryChannelRange_clone_ptr(LDKQueryChannelRange *NONNULL_PTR arg) { - LDKQueryChannelRange ret_var = QueryChannelRange_clone(arg); +static inline uint64_t SocketDescriptor_clone_ptr(LDKSocketDescriptor *NONNULL_PTR arg) { + LDKSocketDescriptor* ret_ret = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor"); + *ret_ret = SocketDescriptor_clone(arg); + return tag_ptr(ret_ret, true); +} +int64_t __attribute__((export_name("TS_SocketDescriptor_clone_ptr"))) TS_SocketDescriptor_clone_ptr(uint64_t arg) { + void* arg_ptr = untag_ptr(arg); + if (ptr_is_owned(arg)) { CHECK_ACCESS(arg_ptr); } + LDKSocketDescriptor* arg_conv = (LDKSocketDescriptor*)arg_ptr; + int64_t ret_conv = SocketDescriptor_clone_ptr(arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_SocketDescriptor_clone"))) TS_SocketDescriptor_clone(uint64_t orig) { + void* orig_ptr = untag_ptr(orig); + if (ptr_is_owned(orig)) { CHECK_ACCESS(orig_ptr); } + LDKSocketDescriptor* orig_conv = (LDKSocketDescriptor*)orig_ptr; + LDKSocketDescriptor* ret_ret = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor"); + *ret_ret = SocketDescriptor_clone(orig_conv); + return tag_ptr(ret_ret, true); +} + +void __attribute__((export_name("TS_SocketDescriptor_free"))) TS_SocketDescriptor_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); + LDKSocketDescriptor this_ptr_conv = *(LDKSocketDescriptor*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + SocketDescriptor_free(this_ptr_conv); +} + +void __attribute__((export_name("TS_PeerHandleError_free"))) TS_PeerHandleError_free(uint64_t this_obj) { + LDKPeerHandleError 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); + PeerHandleError_free(this_obj_conv); +} + +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); return ret_ref; } -int64_t __attribute__((export_name("TS_QueryChannelRange_clone_ptr"))) TS_QueryChannelRange_clone_ptr(uint64_t arg) { - LDKQueryChannelRange arg_conv; + +static inline uint64_t PeerHandleError_clone_ptr(LDKPeerHandleError *NONNULL_PTR arg) { + LDKPeerHandleError ret_var = PeerHandleError_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_PeerHandleError_clone_ptr"))) TS_PeerHandleError_clone_ptr(uint64_t arg) { + LDKPeerHandleError 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 = QueryChannelRange_clone_ptr(&arg_conv); + int64_t ret_conv = PeerHandleError_clone_ptr(&arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_QueryChannelRange_clone"))) TS_QueryChannelRange_clone(uint64_t orig) { - LDKQueryChannelRange orig_conv; +uint64_t __attribute__((export_name("TS_PeerHandleError_clone"))) TS_PeerHandleError_clone(uint64_t orig) { + LDKPeerHandleError 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; - LDKQueryChannelRange ret_var = QueryChannelRange_clone(&orig_conv); + LDKPeerHandleError ret_var = PeerHandleError_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_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; +void __attribute__((export_name("TS_PeerManager_free"))) TS_PeerManager_free(uint64_t this_obj) { + LDKPeerManager 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); - ReplyChannelRange_free(this_obj_conv); + PeerManager_free(this_obj_conv); } -int8_tArray __attribute__((export_name("TS_ReplyChannelRange_get_chain_hash"))) TS_ReplyChannelRange_get_chain_hash(uint64_t this_ptr) { - LDKReplyChannelRange 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(32, __LINE__); - memcpy(ret_arr->elems, *ReplyChannelRange_get_chain_hash(&this_ptr_conv), 32); +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 + + 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); + 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 (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_message_handler_ptr = untag_ptr(custom_message_handler); + CHECK_ACCESS(custom_message_handler_ptr); + LDKCustomMessageHandler custom_message_handler_conv = *(LDKCustomMessageHandler*)(custom_message_handler_ptr); + if (custom_message_handler_conv.free == LDKCustomMessageHandler_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKCustomMessageHandler_JCalls_cloned(&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; +} + +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_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); return ret_arr; } -void __attribute__((export_name("TS_ReplyChannelRange_set_chain_hash"))) TS_ReplyChannelRange_set_chain_hash(uint64_t this_ptr, int8_tArray val) { - LDKReplyChannelRange 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; - LDKThirtyTwoBytes val_ref; - CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); FREE(val); - ReplyChannelRange_set_chain_hash(&this_ptr_conv, val_ref); +uint64_t __attribute__((export_name("TS_PeerManager_new_outbound_connection"))) TS_PeerManager_new_outbound_connection(uint64_t this_arg, int8_tArray their_node_id, uint64_t descriptor, uint64_t remote_network_address) { + 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; + 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); + void* descriptor_ptr = untag_ptr(descriptor); + CHECK_ACCESS(descriptor_ptr); + LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)(descriptor_ptr); + if (descriptor_conv.free == LDKSocketDescriptor_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKSocketDescriptor_JCalls_cloned(&descriptor_conv); + } + void* remote_network_address_ptr = untag_ptr(remote_network_address); + CHECK_ACCESS(remote_network_address_ptr); + LDKCOption_NetAddressZ remote_network_address_conv = *(LDKCOption_NetAddressZ*)(remote_network_address_ptr); + LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ"); + *ret_conv = PeerManager_new_outbound_connection(&this_arg_conv, their_node_id_ref, descriptor_conv, remote_network_address_conv); + return tag_ptr(ret_conv, true); } -int32_t __attribute__((export_name("TS_ReplyChannelRange_get_first_blocknum"))) TS_ReplyChannelRange_get_first_blocknum(uint64_t this_ptr) { - LDKReplyChannelRange 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 = ReplyChannelRange_get_first_blocknum(&this_ptr_conv); - return ret_conv; +uint64_t __attribute__((export_name("TS_PeerManager_new_inbound_connection"))) TS_PeerManager_new_inbound_connection(uint64_t this_arg, uint64_t descriptor, uint64_t remote_network_address) { + 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; + void* descriptor_ptr = untag_ptr(descriptor); + CHECK_ACCESS(descriptor_ptr); + LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)(descriptor_ptr); + if (descriptor_conv.free == LDKSocketDescriptor_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKSocketDescriptor_JCalls_cloned(&descriptor_conv); + } + void* remote_network_address_ptr = untag_ptr(remote_network_address); + CHECK_ACCESS(remote_network_address_ptr); + LDKCOption_NetAddressZ remote_network_address_conv = *(LDKCOption_NetAddressZ*)(remote_network_address_ptr); + LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ"); + *ret_conv = PeerManager_new_inbound_connection(&this_arg_conv, descriptor_conv, remote_network_address_conv); + return tag_ptr(ret_conv, true); } -void __attribute__((export_name("TS_ReplyChannelRange_set_first_blocknum"))) TS_ReplyChannelRange_set_first_blocknum(uint64_t this_ptr, int32_t val) { - LDKReplyChannelRange 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; - ReplyChannelRange_set_first_blocknum(&this_ptr_conv, val); +uint64_t __attribute__((export_name("TS_PeerManager_write_buffer_space_avail"))) TS_PeerManager_write_buffer_space_avail(uint64_t this_arg, uint64_t descriptor) { + 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; + void* descriptor_ptr = untag_ptr(descriptor); + if (ptr_is_owned(descriptor)) { CHECK_ACCESS(descriptor_ptr); } + LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor_ptr; + LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ"); + *ret_conv = PeerManager_write_buffer_space_avail(&this_arg_conv, descriptor_conv); + return tag_ptr(ret_conv, true); +} + +uint64_t __attribute__((export_name("TS_PeerManager_read_event"))) TS_PeerManager_read_event(uint64_t this_arg, uint64_t peer_descriptor, int8_tArray data) { + 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; + void* peer_descriptor_ptr = untag_ptr(peer_descriptor); + if (ptr_is_owned(peer_descriptor)) { CHECK_ACCESS(peer_descriptor_ptr); } + LDKSocketDescriptor* peer_descriptor_conv = (LDKSocketDescriptor*)peer_descriptor_ptr; + LDKu8slice data_ref; + data_ref.datalen = data->arr_len; + data_ref.data = data->elems; + LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ"); + *ret_conv = PeerManager_read_event(&this_arg_conv, peer_descriptor_conv, data_ref); + FREE(data); + return tag_ptr(ret_conv, true); +} + +void __attribute__((export_name("TS_PeerManager_process_events"))) TS_PeerManager_process_events(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; + PeerManager_process_events(&this_arg_conv); +} + +void __attribute__((export_name("TS_PeerManager_socket_disconnected"))) TS_PeerManager_socket_disconnected(uint64_t this_arg, uint64_t descriptor) { + 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; + void* descriptor_ptr = untag_ptr(descriptor); + if (ptr_is_owned(descriptor)) { CHECK_ACCESS(descriptor_ptr); } + LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor_ptr; + 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) { + 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; + 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); +} + +void __attribute__((export_name("TS_PeerManager_disconnect_all_peers"))) TS_PeerManager_disconnect_all_peers(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; + PeerManager_disconnect_all_peers(&this_arg_conv); +} + +void __attribute__((export_name("TS_PeerManager_timer_tick_occurred"))) TS_PeerManager_timer_tick_occurred(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; + 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); } -int32_t __attribute__((export_name("TS_ReplyChannelRange_get_number_of_blocks"))) TS_ReplyChannelRange_get_number_of_blocks(uint64_t this_ptr) { - LDKReplyChannelRange 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 = ReplyChannelRange_get_number_of_blocks(&this_ptr_conv); +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; } -void __attribute__((export_name("TS_ReplyChannelRange_set_number_of_blocks"))) TS_ReplyChannelRange_set_number_of_blocks(uint64_t this_ptr, int32_t val) { - LDKReplyChannelRange 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; - ReplyChannelRange_set_number_of_blocks(&this_ptr_conv, val); -} - -jboolean __attribute__((export_name("TS_ReplyChannelRange_get_sync_complete"))) TS_ReplyChannelRange_get_sync_complete(uint64_t this_ptr) { - LDKReplyChannelRange 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 = ReplyChannelRange_get_sync_complete(&this_ptr_conv); +int64_t __attribute__((export_name("TS_htlc_timeout_tx_weight"))) TS_htlc_timeout_tx_weight(jboolean opt_anchors) { + int64_t ret_conv = htlc_timeout_tx_weight(opt_anchors); return ret_conv; } -void __attribute__((export_name("TS_ReplyChannelRange_set_sync_complete"))) TS_ReplyChannelRange_set_sync_complete(uint64_t this_ptr, jboolean val) { - LDKReplyChannelRange 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; - ReplyChannelRange_set_sync_complete(&this_ptr_conv, val); +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; } -int64_tArray __attribute__((export_name("TS_ReplyChannelRange_get_short_channel_ids"))) TS_ReplyChannelRange_get_short_channel_ids(uint64_t this_ptr) { - LDKReplyChannelRange 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; - LDKCVec_u64Z ret_var = ReplyChannelRange_get_short_channel_ids(&this_ptr_conv); - int64_tArray ret_arr = NULL; - ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); - int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); - for (size_t i = 0; i < ret_var.datalen; i++) { - int64_t ret_conv_8_conv = ret_var.data[i]; - ret_arr_ptr[i] = ret_conv_8_conv; - } - - FREE(ret_var.data); - return ret_arr; +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; } -void __attribute__((export_name("TS_ReplyChannelRange_set_short_channel_ids"))) TS_ReplyChannelRange_set_short_channel_ids(uint64_t this_ptr, int64_tArray val) { - LDKReplyChannelRange 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; - LDKCVec_u64Z val_constr; - val_constr.datalen = val->arr_len; - if (val_constr.datalen > 0) - val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); - else - val_constr.data = NULL; - int64_t* val_vals = val->elems; - for (size_t i = 0; i < val_constr.datalen; i++) { - int64_t val_conv_8 = val_vals[i]; - val_constr.data[i] = val_conv_8; - } - FREE(val); - ReplyChannelRange_set_short_channel_ids(&this_ptr_conv, val_constr); +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; } -uint64_t __attribute__((export_name("TS_ReplyChannelRange_new"))) TS_ReplyChannelRange_new(int8_tArray chain_hash_arg, int32_t first_blocknum_arg, int32_t number_of_blocks_arg, jboolean sync_complete_arg, int64_tArray short_channel_ids_arg) { - LDKThirtyTwoBytes chain_hash_arg_ref; - CHECK(chain_hash_arg->arr_len == 32); - memcpy(chain_hash_arg_ref.data, chain_hash_arg->elems, 32); FREE(chain_hash_arg); - LDKCVec_u64Z short_channel_ids_arg_constr; - short_channel_ids_arg_constr.datalen = short_channel_ids_arg->arr_len; - if (short_channel_ids_arg_constr.datalen > 0) - short_channel_ids_arg_constr.data = MALLOC(short_channel_ids_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); - else - short_channel_ids_arg_constr.data = NULL; - int64_t* short_channel_ids_arg_vals = short_channel_ids_arg->elems; - for (size_t i = 0; i < short_channel_ids_arg_constr.datalen; i++) { - int64_t short_channel_ids_arg_conv_8 = short_channel_ids_arg_vals[i]; - short_channel_ids_arg_constr.data[i] = short_channel_ids_arg_conv_8; - } - FREE(short_channel_ids_arg); - LDKReplyChannelRange ret_var = ReplyChannelRange_new(chain_hash_arg_ref, first_blocknum_arg, number_of_blocks_arg, sync_complete_arg, short_channel_ids_arg_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); - return ret_ref; +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; } -static inline uint64_t ReplyChannelRange_clone_ptr(LDKReplyChannelRange *NONNULL_PTR arg) { - LDKReplyChannelRange ret_var = ReplyChannelRange_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_ReplyChannelRange_clone_ptr"))) TS_ReplyChannelRange_clone_ptr(uint64_t arg) { - LDKReplyChannelRange 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 = ReplyChannelRange_clone_ptr(&arg_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; } -uint64_t __attribute__((export_name("TS_ReplyChannelRange_clone"))) TS_ReplyChannelRange_clone(uint64_t orig) { - LDKReplyChannelRange 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; - LDKReplyChannelRange ret_var = ReplyChannelRange_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; +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_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); +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; } -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); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - QueryShortChannelIds_free(this_obj_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_QueryShortChannelIds_get_chain_hash"))) TS_QueryShortChannelIds_get_chain_hash(uint64_t this_ptr) { - LDKQueryShortChannelIds 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 __attribute__((export_name("TS_build_commitment_secret"))) TS_build_commitment_secret(int8_tArray commitment_seed, int64_t idx) { + uint8_t commitment_seed_arr[32]; + CHECK(commitment_seed->arr_len == 32); + memcpy(commitment_seed_arr, commitment_seed->elems, 32); FREE(commitment_seed); + uint8_t (*commitment_seed_ref)[32] = &commitment_seed_arr; int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, *QueryShortChannelIds_get_chain_hash(&this_ptr_conv), 32); + memcpy(ret_arr->elems, build_commitment_secret(commitment_seed_ref, idx).data, 32); return ret_arr; } -void __attribute__((export_name("TS_QueryShortChannelIds_set_chain_hash"))) TS_QueryShortChannelIds_set_chain_hash(uint64_t this_ptr, int8_tArray val) { - LDKQueryShortChannelIds 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; - LDKThirtyTwoBytes val_ref; - CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); FREE(val); - QueryShortChannelIds_set_chain_hash(&this_ptr_conv, val_ref); -} - -int64_tArray __attribute__((export_name("TS_QueryShortChannelIds_get_short_channel_ids"))) TS_QueryShortChannelIds_get_short_channel_ids(uint64_t this_ptr) { - LDKQueryShortChannelIds 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; - LDKCVec_u64Z ret_var = QueryShortChannelIds_get_short_channel_ids(&this_ptr_conv); - int64_tArray ret_arr = NULL; - ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); - int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); - for (size_t i = 0; i < ret_var.datalen; i++) { - int64_t ret_conv_8_conv = ret_var.data[i]; - ret_arr_ptr[i] = ret_conv_8_conv; - } - - FREE(ret_var.data); +int8_tArray __attribute__((export_name("TS_build_closing_transaction"))) TS_build_closing_transaction(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; + to_holder_script_ref.data = MALLOC(to_holder_script_ref.datalen, "LDKCVec_u8Z Bytes"); + memcpy(to_holder_script_ref.data, to_holder_script->elems, to_holder_script_ref.datalen); FREE(to_holder_script); + LDKCVec_u8Z to_counterparty_script_ref; + to_counterparty_script_ref.datalen = to_counterparty_script->arr_len; + to_counterparty_script_ref.data = MALLOC(to_counterparty_script_ref.datalen, "LDKCVec_u8Z Bytes"); + memcpy(to_counterparty_script_ref.data, to_counterparty_script->elems, to_counterparty_script_ref.datalen); FREE(to_counterparty_script); + LDKOutPoint funding_outpoint_conv; + funding_outpoint_conv.inner = untag_ptr(funding_outpoint); + funding_outpoint_conv.is_owned = ptr_is_owned(funding_outpoint); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_conv); + funding_outpoint_conv = OutPoint_clone(&funding_outpoint_conv); + LDKTransaction ret_var = build_closing_transaction(to_holder_value_sat, to_counterparty_value_sat, to_holder_script_ref, to_counterparty_script_ref, funding_outpoint_conv); + 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; } -void __attribute__((export_name("TS_QueryShortChannelIds_set_short_channel_ids"))) TS_QueryShortChannelIds_set_short_channel_ids(uint64_t this_ptr, int64_tArray val) { - LDKQueryShortChannelIds 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; - LDKCVec_u64Z val_constr; - val_constr.datalen = val->arr_len; - if (val_constr.datalen > 0) - val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); - else - val_constr.data = NULL; - int64_t* val_vals = val->elems; - for (size_t i = 0; i < val_constr.datalen; i++) { - int64_t val_conv_8 = val_vals[i]; - val_constr.data[i] = val_conv_8; - } - FREE(val); - QueryShortChannelIds_set_short_channel_ids(&this_ptr_conv, val_constr); -} - -uint64_t __attribute__((export_name("TS_QueryShortChannelIds_new"))) TS_QueryShortChannelIds_new(int8_tArray chain_hash_arg, int64_tArray short_channel_ids_arg) { - LDKThirtyTwoBytes chain_hash_arg_ref; - CHECK(chain_hash_arg->arr_len == 32); - memcpy(chain_hash_arg_ref.data, chain_hash_arg->elems, 32); FREE(chain_hash_arg); - LDKCVec_u64Z short_channel_ids_arg_constr; - short_channel_ids_arg_constr.datalen = short_channel_ids_arg->arr_len; - if (short_channel_ids_arg_constr.datalen > 0) - short_channel_ids_arg_constr.data = MALLOC(short_channel_ids_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); - else - short_channel_ids_arg_constr.data = NULL; - int64_t* short_channel_ids_arg_vals = short_channel_ids_arg->elems; - for (size_t i = 0; i < short_channel_ids_arg_constr.datalen; i++) { - int64_t short_channel_ids_arg_conv_8 = short_channel_ids_arg_vals[i]; - short_channel_ids_arg_constr.data[i] = short_channel_ids_arg_conv_8; - } - FREE(short_channel_ids_arg); - LDKQueryShortChannelIds ret_var = QueryShortChannelIds_new(chain_hash_arg_ref, short_channel_ids_arg_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); - return ret_ref; +void __attribute__((export_name("TS_CounterpartyCommitmentSecrets_free"))) TS_CounterpartyCommitmentSecrets_free(uint64_t this_obj) { + LDKCounterpartyCommitmentSecrets 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); + CounterpartyCommitmentSecrets_free(this_obj_conv); } -static inline uint64_t QueryShortChannelIds_clone_ptr(LDKQueryShortChannelIds *NONNULL_PTR arg) { - LDKQueryShortChannelIds ret_var = QueryShortChannelIds_clone(arg); +static inline uint64_t CounterpartyCommitmentSecrets_clone_ptr(LDKCounterpartyCommitmentSecrets *NONNULL_PTR arg) { + LDKCounterpartyCommitmentSecrets ret_var = CounterpartyCommitmentSecrets_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_QueryShortChannelIds_clone_ptr"))) TS_QueryShortChannelIds_clone_ptr(uint64_t arg) { - LDKQueryShortChannelIds arg_conv; +int64_t __attribute__((export_name("TS_CounterpartyCommitmentSecrets_clone_ptr"))) TS_CounterpartyCommitmentSecrets_clone_ptr(uint64_t arg) { + LDKCounterpartyCommitmentSecrets 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 = QueryShortChannelIds_clone_ptr(&arg_conv); + int64_t ret_conv = CounterpartyCommitmentSecrets_clone_ptr(&arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_QueryShortChannelIds_clone"))) TS_QueryShortChannelIds_clone(uint64_t orig) { - LDKQueryShortChannelIds orig_conv; +uint64_t __attribute__((export_name("TS_CounterpartyCommitmentSecrets_clone"))) TS_CounterpartyCommitmentSecrets_clone(uint64_t orig) { + LDKCounterpartyCommitmentSecrets 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; - LDKQueryShortChannelIds ret_var = QueryShortChannelIds_clone(&orig_conv); + LDKCounterpartyCommitmentSecrets ret_var = CounterpartyCommitmentSecrets_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_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); +uint64_t __attribute__((export_name("TS_CounterpartyCommitmentSecrets_new"))) TS_CounterpartyCommitmentSecrets_new() { + LDKCounterpartyCommitmentSecrets ret_var = CounterpartyCommitmentSecrets_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; +} + +int64_t __attribute__((export_name("TS_CounterpartyCommitmentSecrets_get_min_seen_secret"))) TS_CounterpartyCommitmentSecrets_get_min_seen_secret(uint64_t this_arg) { + LDKCounterpartyCommitmentSecrets 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 = CounterpartyCommitmentSecrets_get_min_seen_secret(&this_arg_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); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ReplyShortChannelIdsEnd_free(this_obj_conv); +uint64_t __attribute__((export_name("TS_CounterpartyCommitmentSecrets_provide_secret"))) TS_CounterpartyCommitmentSecrets_provide_secret(uint64_t this_arg, int64_t idx, int8_tArray secret) { + LDKCounterpartyCommitmentSecrets 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 secret_ref; + CHECK(secret->arr_len == 32); + memcpy(secret_ref.data, secret->elems, 32); FREE(secret); + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = CounterpartyCommitmentSecrets_provide_secret(&this_arg_conv, idx, secret_ref); + return tag_ptr(ret_conv, true); } -int8_tArray __attribute__((export_name("TS_ReplyShortChannelIdsEnd_get_chain_hash"))) TS_ReplyShortChannelIdsEnd_get_chain_hash(uint64_t this_ptr) { - LDKReplyShortChannelIdsEnd 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 __attribute__((export_name("TS_CounterpartyCommitmentSecrets_get_secret"))) TS_CounterpartyCommitmentSecrets_get_secret(uint64_t this_arg, int64_t idx) { + LDKCounterpartyCommitmentSecrets 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, *ReplyShortChannelIdsEnd_get_chain_hash(&this_ptr_conv), 32); + memcpy(ret_arr->elems, CounterpartyCommitmentSecrets_get_secret(&this_arg_conv, idx).data, 32); return ret_arr; } -void __attribute__((export_name("TS_ReplyShortChannelIdsEnd_set_chain_hash"))) TS_ReplyShortChannelIdsEnd_set_chain_hash(uint64_t this_ptr, int8_tArray val) { - LDKReplyShortChannelIdsEnd 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; - LDKThirtyTwoBytes val_ref; - CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); FREE(val); - ReplyShortChannelIdsEnd_set_chain_hash(&this_ptr_conv, val_ref); -} - -jboolean __attribute__((export_name("TS_ReplyShortChannelIdsEnd_get_full_information"))) TS_ReplyShortChannelIdsEnd_get_full_information(uint64_t this_ptr) { - LDKReplyShortChannelIdsEnd 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 = ReplyShortChannelIdsEnd_get_full_information(&this_ptr_conv); - return ret_conv; +int8_tArray __attribute__((export_name("TS_CounterpartyCommitmentSecrets_write"))) TS_CounterpartyCommitmentSecrets_write(uint64_t obj) { + LDKCounterpartyCommitmentSecrets 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 = CounterpartyCommitmentSecrets_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_ReplyShortChannelIdsEnd_set_full_information"))) TS_ReplyShortChannelIdsEnd_set_full_information(uint64_t this_ptr, jboolean val) { - LDKReplyShortChannelIdsEnd 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; - ReplyShortChannelIdsEnd_set_full_information(&this_ptr_conv, val); +uint64_t __attribute__((export_name("TS_CounterpartyCommitmentSecrets_read"))) TS_CounterpartyCommitmentSecrets_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ), "LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ"); + *ret_conv = CounterpartyCommitmentSecrets_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_ReplyShortChannelIdsEnd_new"))) TS_ReplyShortChannelIdsEnd_new(int8_tArray chain_hash_arg, jboolean full_information_arg) { - LDKThirtyTwoBytes chain_hash_arg_ref; - CHECK(chain_hash_arg->arr_len == 32); - memcpy(chain_hash_arg_ref.data, chain_hash_arg->elems, 32); FREE(chain_hash_arg); - LDKReplyShortChannelIdsEnd ret_var = ReplyShortChannelIdsEnd_new(chain_hash_arg_ref, full_information_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; +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); + uint8_t base_secret_arr[32]; + CHECK(base_secret->arr_len == 32); + memcpy(base_secret_arr, base_secret->elems, 32); FREE(base_secret); + 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; } -static inline uint64_t ReplyShortChannelIdsEnd_clone_ptr(LDKReplyShortChannelIdsEnd *NONNULL_PTR arg) { - LDKReplyShortChannelIdsEnd ret_var = ReplyShortChannelIdsEnd_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_ReplyShortChannelIdsEnd_clone_ptr"))) TS_ReplyShortChannelIdsEnd_clone_ptr(uint64_t arg) { - LDKReplyShortChannelIdsEnd 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 = ReplyShortChannelIdsEnd_clone_ptr(&arg_conv); - return ret_conv; +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); + 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_ReplyShortChannelIdsEnd_clone"))) TS_ReplyShortChannelIdsEnd_clone(uint64_t orig) { - LDKReplyShortChannelIdsEnd 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; - LDKReplyShortChannelIdsEnd ret_var = ReplyShortChannelIdsEnd_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; +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); + 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); + 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; } -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; +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); + 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_GossipTimestampFilter_free"))) TS_GossipTimestampFilter_free(uint64_t this_obj) { - LDKGossipTimestampFilter this_obj_conv; +void __attribute__((export_name("TS_TxCreationKeys_free"))) TS_TxCreationKeys_free(uint64_t this_obj) { + LDKTxCreationKeys 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); - GossipTimestampFilter_free(this_obj_conv); + TxCreationKeys_free(this_obj_conv); } -int8_tArray __attribute__((export_name("TS_GossipTimestampFilter_get_chain_hash"))) TS_GossipTimestampFilter_get_chain_hash(uint64_t this_ptr) { - LDKGossipTimestampFilter this_ptr_conv; +int8_tArray __attribute__((export_name("TS_TxCreationKeys_get_per_commitment_point"))) TS_TxCreationKeys_get_per_commitment_point(uint64_t this_ptr) { + LDKTxCreationKeys 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(32, __LINE__); - memcpy(ret_arr->elems, *GossipTimestampFilter_get_chain_hash(&this_ptr_conv), 32); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, TxCreationKeys_get_per_commitment_point(&this_ptr_conv).compressed_form, 33); return ret_arr; } -void __attribute__((export_name("TS_GossipTimestampFilter_set_chain_hash"))) TS_GossipTimestampFilter_set_chain_hash(uint64_t this_ptr, int8_tArray val) { - LDKGossipTimestampFilter this_ptr_conv; +void __attribute__((export_name("TS_TxCreationKeys_set_per_commitment_point"))) TS_TxCreationKeys_set_per_commitment_point(uint64_t this_ptr, int8_tArray val) { + LDKTxCreationKeys 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; - LDKThirtyTwoBytes val_ref; - CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); FREE(val); - GossipTimestampFilter_set_chain_hash(&this_ptr_conv, val_ref); + LDKPublicKey val_ref; + CHECK(val->arr_len == 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); + TxCreationKeys_set_per_commitment_point(&this_ptr_conv, val_ref); } -int32_t __attribute__((export_name("TS_GossipTimestampFilter_get_first_timestamp"))) TS_GossipTimestampFilter_get_first_timestamp(uint64_t this_ptr) { - LDKGossipTimestampFilter this_ptr_conv; +int8_tArray __attribute__((export_name("TS_TxCreationKeys_get_revocation_key"))) TS_TxCreationKeys_get_revocation_key(uint64_t this_ptr) { + LDKTxCreationKeys 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 = GossipTimestampFilter_get_first_timestamp(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, TxCreationKeys_get_revocation_key(&this_ptr_conv).compressed_form, 33); + return ret_arr; } -void __attribute__((export_name("TS_GossipTimestampFilter_set_first_timestamp"))) TS_GossipTimestampFilter_set_first_timestamp(uint64_t this_ptr, int32_t val) { - LDKGossipTimestampFilter this_ptr_conv; +void __attribute__((export_name("TS_TxCreationKeys_set_revocation_key"))) TS_TxCreationKeys_set_revocation_key(uint64_t this_ptr, int8_tArray val) { + LDKTxCreationKeys 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; - GossipTimestampFilter_set_first_timestamp(&this_ptr_conv, val); + LDKPublicKey val_ref; + CHECK(val->arr_len == 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); + TxCreationKeys_set_revocation_key(&this_ptr_conv, val_ref); } -int32_t __attribute__((export_name("TS_GossipTimestampFilter_get_timestamp_range"))) TS_GossipTimestampFilter_get_timestamp_range(uint64_t this_ptr) { - LDKGossipTimestampFilter this_ptr_conv; +int8_tArray __attribute__((export_name("TS_TxCreationKeys_get_broadcaster_htlc_key"))) TS_TxCreationKeys_get_broadcaster_htlc_key(uint64_t this_ptr) { + LDKTxCreationKeys 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 = GossipTimestampFilter_get_timestamp_range(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, TxCreationKeys_get_broadcaster_htlc_key(&this_ptr_conv).compressed_form, 33); + return ret_arr; } -void __attribute__((export_name("TS_GossipTimestampFilter_set_timestamp_range"))) TS_GossipTimestampFilter_set_timestamp_range(uint64_t this_ptr, int32_t val) { - LDKGossipTimestampFilter this_ptr_conv; +void __attribute__((export_name("TS_TxCreationKeys_set_broadcaster_htlc_key"))) TS_TxCreationKeys_set_broadcaster_htlc_key(uint64_t this_ptr, int8_tArray val) { + LDKTxCreationKeys 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; - GossipTimestampFilter_set_timestamp_range(&this_ptr_conv, val); -} - -uint64_t __attribute__((export_name("TS_GossipTimestampFilter_new"))) TS_GossipTimestampFilter_new(int8_tArray chain_hash_arg, int32_t first_timestamp_arg, int32_t timestamp_range_arg) { - LDKThirtyTwoBytes chain_hash_arg_ref; - CHECK(chain_hash_arg->arr_len == 32); - memcpy(chain_hash_arg_ref.data, chain_hash_arg->elems, 32); FREE(chain_hash_arg); - LDKGossipTimestampFilter ret_var = GossipTimestampFilter_new(chain_hash_arg_ref, first_timestamp_arg, timestamp_range_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 GossipTimestampFilter_clone_ptr(LDKGossipTimestampFilter *NONNULL_PTR arg) { - LDKGossipTimestampFilter ret_var = GossipTimestampFilter_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_GossipTimestampFilter_clone_ptr"))) TS_GossipTimestampFilter_clone_ptr(uint64_t arg) { - LDKGossipTimestampFilter 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 = GossipTimestampFilter_clone_ptr(&arg_conv); - return ret_conv; -} - -uint64_t __attribute__((export_name("TS_GossipTimestampFilter_clone"))) TS_GossipTimestampFilter_clone(uint64_t orig) { - LDKGossipTimestampFilter 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; - LDKGossipTimestampFilter ret_var = GossipTimestampFilter_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_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); - CHECK_ACCESS(this_ptr_ptr); - LDKErrorAction this_ptr_conv = *(LDKErrorAction*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - ErrorAction_free(this_ptr_conv); -} - -static inline uint64_t ErrorAction_clone_ptr(LDKErrorAction *NONNULL_PTR arg) { - LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); - *ret_copy = ErrorAction_clone(arg); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} -int64_t __attribute__((export_name("TS_ErrorAction_clone_ptr"))) TS_ErrorAction_clone_ptr(uint64_t arg) { - LDKErrorAction* arg_conv = (LDKErrorAction*)untag_ptr(arg); - int64_t ret_conv = ErrorAction_clone_ptr(arg_conv); - return ret_conv; -} - -uint64_t __attribute__((export_name("TS_ErrorAction_clone"))) TS_ErrorAction_clone(uint64_t orig) { - LDKErrorAction* orig_conv = (LDKErrorAction*)untag_ptr(orig); - LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); - *ret_copy = ErrorAction_clone(orig_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -uint64_t __attribute__((export_name("TS_ErrorAction_disconnect_peer"))) TS_ErrorAction_disconnect_peer(uint64_t msg) { - LDKErrorMessage 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 = ErrorMessage_clone(&msg_conv); - LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); - *ret_copy = ErrorAction_disconnect_peer(msg_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -uint64_t __attribute__((export_name("TS_ErrorAction_ignore_error"))) TS_ErrorAction_ignore_error() { - LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); - *ret_copy = ErrorAction_ignore_error(); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -uint64_t __attribute__((export_name("TS_ErrorAction_ignore_and_log"))) TS_ErrorAction_ignore_and_log(uint32_t a) { - LDKLevel a_conv = LDKLevel_from_js(a); - LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); - *ret_copy = ErrorAction_ignore_and_log(a_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -uint64_t __attribute__((export_name("TS_ErrorAction_ignore_duplicate_gossip"))) TS_ErrorAction_ignore_duplicate_gossip() { - LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); - *ret_copy = ErrorAction_ignore_duplicate_gossip(); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -uint64_t __attribute__((export_name("TS_ErrorAction_send_error_message"))) TS_ErrorAction_send_error_message(uint64_t msg) { - LDKErrorMessage 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 = ErrorMessage_clone(&msg_conv); - LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); - *ret_copy = ErrorAction_send_error_message(msg_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -uint64_t __attribute__((export_name("TS_ErrorAction_send_warning_message"))) TS_ErrorAction_send_warning_message(uint64_t msg, uint32_t log_level) { - LDKWarningMessage 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 = WarningMessage_clone(&msg_conv); - LDKLevel log_level_conv = LDKLevel_from_js(log_level); - LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); - *ret_copy = ErrorAction_send_warning_message(msg_conv, log_level_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -void __attribute__((export_name("TS_LightningError_free"))) TS_LightningError_free(uint64_t this_obj) { - LDKLightningError 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); - LightningError_free(this_obj_conv); + LDKPublicKey val_ref; + CHECK(val->arr_len == 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); + TxCreationKeys_set_broadcaster_htlc_key(&this_ptr_conv, val_ref); } -jstring __attribute__((export_name("TS_LightningError_get_err"))) TS_LightningError_get_err(uint64_t this_ptr) { - LDKLightningError this_ptr_conv; +int8_tArray __attribute__((export_name("TS_TxCreationKeys_get_countersignatory_htlc_key"))) TS_TxCreationKeys_get_countersignatory_htlc_key(uint64_t this_ptr) { + LDKTxCreationKeys 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 = LightningError_get_err(&this_ptr_conv); - jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len); - Str_free(ret_str); - return ret_conv; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, TxCreationKeys_get_countersignatory_htlc_key(&this_ptr_conv).compressed_form, 33); + return ret_arr; } -void __attribute__((export_name("TS_LightningError_set_err"))) TS_LightningError_set_err(uint64_t this_ptr, jstring val) { - LDKLightningError this_ptr_conv; +void __attribute__((export_name("TS_TxCreationKeys_set_countersignatory_htlc_key"))) TS_TxCreationKeys_set_countersignatory_htlc_key(uint64_t this_ptr, int8_tArray val) { + LDKTxCreationKeys 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); - LightningError_set_err(&this_ptr_conv, val_conv); + LDKPublicKey val_ref; + CHECK(val->arr_len == 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); + TxCreationKeys_set_countersignatory_htlc_key(&this_ptr_conv, val_ref); } -uint64_t __attribute__((export_name("TS_LightningError_get_action"))) TS_LightningError_get_action(uint64_t this_ptr) { - LDKLightningError this_ptr_conv; +int8_tArray __attribute__((export_name("TS_TxCreationKeys_get_broadcaster_delayed_payment_key"))) TS_TxCreationKeys_get_broadcaster_delayed_payment_key(uint64_t this_ptr) { + LDKTxCreationKeys 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; - LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); - *ret_copy = LightningError_get_action(&this_ptr_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, TxCreationKeys_get_broadcaster_delayed_payment_key(&this_ptr_conv).compressed_form, 33); + return ret_arr; } -void __attribute__((export_name("TS_LightningError_set_action"))) TS_LightningError_set_action(uint64_t this_ptr, uint64_t val) { - LDKLightningError this_ptr_conv; +void __attribute__((export_name("TS_TxCreationKeys_set_broadcaster_delayed_payment_key"))) TS_TxCreationKeys_set_broadcaster_delayed_payment_key(uint64_t this_ptr, int8_tArray val) { + LDKTxCreationKeys 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); - LDKErrorAction val_conv = *(LDKErrorAction*)(val_ptr); - val_conv = ErrorAction_clone((LDKErrorAction*)untag_ptr(val)); - LightningError_set_action(&this_ptr_conv, val_conv); + LDKPublicKey val_ref; + CHECK(val->arr_len == 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); + TxCreationKeys_set_broadcaster_delayed_payment_key(&this_ptr_conv, val_ref); } -uint64_t __attribute__((export_name("TS_LightningError_new"))) TS_LightningError_new(jstring err_arg, uint64_t action_arg) { - LDKStr err_arg_conv = str_ref_to_owned_c(err_arg); - void* action_arg_ptr = untag_ptr(action_arg); - CHECK_ACCESS(action_arg_ptr); - LDKErrorAction action_arg_conv = *(LDKErrorAction*)(action_arg_ptr); - action_arg_conv = ErrorAction_clone((LDKErrorAction*)untag_ptr(action_arg)); - LDKLightningError ret_var = LightningError_new(err_arg_conv, action_arg_conv); +uint64_t __attribute__((export_name("TS_TxCreationKeys_new"))) TS_TxCreationKeys_new(int8_tArray per_commitment_point_arg, int8_tArray revocation_key_arg, int8_tArray broadcaster_htlc_key_arg, int8_tArray countersignatory_htlc_key_arg, int8_tArray broadcaster_delayed_payment_key_arg) { + LDKPublicKey per_commitment_point_arg_ref; + CHECK(per_commitment_point_arg->arr_len == 33); + memcpy(per_commitment_point_arg_ref.compressed_form, per_commitment_point_arg->elems, 33); FREE(per_commitment_point_arg); + LDKPublicKey revocation_key_arg_ref; + CHECK(revocation_key_arg->arr_len == 33); + memcpy(revocation_key_arg_ref.compressed_form, revocation_key_arg->elems, 33); FREE(revocation_key_arg); + LDKPublicKey broadcaster_htlc_key_arg_ref; + CHECK(broadcaster_htlc_key_arg->arr_len == 33); + memcpy(broadcaster_htlc_key_arg_ref.compressed_form, broadcaster_htlc_key_arg->elems, 33); FREE(broadcaster_htlc_key_arg); + LDKPublicKey countersignatory_htlc_key_arg_ref; + CHECK(countersignatory_htlc_key_arg->arr_len == 33); + memcpy(countersignatory_htlc_key_arg_ref.compressed_form, countersignatory_htlc_key_arg->elems, 33); FREE(countersignatory_htlc_key_arg); + LDKPublicKey broadcaster_delayed_payment_key_arg_ref; + CHECK(broadcaster_delayed_payment_key_arg->arr_len == 33); + memcpy(broadcaster_delayed_payment_key_arg_ref.compressed_form, broadcaster_delayed_payment_key_arg->elems, 33); FREE(broadcaster_delayed_payment_key_arg); + LDKTxCreationKeys ret_var = TxCreationKeys_new(per_commitment_point_arg_ref, revocation_key_arg_ref, broadcaster_htlc_key_arg_ref, countersignatory_htlc_key_arg_ref, broadcaster_delayed_payment_key_arg_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; } -static inline uint64_t LightningError_clone_ptr(LDKLightningError *NONNULL_PTR arg) { - LDKLightningError ret_var = LightningError_clone(arg); +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; 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_LightningError_clone_ptr"))) TS_LightningError_clone_ptr(uint64_t arg) { - LDKLightningError arg_conv; +int64_t __attribute__((export_name("TS_TxCreationKeys_clone_ptr"))) TS_TxCreationKeys_clone_ptr(uint64_t arg) { + LDKTxCreationKeys 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 = LightningError_clone_ptr(&arg_conv); + int64_t ret_conv = TxCreationKeys_clone_ptr(&arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_LightningError_clone"))) TS_LightningError_clone(uint64_t orig) { - LDKLightningError orig_conv; +uint64_t __attribute__((export_name("TS_TxCreationKeys_clone"))) TS_TxCreationKeys_clone(uint64_t orig) { + LDKTxCreationKeys 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; - LDKLightningError ret_var = LightningError_clone(&orig_conv); + LDKTxCreationKeys ret_var = TxCreationKeys_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_CommitmentUpdate_free"))) TS_CommitmentUpdate_free(uint64_t this_obj) { - LDKCommitmentUpdate 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); - CommitmentUpdate_free(this_obj_conv); +int8_tArray __attribute__((export_name("TS_TxCreationKeys_write"))) TS_TxCreationKeys_write(uint64_t obj) { + LDKTxCreationKeys 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 = TxCreationKeys_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_tArray __attribute__((export_name("TS_CommitmentUpdate_get_update_add_htlcs"))) TS_CommitmentUpdate_get_update_add_htlcs(uint64_t this_ptr) { - LDKCommitmentUpdate 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; - LDKCVec_UpdateAddHTLCZ ret_var = CommitmentUpdate_get_update_add_htlcs(&this_ptr_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++) { - LDKUpdateAddHTLC ret_conv_15_var = ret_var.data[p]; - uint64_t ret_conv_15_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_15_var); - ret_conv_15_ref = tag_ptr(ret_conv_15_var.inner, ret_conv_15_var.is_owned); - ret_arr_ptr[p] = ret_conv_15_ref; - } - - FREE(ret_var.data); - return ret_arr; +uint64_t __attribute__((export_name("TS_TxCreationKeys_read"))) TS_TxCreationKeys_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ"); + *ret_conv = TxCreationKeys_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -void __attribute__((export_name("TS_CommitmentUpdate_set_update_add_htlcs"))) TS_CommitmentUpdate_set_update_add_htlcs(uint64_t this_ptr, uint64_tArray val) { - LDKCommitmentUpdate 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; - LDKCVec_UpdateAddHTLCZ val_constr; - val_constr.datalen = val->arr_len; - if (val_constr.datalen > 0) - val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateAddHTLC), "LDKCVec_UpdateAddHTLCZ Elements"); - else - val_constr.data = NULL; - uint64_t* val_vals = val->elems; - for (size_t p = 0; p < val_constr.datalen; p++) { - uint64_t val_conv_15 = val_vals[p]; - LDKUpdateAddHTLC val_conv_15_conv; - val_conv_15_conv.inner = untag_ptr(val_conv_15); - val_conv_15_conv.is_owned = ptr_is_owned(val_conv_15); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_15_conv); - val_conv_15_conv = UpdateAddHTLC_clone(&val_conv_15_conv); - val_constr.data[p] = val_conv_15_conv; - } - FREE(val); - CommitmentUpdate_set_update_add_htlcs(&this_ptr_conv, val_constr); +void __attribute__((export_name("TS_ChannelPublicKeys_free"))) TS_ChannelPublicKeys_free(uint64_t this_obj) { + LDKChannelPublicKeys 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); + ChannelPublicKeys_free(this_obj_conv); } -uint64_tArray __attribute__((export_name("TS_CommitmentUpdate_get_update_fulfill_htlcs"))) TS_CommitmentUpdate_get_update_fulfill_htlcs(uint64_t this_ptr) { - LDKCommitmentUpdate this_ptr_conv; +int8_tArray __attribute__((export_name("TS_ChannelPublicKeys_get_funding_pubkey"))) TS_ChannelPublicKeys_get_funding_pubkey(uint64_t this_ptr) { + LDKChannelPublicKeys 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; - LDKCVec_UpdateFulfillHTLCZ ret_var = CommitmentUpdate_get_update_fulfill_htlcs(&this_ptr_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 t = 0; t < ret_var.datalen; t++) { - LDKUpdateFulfillHTLC ret_conv_19_var = ret_var.data[t]; - uint64_t ret_conv_19_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_19_var); - ret_conv_19_ref = tag_ptr(ret_conv_19_var.inner, ret_conv_19_var.is_owned); - ret_arr_ptr[t] = ret_conv_19_ref; - } - - FREE(ret_var.data); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, ChannelPublicKeys_get_funding_pubkey(&this_ptr_conv).compressed_form, 33); return ret_arr; } -void __attribute__((export_name("TS_CommitmentUpdate_set_update_fulfill_htlcs"))) TS_CommitmentUpdate_set_update_fulfill_htlcs(uint64_t this_ptr, uint64_tArray val) { - LDKCommitmentUpdate this_ptr_conv; +void __attribute__((export_name("TS_ChannelPublicKeys_set_funding_pubkey"))) TS_ChannelPublicKeys_set_funding_pubkey(uint64_t this_ptr, int8_tArray val) { + LDKChannelPublicKeys 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; - LDKCVec_UpdateFulfillHTLCZ val_constr; - val_constr.datalen = val->arr_len; - if (val_constr.datalen > 0) - val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateFulfillHTLC), "LDKCVec_UpdateFulfillHTLCZ Elements"); - else - val_constr.data = NULL; - uint64_t* val_vals = val->elems; - for (size_t t = 0; t < val_constr.datalen; t++) { - uint64_t val_conv_19 = val_vals[t]; - LDKUpdateFulfillHTLC val_conv_19_conv; - val_conv_19_conv.inner = untag_ptr(val_conv_19); - val_conv_19_conv.is_owned = ptr_is_owned(val_conv_19); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_19_conv); - val_conv_19_conv = UpdateFulfillHTLC_clone(&val_conv_19_conv); - val_constr.data[t] = val_conv_19_conv; - } - FREE(val); - CommitmentUpdate_set_update_fulfill_htlcs(&this_ptr_conv, val_constr); + LDKPublicKey val_ref; + CHECK(val->arr_len == 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); + ChannelPublicKeys_set_funding_pubkey(&this_ptr_conv, val_ref); } -uint64_tArray __attribute__((export_name("TS_CommitmentUpdate_get_update_fail_htlcs"))) TS_CommitmentUpdate_get_update_fail_htlcs(uint64_t this_ptr) { - LDKCommitmentUpdate this_ptr_conv; +int8_tArray __attribute__((export_name("TS_ChannelPublicKeys_get_revocation_basepoint"))) TS_ChannelPublicKeys_get_revocation_basepoint(uint64_t this_ptr) { + LDKChannelPublicKeys 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; - LDKCVec_UpdateFailHTLCZ ret_var = CommitmentUpdate_get_update_fail_htlcs(&this_ptr_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 q = 0; q < ret_var.datalen; q++) { - LDKUpdateFailHTLC 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); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, ChannelPublicKeys_get_revocation_basepoint(&this_ptr_conv).compressed_form, 33); return ret_arr; } -void __attribute__((export_name("TS_CommitmentUpdate_set_update_fail_htlcs"))) TS_CommitmentUpdate_set_update_fail_htlcs(uint64_t this_ptr, uint64_tArray val) { - LDKCommitmentUpdate 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; - LDKCVec_UpdateFailHTLCZ val_constr; - val_constr.datalen = val->arr_len; - if (val_constr.datalen > 0) - val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateFailHTLC), "LDKCVec_UpdateFailHTLCZ Elements"); - else - val_constr.data = NULL; - uint64_t* val_vals = val->elems; - for (size_t q = 0; q < val_constr.datalen; q++) { - uint64_t val_conv_16 = val_vals[q]; - LDKUpdateFailHTLC val_conv_16_conv; - val_conv_16_conv.inner = untag_ptr(val_conv_16); - val_conv_16_conv.is_owned = ptr_is_owned(val_conv_16); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_16_conv); - val_conv_16_conv = UpdateFailHTLC_clone(&val_conv_16_conv); - val_constr.data[q] = val_conv_16_conv; - } - FREE(val); - CommitmentUpdate_set_update_fail_htlcs(&this_ptr_conv, val_constr); -} - -uint64_tArray __attribute__((export_name("TS_CommitmentUpdate_get_update_fail_malformed_htlcs"))) TS_CommitmentUpdate_get_update_fail_malformed_htlcs(uint64_t this_ptr) { - LDKCommitmentUpdate this_ptr_conv; +void __attribute__((export_name("TS_ChannelPublicKeys_set_revocation_basepoint"))) TS_ChannelPublicKeys_set_revocation_basepoint(uint64_t this_ptr, int8_tArray val) { + LDKChannelPublicKeys 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; - LDKCVec_UpdateFailMalformedHTLCZ ret_var = CommitmentUpdate_get_update_fail_malformed_htlcs(&this_ptr_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++) { - LDKUpdateFailMalformedHTLC ret_conv_25_var = ret_var.data[z]; - uint64_t ret_conv_25_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_25_var); - ret_conv_25_ref = tag_ptr(ret_conv_25_var.inner, ret_conv_25_var.is_owned); - ret_arr_ptr[z] = ret_conv_25_ref; - } - - FREE(ret_var.data); - return ret_arr; + LDKPublicKey val_ref; + CHECK(val->arr_len == 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); + ChannelPublicKeys_set_revocation_basepoint(&this_ptr_conv, val_ref); } -void __attribute__((export_name("TS_CommitmentUpdate_set_update_fail_malformed_htlcs"))) TS_CommitmentUpdate_set_update_fail_malformed_htlcs(uint64_t this_ptr, uint64_tArray val) { - LDKCommitmentUpdate this_ptr_conv; +int8_tArray __attribute__((export_name("TS_ChannelPublicKeys_get_payment_point"))) TS_ChannelPublicKeys_get_payment_point(uint64_t this_ptr) { + LDKChannelPublicKeys 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; - LDKCVec_UpdateFailMalformedHTLCZ val_constr; - val_constr.datalen = val->arr_len; - if (val_constr.datalen > 0) - val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateFailMalformedHTLC), "LDKCVec_UpdateFailMalformedHTLCZ Elements"); - else - val_constr.data = NULL; - uint64_t* val_vals = val->elems; - for (size_t z = 0; z < val_constr.datalen; z++) { - uint64_t val_conv_25 = val_vals[z]; - LDKUpdateFailMalformedHTLC val_conv_25_conv; - val_conv_25_conv.inner = untag_ptr(val_conv_25); - val_conv_25_conv.is_owned = ptr_is_owned(val_conv_25); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_25_conv); - val_conv_25_conv = UpdateFailMalformedHTLC_clone(&val_conv_25_conv); - val_constr.data[z] = val_conv_25_conv; - } - FREE(val); - CommitmentUpdate_set_update_fail_malformed_htlcs(&this_ptr_conv, val_constr); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, ChannelPublicKeys_get_payment_point(&this_ptr_conv).compressed_form, 33); + return ret_arr; } -uint64_t __attribute__((export_name("TS_CommitmentUpdate_get_update_fee"))) TS_CommitmentUpdate_get_update_fee(uint64_t this_ptr) { - LDKCommitmentUpdate this_ptr_conv; +void __attribute__((export_name("TS_ChannelPublicKeys_set_payment_point"))) TS_ChannelPublicKeys_set_payment_point(uint64_t this_ptr, int8_tArray val) { + LDKChannelPublicKeys 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; - LDKUpdateFee ret_var = CommitmentUpdate_get_update_fee(&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; + LDKPublicKey val_ref; + CHECK(val->arr_len == 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); + ChannelPublicKeys_set_payment_point(&this_ptr_conv, val_ref); } -void __attribute__((export_name("TS_CommitmentUpdate_set_update_fee"))) TS_CommitmentUpdate_set_update_fee(uint64_t this_ptr, uint64_t val) { - LDKCommitmentUpdate this_ptr_conv; +int8_tArray __attribute__((export_name("TS_ChannelPublicKeys_get_delayed_payment_basepoint"))) TS_ChannelPublicKeys_get_delayed_payment_basepoint(uint64_t this_ptr) { + LDKChannelPublicKeys 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; - LDKUpdateFee 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 = UpdateFee_clone(&val_conv); - CommitmentUpdate_set_update_fee(&this_ptr_conv, val_conv); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, ChannelPublicKeys_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form, 33); + return ret_arr; } -uint64_t __attribute__((export_name("TS_CommitmentUpdate_get_commitment_signed"))) TS_CommitmentUpdate_get_commitment_signed(uint64_t this_ptr) { - LDKCommitmentUpdate this_ptr_conv; +void __attribute__((export_name("TS_ChannelPublicKeys_set_delayed_payment_basepoint"))) TS_ChannelPublicKeys_set_delayed_payment_basepoint(uint64_t this_ptr, int8_tArray val) { + LDKChannelPublicKeys 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; - LDKCommitmentSigned ret_var = CommitmentUpdate_get_commitment_signed(&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; + LDKPublicKey val_ref; + CHECK(val->arr_len == 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); + ChannelPublicKeys_set_delayed_payment_basepoint(&this_ptr_conv, val_ref); } -void __attribute__((export_name("TS_CommitmentUpdate_set_commitment_signed"))) TS_CommitmentUpdate_set_commitment_signed(uint64_t this_ptr, uint64_t val) { - LDKCommitmentUpdate this_ptr_conv; +int8_tArray __attribute__((export_name("TS_ChannelPublicKeys_get_htlc_basepoint"))) TS_ChannelPublicKeys_get_htlc_basepoint(uint64_t this_ptr) { + LDKChannelPublicKeys 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; - LDKCommitmentSigned 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 = CommitmentSigned_clone(&val_conv); - CommitmentUpdate_set_commitment_signed(&this_ptr_conv, val_conv); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, ChannelPublicKeys_get_htlc_basepoint(&this_ptr_conv).compressed_form, 33); + return ret_arr; } -uint64_t __attribute__((export_name("TS_CommitmentUpdate_new"))) TS_CommitmentUpdate_new(uint64_tArray update_add_htlcs_arg, uint64_tArray update_fulfill_htlcs_arg, uint64_tArray update_fail_htlcs_arg, uint64_tArray update_fail_malformed_htlcs_arg, uint64_t update_fee_arg, uint64_t commitment_signed_arg) { - LDKCVec_UpdateAddHTLCZ update_add_htlcs_arg_constr; - update_add_htlcs_arg_constr.datalen = update_add_htlcs_arg->arr_len; - if (update_add_htlcs_arg_constr.datalen > 0) - update_add_htlcs_arg_constr.data = MALLOC(update_add_htlcs_arg_constr.datalen * sizeof(LDKUpdateAddHTLC), "LDKCVec_UpdateAddHTLCZ Elements"); - else - update_add_htlcs_arg_constr.data = NULL; - uint64_t* update_add_htlcs_arg_vals = update_add_htlcs_arg->elems; - for (size_t p = 0; p < update_add_htlcs_arg_constr.datalen; p++) { - uint64_t update_add_htlcs_arg_conv_15 = update_add_htlcs_arg_vals[p]; - LDKUpdateAddHTLC update_add_htlcs_arg_conv_15_conv; - update_add_htlcs_arg_conv_15_conv.inner = untag_ptr(update_add_htlcs_arg_conv_15); - update_add_htlcs_arg_conv_15_conv.is_owned = ptr_is_owned(update_add_htlcs_arg_conv_15); - CHECK_INNER_FIELD_ACCESS_OR_NULL(update_add_htlcs_arg_conv_15_conv); - update_add_htlcs_arg_conv_15_conv = UpdateAddHTLC_clone(&update_add_htlcs_arg_conv_15_conv); - update_add_htlcs_arg_constr.data[p] = update_add_htlcs_arg_conv_15_conv; - } - FREE(update_add_htlcs_arg); - LDKCVec_UpdateFulfillHTLCZ update_fulfill_htlcs_arg_constr; - update_fulfill_htlcs_arg_constr.datalen = update_fulfill_htlcs_arg->arr_len; - if (update_fulfill_htlcs_arg_constr.datalen > 0) - update_fulfill_htlcs_arg_constr.data = MALLOC(update_fulfill_htlcs_arg_constr.datalen * sizeof(LDKUpdateFulfillHTLC), "LDKCVec_UpdateFulfillHTLCZ Elements"); - else - update_fulfill_htlcs_arg_constr.data = NULL; - uint64_t* update_fulfill_htlcs_arg_vals = update_fulfill_htlcs_arg->elems; - for (size_t t = 0; t < update_fulfill_htlcs_arg_constr.datalen; t++) { - uint64_t update_fulfill_htlcs_arg_conv_19 = update_fulfill_htlcs_arg_vals[t]; - LDKUpdateFulfillHTLC update_fulfill_htlcs_arg_conv_19_conv; - update_fulfill_htlcs_arg_conv_19_conv.inner = untag_ptr(update_fulfill_htlcs_arg_conv_19); - update_fulfill_htlcs_arg_conv_19_conv.is_owned = ptr_is_owned(update_fulfill_htlcs_arg_conv_19); - CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fulfill_htlcs_arg_conv_19_conv); - update_fulfill_htlcs_arg_conv_19_conv = UpdateFulfillHTLC_clone(&update_fulfill_htlcs_arg_conv_19_conv); - update_fulfill_htlcs_arg_constr.data[t] = update_fulfill_htlcs_arg_conv_19_conv; - } - FREE(update_fulfill_htlcs_arg); - LDKCVec_UpdateFailHTLCZ update_fail_htlcs_arg_constr; - update_fail_htlcs_arg_constr.datalen = update_fail_htlcs_arg->arr_len; - if (update_fail_htlcs_arg_constr.datalen > 0) - update_fail_htlcs_arg_constr.data = MALLOC(update_fail_htlcs_arg_constr.datalen * sizeof(LDKUpdateFailHTLC), "LDKCVec_UpdateFailHTLCZ Elements"); - else - update_fail_htlcs_arg_constr.data = NULL; - uint64_t* update_fail_htlcs_arg_vals = update_fail_htlcs_arg->elems; - for (size_t q = 0; q < update_fail_htlcs_arg_constr.datalen; q++) { - uint64_t update_fail_htlcs_arg_conv_16 = update_fail_htlcs_arg_vals[q]; - LDKUpdateFailHTLC update_fail_htlcs_arg_conv_16_conv; - update_fail_htlcs_arg_conv_16_conv.inner = untag_ptr(update_fail_htlcs_arg_conv_16); - update_fail_htlcs_arg_conv_16_conv.is_owned = ptr_is_owned(update_fail_htlcs_arg_conv_16); - CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fail_htlcs_arg_conv_16_conv); - update_fail_htlcs_arg_conv_16_conv = UpdateFailHTLC_clone(&update_fail_htlcs_arg_conv_16_conv); - update_fail_htlcs_arg_constr.data[q] = update_fail_htlcs_arg_conv_16_conv; - } - FREE(update_fail_htlcs_arg); - LDKCVec_UpdateFailMalformedHTLCZ update_fail_malformed_htlcs_arg_constr; - update_fail_malformed_htlcs_arg_constr.datalen = update_fail_malformed_htlcs_arg->arr_len; - if (update_fail_malformed_htlcs_arg_constr.datalen > 0) - update_fail_malformed_htlcs_arg_constr.data = MALLOC(update_fail_malformed_htlcs_arg_constr.datalen * sizeof(LDKUpdateFailMalformedHTLC), "LDKCVec_UpdateFailMalformedHTLCZ Elements"); - else - update_fail_malformed_htlcs_arg_constr.data = NULL; - uint64_t* update_fail_malformed_htlcs_arg_vals = update_fail_malformed_htlcs_arg->elems; - for (size_t z = 0; z < update_fail_malformed_htlcs_arg_constr.datalen; z++) { - uint64_t update_fail_malformed_htlcs_arg_conv_25 = update_fail_malformed_htlcs_arg_vals[z]; - LDKUpdateFailMalformedHTLC update_fail_malformed_htlcs_arg_conv_25_conv; - update_fail_malformed_htlcs_arg_conv_25_conv.inner = untag_ptr(update_fail_malformed_htlcs_arg_conv_25); - update_fail_malformed_htlcs_arg_conv_25_conv.is_owned = ptr_is_owned(update_fail_malformed_htlcs_arg_conv_25); - CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fail_malformed_htlcs_arg_conv_25_conv); - update_fail_malformed_htlcs_arg_conv_25_conv = UpdateFailMalformedHTLC_clone(&update_fail_malformed_htlcs_arg_conv_25_conv); - update_fail_malformed_htlcs_arg_constr.data[z] = update_fail_malformed_htlcs_arg_conv_25_conv; - } - FREE(update_fail_malformed_htlcs_arg); - LDKUpdateFee update_fee_arg_conv; - update_fee_arg_conv.inner = untag_ptr(update_fee_arg); - update_fee_arg_conv.is_owned = ptr_is_owned(update_fee_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fee_arg_conv); - update_fee_arg_conv = UpdateFee_clone(&update_fee_arg_conv); - LDKCommitmentSigned commitment_signed_arg_conv; - commitment_signed_arg_conv.inner = untag_ptr(commitment_signed_arg); - commitment_signed_arg_conv.is_owned = ptr_is_owned(commitment_signed_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_signed_arg_conv); - commitment_signed_arg_conv = CommitmentSigned_clone(&commitment_signed_arg_conv); - LDKCommitmentUpdate ret_var = CommitmentUpdate_new(update_add_htlcs_arg_constr, update_fulfill_htlcs_arg_constr, update_fail_htlcs_arg_constr, update_fail_malformed_htlcs_arg_constr, update_fee_arg_conv, commitment_signed_arg_conv); +void __attribute__((export_name("TS_ChannelPublicKeys_set_htlc_basepoint"))) TS_ChannelPublicKeys_set_htlc_basepoint(uint64_t this_ptr, int8_tArray val) { + LDKChannelPublicKeys 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); + ChannelPublicKeys_set_htlc_basepoint(&this_ptr_conv, val_ref); +} + +uint64_t __attribute__((export_name("TS_ChannelPublicKeys_new"))) TS_ChannelPublicKeys_new(int8_tArray funding_pubkey_arg, int8_tArray revocation_basepoint_arg, int8_tArray payment_point_arg, int8_tArray delayed_payment_basepoint_arg, int8_tArray htlc_basepoint_arg) { + LDKPublicKey funding_pubkey_arg_ref; + CHECK(funding_pubkey_arg->arr_len == 33); + memcpy(funding_pubkey_arg_ref.compressed_form, funding_pubkey_arg->elems, 33); FREE(funding_pubkey_arg); + LDKPublicKey revocation_basepoint_arg_ref; + CHECK(revocation_basepoint_arg->arr_len == 33); + memcpy(revocation_basepoint_arg_ref.compressed_form, revocation_basepoint_arg->elems, 33); FREE(revocation_basepoint_arg); + LDKPublicKey payment_point_arg_ref; + CHECK(payment_point_arg->arr_len == 33); + memcpy(payment_point_arg_ref.compressed_form, payment_point_arg->elems, 33); FREE(payment_point_arg); + LDKPublicKey delayed_payment_basepoint_arg_ref; + CHECK(delayed_payment_basepoint_arg->arr_len == 33); + memcpy(delayed_payment_basepoint_arg_ref.compressed_form, delayed_payment_basepoint_arg->elems, 33); FREE(delayed_payment_basepoint_arg); + LDKPublicKey htlc_basepoint_arg_ref; + CHECK(htlc_basepoint_arg->arr_len == 33); + memcpy(htlc_basepoint_arg_ref.compressed_form, htlc_basepoint_arg->elems, 33); FREE(htlc_basepoint_arg); + LDKChannelPublicKeys ret_var = ChannelPublicKeys_new(funding_pubkey_arg_ref, revocation_basepoint_arg_ref, payment_point_arg_ref, delayed_payment_basepoint_arg_ref, htlc_basepoint_arg_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; } -static inline uint64_t CommitmentUpdate_clone_ptr(LDKCommitmentUpdate *NONNULL_PTR arg) { - LDKCommitmentUpdate ret_var = CommitmentUpdate_clone(arg); +static inline uint64_t ChannelPublicKeys_clone_ptr(LDKChannelPublicKeys *NONNULL_PTR arg) { + LDKChannelPublicKeys ret_var = ChannelPublicKeys_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_CommitmentUpdate_clone_ptr"))) TS_CommitmentUpdate_clone_ptr(uint64_t arg) { - LDKCommitmentUpdate arg_conv; +int64_t __attribute__((export_name("TS_ChannelPublicKeys_clone_ptr"))) TS_ChannelPublicKeys_clone_ptr(uint64_t arg) { + LDKChannelPublicKeys 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 = CommitmentUpdate_clone_ptr(&arg_conv); + int64_t ret_conv = ChannelPublicKeys_clone_ptr(&arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_CommitmentUpdate_clone"))) TS_CommitmentUpdate_clone(uint64_t orig) { - LDKCommitmentUpdate orig_conv; +uint64_t __attribute__((export_name("TS_ChannelPublicKeys_clone"))) TS_ChannelPublicKeys_clone(uint64_t orig) { + LDKChannelPublicKeys 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; - LDKCommitmentUpdate ret_var = CommitmentUpdate_clone(&orig_conv); + LDKChannelPublicKeys ret_var = ChannelPublicKeys_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_CommitmentUpdate_eq"))) TS_CommitmentUpdate_eq(uint64_t a, uint64_t b) { - LDKCommitmentUpdate a_conv; +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; - LDKCommitmentUpdate b_conv; + 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 = CommitmentUpdate_eq(&a_conv, &b_conv); + jboolean ret_conv = ChannelPublicKeys_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); - CHECK_ACCESS(this_ptr_ptr); - LDKChannelMessageHandler this_ptr_conv = *(LDKChannelMessageHandler*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - ChannelMessageHandler_free(this_ptr_conv); -} - -void __attribute__((export_name("TS_RoutingMessageHandler_free"))) TS_RoutingMessageHandler_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); - LDKRoutingMessageHandler this_ptr_conv = *(LDKRoutingMessageHandler*)(this_ptr_ptr); - FREE(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; +int8_tArray __attribute__((export_name("TS_ChannelPublicKeys_write"))) TS_ChannelPublicKeys_write(uint64_t obj) { + LDKChannelPublicKeys 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 = AcceptChannel_write(&obj_conv); + LDKCVec_u8Z ret_var = ChannelPublicKeys_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_AcceptChannel_read"))) TS_AcceptChannel_read(int8_tArray ser) { +uint64_t __attribute__((export_name("TS_ChannelPublicKeys_read"))) TS_ChannelPublicKeys_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; ser_ref.data = ser->elems; - LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ"); - *ret_conv = AcceptChannel_read(ser_ref); + LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ"); + *ret_conv = ChannelPublicKeys_read(ser_ref); FREE(ser); return tag_ptr(ret_conv, true); } -int8_tArray __attribute__((export_name("TS_AnnouncementSignatures_write"))) TS_AnnouncementSignatures_write(uint64_t obj) { - LDKAnnouncementSignatures 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 = AnnouncementSignatures_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_TxCreationKeys_derive_new"))) TS_TxCreationKeys_derive_new(int8_tArray per_commitment_point, int8_tArray broadcaster_delayed_payment_base, int8_tArray broadcaster_htlc_base, int8_tArray countersignatory_revocation_base, int8_tArray countersignatory_htlc_base) { + 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 broadcaster_delayed_payment_base_ref; + CHECK(broadcaster_delayed_payment_base->arr_len == 33); + memcpy(broadcaster_delayed_payment_base_ref.compressed_form, broadcaster_delayed_payment_base->elems, 33); FREE(broadcaster_delayed_payment_base); + LDKPublicKey broadcaster_htlc_base_ref; + CHECK(broadcaster_htlc_base->arr_len == 33); + memcpy(broadcaster_htlc_base_ref.compressed_form, broadcaster_htlc_base->elems, 33); FREE(broadcaster_htlc_base); + LDKPublicKey countersignatory_revocation_base_ref; + CHECK(countersignatory_revocation_base->arr_len == 33); + memcpy(countersignatory_revocation_base_ref.compressed_form, countersignatory_revocation_base->elems, 33); FREE(countersignatory_revocation_base); + 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); + 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_AnnouncementSignatures_read"))) TS_AnnouncementSignatures_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ"); - *ret_conv = AnnouncementSignatures_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +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) { + 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); + LDKChannelPublicKeys broadcaster_keys_conv; + broadcaster_keys_conv.inner = untag_ptr(broadcaster_keys); + broadcaster_keys_conv.is_owned = ptr_is_owned(broadcaster_keys); + CHECK_INNER_FIELD_ACCESS_OR_NULL(broadcaster_keys_conv); + broadcaster_keys_conv.is_owned = false; + LDKChannelPublicKeys countersignatory_keys_conv; + countersignatory_keys_conv.inner = untag_ptr(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; + 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_ChannelReestablish_write"))) TS_ChannelReestablish_write(uint64_t obj) { - LDKChannelReestablish 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 = ChannelReestablish_write(&obj_conv); +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) { + LDKPublicKey revocation_key_ref; + CHECK(revocation_key->arr_len == 33); + memcpy(revocation_key_ref.compressed_form, revocation_key->elems, 33); FREE(revocation_key); + LDKPublicKey broadcaster_delayed_payment_key_ref; + CHECK(broadcaster_delayed_payment_key->arr_len == 33); + memcpy(broadcaster_delayed_payment_key_ref.compressed_form, broadcaster_delayed_payment_key->elems, 33); FREE(broadcaster_delayed_payment_key); + LDKCVec_u8Z ret_var = get_revokeable_redeemscript(revocation_key_ref, contest_delay, broadcaster_delayed_payment_key_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; } -uint64_t __attribute__((export_name("TS_ChannelReestablish_read"))) TS_ChannelReestablish_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ"); - *ret_conv = ChannelReestablish_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +void __attribute__((export_name("TS_HTLCOutputInCommitment_free"))) TS_HTLCOutputInCommitment_free(uint64_t this_obj) { + LDKHTLCOutputInCommitment 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); + HTLCOutputInCommitment_free(this_obj_conv); } -int8_tArray __attribute__((export_name("TS_ClosingSigned_write"))) TS_ClosingSigned_write(uint64_t obj) { - LDKClosingSigned 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 = ClosingSigned_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; +jboolean __attribute__((export_name("TS_HTLCOutputInCommitment_get_offered"))) TS_HTLCOutputInCommitment_get_offered(uint64_t this_ptr) { + LDKHTLCOutputInCommitment 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 = HTLCOutputInCommitment_get_offered(&this_ptr_conv); + return ret_conv; } -uint64_t __attribute__((export_name("TS_ClosingSigned_read"))) TS_ClosingSigned_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ"); - *ret_conv = ClosingSigned_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +void __attribute__((export_name("TS_HTLCOutputInCommitment_set_offered"))) TS_HTLCOutputInCommitment_set_offered(uint64_t this_ptr, jboolean val) { + LDKHTLCOutputInCommitment 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; + HTLCOutputInCommitment_set_offered(&this_ptr_conv, val); } -int8_tArray __attribute__((export_name("TS_ClosingSignedFeeRange_write"))) TS_ClosingSignedFeeRange_write(uint64_t obj) { - LDKClosingSignedFeeRange 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 = ClosingSignedFeeRange_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; +int64_t __attribute__((export_name("TS_HTLCOutputInCommitment_get_amount_msat"))) TS_HTLCOutputInCommitment_get_amount_msat(uint64_t this_ptr) { + LDKHTLCOutputInCommitment 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 = HTLCOutputInCommitment_get_amount_msat(&this_ptr_conv); + return ret_conv; } -uint64_t __attribute__((export_name("TS_ClosingSignedFeeRange_read"))) TS_ClosingSignedFeeRange_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ"); - *ret_conv = ClosingSignedFeeRange_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +void __attribute__((export_name("TS_HTLCOutputInCommitment_set_amount_msat"))) TS_HTLCOutputInCommitment_set_amount_msat(uint64_t this_ptr, int64_t val) { + LDKHTLCOutputInCommitment 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; + HTLCOutputInCommitment_set_amount_msat(&this_ptr_conv, val); } -int8_tArray __attribute__((export_name("TS_CommitmentSigned_write"))) TS_CommitmentSigned_write(uint64_t obj) { - LDKCommitmentSigned 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 = CommitmentSigned_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); +int32_t __attribute__((export_name("TS_HTLCOutputInCommitment_get_cltv_expiry"))) TS_HTLCOutputInCommitment_get_cltv_expiry(uint64_t this_ptr) { + LDKHTLCOutputInCommitment 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 = HTLCOutputInCommitment_get_cltv_expiry(&this_ptr_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_HTLCOutputInCommitment_set_cltv_expiry"))) TS_HTLCOutputInCommitment_set_cltv_expiry(uint64_t this_ptr, int32_t val) { + LDKHTLCOutputInCommitment 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; + HTLCOutputInCommitment_set_cltv_expiry(&this_ptr_conv, val); +} + +int8_tArray __attribute__((export_name("TS_HTLCOutputInCommitment_get_payment_hash"))) TS_HTLCOutputInCommitment_get_payment_hash(uint64_t this_ptr) { + LDKHTLCOutputInCommitment 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(32, __LINE__); + memcpy(ret_arr->elems, *HTLCOutputInCommitment_get_payment_hash(&this_ptr_conv), 32); return ret_arr; } -uint64_t __attribute__((export_name("TS_CommitmentSigned_read"))) TS_CommitmentSigned_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ"); - *ret_conv = CommitmentSigned_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +void __attribute__((export_name("TS_HTLCOutputInCommitment_set_payment_hash"))) TS_HTLCOutputInCommitment_set_payment_hash(uint64_t this_ptr, int8_tArray val) { + LDKHTLCOutputInCommitment 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; + LDKThirtyTwoBytes val_ref; + CHECK(val->arr_len == 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); + HTLCOutputInCommitment_set_payment_hash(&this_ptr_conv, val_ref); +} + +uint64_t __attribute__((export_name("TS_HTLCOutputInCommitment_get_transaction_output_index"))) TS_HTLCOutputInCommitment_get_transaction_output_index(uint64_t this_ptr) { + LDKHTLCOutputInCommitment 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 = HTLCOutputInCommitment_get_transaction_output_index(&this_ptr_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void __attribute__((export_name("TS_HTLCOutputInCommitment_set_transaction_output_index"))) TS_HTLCOutputInCommitment_set_transaction_output_index(uint64_t this_ptr, uint64_t val) { + LDKHTLCOutputInCommitment 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)); + HTLCOutputInCommitment_set_transaction_output_index(&this_ptr_conv, val_conv); +} + +uint64_t __attribute__((export_name("TS_HTLCOutputInCommitment_new"))) TS_HTLCOutputInCommitment_new(jboolean offered_arg, int64_t amount_msat_arg, int32_t cltv_expiry_arg, int8_tArray payment_hash_arg, uint64_t transaction_output_index_arg) { + LDKThirtyTwoBytes payment_hash_arg_ref; + CHECK(payment_hash_arg->arr_len == 32); + memcpy(payment_hash_arg_ref.data, payment_hash_arg->elems, 32); FREE(payment_hash_arg); + void* transaction_output_index_arg_ptr = untag_ptr(transaction_output_index_arg); + CHECK_ACCESS(transaction_output_index_arg_ptr); + LDKCOption_u32Z transaction_output_index_arg_conv = *(LDKCOption_u32Z*)(transaction_output_index_arg_ptr); + transaction_output_index_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(transaction_output_index_arg)); + LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_new(offered_arg, amount_msat_arg, cltv_expiry_arg, payment_hash_arg_ref, transaction_output_index_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; +} + +static inline uint64_t HTLCOutputInCommitment_clone_ptr(LDKHTLCOutputInCommitment *NONNULL_PTR arg) { + LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_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_HTLCOutputInCommitment_clone_ptr"))) TS_HTLCOutputInCommitment_clone_ptr(uint64_t arg) { + LDKHTLCOutputInCommitment 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 = HTLCOutputInCommitment_clone_ptr(&arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_HTLCOutputInCommitment_clone"))) TS_HTLCOutputInCommitment_clone(uint64_t orig) { + LDKHTLCOutputInCommitment 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; + LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_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_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_FundingCreated_write"))) TS_FundingCreated_write(uint64_t obj) { - LDKFundingCreated obj_conv; +int8_tArray __attribute__((export_name("TS_HTLCOutputInCommitment_write"))) TS_HTLCOutputInCommitment_write(uint64_t obj) { + LDKHTLCOutputInCommitment 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 = FundingCreated_write(&obj_conv); + LDKCVec_u8Z ret_var = HTLCOutputInCommitment_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_FundingCreated_read"))) TS_FundingCreated_read(int8_tArray ser) { +uint64_t __attribute__((export_name("TS_HTLCOutputInCommitment_read"))) TS_HTLCOutputInCommitment_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; ser_ref.data = ser->elems; - LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ"); - *ret_conv = FundingCreated_read(ser_ref); + LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ"); + *ret_conv = HTLCOutputInCommitment_read(ser_ref); FREE(ser); return tag_ptr(ret_conv, true); } -int8_tArray __attribute__((export_name("TS_FundingSigned_write"))) TS_FundingSigned_write(uint64_t obj) { - LDKFundingSigned 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 = FundingSigned_write(&obj_conv); +int8_tArray __attribute__((export_name("TS_get_htlc_redeemscript"))) TS_get_htlc_redeemscript(uint64_t htlc, jboolean opt_anchors, uint64_t keys) { + LDKHTLCOutputInCommitment htlc_conv; + htlc_conv.inner = untag_ptr(htlc); + htlc_conv.is_owned = ptr_is_owned(htlc); + CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_conv); + htlc_conv.is_owned = false; + LDKTxCreationKeys keys_conv; + keys_conv.inner = untag_ptr(keys); + keys_conv.is_owned = ptr_is_owned(keys); + CHECK_INNER_FIELD_ACCESS_OR_NULL(keys_conv); + keys_conv.is_owned = false; + LDKCVec_u8Z ret_var = get_htlc_redeemscript(&htlc_conv, opt_anchors, &keys_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_FundingSigned_read"))) TS_FundingSigned_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ"); - *ret_conv = FundingSigned_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); -} - -int8_tArray __attribute__((export_name("TS_ChannelReady_write"))) TS_ChannelReady_write(uint64_t obj) { - LDKChannelReady 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 = ChannelReady_write(&obj_conv); +int8_tArray __attribute__((export_name("TS_make_funding_redeemscript"))) TS_make_funding_redeemscript(int8_tArray broadcaster, int8_tArray countersignatory) { + LDKPublicKey broadcaster_ref; + CHECK(broadcaster->arr_len == 33); + memcpy(broadcaster_ref.compressed_form, broadcaster->elems, 33); FREE(broadcaster); + LDKPublicKey countersignatory_ref; + CHECK(countersignatory->arr_len == 33); + memcpy(countersignatory_ref.compressed_form, countersignatory->elems, 33); FREE(countersignatory); + LDKCVec_u8Z ret_var = make_funding_redeemscript(broadcaster_ref, countersignatory_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; } -uint64_t __attribute__((export_name("TS_ChannelReady_read"))) TS_ChannelReady_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_ChannelReadyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReadyDecodeErrorZ), "LDKCResult_ChannelReadyDecodeErrorZ"); - *ret_conv = ChannelReady_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); -} - -int8_tArray __attribute__((export_name("TS_Init_write"))) TS_Init_write(uint64_t obj) { - LDKInit 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 = Init_write(&obj_conv); +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); + 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); + CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_conv); + htlc_conv.is_owned = false; + LDKPublicKey broadcaster_delayed_payment_key_ref; + CHECK(broadcaster_delayed_payment_key->arr_len == 33); + memcpy(broadcaster_delayed_payment_key_ref.compressed_form, broadcaster_delayed_payment_key->elems, 33); FREE(broadcaster_delayed_payment_key); + 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, 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); - CVec_u8Z_free(ret_var); + Transaction_free(ret_var); return ret_arr; } -uint64_t __attribute__((export_name("TS_Init_read"))) TS_Init_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ"); - *ret_conv = Init_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +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_OpenChannel_write"))) TS_OpenChannel_write(uint64_t obj) { - LDKOpenChannel 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 = OpenChannel_write(&obj_conv); +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; } -uint64_t __attribute__((export_name("TS_OpenChannel_read"))) TS_OpenChannel_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ"); - *ret_conv = OpenChannel_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); -} - -int8_tArray __attribute__((export_name("TS_RevokeAndACK_write"))) TS_RevokeAndACK_write(uint64_t obj) { - LDKRevokeAndACK 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 = RevokeAndACK_write(&obj_conv); +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); + memcpy(funding_pubkey_ref.compressed_form, funding_pubkey->elems, 33); FREE(funding_pubkey); + LDKCVec_u8Z ret_var = get_anchor_redeemscript(funding_pubkey_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; } -uint64_t __attribute__((export_name("TS_RevokeAndACK_read"))) TS_RevokeAndACK_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ"); - *ret_conv = RevokeAndACK_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); -} - -int8_tArray __attribute__((export_name("TS_Shutdown_write"))) TS_Shutdown_write(uint64_t obj) { - LDKShutdown 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 = Shutdown_write(&obj_conv); +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); - CVec_u8Z_free(ret_var); + Witness_free(ret_var); return ret_arr; } -uint64_t __attribute__((export_name("TS_Shutdown_read"))) TS_Shutdown_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ"); - *ret_conv = Shutdown_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +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); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ChannelTransactionParameters_free(this_obj_conv); } -int8_tArray __attribute__((export_name("TS_UpdateFailHTLC_write"))) TS_UpdateFailHTLC_write(uint64_t obj) { - LDKUpdateFailHTLC 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 = UpdateFailHTLC_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_ChannelTransactionParameters_get_holder_pubkeys"))) TS_ChannelTransactionParameters_get_holder_pubkeys(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; + LDKChannelPublicKeys ret_var = ChannelTransactionParameters_get_holder_pubkeys(&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; } -uint64_t __attribute__((export_name("TS_UpdateFailHTLC_read"))) TS_UpdateFailHTLC_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ"); - *ret_conv = UpdateFailHTLC_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +void __attribute__((export_name("TS_ChannelTransactionParameters_set_holder_pubkeys"))) TS_ChannelTransactionParameters_set_holder_pubkeys(uint64_t this_ptr, uint64_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; + LDKChannelPublicKeys 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 = ChannelPublicKeys_clone(&val_conv); + ChannelTransactionParameters_set_holder_pubkeys(&this_ptr_conv, val_conv); } -int8_tArray __attribute__((export_name("TS_UpdateFailMalformedHTLC_write"))) TS_UpdateFailMalformedHTLC_write(uint64_t obj) { - LDKUpdateFailMalformedHTLC 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 = UpdateFailMalformedHTLC_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; +int16_t __attribute__((export_name("TS_ChannelTransactionParameters_get_holder_selected_contest_delay"))) TS_ChannelTransactionParameters_get_holder_selected_contest_delay(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; + int16_t ret_conv = ChannelTransactionParameters_get_holder_selected_contest_delay(&this_ptr_conv); + return ret_conv; } -uint64_t __attribute__((export_name("TS_UpdateFailMalformedHTLC_read"))) TS_UpdateFailMalformedHTLC_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ"); - *ret_conv = UpdateFailMalformedHTLC_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +void __attribute__((export_name("TS_ChannelTransactionParameters_set_holder_selected_contest_delay"))) TS_ChannelTransactionParameters_set_holder_selected_contest_delay(uint64_t this_ptr, int16_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; + ChannelTransactionParameters_set_holder_selected_contest_delay(&this_ptr_conv, val); } -int8_tArray __attribute__((export_name("TS_UpdateFee_write"))) TS_UpdateFee_write(uint64_t obj) { - LDKUpdateFee 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 = UpdateFee_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; +jboolean __attribute__((export_name("TS_ChannelTransactionParameters_get_is_outbound_from_holder"))) TS_ChannelTransactionParameters_get_is_outbound_from_holder(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; + jboolean ret_conv = ChannelTransactionParameters_get_is_outbound_from_holder(&this_ptr_conv); + return ret_conv; } -uint64_t __attribute__((export_name("TS_UpdateFee_read"))) TS_UpdateFee_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ"); - *ret_conv = UpdateFee_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +void __attribute__((export_name("TS_ChannelTransactionParameters_set_is_outbound_from_holder"))) TS_ChannelTransactionParameters_set_is_outbound_from_holder(uint64_t this_ptr, jboolean 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; + ChannelTransactionParameters_set_is_outbound_from_holder(&this_ptr_conv, val); } -int8_tArray __attribute__((export_name("TS_UpdateFulfillHTLC_write"))) TS_UpdateFulfillHTLC_write(uint64_t obj) { - LDKUpdateFulfillHTLC 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 = UpdateFulfillHTLC_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_ChannelTransactionParameters_get_counterparty_parameters"))) TS_ChannelTransactionParameters_get_counterparty_parameters(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; + LDKCounterpartyChannelTransactionParameters ret_var = ChannelTransactionParameters_get_counterparty_parameters(&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; } -uint64_t __attribute__((export_name("TS_UpdateFulfillHTLC_read"))) TS_UpdateFulfillHTLC_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ"); - *ret_conv = UpdateFulfillHTLC_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +void __attribute__((export_name("TS_ChannelTransactionParameters_set_counterparty_parameters"))) TS_ChannelTransactionParameters_set_counterparty_parameters(uint64_t this_ptr, uint64_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; + LDKCounterpartyChannelTransactionParameters 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 = CounterpartyChannelTransactionParameters_clone(&val_conv); + ChannelTransactionParameters_set_counterparty_parameters(&this_ptr_conv, val_conv); } -int8_tArray __attribute__((export_name("TS_UpdateAddHTLC_write"))) TS_UpdateAddHTLC_write(uint64_t obj) { - LDKUpdateAddHTLC 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 = UpdateAddHTLC_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_ChannelTransactionParameters_get_funding_outpoint"))) TS_ChannelTransactionParameters_get_funding_outpoint(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; + LDKOutPoint ret_var = ChannelTransactionParameters_get_funding_outpoint(&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_ChannelTransactionParameters_set_funding_outpoint"))) TS_ChannelTransactionParameters_set_funding_outpoint(uint64_t this_ptr, uint64_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; + LDKOutPoint 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 = OutPoint_clone(&val_conv); + ChannelTransactionParameters_set_funding_outpoint(&this_ptr_conv, val_conv); +} + +uint32_t __attribute__((export_name("TS_ChannelTransactionParameters_get_opt_anchors"))) TS_ChannelTransactionParameters_get_opt_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_anchors(&this_ptr_conv)); + return ret_conv; +} + +void __attribute__((export_name("TS_ChannelTransactionParameters_set_opt_anchors"))) TS_ChannelTransactionParameters_set_opt_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_anchors(&this_ptr_conv, val_conv); +} + +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(holder_pubkeys_arg_conv); + holder_pubkeys_arg_conv = ChannelPublicKeys_clone(&holder_pubkeys_arg_conv); + LDKCounterpartyChannelTransactionParameters counterparty_parameters_arg_conv; + counterparty_parameters_arg_conv.inner = untag_ptr(counterparty_parameters_arg); + counterparty_parameters_arg_conv.is_owned = ptr_is_owned(counterparty_parameters_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(counterparty_parameters_arg_conv); + counterparty_parameters_arg_conv = CounterpartyChannelTransactionParameters_clone(&counterparty_parameters_arg_conv); + LDKOutPoint funding_outpoint_arg_conv; + funding_outpoint_arg_conv.inner = untag_ptr(funding_outpoint_arg); + funding_outpoint_arg_conv.is_owned = ptr_is_owned(funding_outpoint_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); + 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); + return ret_ref; +} + +static inline uint64_t ChannelTransactionParameters_clone_ptr(LDKChannelTransactionParameters *NONNULL_PTR arg) { + LDKChannelTransactionParameters ret_var = ChannelTransactionParameters_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_ChannelTransactionParameters_clone_ptr"))) TS_ChannelTransactionParameters_clone_ptr(uint64_t arg) { + LDKChannelTransactionParameters 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 = ChannelTransactionParameters_clone_ptr(&arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_ChannelTransactionParameters_clone"))) TS_ChannelTransactionParameters_clone(uint64_t orig) { + LDKChannelTransactionParameters 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; + LDKChannelTransactionParameters ret_var = ChannelTransactionParameters_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_ChannelTransactionParameters_eq"))) TS_ChannelTransactionParameters_eq(uint64_t a, uint64_t b) { + LDKChannelTransactionParameters 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; + LDKChannelTransactionParameters 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 = ChannelTransactionParameters_eq(&a_conv, &b_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_CounterpartyChannelTransactionParameters_free"))) TS_CounterpartyChannelTransactionParameters_free(uint64_t this_obj) { + LDKCounterpartyChannelTransactionParameters 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); + CounterpartyChannelTransactionParameters_free(this_obj_conv); +} + +uint64_t __attribute__((export_name("TS_CounterpartyChannelTransactionParameters_get_pubkeys"))) TS_CounterpartyChannelTransactionParameters_get_pubkeys(uint64_t this_ptr) { + LDKCounterpartyChannelTransactionParameters 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; + LDKChannelPublicKeys ret_var = CounterpartyChannelTransactionParameters_get_pubkeys(&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; } -uint64_t __attribute__((export_name("TS_UpdateAddHTLC_read"))) TS_UpdateAddHTLC_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ"); - *ret_conv = UpdateAddHTLC_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +void __attribute__((export_name("TS_CounterpartyChannelTransactionParameters_set_pubkeys"))) TS_CounterpartyChannelTransactionParameters_set_pubkeys(uint64_t this_ptr, uint64_t val) { + LDKCounterpartyChannelTransactionParameters 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; + LDKChannelPublicKeys 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 = ChannelPublicKeys_clone(&val_conv); + CounterpartyChannelTransactionParameters_set_pubkeys(&this_ptr_conv, val_conv); } -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); +int16_t __attribute__((export_name("TS_CounterpartyChannelTransactionParameters_get_selected_contest_delay"))) TS_CounterpartyChannelTransactionParameters_get_selected_contest_delay(uint64_t this_ptr) { + LDKCounterpartyChannelTransactionParameters 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; + int16_t ret_conv = CounterpartyChannelTransactionParameters_get_selected_contest_delay(&this_ptr_conv); + return ret_conv; } -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; +void __attribute__((export_name("TS_CounterpartyChannelTransactionParameters_set_selected_contest_delay"))) TS_CounterpartyChannelTransactionParameters_set_selected_contest_delay(uint64_t this_ptr, int16_t val) { + LDKCounterpartyChannelTransactionParameters 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; + CounterpartyChannelTransactionParameters_set_selected_contest_delay(&this_ptr_conv, val); } -int8_tArray __attribute__((export_name("TS_Ping_write"))) TS_Ping_write(uint64_t obj) { - LDKPing 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 = Ping_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_CounterpartyChannelTransactionParameters_new"))) TS_CounterpartyChannelTransactionParameters_new(uint64_t pubkeys_arg, int16_t selected_contest_delay_arg) { + LDKChannelPublicKeys pubkeys_arg_conv; + pubkeys_arg_conv.inner = untag_ptr(pubkeys_arg); + pubkeys_arg_conv.is_owned = ptr_is_owned(pubkeys_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(pubkeys_arg_conv); + pubkeys_arg_conv = ChannelPublicKeys_clone(&pubkeys_arg_conv); + LDKCounterpartyChannelTransactionParameters ret_var = CounterpartyChannelTransactionParameters_new(pubkeys_arg_conv, selected_contest_delay_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_Ping_read"))) TS_Ping_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ"); - *ret_conv = Ping_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +static inline uint64_t CounterpartyChannelTransactionParameters_clone_ptr(LDKCounterpartyChannelTransactionParameters *NONNULL_PTR arg) { + LDKCounterpartyChannelTransactionParameters ret_var = CounterpartyChannelTransactionParameters_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; } - -int8_tArray __attribute__((export_name("TS_Pong_write"))) TS_Pong_write(uint64_t obj) { - LDKPong 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 = Pong_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; +int64_t __attribute__((export_name("TS_CounterpartyChannelTransactionParameters_clone_ptr"))) TS_CounterpartyChannelTransactionParameters_clone_ptr(uint64_t arg) { + LDKCounterpartyChannelTransactionParameters 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 = CounterpartyChannelTransactionParameters_clone_ptr(&arg_conv); + return ret_conv; } -uint64_t __attribute__((export_name("TS_Pong_read"))) TS_Pong_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ"); - *ret_conv = Pong_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +uint64_t __attribute__((export_name("TS_CounterpartyChannelTransactionParameters_clone"))) TS_CounterpartyChannelTransactionParameters_clone(uint64_t orig) { + LDKCounterpartyChannelTransactionParameters 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; + LDKCounterpartyChannelTransactionParameters ret_var = CounterpartyChannelTransactionParameters_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; } -int8_tArray __attribute__((export_name("TS_UnsignedChannelAnnouncement_write"))) TS_UnsignedChannelAnnouncement_write(uint64_t obj) { - LDKUnsignedChannelAnnouncement 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 = UnsignedChannelAnnouncement_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; +jboolean __attribute__((export_name("TS_CounterpartyChannelTransactionParameters_eq"))) TS_CounterpartyChannelTransactionParameters_eq(uint64_t a, uint64_t b) { + LDKCounterpartyChannelTransactionParameters 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; + LDKCounterpartyChannelTransactionParameters 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 = CounterpartyChannelTransactionParameters_eq(&a_conv, &b_conv); + return ret_conv; } -uint64_t __attribute__((export_name("TS_UnsignedChannelAnnouncement_read"))) TS_UnsignedChannelAnnouncement_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ"); - *ret_conv = UnsignedChannelAnnouncement_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +jboolean __attribute__((export_name("TS_ChannelTransactionParameters_is_populated"))) TS_ChannelTransactionParameters_is_populated(uint64_t this_arg) { + LDKChannelTransactionParameters 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 = ChannelTransactionParameters_is_populated(&this_arg_conv); + return ret_conv; } -int8_tArray __attribute__((export_name("TS_ChannelAnnouncement_write"))) TS_ChannelAnnouncement_write(uint64_t obj) { - LDKChannelAnnouncement 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 = ChannelAnnouncement_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_ChannelTransactionParameters_as_holder_broadcastable"))) TS_ChannelTransactionParameters_as_holder_broadcastable(uint64_t this_arg) { + LDKChannelTransactionParameters 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; + LDKDirectedChannelTransactionParameters ret_var = ChannelTransactionParameters_as_holder_broadcastable(&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_ChannelAnnouncement_read"))) TS_ChannelAnnouncement_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ"); - *ret_conv = ChannelAnnouncement_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +uint64_t __attribute__((export_name("TS_ChannelTransactionParameters_as_counterparty_broadcastable"))) TS_ChannelTransactionParameters_as_counterparty_broadcastable(uint64_t this_arg) { + LDKChannelTransactionParameters 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; + LDKDirectedChannelTransactionParameters ret_var = ChannelTransactionParameters_as_counterparty_broadcastable(&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; } -int8_tArray __attribute__((export_name("TS_UnsignedChannelUpdate_write"))) TS_UnsignedChannelUpdate_write(uint64_t obj) { - LDKUnsignedChannelUpdate obj_conv; +int8_tArray __attribute__((export_name("TS_CounterpartyChannelTransactionParameters_write"))) TS_CounterpartyChannelTransactionParameters_write(uint64_t obj) { + LDKCounterpartyChannelTransactionParameters 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 = UnsignedChannelUpdate_write(&obj_conv); + LDKCVec_u8Z ret_var = CounterpartyChannelTransactionParameters_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_UnsignedChannelUpdate_read"))) TS_UnsignedChannelUpdate_read(int8_tArray ser) { +uint64_t __attribute__((export_name("TS_CounterpartyChannelTransactionParameters_read"))) TS_CounterpartyChannelTransactionParameters_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; ser_ref.data = ser->elems; - LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ"); - *ret_conv = UnsignedChannelUpdate_read(ser_ref); + LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ"); + *ret_conv = CounterpartyChannelTransactionParameters_read(ser_ref); FREE(ser); return tag_ptr(ret_conv, true); } -int8_tArray __attribute__((export_name("TS_ChannelUpdate_write"))) TS_ChannelUpdate_write(uint64_t obj) { - LDKChannelUpdate obj_conv; +int8_tArray __attribute__((export_name("TS_ChannelTransactionParameters_write"))) TS_ChannelTransactionParameters_write(uint64_t obj) { + LDKChannelTransactionParameters 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 = ChannelUpdate_write(&obj_conv); + LDKCVec_u8Z ret_var = ChannelTransactionParameters_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_ChannelUpdate_read"))) TS_ChannelUpdate_read(int8_tArray ser) { +uint64_t __attribute__((export_name("TS_ChannelTransactionParameters_read"))) TS_ChannelTransactionParameters_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; ser_ref.data = ser->elems; - LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ"); - *ret_conv = ChannelUpdate_read(ser_ref); + LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ"); + *ret_conv = ChannelTransactionParameters_read(ser_ref); FREE(ser); return tag_ptr(ret_conv, true); } -int8_tArray __attribute__((export_name("TS_ErrorMessage_write"))) TS_ErrorMessage_write(uint64_t obj) { - LDKErrorMessage 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 = ErrorMessage_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_DirectedChannelTransactionParameters_free"))) TS_DirectedChannelTransactionParameters_free(uint64_t this_obj) { + LDKDirectedChannelTransactionParameters 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); + DirectedChannelTransactionParameters_free(this_obj_conv); } -uint64_t __attribute__((export_name("TS_ErrorMessage_read"))) TS_ErrorMessage_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ"); - *ret_conv = ErrorMessage_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +uint64_t __attribute__((export_name("TS_DirectedChannelTransactionParameters_broadcaster_pubkeys"))) TS_DirectedChannelTransactionParameters_broadcaster_pubkeys(uint64_t this_arg) { + LDKDirectedChannelTransactionParameters 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; + LDKChannelPublicKeys ret_var = DirectedChannelTransactionParameters_broadcaster_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; } -int8_tArray __attribute__((export_name("TS_WarningMessage_write"))) TS_WarningMessage_write(uint64_t obj) { - LDKWarningMessage 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 = WarningMessage_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_DirectedChannelTransactionParameters_countersignatory_pubkeys"))) TS_DirectedChannelTransactionParameters_countersignatory_pubkeys(uint64_t this_arg) { + LDKDirectedChannelTransactionParameters 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; + LDKChannelPublicKeys ret_var = DirectedChannelTransactionParameters_countersignatory_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; } -uint64_t __attribute__((export_name("TS_WarningMessage_read"))) TS_WarningMessage_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_WarningMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WarningMessageDecodeErrorZ), "LDKCResult_WarningMessageDecodeErrorZ"); - *ret_conv = WarningMessage_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +int16_t __attribute__((export_name("TS_DirectedChannelTransactionParameters_contest_delay"))) TS_DirectedChannelTransactionParameters_contest_delay(uint64_t this_arg) { + LDKDirectedChannelTransactionParameters 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; + int16_t ret_conv = DirectedChannelTransactionParameters_contest_delay(&this_arg_conv); + return ret_conv; } -int8_tArray __attribute__((export_name("TS_UnsignedNodeAnnouncement_write"))) TS_UnsignedNodeAnnouncement_write(uint64_t obj) { - LDKUnsignedNodeAnnouncement 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 = UnsignedNodeAnnouncement_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; +jboolean __attribute__((export_name("TS_DirectedChannelTransactionParameters_is_outbound"))) TS_DirectedChannelTransactionParameters_is_outbound(uint64_t this_arg) { + LDKDirectedChannelTransactionParameters 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 = DirectedChannelTransactionParameters_is_outbound(&this_arg_conv); + return ret_conv; } -uint64_t __attribute__((export_name("TS_UnsignedNodeAnnouncement_read"))) TS_UnsignedNodeAnnouncement_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ"); - *ret_conv = UnsignedNodeAnnouncement_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +uint64_t __attribute__((export_name("TS_DirectedChannelTransactionParameters_funding_outpoint"))) TS_DirectedChannelTransactionParameters_funding_outpoint(uint64_t this_arg) { + LDKDirectedChannelTransactionParameters 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; + LDKOutPoint ret_var = DirectedChannelTransactionParameters_funding_outpoint(&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; } -int8_tArray __attribute__((export_name("TS_NodeAnnouncement_write"))) TS_NodeAnnouncement_write(uint64_t obj) { - LDKNodeAnnouncement 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 = NodeAnnouncement_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; +jboolean __attribute__((export_name("TS_DirectedChannelTransactionParameters_opt_anchors"))) TS_DirectedChannelTransactionParameters_opt_anchors(uint64_t this_arg) { + LDKDirectedChannelTransactionParameters 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 = DirectedChannelTransactionParameters_opt_anchors(&this_arg_conv); + return ret_conv; } -uint64_t __attribute__((export_name("TS_NodeAnnouncement_read"))) TS_NodeAnnouncement_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ"); - *ret_conv = NodeAnnouncement_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +void __attribute__((export_name("TS_HolderCommitmentTransaction_free"))) TS_HolderCommitmentTransaction_free(uint64_t this_obj) { + LDKHolderCommitmentTransaction 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); + HolderCommitmentTransaction_free(this_obj_conv); } -uint64_t __attribute__((export_name("TS_QueryShortChannelIds_read"))) TS_QueryShortChannelIds_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ"); - *ret_conv = QueryShortChannelIds_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +int8_tArray __attribute__((export_name("TS_HolderCommitmentTransaction_get_counterparty_sig"))) TS_HolderCommitmentTransaction_get_counterparty_sig(uint64_t this_ptr) { + LDKHolderCommitmentTransaction 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(64, __LINE__); + memcpy(ret_arr->elems, HolderCommitmentTransaction_get_counterparty_sig(&this_ptr_conv).compact_form, 64); + return ret_arr; } -int8_tArray __attribute__((export_name("TS_QueryShortChannelIds_write"))) TS_QueryShortChannelIds_write(uint64_t obj) { - LDKQueryShortChannelIds 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 = QueryShortChannelIds_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_HolderCommitmentTransaction_set_counterparty_sig"))) TS_HolderCommitmentTransaction_set_counterparty_sig(uint64_t this_ptr, int8_tArray val) { + LDKHolderCommitmentTransaction 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; + LDKSignature val_ref; + CHECK(val->arr_len == 64); + memcpy(val_ref.compact_form, val->elems, 64); FREE(val); + HolderCommitmentTransaction_set_counterparty_sig(&this_ptr_conv, val_ref); } -int8_tArray __attribute__((export_name("TS_ReplyShortChannelIdsEnd_write"))) TS_ReplyShortChannelIdsEnd_write(uint64_t obj) { - LDKReplyShortChannelIdsEnd 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 = ReplyShortChannelIdsEnd_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); +ptrArray __attribute__((export_name("TS_HolderCommitmentTransaction_get_counterparty_htlc_sigs"))) TS_HolderCommitmentTransaction_get_counterparty_htlc_sigs(uint64_t this_ptr) { + LDKHolderCommitmentTransaction 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; + LDKCVec_SignatureZ ret_var = HolderCommitmentTransaction_get_counterparty_htlc_sigs(&this_ptr_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(64, __LINE__); + memcpy(ret_conv_12_arr->elems, ret_var.data[m].compact_form, 64); + ret_arr_ptr[m] = ret_conv_12_arr; + } + + FREE(ret_var.data); return ret_arr; } -uint64_t __attribute__((export_name("TS_ReplyShortChannelIdsEnd_read"))) TS_ReplyShortChannelIdsEnd_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ"); - *ret_conv = ReplyShortChannelIdsEnd_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +void __attribute__((export_name("TS_HolderCommitmentTransaction_set_counterparty_htlc_sigs"))) TS_HolderCommitmentTransaction_set_counterparty_htlc_sigs(uint64_t this_ptr, ptrArray val) { + LDKHolderCommitmentTransaction 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; + LDKCVec_SignatureZ val_constr; + val_constr.datalen = val->arr_len; + if (val_constr.datalen > 0) + val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements"); + else + val_constr.data = NULL; + int8_tArray* val_vals = (void*) val->elems; + for (size_t m = 0; m < val_constr.datalen; m++) { + int8_tArray val_conv_12 = val_vals[m]; + LDKSignature val_conv_12_ref; + CHECK(val_conv_12->arr_len == 64); + memcpy(val_conv_12_ref.compact_form, val_conv_12->elems, 64); FREE(val_conv_12); + val_constr.data[m] = val_conv_12_ref; + } + FREE(val); + HolderCommitmentTransaction_set_counterparty_htlc_sigs(&this_ptr_conv, val_constr); } -int32_t __attribute__((export_name("TS_QueryChannelRange_end_blocknum"))) TS_QueryChannelRange_end_blocknum(uint64_t this_arg) { - LDKQueryChannelRange 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; - int32_t ret_conv = QueryChannelRange_end_blocknum(&this_arg_conv); +static inline uint64_t HolderCommitmentTransaction_clone_ptr(LDKHolderCommitmentTransaction *NONNULL_PTR arg) { + LDKHolderCommitmentTransaction ret_var = HolderCommitmentTransaction_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_HolderCommitmentTransaction_clone_ptr"))) TS_HolderCommitmentTransaction_clone_ptr(uint64_t arg) { + LDKHolderCommitmentTransaction 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 = HolderCommitmentTransaction_clone_ptr(&arg_conv); return ret_conv; } -int8_tArray __attribute__((export_name("TS_QueryChannelRange_write"))) TS_QueryChannelRange_write(uint64_t obj) { - LDKQueryChannelRange obj_conv; +uint64_t __attribute__((export_name("TS_HolderCommitmentTransaction_clone"))) TS_HolderCommitmentTransaction_clone(uint64_t orig) { + LDKHolderCommitmentTransaction 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; + LDKHolderCommitmentTransaction ret_var = HolderCommitmentTransaction_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; +} + +int8_tArray __attribute__((export_name("TS_HolderCommitmentTransaction_write"))) TS_HolderCommitmentTransaction_write(uint64_t obj) { + LDKHolderCommitmentTransaction 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 = QueryChannelRange_write(&obj_conv); + LDKCVec_u8Z ret_var = HolderCommitmentTransaction_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_QueryChannelRange_read"))) TS_QueryChannelRange_read(int8_tArray ser) { +uint64_t __attribute__((export_name("TS_HolderCommitmentTransaction_read"))) TS_HolderCommitmentTransaction_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; ser_ref.data = ser->elems; - LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ"); - *ret_conv = QueryChannelRange_read(ser_ref); + LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ"); + *ret_conv = HolderCommitmentTransaction_read(ser_ref); FREE(ser); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_ReplyChannelRange_read"))) TS_ReplyChannelRange_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ"); - *ret_conv = ReplyChannelRange_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +uint64_t __attribute__((export_name("TS_HolderCommitmentTransaction_new"))) TS_HolderCommitmentTransaction_new(uint64_t commitment_tx, int8_tArray counterparty_sig, ptrArray counterparty_htlc_sigs, int8_tArray holder_funding_key, int8_tArray counterparty_funding_key) { + LDKCommitmentTransaction commitment_tx_conv; + commitment_tx_conv.inner = untag_ptr(commitment_tx); + commitment_tx_conv.is_owned = ptr_is_owned(commitment_tx); + CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_conv); + commitment_tx_conv = CommitmentTransaction_clone(&commitment_tx_conv); + LDKSignature counterparty_sig_ref; + CHECK(counterparty_sig->arr_len == 64); + memcpy(counterparty_sig_ref.compact_form, counterparty_sig->elems, 64); FREE(counterparty_sig); + LDKCVec_SignatureZ counterparty_htlc_sigs_constr; + counterparty_htlc_sigs_constr.datalen = counterparty_htlc_sigs->arr_len; + if (counterparty_htlc_sigs_constr.datalen > 0) + counterparty_htlc_sigs_constr.data = MALLOC(counterparty_htlc_sigs_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements"); + else + counterparty_htlc_sigs_constr.data = NULL; + int8_tArray* counterparty_htlc_sigs_vals = (void*) counterparty_htlc_sigs->elems; + for (size_t m = 0; m < counterparty_htlc_sigs_constr.datalen; m++) { + int8_tArray counterparty_htlc_sigs_conv_12 = counterparty_htlc_sigs_vals[m]; + LDKSignature counterparty_htlc_sigs_conv_12_ref; + CHECK(counterparty_htlc_sigs_conv_12->arr_len == 64); + memcpy(counterparty_htlc_sigs_conv_12_ref.compact_form, counterparty_htlc_sigs_conv_12->elems, 64); FREE(counterparty_htlc_sigs_conv_12); + counterparty_htlc_sigs_constr.data[m] = counterparty_htlc_sigs_conv_12_ref; + } + FREE(counterparty_htlc_sigs); + LDKPublicKey holder_funding_key_ref; + CHECK(holder_funding_key->arr_len == 33); + memcpy(holder_funding_key_ref.compressed_form, holder_funding_key->elems, 33); FREE(holder_funding_key); + LDKPublicKey counterparty_funding_key_ref; + CHECK(counterparty_funding_key->arr_len == 33); + memcpy(counterparty_funding_key_ref.compressed_form, counterparty_funding_key->elems, 33); FREE(counterparty_funding_key); + LDKHolderCommitmentTransaction ret_var = HolderCommitmentTransaction_new(commitment_tx_conv, counterparty_sig_ref, counterparty_htlc_sigs_constr, holder_funding_key_ref, counterparty_funding_key_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; } -int8_tArray __attribute__((export_name("TS_ReplyChannelRange_write"))) TS_ReplyChannelRange_write(uint64_t obj) { - LDKReplyChannelRange 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 = ReplyChannelRange_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_BuiltCommitmentTransaction_free"))) TS_BuiltCommitmentTransaction_free(uint64_t this_obj) { + LDKBuiltCommitmentTransaction 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); + BuiltCommitmentTransaction_free(this_obj_conv); } -int8_tArray __attribute__((export_name("TS_GossipTimestampFilter_write"))) TS_GossipTimestampFilter_write(uint64_t obj) { - LDKGossipTimestampFilter 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 = GossipTimestampFilter_write(&obj_conv); +int8_tArray __attribute__((export_name("TS_BuiltCommitmentTransaction_get_transaction"))) TS_BuiltCommitmentTransaction_get_transaction(uint64_t this_ptr) { + LDKBuiltCommitmentTransaction 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; + LDKTransaction ret_var = BuiltCommitmentTransaction_get_transaction(&this_ptr_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); + Transaction_free(ret_var); return ret_arr; } -uint64_t __attribute__((export_name("TS_GossipTimestampFilter_read"))) TS_GossipTimestampFilter_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ"); - *ret_conv = GossipTimestampFilter_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +void __attribute__((export_name("TS_BuiltCommitmentTransaction_set_transaction"))) TS_BuiltCommitmentTransaction_set_transaction(uint64_t this_ptr, int8_tArray val) { + LDKBuiltCommitmentTransaction 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; + LDKTransaction val_ref; + val_ref.datalen = val->arr_len; + val_ref.data = MALLOC(val_ref.datalen, "LDKTransaction Bytes"); + memcpy(val_ref.data, val->elems, val_ref.datalen); FREE(val); + val_ref.data_is_owned = true; + BuiltCommitmentTransaction_set_transaction(&this_ptr_conv, val_ref); } -void __attribute__((export_name("TS_CustomMessageHandler_free"))) TS_CustomMessageHandler_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); - LDKCustomMessageHandler this_ptr_conv = *(LDKCustomMessageHandler*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - CustomMessageHandler_free(this_ptr_conv); +int8_tArray __attribute__((export_name("TS_BuiltCommitmentTransaction_get_txid"))) TS_BuiltCommitmentTransaction_get_txid(uint64_t this_ptr) { + LDKBuiltCommitmentTransaction 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(32, __LINE__); + memcpy(ret_arr->elems, *BuiltCommitmentTransaction_get_txid(&this_ptr_conv), 32); + return ret_arr; } -void __attribute__((export_name("TS_IgnoringMessageHandler_free"))) TS_IgnoringMessageHandler_free(uint64_t this_obj) { - LDKIgnoringMessageHandler 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); - IgnoringMessageHandler_free(this_obj_conv); +void __attribute__((export_name("TS_BuiltCommitmentTransaction_set_txid"))) TS_BuiltCommitmentTransaction_set_txid(uint64_t this_ptr, int8_tArray val) { + LDKBuiltCommitmentTransaction 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; + LDKThirtyTwoBytes val_ref; + CHECK(val->arr_len == 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); + BuiltCommitmentTransaction_set_txid(&this_ptr_conv, val_ref); } -uint64_t __attribute__((export_name("TS_IgnoringMessageHandler_new"))) TS_IgnoringMessageHandler_new() { - LDKIgnoringMessageHandler ret_var = IgnoringMessageHandler_new(); +uint64_t __attribute__((export_name("TS_BuiltCommitmentTransaction_new"))) TS_BuiltCommitmentTransaction_new(int8_tArray transaction_arg, int8_tArray txid_arg) { + LDKTransaction transaction_arg_ref; + transaction_arg_ref.datalen = transaction_arg->arr_len; + transaction_arg_ref.data = MALLOC(transaction_arg_ref.datalen, "LDKTransaction Bytes"); + memcpy(transaction_arg_ref.data, transaction_arg->elems, transaction_arg_ref.datalen); FREE(transaction_arg); + transaction_arg_ref.data_is_owned = true; + LDKThirtyTwoBytes txid_arg_ref; + CHECK(txid_arg->arr_len == 32); + memcpy(txid_arg_ref.data, txid_arg->elems, 32); FREE(txid_arg); + LDKBuiltCommitmentTransaction ret_var = BuiltCommitmentTransaction_new(transaction_arg_ref, txid_arg_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_IgnoringMessageHandler_as_MessageSendEventsProvider"))) TS_IgnoringMessageHandler_as_MessageSendEventsProvider(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; - LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider"); - *ret_ret = IgnoringMessageHandler_as_MessageSendEventsProvider(&this_arg_conv); - return tag_ptr(ret_ret, true); +static inline uint64_t BuiltCommitmentTransaction_clone_ptr(LDKBuiltCommitmentTransaction *NONNULL_PTR arg) { + LDKBuiltCommitmentTransaction ret_var = BuiltCommitmentTransaction_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_BuiltCommitmentTransaction_clone_ptr"))) TS_BuiltCommitmentTransaction_clone_ptr(uint64_t arg) { + LDKBuiltCommitmentTransaction 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 = BuiltCommitmentTransaction_clone_ptr(&arg_conv); + return ret_conv; } -uint64_t __attribute__((export_name("TS_IgnoringMessageHandler_as_RoutingMessageHandler"))) TS_IgnoringMessageHandler_as_RoutingMessageHandler(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; - LDKRoutingMessageHandler* ret_ret = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler"); - *ret_ret = IgnoringMessageHandler_as_RoutingMessageHandler(&this_arg_conv); - return tag_ptr(ret_ret, true); +uint64_t __attribute__((export_name("TS_BuiltCommitmentTransaction_clone"))) TS_BuiltCommitmentTransaction_clone(uint64_t orig) { + LDKBuiltCommitmentTransaction 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; + LDKBuiltCommitmentTransaction ret_var = BuiltCommitmentTransaction_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_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); +int8_tArray __attribute__((export_name("TS_BuiltCommitmentTransaction_write"))) TS_BuiltCommitmentTransaction_write(uint64_t obj) { + LDKBuiltCommitmentTransaction 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 = BuiltCommitmentTransaction_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_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_BuiltCommitmentTransaction_read"))) TS_BuiltCommitmentTransaction_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ"); + *ret_conv = BuiltCommitmentTransaction_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_IgnoringMessageHandler_as_CustomOnionMessageHandler"))) TS_IgnoringMessageHandler_as_CustomOnionMessageHandler(uint64_t this_arg) { - LDKIgnoringMessageHandler this_arg_conv; +int8_tArray __attribute__((export_name("TS_BuiltCommitmentTransaction_get_sighash_all"))) TS_BuiltCommitmentTransaction_get_sighash_all(uint64_t this_arg, int8_tArray funding_redeemscript, int64_t channel_value_satoshis) { + LDKBuiltCommitmentTransaction 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); + LDKu8slice funding_redeemscript_ref; + funding_redeemscript_ref.datalen = funding_redeemscript->arr_len; + funding_redeemscript_ref.data = funding_redeemscript->elems; + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, BuiltCommitmentTransaction_get_sighash_all(&this_arg_conv, funding_redeemscript_ref, channel_value_satoshis).data, 32); + FREE(funding_redeemscript); + return ret_arr; } -uint64_t __attribute__((export_name("TS_IgnoringMessageHandler_as_CustomMessageReader"))) TS_IgnoringMessageHandler_as_CustomMessageReader(uint64_t this_arg) { - LDKIgnoringMessageHandler this_arg_conv; +int8_tArray __attribute__((export_name("TS_BuiltCommitmentTransaction_sign_counterparty_commitment"))) TS_BuiltCommitmentTransaction_sign_counterparty_commitment(uint64_t this_arg, int8_tArray funding_key, int8_tArray funding_redeemscript, int64_t channel_value_satoshis) { + LDKBuiltCommitmentTransaction 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; - LDKCustomMessageReader* ret_ret = MALLOC(sizeof(LDKCustomMessageReader), "LDKCustomMessageReader"); - *ret_ret = IgnoringMessageHandler_as_CustomMessageReader(&this_arg_conv); - return tag_ptr(ret_ret, true); + uint8_t funding_key_arr[32]; + CHECK(funding_key->arr_len == 32); + memcpy(funding_key_arr, funding_key->elems, 32); FREE(funding_key); + 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; + int8_tArray ret_arr = init_int8_tArray(64, __LINE__); + memcpy(ret_arr->elems, BuiltCommitmentTransaction_sign_counterparty_commitment(&this_arg_conv, funding_key_ref, funding_redeemscript_ref, channel_value_satoshis).compact_form, 64); + FREE(funding_redeemscript); + return ret_arr; } -uint64_t __attribute__((export_name("TS_IgnoringMessageHandler_as_CustomMessageHandler"))) TS_IgnoringMessageHandler_as_CustomMessageHandler(uint64_t this_arg) { - LDKIgnoringMessageHandler this_arg_conv; +int8_tArray __attribute__((export_name("TS_BuiltCommitmentTransaction_sign_holder_commitment"))) TS_BuiltCommitmentTransaction_sign_holder_commitment(uint64_t this_arg, int8_tArray funding_key, int8_tArray funding_redeemscript, int64_t channel_value_satoshis, uint64_t entropy_source) { + LDKBuiltCommitmentTransaction 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; - LDKCustomMessageHandler* ret_ret = MALLOC(sizeof(LDKCustomMessageHandler), "LDKCustomMessageHandler"); - *ret_ret = IgnoringMessageHandler_as_CustomMessageHandler(&this_arg_conv); - return tag_ptr(ret_ret, true); + uint8_t funding_key_arr[32]; + CHECK(funding_key->arr_len == 32); + memcpy(funding_key_arr, funding_key->elems, 32); FREE(funding_key); + 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; + 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; + int8_tArray ret_arr = init_int8_tArray(64, __LINE__); + memcpy(ret_arr->elems, BuiltCommitmentTransaction_sign_holder_commitment(&this_arg_conv, funding_key_ref, funding_redeemscript_ref, channel_value_satoshis, entropy_source_conv).compact_form, 64); + FREE(funding_redeemscript); + return ret_arr; } -void __attribute__((export_name("TS_ErroringMessageHandler_free"))) TS_ErroringMessageHandler_free(uint64_t this_obj) { - LDKErroringMessageHandler this_obj_conv; +void __attribute__((export_name("TS_ClosingTransaction_free"))) TS_ClosingTransaction_free(uint64_t this_obj) { + LDKClosingTransaction 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); - ErroringMessageHandler_free(this_obj_conv); + ClosingTransaction_free(this_obj_conv); } -uint64_t __attribute__((export_name("TS_ErroringMessageHandler_new"))) TS_ErroringMessageHandler_new() { - LDKErroringMessageHandler ret_var = ErroringMessageHandler_new(); +static inline uint64_t ClosingTransaction_clone_ptr(LDKClosingTransaction *NONNULL_PTR arg) { + LDKClosingTransaction ret_var = ClosingTransaction_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; } - -uint64_t __attribute__((export_name("TS_ErroringMessageHandler_as_MessageSendEventsProvider"))) TS_ErroringMessageHandler_as_MessageSendEventsProvider(uint64_t this_arg) { - LDKErroringMessageHandler 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; - LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider"); - *ret_ret = ErroringMessageHandler_as_MessageSendEventsProvider(&this_arg_conv); - return tag_ptr(ret_ret, true); -} - -uint64_t __attribute__((export_name("TS_ErroringMessageHandler_as_ChannelMessageHandler"))) TS_ErroringMessageHandler_as_ChannelMessageHandler(uint64_t this_arg) { - LDKErroringMessageHandler 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; - LDKChannelMessageHandler* ret_ret = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler"); - *ret_ret = ErroringMessageHandler_as_ChannelMessageHandler(&this_arg_conv); - return tag_ptr(ret_ret, true); -} - -void __attribute__((export_name("TS_MessageHandler_free"))) TS_MessageHandler_free(uint64_t this_obj) { - LDKMessageHandler 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); - MessageHandler_free(this_obj_conv); -} - -uint64_t __attribute__((export_name("TS_MessageHandler_get_chan_handler"))) TS_MessageHandler_get_chan_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_chan_handler(&this_ptr_conv), false); - return ret_ret; -} - -void __attribute__((export_name("TS_MessageHandler_set_chan_handler"))) TS_MessageHandler_set_chan_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); - LDKChannelMessageHandler val_conv = *(LDKChannelMessageHandler*)(val_ptr); - if (val_conv.free == LDKChannelMessageHandler_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKChannelMessageHandler_JCalls_cloned(&val_conv); - } - MessageHandler_set_chan_handler(&this_ptr_conv, val_conv); +int64_t __attribute__((export_name("TS_ClosingTransaction_clone_ptr"))) TS_ClosingTransaction_clone_ptr(uint64_t arg) { + LDKClosingTransaction 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 = ClosingTransaction_clone_ptr(&arg_conv); + return ret_conv; } -uint64_t __attribute__((export_name("TS_MessageHandler_get_route_handler"))) TS_MessageHandler_get_route_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_route_handler(&this_ptr_conv), false); - return ret_ret; +uint64_t __attribute__((export_name("TS_ClosingTransaction_clone"))) TS_ClosingTransaction_clone(uint64_t orig) { + LDKClosingTransaction 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; + LDKClosingTransaction ret_var = ClosingTransaction_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_MessageHandler_set_route_handler"))) TS_MessageHandler_set_route_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); - LDKRoutingMessageHandler val_conv = *(LDKRoutingMessageHandler*)(val_ptr); - if (val_conv.free == LDKRoutingMessageHandler_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKRoutingMessageHandler_JCalls_cloned(&val_conv); - } - MessageHandler_set_route_handler(&this_ptr_conv, val_conv); +int64_t __attribute__((export_name("TS_ClosingTransaction_hash"))) TS_ClosingTransaction_hash(uint64_t o) { + LDKClosingTransaction 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 = ClosingTransaction_hash(&o_conv); + return ret_conv; } -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; +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; } -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_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; + to_holder_script_ref.data = MALLOC(to_holder_script_ref.datalen, "LDKCVec_u8Z Bytes"); + memcpy(to_holder_script_ref.data, to_holder_script->elems, to_holder_script_ref.datalen); FREE(to_holder_script); + LDKCVec_u8Z to_counterparty_script_ref; + to_counterparty_script_ref.datalen = to_counterparty_script->arr_len; + to_counterparty_script_ref.data = MALLOC(to_counterparty_script_ref.datalen, "LDKCVec_u8Z Bytes"); + memcpy(to_counterparty_script_ref.data, to_counterparty_script->elems, to_counterparty_script_ref.datalen); FREE(to_counterparty_script); + LDKOutPoint funding_outpoint_conv; + funding_outpoint_conv.inner = untag_ptr(funding_outpoint); + funding_outpoint_conv.is_owned = ptr_is_owned(funding_outpoint); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_conv); + funding_outpoint_conv = OutPoint_clone(&funding_outpoint_conv); + LDKClosingTransaction ret_var = ClosingTransaction_new(to_holder_value_sat, to_counterparty_value_sat, to_holder_script_ref, to_counterparty_script_ref, funding_outpoint_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_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 (chan_handler_arg_conv.free == LDKChannelMessageHandler_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKChannelMessageHandler_JCalls_cloned(&chan_handler_arg_conv); - } - void* route_handler_arg_ptr = untag_ptr(route_handler_arg); - CHECK_ACCESS(route_handler_arg_ptr); - LDKRoutingMessageHandler route_handler_arg_conv = *(LDKRoutingMessageHandler*)(route_handler_arg_ptr); - if (route_handler_arg_conv.free == LDKRoutingMessageHandler_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKRoutingMessageHandler_JCalls_cloned(&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 __attribute__((export_name("TS_ClosingTransaction_trust"))) TS_ClosingTransaction_trust(uint64_t this_arg) { + LDKClosingTransaction 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; + LDKTrustedClosingTransaction ret_var = ClosingTransaction_trust(&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; } -static inline uint64_t SocketDescriptor_clone_ptr(LDKSocketDescriptor *NONNULL_PTR arg) { - LDKSocketDescriptor* ret_ret = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor"); - *ret_ret = SocketDescriptor_clone(arg); - return tag_ptr(ret_ret, true); +uint64_t __attribute__((export_name("TS_ClosingTransaction_verify"))) TS_ClosingTransaction_verify(uint64_t this_arg, uint64_t funding_outpoint) { + LDKClosingTransaction 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; + LDKOutPoint funding_outpoint_conv; + funding_outpoint_conv.inner = untag_ptr(funding_outpoint); + funding_outpoint_conv.is_owned = ptr_is_owned(funding_outpoint); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_conv); + funding_outpoint_conv = OutPoint_clone(&funding_outpoint_conv); + LDKCResult_TrustedClosingTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedClosingTransactionNoneZ), "LDKCResult_TrustedClosingTransactionNoneZ"); + *ret_conv = ClosingTransaction_verify(&this_arg_conv, funding_outpoint_conv); + return tag_ptr(ret_conv, true); } -int64_t __attribute__((export_name("TS_SocketDescriptor_clone_ptr"))) TS_SocketDescriptor_clone_ptr(uint64_t arg) { - void* arg_ptr = untag_ptr(arg); - if (ptr_is_owned(arg)) { CHECK_ACCESS(arg_ptr); } - LDKSocketDescriptor* arg_conv = (LDKSocketDescriptor*)arg_ptr; - int64_t ret_conv = SocketDescriptor_clone_ptr(arg_conv); + +int64_t __attribute__((export_name("TS_ClosingTransaction_to_holder_value_sat"))) TS_ClosingTransaction_to_holder_value_sat(uint64_t this_arg) { + LDKClosingTransaction 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 = ClosingTransaction_to_holder_value_sat(&this_arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_SocketDescriptor_clone"))) TS_SocketDescriptor_clone(uint64_t orig) { - void* orig_ptr = untag_ptr(orig); - if (ptr_is_owned(orig)) { CHECK_ACCESS(orig_ptr); } - LDKSocketDescriptor* orig_conv = (LDKSocketDescriptor*)orig_ptr; - LDKSocketDescriptor* ret_ret = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor"); - *ret_ret = SocketDescriptor_clone(orig_conv); - return tag_ptr(ret_ret, true); +int64_t __attribute__((export_name("TS_ClosingTransaction_to_counterparty_value_sat"))) TS_ClosingTransaction_to_counterparty_value_sat(uint64_t this_arg) { + LDKClosingTransaction 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 = ClosingTransaction_to_counterparty_value_sat(&this_arg_conv); + return ret_conv; } -void __attribute__((export_name("TS_SocketDescriptor_free"))) TS_SocketDescriptor_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); - LDKSocketDescriptor this_ptr_conv = *(LDKSocketDescriptor*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - SocketDescriptor_free(this_ptr_conv); +int8_tArray __attribute__((export_name("TS_ClosingTransaction_to_holder_script"))) TS_ClosingTransaction_to_holder_script(uint64_t this_arg) { + LDKClosingTransaction 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 ret_var = ClosingTransaction_to_holder_script(&this_arg_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + return ret_arr; } -void __attribute__((export_name("TS_PeerHandleError_free"))) TS_PeerHandleError_free(uint64_t this_obj) { - LDKPeerHandleError this_obj_conv; +int8_tArray __attribute__((export_name("TS_ClosingTransaction_to_counterparty_script"))) TS_ClosingTransaction_to_counterparty_script(uint64_t this_arg) { + LDKClosingTransaction 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 ret_var = ClosingTransaction_to_counterparty_script(&this_arg_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + return ret_arr; +} + +void __attribute__((export_name("TS_TrustedClosingTransaction_free"))) TS_TrustedClosingTransaction_free(uint64_t this_obj) { + LDKTrustedClosingTransaction 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); - PeerHandleError_free(this_obj_conv); + TrustedClosingTransaction_free(this_obj_conv); } -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); - return ret_ref; +int8_tArray __attribute__((export_name("TS_TrustedClosingTransaction_built_transaction"))) TS_TrustedClosingTransaction_built_transaction(uint64_t this_arg) { + LDKTrustedClosingTransaction 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; + LDKTransaction ret_var = TrustedClosingTransaction_built_transaction(&this_arg_conv); + 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; } -static inline uint64_t PeerHandleError_clone_ptr(LDKPeerHandleError *NONNULL_PTR arg) { - LDKPeerHandleError ret_var = PeerHandleError_clone(arg); +int8_tArray __attribute__((export_name("TS_TrustedClosingTransaction_get_sighash_all"))) TS_TrustedClosingTransaction_get_sighash_all(uint64_t this_arg, int8_tArray funding_redeemscript, int64_t channel_value_satoshis) { + LDKTrustedClosingTransaction 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 funding_redeemscript_ref; + funding_redeemscript_ref.datalen = funding_redeemscript->arr_len; + funding_redeemscript_ref.data = funding_redeemscript->elems; + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, TrustedClosingTransaction_get_sighash_all(&this_arg_conv, funding_redeemscript_ref, channel_value_satoshis).data, 32); + FREE(funding_redeemscript); + return ret_arr; +} + +int8_tArray __attribute__((export_name("TS_TrustedClosingTransaction_sign"))) TS_TrustedClosingTransaction_sign(uint64_t this_arg, int8_tArray funding_key, int8_tArray funding_redeemscript, int64_t channel_value_satoshis) { + LDKTrustedClosingTransaction 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 funding_key_arr[32]; + CHECK(funding_key->arr_len == 32); + memcpy(funding_key_arr, funding_key->elems, 32); FREE(funding_key); + 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; + int8_tArray ret_arr = init_int8_tArray(64, __LINE__); + memcpy(ret_arr->elems, TrustedClosingTransaction_sign(&this_arg_conv, funding_key_ref, funding_redeemscript_ref, channel_value_satoshis).compact_form, 64); + FREE(funding_redeemscript); + return ret_arr; +} + +void __attribute__((export_name("TS_CommitmentTransaction_free"))) TS_CommitmentTransaction_free(uint64_t this_obj) { + LDKCommitmentTransaction 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); + CommitmentTransaction_free(this_obj_conv); +} + +static inline uint64_t CommitmentTransaction_clone_ptr(LDKCommitmentTransaction *NONNULL_PTR arg) { + LDKCommitmentTransaction ret_var = CommitmentTransaction_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_PeerHandleError_clone_ptr"))) TS_PeerHandleError_clone_ptr(uint64_t arg) { - LDKPeerHandleError arg_conv; +int64_t __attribute__((export_name("TS_CommitmentTransaction_clone_ptr"))) TS_CommitmentTransaction_clone_ptr(uint64_t arg) { + LDKCommitmentTransaction 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 = PeerHandleError_clone_ptr(&arg_conv); + int64_t ret_conv = CommitmentTransaction_clone_ptr(&arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_PeerHandleError_clone"))) TS_PeerHandleError_clone(uint64_t orig) { - LDKPeerHandleError orig_conv; +uint64_t __attribute__((export_name("TS_CommitmentTransaction_clone"))) TS_CommitmentTransaction_clone(uint64_t orig) { + LDKCommitmentTransaction 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; - LDKPeerHandleError ret_var = PeerHandleError_clone(&orig_conv); + LDKCommitmentTransaction ret_var = CommitmentTransaction_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_PeerManager_free"))) TS_PeerManager_free(uint64_t this_obj) { - LDKPeerManager 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); - PeerManager_free(this_obj_conv); +int8_tArray __attribute__((export_name("TS_CommitmentTransaction_write"))) TS_CommitmentTransaction_write(uint64_t obj) { + LDKCommitmentTransaction 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 = CommitmentTransaction_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_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 - - 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); - 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 (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_message_handler_ptr = untag_ptr(custom_message_handler); - CHECK_ACCESS(custom_message_handler_ptr); - LDKCustomMessageHandler custom_message_handler_conv = *(LDKCustomMessageHandler*)(custom_message_handler_ptr); - if (custom_message_handler_conv.free == LDKCustomMessageHandler_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKCustomMessageHandler_JCalls_cloned(&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; +uint64_t __attribute__((export_name("TS_CommitmentTransaction_read"))) TS_CommitmentTransaction_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ"); + *ret_conv = CommitmentTransaction_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -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; +int64_t __attribute__((export_name("TS_CommitmentTransaction_commitment_number"))) TS_CommitmentTransaction_commitment_number(uint64_t this_arg) { + LDKCommitmentTransaction 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_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); - return ret_arr; + int64_t ret_conv = CommitmentTransaction_commitment_number(&this_arg_conv); + return ret_conv; } -uint64_t __attribute__((export_name("TS_PeerManager_new_outbound_connection"))) TS_PeerManager_new_outbound_connection(uint64_t this_arg, int8_tArray their_node_id, uint64_t descriptor, uint64_t remote_network_address) { - LDKPeerManager this_arg_conv; +int64_t __attribute__((export_name("TS_CommitmentTransaction_to_broadcaster_value_sat"))) TS_CommitmentTransaction_to_broadcaster_value_sat(uint64_t this_arg) { + LDKCommitmentTransaction 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 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); - void* descriptor_ptr = untag_ptr(descriptor); - CHECK_ACCESS(descriptor_ptr); - LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)(descriptor_ptr); - if (descriptor_conv.free == LDKSocketDescriptor_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKSocketDescriptor_JCalls_cloned(&descriptor_conv); - } - void* remote_network_address_ptr = untag_ptr(remote_network_address); - CHECK_ACCESS(remote_network_address_ptr); - LDKCOption_NetAddressZ remote_network_address_conv = *(LDKCOption_NetAddressZ*)(remote_network_address_ptr); - LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ"); - *ret_conv = PeerManager_new_outbound_connection(&this_arg_conv, their_node_id_ref, descriptor_conv, remote_network_address_conv); - return tag_ptr(ret_conv, true); + int64_t ret_conv = CommitmentTransaction_to_broadcaster_value_sat(&this_arg_conv); + return ret_conv; } -uint64_t __attribute__((export_name("TS_PeerManager_new_inbound_connection"))) TS_PeerManager_new_inbound_connection(uint64_t this_arg, uint64_t descriptor, uint64_t remote_network_address) { - LDKPeerManager this_arg_conv; +int64_t __attribute__((export_name("TS_CommitmentTransaction_to_countersignatory_value_sat"))) TS_CommitmentTransaction_to_countersignatory_value_sat(uint64_t this_arg) { + LDKCommitmentTransaction 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* descriptor_ptr = untag_ptr(descriptor); - CHECK_ACCESS(descriptor_ptr); - LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)(descriptor_ptr); - if (descriptor_conv.free == LDKSocketDescriptor_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKSocketDescriptor_JCalls_cloned(&descriptor_conv); - } - void* remote_network_address_ptr = untag_ptr(remote_network_address); - CHECK_ACCESS(remote_network_address_ptr); - LDKCOption_NetAddressZ remote_network_address_conv = *(LDKCOption_NetAddressZ*)(remote_network_address_ptr); - LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ"); - *ret_conv = PeerManager_new_inbound_connection(&this_arg_conv, descriptor_conv, remote_network_address_conv); - return tag_ptr(ret_conv, true); + int64_t ret_conv = CommitmentTransaction_to_countersignatory_value_sat(&this_arg_conv); + return ret_conv; } -uint64_t __attribute__((export_name("TS_PeerManager_write_buffer_space_avail"))) TS_PeerManager_write_buffer_space_avail(uint64_t this_arg, uint64_t descriptor) { - LDKPeerManager this_arg_conv; +int32_t __attribute__((export_name("TS_CommitmentTransaction_feerate_per_kw"))) TS_CommitmentTransaction_feerate_per_kw(uint64_t this_arg) { + LDKCommitmentTransaction 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* descriptor_ptr = untag_ptr(descriptor); - if (ptr_is_owned(descriptor)) { CHECK_ACCESS(descriptor_ptr); } - LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor_ptr; - LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ"); - *ret_conv = PeerManager_write_buffer_space_avail(&this_arg_conv, descriptor_conv); - return tag_ptr(ret_conv, true); + int32_t ret_conv = CommitmentTransaction_feerate_per_kw(&this_arg_conv); + return ret_conv; } -uint64_t __attribute__((export_name("TS_PeerManager_read_event"))) TS_PeerManager_read_event(uint64_t this_arg, uint64_t peer_descriptor, int8_tArray data) { - LDKPeerManager this_arg_conv; +uint64_t __attribute__((export_name("TS_CommitmentTransaction_trust"))) TS_CommitmentTransaction_trust(uint64_t this_arg) { + LDKCommitmentTransaction 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* peer_descriptor_ptr = untag_ptr(peer_descriptor); - if (ptr_is_owned(peer_descriptor)) { CHECK_ACCESS(peer_descriptor_ptr); } - LDKSocketDescriptor* peer_descriptor_conv = (LDKSocketDescriptor*)peer_descriptor_ptr; - LDKu8slice data_ref; - data_ref.datalen = data->arr_len; - data_ref.data = data->elems; - LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ"); - *ret_conv = PeerManager_read_event(&this_arg_conv, peer_descriptor_conv, data_ref); - FREE(data); + LDKTrustedCommitmentTransaction ret_var = CommitmentTransaction_trust(&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_CommitmentTransaction_verify"))) TS_CommitmentTransaction_verify(uint64_t this_arg, uint64_t channel_parameters, uint64_t broadcaster_keys, uint64_t countersignatory_keys) { + LDKCommitmentTransaction 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; + LDKDirectedChannelTransactionParameters 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; + LDKChannelPublicKeys broadcaster_keys_conv; + broadcaster_keys_conv.inner = untag_ptr(broadcaster_keys); + broadcaster_keys_conv.is_owned = ptr_is_owned(broadcaster_keys); + CHECK_INNER_FIELD_ACCESS_OR_NULL(broadcaster_keys_conv); + broadcaster_keys_conv.is_owned = false; + LDKChannelPublicKeys countersignatory_keys_conv; + countersignatory_keys_conv.inner = untag_ptr(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_TrustedCommitmentTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedCommitmentTransactionNoneZ), "LDKCResult_TrustedCommitmentTransactionNoneZ"); + *ret_conv = CommitmentTransaction_verify(&this_arg_conv, &channel_parameters_conv, &broadcaster_keys_conv, &countersignatory_keys_conv); return tag_ptr(ret_conv, true); } -void __attribute__((export_name("TS_PeerManager_process_events"))) TS_PeerManager_process_events(uint64_t this_arg) { - LDKPeerManager this_arg_conv; +void __attribute__((export_name("TS_TrustedCommitmentTransaction_free"))) TS_TrustedCommitmentTransaction_free(uint64_t this_obj) { + LDKTrustedCommitmentTransaction 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); + TrustedCommitmentTransaction_free(this_obj_conv); +} + +int8_tArray __attribute__((export_name("TS_TrustedCommitmentTransaction_txid"))) TS_TrustedCommitmentTransaction_txid(uint64_t this_arg) { + LDKTrustedCommitmentTransaction 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; - PeerManager_process_events(&this_arg_conv); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, TrustedCommitmentTransaction_txid(&this_arg_conv).data, 32); + return ret_arr; } -void __attribute__((export_name("TS_PeerManager_socket_disconnected"))) TS_PeerManager_socket_disconnected(uint64_t this_arg, uint64_t descriptor) { - LDKPeerManager this_arg_conv; +uint64_t __attribute__((export_name("TS_TrustedCommitmentTransaction_built_transaction"))) TS_TrustedCommitmentTransaction_built_transaction(uint64_t this_arg) { + LDKTrustedCommitmentTransaction 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* descriptor_ptr = untag_ptr(descriptor); - if (ptr_is_owned(descriptor)) { CHECK_ACCESS(descriptor_ptr); } - LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor_ptr; - PeerManager_socket_disconnected(&this_arg_conv, descriptor_conv); + LDKBuiltCommitmentTransaction ret_var = TrustedCommitmentTransaction_built_transaction(&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; } -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; +uint64_t __attribute__((export_name("TS_TrustedCommitmentTransaction_keys"))) TS_TrustedCommitmentTransaction_keys(uint64_t this_arg) { + LDKTrustedCommitmentTransaction 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); - PeerManager_disconnect_by_node_id(&this_arg_conv, node_id_ref); + LDKTxCreationKeys ret_var = TrustedCommitmentTransaction_keys(&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; +} + +jboolean __attribute__((export_name("TS_TrustedCommitmentTransaction_opt_anchors"))) TS_TrustedCommitmentTransaction_opt_anchors(uint64_t this_arg) { + LDKTrustedCommitmentTransaction 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 = TrustedCommitmentTransaction_opt_anchors(&this_arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_TrustedCommitmentTransaction_get_htlc_sigs"))) TS_TrustedCommitmentTransaction_get_htlc_sigs(uint64_t this_arg, int8_tArray htlc_base_key, uint64_t channel_parameters, uint64_t entropy_source) { + LDKTrustedCommitmentTransaction 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 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); + 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); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_parameters_conv); + channel_parameters_conv.is_owned = false; + 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_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ"); + *ret_conv = TrustedCommitmentTransaction_get_htlc_sigs(&this_arg_conv, htlc_base_key_ref, &channel_parameters_conv, entropy_source_conv); + return tag_ptr(ret_conv, true); +} + +int64_t __attribute__((export_name("TS_get_commitment_transaction_number_obscure_factor"))) TS_get_commitment_transaction_number_obscure_factor(int8_tArray broadcaster_payment_basepoint, int8_tArray countersignatory_payment_basepoint, jboolean outbound_from_broadcaster) { + LDKPublicKey broadcaster_payment_basepoint_ref; + CHECK(broadcaster_payment_basepoint->arr_len == 33); + memcpy(broadcaster_payment_basepoint_ref.compressed_form, broadcaster_payment_basepoint->elems, 33); FREE(broadcaster_payment_basepoint); + LDKPublicKey countersignatory_payment_basepoint_ref; + CHECK(countersignatory_payment_basepoint->arr_len == 33); + memcpy(countersignatory_payment_basepoint_ref.compressed_form, countersignatory_payment_basepoint->elems, 33); FREE(countersignatory_payment_basepoint); + int64_t ret_conv = get_commitment_transaction_number_obscure_factor(broadcaster_payment_basepoint_ref, countersignatory_payment_basepoint_ref, outbound_from_broadcaster); + return ret_conv; +} + +jboolean __attribute__((export_name("TS_InitFeatures_eq"))) TS_InitFeatures_eq(uint64_t a, uint64_t b) { + LDKInitFeatures 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; + LDKInitFeatures 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 = InitFeatures_eq(&a_conv, &b_conv); + return ret_conv; +} + +jboolean __attribute__((export_name("TS_NodeFeatures_eq"))) TS_NodeFeatures_eq(uint64_t a, uint64_t b) { + LDKNodeFeatures 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; + LDKNodeFeatures 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 = NodeFeatures_eq(&a_conv, &b_conv); + return ret_conv; +} + +jboolean __attribute__((export_name("TS_ChannelFeatures_eq"))) TS_ChannelFeatures_eq(uint64_t a, uint64_t b) { + LDKChannelFeatures 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; + LDKChannelFeatures 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 = ChannelFeatures_eq(&a_conv, &b_conv); + return ret_conv; +} + +jboolean __attribute__((export_name("TS_InvoiceFeatures_eq"))) TS_InvoiceFeatures_eq(uint64_t a, uint64_t b) { + LDKInvoiceFeatures 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; + LDKInvoiceFeatures 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 = InvoiceFeatures_eq(&a_conv, &b_conv); + 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); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKChannelTypeFeatures 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 = ChannelTypeFeatures_eq(&a_conv, &b_conv); + return ret_conv; } -void __attribute__((export_name("TS_PeerManager_disconnect_all_peers"))) TS_PeerManager_disconnect_all_peers(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; - PeerManager_disconnect_all_peers(&this_arg_conv); +static inline uint64_t InitFeatures_clone_ptr(LDKInitFeatures *NONNULL_PTR arg) { + LDKInitFeatures ret_var = InitFeatures_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; } - -void __attribute__((export_name("TS_PeerManager_timer_tick_occurred"))) TS_PeerManager_timer_tick_occurred(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; - PeerManager_timer_tick_occurred(&this_arg_conv); +int64_t __attribute__((export_name("TS_InitFeatures_clone_ptr"))) TS_InitFeatures_clone_ptr(uint64_t arg) { + LDKInitFeatures 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 = InitFeatures_clone_ptr(&arg_conv); + return ret_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); +uint64_t __attribute__((export_name("TS_InitFeatures_clone"))) TS_InitFeatures_clone(uint64_t orig) { + LDKInitFeatures 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; + LDKInitFeatures ret_var = InitFeatures_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_htlc_success_tx_weight"))) TS_htlc_success_tx_weight(jboolean opt_anchors) { - int64_t ret_conv = htlc_success_tx_weight(opt_anchors); +static inline uint64_t NodeFeatures_clone_ptr(LDKNodeFeatures *NONNULL_PTR arg) { + LDKNodeFeatures ret_var = NodeFeatures_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_NodeFeatures_clone_ptr"))) TS_NodeFeatures_clone_ptr(uint64_t arg) { + LDKNodeFeatures 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 = NodeFeatures_clone_ptr(&arg_conv); return ret_conv; } -int64_t __attribute__((export_name("TS_htlc_timeout_tx_weight"))) TS_htlc_timeout_tx_weight(jboolean opt_anchors) { - int64_t ret_conv = htlc_timeout_tx_weight(opt_anchors); - return ret_conv; +uint64_t __attribute__((export_name("TS_NodeFeatures_clone"))) TS_NodeFeatures_clone(uint64_t orig) { + LDKNodeFeatures 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; + LDKNodeFeatures ret_var = NodeFeatures_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; } -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)); +static inline uint64_t ChannelFeatures_clone_ptr(LDKChannelFeatures *NONNULL_PTR arg) { + LDKChannelFeatures ret_var = ChannelFeatures_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_ChannelFeatures_clone_ptr"))) TS_ChannelFeatures_clone_ptr(uint64_t arg) { + LDKChannelFeatures 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 = ChannelFeatures_clone_ptr(&arg_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; +uint64_t __attribute__((export_name("TS_ChannelFeatures_clone"))) TS_ChannelFeatures_clone(uint64_t orig) { + LDKChannelFeatures 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; + LDKChannelFeatures ret_var = ChannelFeatures_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; } -uint32_t __attribute__((export_name("TS_HTLCClaim_offered_preimage"))) TS_HTLCClaim_offered_preimage() { - uint32_t ret_conv = LDKHTLCClaim_to_js(HTLCClaim_offered_preimage()); +static inline uint64_t InvoiceFeatures_clone_ptr(LDKInvoiceFeatures *NONNULL_PTR arg) { + LDKInvoiceFeatures ret_var = InvoiceFeatures_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_InvoiceFeatures_clone_ptr"))) TS_InvoiceFeatures_clone_ptr(uint64_t arg) { + LDKInvoiceFeatures 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 = InvoiceFeatures_clone_ptr(&arg_conv); 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; +uint64_t __attribute__((export_name("TS_InvoiceFeatures_clone"))) TS_InvoiceFeatures_clone(uint64_t orig) { + LDKInvoiceFeatures 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; + LDKInvoiceFeatures ret_var = InvoiceFeatures_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; } -uint32_t __attribute__((export_name("TS_HTLCClaim_accepted_preimage"))) TS_HTLCClaim_accepted_preimage() { - uint32_t ret_conv = LDKHTLCClaim_to_js(HTLCClaim_accepted_preimage()); +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; } -uint32_t __attribute__((export_name("TS_HTLCClaim_revocation"))) TS_HTLCClaim_revocation() { - uint32_t ret_conv = LDKHTLCClaim_to_js(HTLCClaim_revocation()); - 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; } -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); +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_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); +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; } -int8_tArray __attribute__((export_name("TS_build_commitment_secret"))) TS_build_commitment_secret(int8_tArray commitment_seed, int64_t idx) { - uint8_t commitment_seed_arr[32]; - CHECK(commitment_seed->arr_len == 32); - memcpy(commitment_seed_arr, commitment_seed->elems, 32); FREE(commitment_seed); - 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; +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; } - -int8_tArray __attribute__((export_name("TS_build_closing_transaction"))) TS_build_closing_transaction(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; - to_holder_script_ref.data = MALLOC(to_holder_script_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(to_holder_script_ref.data, to_holder_script->elems, to_holder_script_ref.datalen); FREE(to_holder_script); - LDKCVec_u8Z to_counterparty_script_ref; - to_counterparty_script_ref.datalen = to_counterparty_script->arr_len; - to_counterparty_script_ref.data = MALLOC(to_counterparty_script_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(to_counterparty_script_ref.data, to_counterparty_script->elems, to_counterparty_script_ref.datalen); FREE(to_counterparty_script); - LDKOutPoint funding_outpoint_conv; - funding_outpoint_conv.inner = untag_ptr(funding_outpoint); - funding_outpoint_conv.is_owned = ptr_is_owned(funding_outpoint); - CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_conv); - funding_outpoint_conv = OutPoint_clone(&funding_outpoint_conv); - LDKTransaction ret_var = build_closing_transaction(to_holder_value_sat, to_counterparty_value_sat, to_holder_script_ref, to_counterparty_script_ref, funding_outpoint_conv); - 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; +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; } -void __attribute__((export_name("TS_CounterpartyCommitmentSecrets_free"))) TS_CounterpartyCommitmentSecrets_free(uint64_t this_obj) { - LDKCounterpartyCommitmentSecrets 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); - CounterpartyCommitmentSecrets_free(this_obj_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 CounterpartyCommitmentSecrets_clone_ptr(LDKCounterpartyCommitmentSecrets *NONNULL_PTR arg) { - LDKCounterpartyCommitmentSecrets ret_var = CounterpartyCommitmentSecrets_clone(arg); +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_CounterpartyCommitmentSecrets_clone_ptr"))) TS_CounterpartyCommitmentSecrets_clone_ptr(uint64_t arg) { - LDKCounterpartyCommitmentSecrets arg_conv; +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 = CounterpartyCommitmentSecrets_clone_ptr(&arg_conv); + int64_t ret_conv = BlindedHopFeatures_clone_ptr(&arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_CounterpartyCommitmentSecrets_clone"))) TS_CounterpartyCommitmentSecrets_clone(uint64_t orig) { - LDKCounterpartyCommitmentSecrets orig_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; - LDKCounterpartyCommitmentSecrets ret_var = CounterpartyCommitmentSecrets_clone(&orig_conv); + 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; } -uint64_t __attribute__((export_name("TS_CounterpartyCommitmentSecrets_new"))) TS_CounterpartyCommitmentSecrets_new() { - LDKCounterpartyCommitmentSecrets ret_var = CounterpartyCommitmentSecrets_new(); +static inline uint64_t ChannelTypeFeatures_clone_ptr(LDKChannelTypeFeatures *NONNULL_PTR arg) { + LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_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_CounterpartyCommitmentSecrets_get_min_seen_secret"))) TS_CounterpartyCommitmentSecrets_get_min_seen_secret(uint64_t this_arg) { - LDKCounterpartyCommitmentSecrets 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 = CounterpartyCommitmentSecrets_get_min_seen_secret(&this_arg_conv); +int64_t __attribute__((export_name("TS_ChannelTypeFeatures_clone_ptr"))) TS_ChannelTypeFeatures_clone_ptr(uint64_t arg) { + LDKChannelTypeFeatures 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 = ChannelTypeFeatures_clone_ptr(&arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_CounterpartyCommitmentSecrets_provide_secret"))) TS_CounterpartyCommitmentSecrets_provide_secret(uint64_t this_arg, int64_t idx, int8_tArray secret) { - LDKCounterpartyCommitmentSecrets 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 secret_ref; - CHECK(secret->arr_len == 32); - memcpy(secret_ref.data, secret->elems, 32); FREE(secret); - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = CounterpartyCommitmentSecrets_provide_secret(&this_arg_conv, idx, secret_ref); - return tag_ptr(ret_conv, true); +uint64_t __attribute__((export_name("TS_ChannelTypeFeatures_clone"))) TS_ChannelTypeFeatures_clone(uint64_t orig) { + LDKChannelTypeFeatures 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; + LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_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; } -int8_tArray __attribute__((export_name("TS_CounterpartyCommitmentSecrets_get_secret"))) TS_CounterpartyCommitmentSecrets_get_secret(uint64_t this_arg, int64_t idx) { - LDKCounterpartyCommitmentSecrets 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, CounterpartyCommitmentSecrets_get_secret(&this_arg_conv, idx).data, 32); - return ret_arr; +void __attribute__((export_name("TS_InitFeatures_free"))) TS_InitFeatures_free(uint64_t this_obj) { + LDKInitFeatures 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); + InitFeatures_free(this_obj_conv); } -int8_tArray __attribute__((export_name("TS_CounterpartyCommitmentSecrets_write"))) TS_CounterpartyCommitmentSecrets_write(uint64_t obj) { - LDKCounterpartyCommitmentSecrets 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 = CounterpartyCommitmentSecrets_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_NodeFeatures_free"))) TS_NodeFeatures_free(uint64_t this_obj) { + LDKNodeFeatures 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); + NodeFeatures_free(this_obj_conv); } -uint64_t __attribute__((export_name("TS_CounterpartyCommitmentSecrets_read"))) TS_CounterpartyCommitmentSecrets_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ), "LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ"); - *ret_conv = CounterpartyCommitmentSecrets_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +void __attribute__((export_name("TS_ChannelFeatures_free"))) TS_ChannelFeatures_free(uint64_t this_obj) { + LDKChannelFeatures 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); + ChannelFeatures_free(this_obj_conv); } -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); - uint8_t base_secret_arr[32]; - CHECK(base_secret->arr_len == 32); - memcpy(base_secret_arr, base_secret->elems, 32); FREE(base_secret); - 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; +void __attribute__((export_name("TS_InvoiceFeatures_free"))) TS_InvoiceFeatures_free(uint64_t this_obj) { + LDKInvoiceFeatures 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); + InvoiceFeatures_free(this_obj_conv); } -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); - 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; +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); } -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); - 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); - 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; +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); } -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); - 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_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_TxCreationKeys_free"))) TS_TxCreationKeys_free(uint64_t this_obj) { - LDKTxCreationKeys 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); - TxCreationKeys_free(this_obj_conv); + BlindedHopFeatures_free(this_obj_conv); } -int8_tArray __attribute__((export_name("TS_TxCreationKeys_get_per_commitment_point"))) TS_TxCreationKeys_get_per_commitment_point(uint64_t this_ptr) { - LDKTxCreationKeys 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, TxCreationKeys_get_per_commitment_point(&this_ptr_conv).compressed_form, 33); - return ret_arr; +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); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ChannelTypeFeatures_free(this_obj_conv); } -void __attribute__((export_name("TS_TxCreationKeys_set_per_commitment_point"))) TS_TxCreationKeys_set_per_commitment_point(uint64_t this_ptr, int8_tArray val) { - LDKTxCreationKeys 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); - TxCreationKeys_set_per_commitment_point(&this_ptr_conv, val_ref); +uint64_t __attribute__((export_name("TS_InitFeatures_empty"))) TS_InitFeatures_empty() { + LDKInitFeatures ret_var = InitFeatures_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_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); + 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_unknown_bits(&this_arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_NodeFeatures_empty"))) TS_NodeFeatures_empty() { + LDKNodeFeatures ret_var = NodeFeatures_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; } -int8_tArray __attribute__((export_name("TS_TxCreationKeys_get_revocation_key"))) TS_TxCreationKeys_get_revocation_key(uint64_t this_ptr) { - LDKTxCreationKeys 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, TxCreationKeys_get_revocation_key(&this_ptr_conv).compressed_form, 33); - return ret_arr; +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; } -void __attribute__((export_name("TS_TxCreationKeys_set_revocation_key"))) TS_TxCreationKeys_set_revocation_key(uint64_t this_ptr, int8_tArray val) { - LDKTxCreationKeys 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); - TxCreationKeys_set_revocation_key(&this_ptr_conv, val_ref); +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; } -int8_tArray __attribute__((export_name("TS_TxCreationKeys_get_broadcaster_htlc_key"))) TS_TxCreationKeys_get_broadcaster_htlc_key(uint64_t this_ptr) { - LDKTxCreationKeys 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, TxCreationKeys_get_broadcaster_htlc_key(&this_ptr_conv).compressed_form, 33); - return ret_arr; +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 = ChannelFeatures_requires_unknown_bits(&this_arg_conv); + return ret_conv; } -void __attribute__((export_name("TS_TxCreationKeys_set_broadcaster_htlc_key"))) TS_TxCreationKeys_set_broadcaster_htlc_key(uint64_t this_ptr, int8_tArray val) { - LDKTxCreationKeys 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); - TxCreationKeys_set_broadcaster_htlc_key(&this_ptr_conv, val_ref); +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; } -int8_tArray __attribute__((export_name("TS_TxCreationKeys_get_countersignatory_htlc_key"))) TS_TxCreationKeys_get_countersignatory_htlc_key(uint64_t this_ptr) { - LDKTxCreationKeys 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, TxCreationKeys_get_countersignatory_htlc_key(&this_ptr_conv).compressed_form, 33); - return ret_arr; +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; } -void __attribute__((export_name("TS_TxCreationKeys_set_countersignatory_htlc_key"))) TS_TxCreationKeys_set_countersignatory_htlc_key(uint64_t this_ptr, int8_tArray val) { - LDKTxCreationKeys 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); - TxCreationKeys_set_countersignatory_htlc_key(&this_ptr_conv, val_ref); +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; } -int8_tArray __attribute__((export_name("TS_TxCreationKeys_get_broadcaster_delayed_payment_key"))) TS_TxCreationKeys_get_broadcaster_delayed_payment_key(uint64_t this_ptr) { - LDKTxCreationKeys 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, TxCreationKeys_get_broadcaster_delayed_payment_key(&this_ptr_conv).compressed_form, 33); - return ret_arr; +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 = OfferFeatures_requires_unknown_bits(&this_arg_conv); + return ret_conv; } -void __attribute__((export_name("TS_TxCreationKeys_set_broadcaster_delayed_payment_key"))) TS_TxCreationKeys_set_broadcaster_delayed_payment_key(uint64_t this_ptr, int8_tArray val) { - LDKTxCreationKeys 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); - TxCreationKeys_set_broadcaster_delayed_payment_key(&this_ptr_conv, val_ref); +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_TxCreationKeys_new"))) TS_TxCreationKeys_new(int8_tArray per_commitment_point_arg, int8_tArray revocation_key_arg, int8_tArray broadcaster_htlc_key_arg, int8_tArray countersignatory_htlc_key_arg, int8_tArray broadcaster_delayed_payment_key_arg) { - LDKPublicKey per_commitment_point_arg_ref; - CHECK(per_commitment_point_arg->arr_len == 33); - memcpy(per_commitment_point_arg_ref.compressed_form, per_commitment_point_arg->elems, 33); FREE(per_commitment_point_arg); - LDKPublicKey revocation_key_arg_ref; - CHECK(revocation_key_arg->arr_len == 33); - memcpy(revocation_key_arg_ref.compressed_form, revocation_key_arg->elems, 33); FREE(revocation_key_arg); - LDKPublicKey broadcaster_htlc_key_arg_ref; - CHECK(broadcaster_htlc_key_arg->arr_len == 33); - memcpy(broadcaster_htlc_key_arg_ref.compressed_form, broadcaster_htlc_key_arg->elems, 33); FREE(broadcaster_htlc_key_arg); - LDKPublicKey countersignatory_htlc_key_arg_ref; - CHECK(countersignatory_htlc_key_arg->arr_len == 33); - memcpy(countersignatory_htlc_key_arg_ref.compressed_form, countersignatory_htlc_key_arg->elems, 33); FREE(countersignatory_htlc_key_arg); - LDKPublicKey broadcaster_delayed_payment_key_arg_ref; - CHECK(broadcaster_delayed_payment_key_arg->arr_len == 33); - memcpy(broadcaster_delayed_payment_key_arg_ref.compressed_form, broadcaster_delayed_payment_key_arg->elems, 33); FREE(broadcaster_delayed_payment_key_arg); - LDKTxCreationKeys ret_var = TxCreationKeys_new(per_commitment_point_arg_ref, revocation_key_arg_ref, broadcaster_htlc_key_arg_ref, countersignatory_htlc_key_arg_ref, broadcaster_delayed_payment_key_arg_ref); +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_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); +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 = Bolt12InvoiceFeatures_requires_unknown_bits(&this_arg_conv); return ret_conv; } -static inline uint64_t TxCreationKeys_clone_ptr(LDKTxCreationKeys *NONNULL_PTR arg) { - LDKTxCreationKeys ret_var = TxCreationKeys_clone(arg); +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; } -int64_t __attribute__((export_name("TS_TxCreationKeys_clone_ptr"))) TS_TxCreationKeys_clone_ptr(uint64_t arg) { - LDKTxCreationKeys 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 = TxCreationKeys_clone_ptr(&arg_conv); + +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_TxCreationKeys_clone"))) TS_TxCreationKeys_clone(uint64_t orig) { - LDKTxCreationKeys 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; - LDKTxCreationKeys ret_var = TxCreationKeys_clone(&orig_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 ret_ref; } -int8_tArray __attribute__((export_name("TS_TxCreationKeys_write"))) TS_TxCreationKeys_write(uint64_t obj) { - LDKTxCreationKeys obj_conv; +jboolean __attribute__((export_name("TS_ChannelTypeFeatures_requires_unknown_bits"))) TS_ChannelTypeFeatures_requires_unknown_bits(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_unknown_bits(&this_arg_conv); + return ret_conv; +} + +int8_tArray __attribute__((export_name("TS_InitFeatures_write"))) TS_InitFeatures_write(uint64_t obj) { + LDKInitFeatures 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 = TxCreationKeys_write(&obj_conv); + LDKCVec_u8Z ret_var = InitFeatures_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_TxCreationKeys_read"))) TS_TxCreationKeys_read(int8_tArray ser) { +uint64_t __attribute__((export_name("TS_InitFeatures_read"))) TS_InitFeatures_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; ser_ref.data = ser->elems; - LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ"); - *ret_conv = TxCreationKeys_read(ser_ref); + LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ"); + *ret_conv = InitFeatures_read(ser_ref); FREE(ser); return tag_ptr(ret_conv, true); } -void __attribute__((export_name("TS_ChannelPublicKeys_free"))) TS_ChannelPublicKeys_free(uint64_t this_obj) { - LDKChannelPublicKeys 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); - ChannelPublicKeys_free(this_obj_conv); +int8_tArray __attribute__((export_name("TS_ChannelFeatures_write"))) TS_ChannelFeatures_write(uint64_t obj) { + LDKChannelFeatures 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 = ChannelFeatures_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_ChannelPublicKeys_get_funding_pubkey"))) TS_ChannelPublicKeys_get_funding_pubkey(uint64_t this_ptr) { - LDKChannelPublicKeys 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, ChannelPublicKeys_get_funding_pubkey(&this_ptr_conv).compressed_form, 33); +uint64_t __attribute__((export_name("TS_ChannelFeatures_read"))) TS_ChannelFeatures_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ"); + *ret_conv = ChannelFeatures_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +int8_tArray __attribute__((export_name("TS_NodeFeatures_write"))) TS_NodeFeatures_write(uint64_t obj) { + LDKNodeFeatures 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 = NodeFeatures_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_ChannelPublicKeys_set_funding_pubkey"))) TS_ChannelPublicKeys_set_funding_pubkey(uint64_t this_ptr, int8_tArray val) { - LDKChannelPublicKeys 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); - ChannelPublicKeys_set_funding_pubkey(&this_ptr_conv, val_ref); +uint64_t __attribute__((export_name("TS_NodeFeatures_read"))) TS_NodeFeatures_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ"); + *ret_conv = NodeFeatures_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -int8_tArray __attribute__((export_name("TS_ChannelPublicKeys_get_revocation_basepoint"))) TS_ChannelPublicKeys_get_revocation_basepoint(uint64_t this_ptr) { - LDKChannelPublicKeys 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, ChannelPublicKeys_get_revocation_basepoint(&this_ptr_conv).compressed_form, 33); +int8_tArray __attribute__((export_name("TS_InvoiceFeatures_write"))) TS_InvoiceFeatures_write(uint64_t obj) { + LDKInvoiceFeatures 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 = InvoiceFeatures_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_ChannelPublicKeys_set_revocation_basepoint"))) TS_ChannelPublicKeys_set_revocation_basepoint(uint64_t this_ptr, int8_tArray val) { - LDKChannelPublicKeys 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); - ChannelPublicKeys_set_revocation_basepoint(&this_ptr_conv, val_ref); +uint64_t __attribute__((export_name("TS_InvoiceFeatures_read"))) TS_InvoiceFeatures_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ"); + *ret_conv = InvoiceFeatures_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -int8_tArray __attribute__((export_name("TS_ChannelPublicKeys_get_payment_point"))) TS_ChannelPublicKeys_get_payment_point(uint64_t this_ptr) { - LDKChannelPublicKeys 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, ChannelPublicKeys_get_payment_point(&this_ptr_conv).compressed_form, 33); +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; } -void __attribute__((export_name("TS_ChannelPublicKeys_set_payment_point"))) TS_ChannelPublicKeys_set_payment_point(uint64_t this_ptr, int8_tArray val) { - LDKChannelPublicKeys 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); - ChannelPublicKeys_set_payment_point(&this_ptr_conv, val_ref); +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_ChannelPublicKeys_get_delayed_payment_basepoint"))) TS_ChannelPublicKeys_get_delayed_payment_basepoint(uint64_t this_ptr) { - LDKChannelPublicKeys 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, ChannelPublicKeys_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form, 33); +int8_tArray __attribute__((export_name("TS_ChannelTypeFeatures_write"))) TS_ChannelTypeFeatures_write(uint64_t obj) { + LDKChannelTypeFeatures 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 = ChannelTypeFeatures_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_ChannelPublicKeys_set_delayed_payment_basepoint"))) TS_ChannelPublicKeys_set_delayed_payment_basepoint(uint64_t this_ptr, int8_tArray val) { - LDKChannelPublicKeys 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); - ChannelPublicKeys_set_delayed_payment_basepoint(&this_ptr_conv, val_ref); +uint64_t __attribute__((export_name("TS_ChannelTypeFeatures_read"))) TS_ChannelTypeFeatures_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ"); + *ret_conv = ChannelTypeFeatures_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -int8_tArray __attribute__((export_name("TS_ChannelPublicKeys_get_htlc_basepoint"))) TS_ChannelPublicKeys_get_htlc_basepoint(uint64_t this_ptr) { - LDKChannelPublicKeys 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, ChannelPublicKeys_get_htlc_basepoint(&this_ptr_conv).compressed_form, 33); - return ret_arr; +void __attribute__((export_name("TS_InitFeatures_set_data_loss_protect_optional"))) TS_InitFeatures_set_data_loss_protect_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_data_loss_protect_optional(&this_arg_conv); } -void __attribute__((export_name("TS_ChannelPublicKeys_set_htlc_basepoint"))) TS_ChannelPublicKeys_set_htlc_basepoint(uint64_t this_ptr, int8_tArray val) { - LDKChannelPublicKeys 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); - ChannelPublicKeys_set_htlc_basepoint(&this_ptr_conv, val_ref); +void __attribute__((export_name("TS_InitFeatures_set_data_loss_protect_required"))) TS_InitFeatures_set_data_loss_protect_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_data_loss_protect_required(&this_arg_conv); } -uint64_t __attribute__((export_name("TS_ChannelPublicKeys_new"))) TS_ChannelPublicKeys_new(int8_tArray funding_pubkey_arg, int8_tArray revocation_basepoint_arg, int8_tArray payment_point_arg, int8_tArray delayed_payment_basepoint_arg, int8_tArray htlc_basepoint_arg) { - LDKPublicKey funding_pubkey_arg_ref; - CHECK(funding_pubkey_arg->arr_len == 33); - memcpy(funding_pubkey_arg_ref.compressed_form, funding_pubkey_arg->elems, 33); FREE(funding_pubkey_arg); - LDKPublicKey revocation_basepoint_arg_ref; - CHECK(revocation_basepoint_arg->arr_len == 33); - memcpy(revocation_basepoint_arg_ref.compressed_form, revocation_basepoint_arg->elems, 33); FREE(revocation_basepoint_arg); - LDKPublicKey payment_point_arg_ref; - CHECK(payment_point_arg->arr_len == 33); - memcpy(payment_point_arg_ref.compressed_form, payment_point_arg->elems, 33); FREE(payment_point_arg); - LDKPublicKey delayed_payment_basepoint_arg_ref; - CHECK(delayed_payment_basepoint_arg->arr_len == 33); - memcpy(delayed_payment_basepoint_arg_ref.compressed_form, delayed_payment_basepoint_arg->elems, 33); FREE(delayed_payment_basepoint_arg); - LDKPublicKey htlc_basepoint_arg_ref; - CHECK(htlc_basepoint_arg->arr_len == 33); - memcpy(htlc_basepoint_arg_ref.compressed_form, htlc_basepoint_arg->elems, 33); FREE(htlc_basepoint_arg); - LDKChannelPublicKeys ret_var = ChannelPublicKeys_new(funding_pubkey_arg_ref, revocation_basepoint_arg_ref, payment_point_arg_ref, delayed_payment_basepoint_arg_ref, htlc_basepoint_arg_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; +jboolean __attribute__((export_name("TS_InitFeatures_supports_data_loss_protect"))) TS_InitFeatures_supports_data_loss_protect(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_data_loss_protect(&this_arg_conv); + return ret_conv; } -static inline uint64_t ChannelPublicKeys_clone_ptr(LDKChannelPublicKeys *NONNULL_PTR arg) { - LDKChannelPublicKeys ret_var = ChannelPublicKeys_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; +void __attribute__((export_name("TS_NodeFeatures_set_data_loss_protect_optional"))) TS_NodeFeatures_set_data_loss_protect_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_data_loss_protect_optional(&this_arg_conv); +} + +void __attribute__((export_name("TS_NodeFeatures_set_data_loss_protect_required"))) TS_NodeFeatures_set_data_loss_protect_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_data_loss_protect_required(&this_arg_conv); +} + +jboolean __attribute__((export_name("TS_NodeFeatures_supports_data_loss_protect"))) TS_NodeFeatures_supports_data_loss_protect(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_data_loss_protect(&this_arg_conv); + return ret_conv; +} + +jboolean __attribute__((export_name("TS_InitFeatures_requires_data_loss_protect"))) TS_InitFeatures_requires_data_loss_protect(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_data_loss_protect(&this_arg_conv); + return ret_conv; } -int64_t __attribute__((export_name("TS_ChannelPublicKeys_clone_ptr"))) TS_ChannelPublicKeys_clone_ptr(uint64_t arg) { - LDKChannelPublicKeys 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 = ChannelPublicKeys_clone_ptr(&arg_conv); + +jboolean __attribute__((export_name("TS_NodeFeatures_requires_data_loss_protect"))) TS_NodeFeatures_requires_data_loss_protect(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_data_loss_protect(&this_arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_ChannelPublicKeys_clone"))) TS_ChannelPublicKeys_clone(uint64_t orig) { - LDKChannelPublicKeys 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; - LDKChannelPublicKeys ret_var = ChannelPublicKeys_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_InitFeatures_set_initial_routing_sync_optional"))) TS_InitFeatures_set_initial_routing_sync_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_initial_routing_sync_optional(&this_arg_conv); } -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); +void __attribute__((export_name("TS_InitFeatures_set_initial_routing_sync_required"))) TS_InitFeatures_set_initial_routing_sync_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_initial_routing_sync_required(&this_arg_conv); +} + +jboolean __attribute__((export_name("TS_InitFeatures_initial_routing_sync"))) TS_InitFeatures_initial_routing_sync(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_initial_routing_sync(&this_arg_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); - 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 = ChannelPublicKeys_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_InitFeatures_set_upfront_shutdown_script_optional"))) TS_InitFeatures_set_upfront_shutdown_script_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_upfront_shutdown_script_optional(&this_arg_conv); } -uint64_t __attribute__((export_name("TS_ChannelPublicKeys_read"))) TS_ChannelPublicKeys_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ"); - *ret_conv = ChannelPublicKeys_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +void __attribute__((export_name("TS_InitFeatures_set_upfront_shutdown_script_required"))) TS_InitFeatures_set_upfront_shutdown_script_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_upfront_shutdown_script_required(&this_arg_conv); } -uint64_t __attribute__((export_name("TS_TxCreationKeys_derive_new"))) TS_TxCreationKeys_derive_new(int8_tArray per_commitment_point, int8_tArray broadcaster_delayed_payment_base, int8_tArray broadcaster_htlc_base, int8_tArray countersignatory_revocation_base, int8_tArray countersignatory_htlc_base) { - 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 broadcaster_delayed_payment_base_ref; - CHECK(broadcaster_delayed_payment_base->arr_len == 33); - memcpy(broadcaster_delayed_payment_base_ref.compressed_form, broadcaster_delayed_payment_base->elems, 33); FREE(broadcaster_delayed_payment_base); - LDKPublicKey broadcaster_htlc_base_ref; - CHECK(broadcaster_htlc_base->arr_len == 33); - memcpy(broadcaster_htlc_base_ref.compressed_form, broadcaster_htlc_base->elems, 33); FREE(broadcaster_htlc_base); - LDKPublicKey countersignatory_revocation_base_ref; - CHECK(countersignatory_revocation_base->arr_len == 33); - memcpy(countersignatory_revocation_base_ref.compressed_form, countersignatory_revocation_base->elems, 33); FREE(countersignatory_revocation_base); - 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); - 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; +jboolean __attribute__((export_name("TS_InitFeatures_supports_upfront_shutdown_script"))) TS_InitFeatures_supports_upfront_shutdown_script(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_upfront_shutdown_script(&this_arg_conv); + return ret_conv; } -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) { - 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); - LDKChannelPublicKeys broadcaster_keys_conv; - broadcaster_keys_conv.inner = untag_ptr(broadcaster_keys); - broadcaster_keys_conv.is_owned = ptr_is_owned(broadcaster_keys); - CHECK_INNER_FIELD_ACCESS_OR_NULL(broadcaster_keys_conv); - broadcaster_keys_conv.is_owned = false; - LDKChannelPublicKeys countersignatory_keys_conv; - countersignatory_keys_conv.inner = untag_ptr(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; - 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; +void __attribute__((export_name("TS_NodeFeatures_set_upfront_shutdown_script_optional"))) TS_NodeFeatures_set_upfront_shutdown_script_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_upfront_shutdown_script_optional(&this_arg_conv); } -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) { - LDKPublicKey revocation_key_ref; - CHECK(revocation_key->arr_len == 33); - memcpy(revocation_key_ref.compressed_form, revocation_key->elems, 33); FREE(revocation_key); - LDKPublicKey broadcaster_delayed_payment_key_ref; - CHECK(broadcaster_delayed_payment_key->arr_len == 33); - memcpy(broadcaster_delayed_payment_key_ref.compressed_form, broadcaster_delayed_payment_key->elems, 33); FREE(broadcaster_delayed_payment_key); - LDKCVec_u8Z ret_var = get_revokeable_redeemscript(revocation_key_ref, contest_delay, broadcaster_delayed_payment_key_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; +void __attribute__((export_name("TS_NodeFeatures_set_upfront_shutdown_script_required"))) TS_NodeFeatures_set_upfront_shutdown_script_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_upfront_shutdown_script_required(&this_arg_conv); } -void __attribute__((export_name("TS_HTLCOutputInCommitment_free"))) TS_HTLCOutputInCommitment_free(uint64_t this_obj) { - LDKHTLCOutputInCommitment 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); - HTLCOutputInCommitment_free(this_obj_conv); +jboolean __attribute__((export_name("TS_NodeFeatures_supports_upfront_shutdown_script"))) TS_NodeFeatures_supports_upfront_shutdown_script(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_upfront_shutdown_script(&this_arg_conv); + return ret_conv; } -jboolean __attribute__((export_name("TS_HTLCOutputInCommitment_get_offered"))) TS_HTLCOutputInCommitment_get_offered(uint64_t this_ptr) { - LDKHTLCOutputInCommitment 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 = HTLCOutputInCommitment_get_offered(&this_ptr_conv); +jboolean __attribute__((export_name("TS_InitFeatures_requires_upfront_shutdown_script"))) TS_InitFeatures_requires_upfront_shutdown_script(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_upfront_shutdown_script(&this_arg_conv); return ret_conv; } -void __attribute__((export_name("TS_HTLCOutputInCommitment_set_offered"))) TS_HTLCOutputInCommitment_set_offered(uint64_t this_ptr, jboolean val) { - LDKHTLCOutputInCommitment 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; - HTLCOutputInCommitment_set_offered(&this_ptr_conv, val); +jboolean __attribute__((export_name("TS_NodeFeatures_requires_upfront_shutdown_script"))) TS_NodeFeatures_requires_upfront_shutdown_script(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_upfront_shutdown_script(&this_arg_conv); + return ret_conv; } -int64_t __attribute__((export_name("TS_HTLCOutputInCommitment_get_amount_msat"))) TS_HTLCOutputInCommitment_get_amount_msat(uint64_t this_ptr) { - LDKHTLCOutputInCommitment 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 = HTLCOutputInCommitment_get_amount_msat(&this_ptr_conv); +void __attribute__((export_name("TS_InitFeatures_set_gossip_queries_optional"))) TS_InitFeatures_set_gossip_queries_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_gossip_queries_optional(&this_arg_conv); +} + +void __attribute__((export_name("TS_InitFeatures_set_gossip_queries_required"))) TS_InitFeatures_set_gossip_queries_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_gossip_queries_required(&this_arg_conv); +} + +jboolean __attribute__((export_name("TS_InitFeatures_supports_gossip_queries"))) TS_InitFeatures_supports_gossip_queries(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_gossip_queries(&this_arg_conv); return ret_conv; } -void __attribute__((export_name("TS_HTLCOutputInCommitment_set_amount_msat"))) TS_HTLCOutputInCommitment_set_amount_msat(uint64_t this_ptr, int64_t val) { - LDKHTLCOutputInCommitment 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; - HTLCOutputInCommitment_set_amount_msat(&this_ptr_conv, val); +void __attribute__((export_name("TS_NodeFeatures_set_gossip_queries_optional"))) TS_NodeFeatures_set_gossip_queries_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_gossip_queries_optional(&this_arg_conv); } -int32_t __attribute__((export_name("TS_HTLCOutputInCommitment_get_cltv_expiry"))) TS_HTLCOutputInCommitment_get_cltv_expiry(uint64_t this_ptr) { - LDKHTLCOutputInCommitment 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 = HTLCOutputInCommitment_get_cltv_expiry(&this_ptr_conv); +void __attribute__((export_name("TS_NodeFeatures_set_gossip_queries_required"))) TS_NodeFeatures_set_gossip_queries_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_gossip_queries_required(&this_arg_conv); +} + +jboolean __attribute__((export_name("TS_NodeFeatures_supports_gossip_queries"))) TS_NodeFeatures_supports_gossip_queries(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_gossip_queries(&this_arg_conv); return ret_conv; } -void __attribute__((export_name("TS_HTLCOutputInCommitment_set_cltv_expiry"))) TS_HTLCOutputInCommitment_set_cltv_expiry(uint64_t this_ptr, int32_t val) { - LDKHTLCOutputInCommitment 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; - HTLCOutputInCommitment_set_cltv_expiry(&this_ptr_conv, val); +jboolean __attribute__((export_name("TS_InitFeatures_requires_gossip_queries"))) TS_InitFeatures_requires_gossip_queries(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_gossip_queries(&this_arg_conv); + return ret_conv; } -int8_tArray __attribute__((export_name("TS_HTLCOutputInCommitment_get_payment_hash"))) TS_HTLCOutputInCommitment_get_payment_hash(uint64_t this_ptr) { - LDKHTLCOutputInCommitment 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(32, __LINE__); - memcpy(ret_arr->elems, *HTLCOutputInCommitment_get_payment_hash(&this_ptr_conv), 32); - return ret_arr; +jboolean __attribute__((export_name("TS_NodeFeatures_requires_gossip_queries"))) TS_NodeFeatures_requires_gossip_queries(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_gossip_queries(&this_arg_conv); + return ret_conv; } -void __attribute__((export_name("TS_HTLCOutputInCommitment_set_payment_hash"))) TS_HTLCOutputInCommitment_set_payment_hash(uint64_t this_ptr, int8_tArray val) { - LDKHTLCOutputInCommitment 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; - LDKThirtyTwoBytes val_ref; - CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); FREE(val); - HTLCOutputInCommitment_set_payment_hash(&this_ptr_conv, val_ref); +void __attribute__((export_name("TS_InitFeatures_set_variable_length_onion_optional"))) TS_InitFeatures_set_variable_length_onion_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_variable_length_onion_optional(&this_arg_conv); } -uint64_t __attribute__((export_name("TS_HTLCOutputInCommitment_get_transaction_output_index"))) TS_HTLCOutputInCommitment_get_transaction_output_index(uint64_t this_ptr) { - LDKHTLCOutputInCommitment 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 = HTLCOutputInCommitment_get_transaction_output_index(&this_ptr_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void __attribute__((export_name("TS_InitFeatures_set_variable_length_onion_required"))) TS_InitFeatures_set_variable_length_onion_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_variable_length_onion_required(&this_arg_conv); } -void __attribute__((export_name("TS_HTLCOutputInCommitment_set_transaction_output_index"))) TS_HTLCOutputInCommitment_set_transaction_output_index(uint64_t this_ptr, uint64_t val) { - LDKHTLCOutputInCommitment 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)); - HTLCOutputInCommitment_set_transaction_output_index(&this_ptr_conv, val_conv); +jboolean __attribute__((export_name("TS_InitFeatures_supports_variable_length_onion"))) TS_InitFeatures_supports_variable_length_onion(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_variable_length_onion(&this_arg_conv); + return ret_conv; } -uint64_t __attribute__((export_name("TS_HTLCOutputInCommitment_new"))) TS_HTLCOutputInCommitment_new(jboolean offered_arg, int64_t amount_msat_arg, int32_t cltv_expiry_arg, int8_tArray payment_hash_arg, uint64_t transaction_output_index_arg) { - LDKThirtyTwoBytes payment_hash_arg_ref; - CHECK(payment_hash_arg->arr_len == 32); - memcpy(payment_hash_arg_ref.data, payment_hash_arg->elems, 32); FREE(payment_hash_arg); - void* transaction_output_index_arg_ptr = untag_ptr(transaction_output_index_arg); - CHECK_ACCESS(transaction_output_index_arg_ptr); - LDKCOption_u32Z transaction_output_index_arg_conv = *(LDKCOption_u32Z*)(transaction_output_index_arg_ptr); - transaction_output_index_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(transaction_output_index_arg)); - LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_new(offered_arg, amount_msat_arg, cltv_expiry_arg, payment_hash_arg_ref, transaction_output_index_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_NodeFeatures_set_variable_length_onion_optional"))) TS_NodeFeatures_set_variable_length_onion_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_variable_length_onion_optional(&this_arg_conv); } -static inline uint64_t HTLCOutputInCommitment_clone_ptr(LDKHTLCOutputInCommitment *NONNULL_PTR arg) { - LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_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; +void __attribute__((export_name("TS_NodeFeatures_set_variable_length_onion_required"))) TS_NodeFeatures_set_variable_length_onion_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_variable_length_onion_required(&this_arg_conv); } -int64_t __attribute__((export_name("TS_HTLCOutputInCommitment_clone_ptr"))) TS_HTLCOutputInCommitment_clone_ptr(uint64_t arg) { - LDKHTLCOutputInCommitment 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 = HTLCOutputInCommitment_clone_ptr(&arg_conv); + +jboolean __attribute__((export_name("TS_NodeFeatures_supports_variable_length_onion"))) TS_NodeFeatures_supports_variable_length_onion(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_variable_length_onion(&this_arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_HTLCOutputInCommitment_clone"))) TS_HTLCOutputInCommitment_clone(uint64_t orig) { - LDKHTLCOutputInCommitment 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; - LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_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_InvoiceFeatures_set_variable_length_onion_optional"))) TS_InvoiceFeatures_set_variable_length_onion_optional(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; + InvoiceFeatures_set_variable_length_onion_optional(&this_arg_conv); } -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); +void __attribute__((export_name("TS_InvoiceFeatures_set_variable_length_onion_required"))) TS_InvoiceFeatures_set_variable_length_onion_required(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; + InvoiceFeatures_set_variable_length_onion_required(&this_arg_conv); +} + +jboolean __attribute__((export_name("TS_InvoiceFeatures_supports_variable_length_onion"))) TS_InvoiceFeatures_supports_variable_length_onion(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_supports_variable_length_onion(&this_arg_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); - 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 = HTLCOutputInCommitment_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; +jboolean __attribute__((export_name("TS_InitFeatures_requires_variable_length_onion"))) TS_InitFeatures_requires_variable_length_onion(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_variable_length_onion(&this_arg_conv); + return ret_conv; } -uint64_t __attribute__((export_name("TS_HTLCOutputInCommitment_read"))) TS_HTLCOutputInCommitment_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ"); - *ret_conv = HTLCOutputInCommitment_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +jboolean __attribute__((export_name("TS_NodeFeatures_requires_variable_length_onion"))) TS_NodeFeatures_requires_variable_length_onion(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_variable_length_onion(&this_arg_conv); + return ret_conv; } -int8_tArray __attribute__((export_name("TS_get_htlc_redeemscript"))) TS_get_htlc_redeemscript(uint64_t htlc, jboolean opt_anchors, uint64_t keys) { - LDKHTLCOutputInCommitment htlc_conv; - htlc_conv.inner = untag_ptr(htlc); - htlc_conv.is_owned = ptr_is_owned(htlc); - CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_conv); - htlc_conv.is_owned = false; - LDKTxCreationKeys keys_conv; - keys_conv.inner = untag_ptr(keys); - keys_conv.is_owned = ptr_is_owned(keys); - CHECK_INNER_FIELD_ACCESS_OR_NULL(keys_conv); - keys_conv.is_owned = false; - LDKCVec_u8Z ret_var = get_htlc_redeemscript(&htlc_conv, opt_anchors, &keys_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; +jboolean __attribute__((export_name("TS_InvoiceFeatures_requires_variable_length_onion"))) TS_InvoiceFeatures_requires_variable_length_onion(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_variable_length_onion(&this_arg_conv); + return ret_conv; } -int8_tArray __attribute__((export_name("TS_make_funding_redeemscript"))) TS_make_funding_redeemscript(int8_tArray broadcaster, int8_tArray countersignatory) { - LDKPublicKey broadcaster_ref; - CHECK(broadcaster->arr_len == 33); - memcpy(broadcaster_ref.compressed_form, broadcaster->elems, 33); FREE(broadcaster); - LDKPublicKey countersignatory_ref; - CHECK(countersignatory->arr_len == 33); - memcpy(countersignatory_ref.compressed_form, countersignatory->elems, 33); FREE(countersignatory); - LDKCVec_u8Z ret_var = make_funding_redeemscript(broadcaster_ref, countersignatory_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; +void __attribute__((export_name("TS_InitFeatures_set_static_remote_key_optional"))) TS_InitFeatures_set_static_remote_key_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_static_remote_key_optional(&this_arg_conv); } -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); - 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); - CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_conv); - htlc_conv.is_owned = false; - LDKPublicKey broadcaster_delayed_payment_key_ref; - CHECK(broadcaster_delayed_payment_key->arr_len == 33); - memcpy(broadcaster_delayed_payment_key_ref.compressed_form, broadcaster_delayed_payment_key->elems, 33); FREE(broadcaster_delayed_payment_key); - 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, 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; +void __attribute__((export_name("TS_InitFeatures_set_static_remote_key_required"))) TS_InitFeatures_set_static_remote_key_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_static_remote_key_required(&this_arg_conv); } -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; +jboolean __attribute__((export_name("TS_InitFeatures_supports_static_remote_key"))) TS_InitFeatures_supports_static_remote_key(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_static_remote_key(&this_arg_conv); + return ret_conv; } -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; +void __attribute__((export_name("TS_NodeFeatures_set_static_remote_key_optional"))) TS_NodeFeatures_set_static_remote_key_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_static_remote_key_optional(&this_arg_conv); } -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); - memcpy(funding_pubkey_ref.compressed_form, funding_pubkey->elems, 33); FREE(funding_pubkey); - LDKCVec_u8Z ret_var = get_anchor_redeemscript(funding_pubkey_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; +void __attribute__((export_name("TS_NodeFeatures_set_static_remote_key_required"))) TS_NodeFeatures_set_static_remote_key_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_static_remote_key_required(&this_arg_conv); } -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; +jboolean __attribute__((export_name("TS_NodeFeatures_supports_static_remote_key"))) TS_NodeFeatures_supports_static_remote_key(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_static_remote_key(&this_arg_conv); + return ret_conv; } -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); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChannelTransactionParameters_free(this_obj_conv); +void __attribute__((export_name("TS_ChannelTypeFeatures_set_static_remote_key_optional"))) TS_ChannelTypeFeatures_set_static_remote_key_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_static_remote_key_optional(&this_arg_conv); } -uint64_t __attribute__((export_name("TS_ChannelTransactionParameters_get_holder_pubkeys"))) TS_ChannelTransactionParameters_get_holder_pubkeys(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; - LDKChannelPublicKeys ret_var = ChannelTransactionParameters_get_holder_pubkeys(&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_ChannelTypeFeatures_set_static_remote_key_required"))) TS_ChannelTypeFeatures_set_static_remote_key_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_static_remote_key_required(&this_arg_conv); } -void __attribute__((export_name("TS_ChannelTransactionParameters_set_holder_pubkeys"))) TS_ChannelTransactionParameters_set_holder_pubkeys(uint64_t this_ptr, uint64_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; - LDKChannelPublicKeys 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 = ChannelPublicKeys_clone(&val_conv); - ChannelTransactionParameters_set_holder_pubkeys(&this_ptr_conv, val_conv); +jboolean __attribute__((export_name("TS_ChannelTypeFeatures_supports_static_remote_key"))) TS_ChannelTypeFeatures_supports_static_remote_key(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_static_remote_key(&this_arg_conv); + return ret_conv; } -int16_t __attribute__((export_name("TS_ChannelTransactionParameters_get_holder_selected_contest_delay"))) TS_ChannelTransactionParameters_get_holder_selected_contest_delay(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; - int16_t ret_conv = ChannelTransactionParameters_get_holder_selected_contest_delay(&this_ptr_conv); +jboolean __attribute__((export_name("TS_InitFeatures_requires_static_remote_key"))) TS_InitFeatures_requires_static_remote_key(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_static_remote_key(&this_arg_conv); return ret_conv; } -void __attribute__((export_name("TS_ChannelTransactionParameters_set_holder_selected_contest_delay"))) TS_ChannelTransactionParameters_set_holder_selected_contest_delay(uint64_t this_ptr, int16_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; - ChannelTransactionParameters_set_holder_selected_contest_delay(&this_ptr_conv, val); +jboolean __attribute__((export_name("TS_NodeFeatures_requires_static_remote_key"))) TS_NodeFeatures_requires_static_remote_key(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_static_remote_key(&this_arg_conv); + return ret_conv; } -jboolean __attribute__((export_name("TS_ChannelTransactionParameters_get_is_outbound_from_holder"))) TS_ChannelTransactionParameters_get_is_outbound_from_holder(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; - jboolean ret_conv = ChannelTransactionParameters_get_is_outbound_from_holder(&this_ptr_conv); +jboolean __attribute__((export_name("TS_ChannelTypeFeatures_requires_static_remote_key"))) TS_ChannelTypeFeatures_requires_static_remote_key(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_static_remote_key(&this_arg_conv); return ret_conv; } -void __attribute__((export_name("TS_ChannelTransactionParameters_set_is_outbound_from_holder"))) TS_ChannelTransactionParameters_set_is_outbound_from_holder(uint64_t this_ptr, jboolean 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; - ChannelTransactionParameters_set_is_outbound_from_holder(&this_ptr_conv, val); +void __attribute__((export_name("TS_InitFeatures_set_payment_secret_optional"))) TS_InitFeatures_set_payment_secret_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_payment_secret_optional(&this_arg_conv); } -uint64_t __attribute__((export_name("TS_ChannelTransactionParameters_get_counterparty_parameters"))) TS_ChannelTransactionParameters_get_counterparty_parameters(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; - LDKCounterpartyChannelTransactionParameters ret_var = ChannelTransactionParameters_get_counterparty_parameters(&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_InitFeatures_set_payment_secret_required"))) TS_InitFeatures_set_payment_secret_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_payment_secret_required(&this_arg_conv); } -void __attribute__((export_name("TS_ChannelTransactionParameters_set_counterparty_parameters"))) TS_ChannelTransactionParameters_set_counterparty_parameters(uint64_t this_ptr, uint64_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; - LDKCounterpartyChannelTransactionParameters 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 = CounterpartyChannelTransactionParameters_clone(&val_conv); - ChannelTransactionParameters_set_counterparty_parameters(&this_ptr_conv, val_conv); +jboolean __attribute__((export_name("TS_InitFeatures_supports_payment_secret"))) TS_InitFeatures_supports_payment_secret(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_payment_secret(&this_arg_conv); + return ret_conv; } -uint64_t __attribute__((export_name("TS_ChannelTransactionParameters_get_funding_outpoint"))) TS_ChannelTransactionParameters_get_funding_outpoint(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; - LDKOutPoint ret_var = ChannelTransactionParameters_get_funding_outpoint(&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_NodeFeatures_set_payment_secret_optional"))) TS_NodeFeatures_set_payment_secret_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_payment_secret_optional(&this_arg_conv); } -void __attribute__((export_name("TS_ChannelTransactionParameters_set_funding_outpoint"))) TS_ChannelTransactionParameters_set_funding_outpoint(uint64_t this_ptr, uint64_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; - LDKOutPoint 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 = OutPoint_clone(&val_conv); - ChannelTransactionParameters_set_funding_outpoint(&this_ptr_conv, val_conv); +void __attribute__((export_name("TS_NodeFeatures_set_payment_secret_required"))) TS_NodeFeatures_set_payment_secret_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_payment_secret_required(&this_arg_conv); } -uint32_t __attribute__((export_name("TS_ChannelTransactionParameters_get_opt_anchors"))) TS_ChannelTransactionParameters_get_opt_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_anchors(&this_ptr_conv)); +jboolean __attribute__((export_name("TS_NodeFeatures_supports_payment_secret"))) TS_NodeFeatures_supports_payment_secret(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_payment_secret(&this_arg_conv); return ret_conv; } -void __attribute__((export_name("TS_ChannelTransactionParameters_set_opt_anchors"))) TS_ChannelTransactionParameters_set_opt_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_anchors(&this_ptr_conv, val_conv); +void __attribute__((export_name("TS_InvoiceFeatures_set_payment_secret_optional"))) TS_InvoiceFeatures_set_payment_secret_optional(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; + InvoiceFeatures_set_payment_secret_optional(&this_arg_conv); } -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_InvoiceFeatures_set_payment_secret_required"))) TS_InvoiceFeatures_set_payment_secret_required(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; + InvoiceFeatures_set_payment_secret_required(&this_arg_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); +jboolean __attribute__((export_name("TS_InvoiceFeatures_supports_payment_secret"))) TS_InvoiceFeatures_supports_payment_secret(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_supports_payment_secret(&this_arg_conv); + return ret_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(holder_pubkeys_arg_conv); - holder_pubkeys_arg_conv = ChannelPublicKeys_clone(&holder_pubkeys_arg_conv); - LDKCounterpartyChannelTransactionParameters counterparty_parameters_arg_conv; - counterparty_parameters_arg_conv.inner = untag_ptr(counterparty_parameters_arg); - counterparty_parameters_arg_conv.is_owned = ptr_is_owned(counterparty_parameters_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(counterparty_parameters_arg_conv); - counterparty_parameters_arg_conv = CounterpartyChannelTransactionParameters_clone(&counterparty_parameters_arg_conv); - LDKOutPoint funding_outpoint_arg_conv; - funding_outpoint_arg_conv.inner = untag_ptr(funding_outpoint_arg); - funding_outpoint_arg_conv.is_owned = ptr_is_owned(funding_outpoint_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); - 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); - return ret_ref; +jboolean __attribute__((export_name("TS_InitFeatures_requires_payment_secret"))) TS_InitFeatures_requires_payment_secret(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_payment_secret(&this_arg_conv); + return ret_conv; } -static inline uint64_t ChannelTransactionParameters_clone_ptr(LDKChannelTransactionParameters *NONNULL_PTR arg) { - LDKChannelTransactionParameters ret_var = ChannelTransactionParameters_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; +jboolean __attribute__((export_name("TS_NodeFeatures_requires_payment_secret"))) TS_NodeFeatures_requires_payment_secret(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_payment_secret(&this_arg_conv); + return ret_conv; } -int64_t __attribute__((export_name("TS_ChannelTransactionParameters_clone_ptr"))) TS_ChannelTransactionParameters_clone_ptr(uint64_t arg) { - LDKChannelTransactionParameters 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 = ChannelTransactionParameters_clone_ptr(&arg_conv); + +jboolean __attribute__((export_name("TS_InvoiceFeatures_requires_payment_secret"))) TS_InvoiceFeatures_requires_payment_secret(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_payment_secret(&this_arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_ChannelTransactionParameters_clone"))) TS_ChannelTransactionParameters_clone(uint64_t orig) { - LDKChannelTransactionParameters 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; - LDKChannelTransactionParameters ret_var = ChannelTransactionParameters_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_InitFeatures_set_basic_mpp_optional"))) TS_InitFeatures_set_basic_mpp_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_basic_mpp_optional(&this_arg_conv); } -void __attribute__((export_name("TS_CounterpartyChannelTransactionParameters_free"))) TS_CounterpartyChannelTransactionParameters_free(uint64_t this_obj) { - LDKCounterpartyChannelTransactionParameters 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); - CounterpartyChannelTransactionParameters_free(this_obj_conv); +void __attribute__((export_name("TS_InitFeatures_set_basic_mpp_required"))) TS_InitFeatures_set_basic_mpp_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_basic_mpp_required(&this_arg_conv); } -uint64_t __attribute__((export_name("TS_CounterpartyChannelTransactionParameters_get_pubkeys"))) TS_CounterpartyChannelTransactionParameters_get_pubkeys(uint64_t this_ptr) { - LDKCounterpartyChannelTransactionParameters 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; - LDKChannelPublicKeys ret_var = CounterpartyChannelTransactionParameters_get_pubkeys(&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; +jboolean __attribute__((export_name("TS_InitFeatures_supports_basic_mpp"))) TS_InitFeatures_supports_basic_mpp(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_basic_mpp(&this_arg_conv); + return ret_conv; } -void __attribute__((export_name("TS_CounterpartyChannelTransactionParameters_set_pubkeys"))) TS_CounterpartyChannelTransactionParameters_set_pubkeys(uint64_t this_ptr, uint64_t val) { - LDKCounterpartyChannelTransactionParameters 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; - LDKChannelPublicKeys 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 = ChannelPublicKeys_clone(&val_conv); - CounterpartyChannelTransactionParameters_set_pubkeys(&this_ptr_conv, val_conv); +void __attribute__((export_name("TS_NodeFeatures_set_basic_mpp_optional"))) TS_NodeFeatures_set_basic_mpp_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_basic_mpp_optional(&this_arg_conv); +} + +void __attribute__((export_name("TS_NodeFeatures_set_basic_mpp_required"))) TS_NodeFeatures_set_basic_mpp_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_basic_mpp_required(&this_arg_conv); } -int16_t __attribute__((export_name("TS_CounterpartyChannelTransactionParameters_get_selected_contest_delay"))) TS_CounterpartyChannelTransactionParameters_get_selected_contest_delay(uint64_t this_ptr) { - LDKCounterpartyChannelTransactionParameters 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; - int16_t ret_conv = CounterpartyChannelTransactionParameters_get_selected_contest_delay(&this_ptr_conv); +jboolean __attribute__((export_name("TS_NodeFeatures_supports_basic_mpp"))) TS_NodeFeatures_supports_basic_mpp(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_basic_mpp(&this_arg_conv); return ret_conv; } -void __attribute__((export_name("TS_CounterpartyChannelTransactionParameters_set_selected_contest_delay"))) TS_CounterpartyChannelTransactionParameters_set_selected_contest_delay(uint64_t this_ptr, int16_t val) { - LDKCounterpartyChannelTransactionParameters 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; - CounterpartyChannelTransactionParameters_set_selected_contest_delay(&this_ptr_conv, val); +void __attribute__((export_name("TS_InvoiceFeatures_set_basic_mpp_optional"))) TS_InvoiceFeatures_set_basic_mpp_optional(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; + InvoiceFeatures_set_basic_mpp_optional(&this_arg_conv); } -uint64_t __attribute__((export_name("TS_CounterpartyChannelTransactionParameters_new"))) TS_CounterpartyChannelTransactionParameters_new(uint64_t pubkeys_arg, int16_t selected_contest_delay_arg) { - LDKChannelPublicKeys pubkeys_arg_conv; - pubkeys_arg_conv.inner = untag_ptr(pubkeys_arg); - pubkeys_arg_conv.is_owned = ptr_is_owned(pubkeys_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(pubkeys_arg_conv); - pubkeys_arg_conv = ChannelPublicKeys_clone(&pubkeys_arg_conv); - LDKCounterpartyChannelTransactionParameters ret_var = CounterpartyChannelTransactionParameters_new(pubkeys_arg_conv, selected_contest_delay_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; +void __attribute__((export_name("TS_InvoiceFeatures_set_basic_mpp_required"))) TS_InvoiceFeatures_set_basic_mpp_required(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; + InvoiceFeatures_set_basic_mpp_required(&this_arg_conv); } -static inline uint64_t CounterpartyChannelTransactionParameters_clone_ptr(LDKCounterpartyChannelTransactionParameters *NONNULL_PTR arg) { - LDKCounterpartyChannelTransactionParameters ret_var = CounterpartyChannelTransactionParameters_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_CounterpartyChannelTransactionParameters_clone_ptr"))) TS_CounterpartyChannelTransactionParameters_clone_ptr(uint64_t arg) { - LDKCounterpartyChannelTransactionParameters 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 = CounterpartyChannelTransactionParameters_clone_ptr(&arg_conv); +jboolean __attribute__((export_name("TS_InvoiceFeatures_supports_basic_mpp"))) TS_InvoiceFeatures_supports_basic_mpp(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_supports_basic_mpp(&this_arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_CounterpartyChannelTransactionParameters_clone"))) TS_CounterpartyChannelTransactionParameters_clone(uint64_t orig) { - LDKCounterpartyChannelTransactionParameters 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; - LDKCounterpartyChannelTransactionParameters ret_var = CounterpartyChannelTransactionParameters_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_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); } -jboolean __attribute__((export_name("TS_ChannelTransactionParameters_is_populated"))) TS_ChannelTransactionParameters_is_populated(uint64_t this_arg) { - LDKChannelTransactionParameters 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; - jboolean ret_conv = ChannelTransactionParameters_is_populated(&this_arg_conv); + 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; } -uint64_t __attribute__((export_name("TS_ChannelTransactionParameters_as_holder_broadcastable"))) TS_ChannelTransactionParameters_as_holder_broadcastable(uint64_t this_arg) { - LDKChannelTransactionParameters this_arg_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); 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; - LDKDirectedChannelTransactionParameters ret_var = ChannelTransactionParameters_as_holder_broadcastable(&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; + jboolean ret_conv = InitFeatures_requires_basic_mpp(&this_arg_conv); + return ret_conv; } -uint64_t __attribute__((export_name("TS_ChannelTransactionParameters_as_counterparty_broadcastable"))) TS_ChannelTransactionParameters_as_counterparty_broadcastable(uint64_t this_arg) { - LDKChannelTransactionParameters this_arg_conv; +jboolean __attribute__((export_name("TS_NodeFeatures_requires_basic_mpp"))) TS_NodeFeatures_requires_basic_mpp(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; - LDKDirectedChannelTransactionParameters ret_var = ChannelTransactionParameters_as_counterparty_broadcastable(&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; + jboolean ret_conv = NodeFeatures_requires_basic_mpp(&this_arg_conv); + return ret_conv; } -int8_tArray __attribute__((export_name("TS_CounterpartyChannelTransactionParameters_write"))) TS_CounterpartyChannelTransactionParameters_write(uint64_t obj) { - LDKCounterpartyChannelTransactionParameters 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 = CounterpartyChannelTransactionParameters_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; +jboolean __attribute__((export_name("TS_InvoiceFeatures_requires_basic_mpp"))) TS_InvoiceFeatures_requires_basic_mpp(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_basic_mpp(&this_arg_conv); + return ret_conv; } -uint64_t __attribute__((export_name("TS_CounterpartyChannelTransactionParameters_read"))) TS_CounterpartyChannelTransactionParameters_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ"); - *ret_conv = CounterpartyChannelTransactionParameters_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +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; } -int8_tArray __attribute__((export_name("TS_ChannelTransactionParameters_write"))) TS_ChannelTransactionParameters_write(uint64_t obj) { - LDKChannelTransactionParameters 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 = ChannelTransactionParameters_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_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); + 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_wumbo_optional(&this_arg_conv); } -uint64_t __attribute__((export_name("TS_ChannelTransactionParameters_read"))) TS_ChannelTransactionParameters_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ"); - *ret_conv = ChannelTransactionParameters_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +void __attribute__((export_name("TS_InitFeatures_set_wumbo_required"))) TS_InitFeatures_set_wumbo_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_wumbo_required(&this_arg_conv); } -void __attribute__((export_name("TS_DirectedChannelTransactionParameters_free"))) TS_DirectedChannelTransactionParameters_free(uint64_t this_obj) { - LDKDirectedChannelTransactionParameters 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); - DirectedChannelTransactionParameters_free(this_obj_conv); +jboolean __attribute__((export_name("TS_InitFeatures_supports_wumbo"))) TS_InitFeatures_supports_wumbo(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_wumbo(&this_arg_conv); + return ret_conv; } -uint64_t __attribute__((export_name("TS_DirectedChannelTransactionParameters_broadcaster_pubkeys"))) TS_DirectedChannelTransactionParameters_broadcaster_pubkeys(uint64_t this_arg) { - LDKDirectedChannelTransactionParameters this_arg_conv; +void __attribute__((export_name("TS_NodeFeatures_set_wumbo_optional"))) TS_NodeFeatures_set_wumbo_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; - LDKChannelPublicKeys ret_var = DirectedChannelTransactionParameters_broadcaster_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; + NodeFeatures_set_wumbo_optional(&this_arg_conv); } -uint64_t __attribute__((export_name("TS_DirectedChannelTransactionParameters_countersignatory_pubkeys"))) TS_DirectedChannelTransactionParameters_countersignatory_pubkeys(uint64_t this_arg) { - LDKDirectedChannelTransactionParameters this_arg_conv; +void __attribute__((export_name("TS_NodeFeatures_set_wumbo_required"))) TS_NodeFeatures_set_wumbo_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; - LDKChannelPublicKeys ret_var = DirectedChannelTransactionParameters_countersignatory_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; + NodeFeatures_set_wumbo_required(&this_arg_conv); } -int16_t __attribute__((export_name("TS_DirectedChannelTransactionParameters_contest_delay"))) TS_DirectedChannelTransactionParameters_contest_delay(uint64_t this_arg) { - LDKDirectedChannelTransactionParameters this_arg_conv; +jboolean __attribute__((export_name("TS_NodeFeatures_supports_wumbo"))) TS_NodeFeatures_supports_wumbo(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; - int16_t ret_conv = DirectedChannelTransactionParameters_contest_delay(&this_arg_conv); + jboolean ret_conv = NodeFeatures_supports_wumbo(&this_arg_conv); return ret_conv; } -jboolean __attribute__((export_name("TS_DirectedChannelTransactionParameters_is_outbound"))) TS_DirectedChannelTransactionParameters_is_outbound(uint64_t this_arg) { - LDKDirectedChannelTransactionParameters this_arg_conv; +jboolean __attribute__((export_name("TS_InitFeatures_requires_wumbo"))) TS_InitFeatures_requires_wumbo(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 = DirectedChannelTransactionParameters_is_outbound(&this_arg_conv); + jboolean ret_conv = InitFeatures_requires_wumbo(&this_arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_DirectedChannelTransactionParameters_funding_outpoint"))) TS_DirectedChannelTransactionParameters_funding_outpoint(uint64_t this_arg) { - LDKDirectedChannelTransactionParameters this_arg_conv; +jboolean __attribute__((export_name("TS_NodeFeatures_requires_wumbo"))) TS_NodeFeatures_requires_wumbo(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; - LDKOutPoint ret_var = DirectedChannelTransactionParameters_funding_outpoint(&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; + jboolean ret_conv = NodeFeatures_requires_wumbo(&this_arg_conv); + return ret_conv; } -jboolean __attribute__((export_name("TS_DirectedChannelTransactionParameters_opt_anchors"))) TS_DirectedChannelTransactionParameters_opt_anchors(uint64_t this_arg) { - LDKDirectedChannelTransactionParameters this_arg_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; - jboolean ret_conv = DirectedChannelTransactionParameters_opt_anchors(&this_arg_conv); - return ret_conv; + InitFeatures_set_anchors_zero_fee_htlc_tx_optional(&this_arg_conv); } -void __attribute__((export_name("TS_HolderCommitmentTransaction_free"))) TS_HolderCommitmentTransaction_free(uint64_t this_obj) { - LDKHolderCommitmentTransaction 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); - HolderCommitmentTransaction_free(this_obj_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); } -int8_tArray __attribute__((export_name("TS_HolderCommitmentTransaction_get_counterparty_sig"))) TS_HolderCommitmentTransaction_get_counterparty_sig(uint64_t this_ptr) { - LDKHolderCommitmentTransaction 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(64, __LINE__); - memcpy(ret_arr->elems, HolderCommitmentTransaction_get_counterparty_sig(&this_ptr_conv).compact_form, 64); - return ret_arr; +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_HolderCommitmentTransaction_set_counterparty_sig"))) TS_HolderCommitmentTransaction_set_counterparty_sig(uint64_t this_ptr, int8_tArray val) { - LDKHolderCommitmentTransaction 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; - LDKSignature val_ref; - CHECK(val->arr_len == 64); - memcpy(val_ref.compact_form, val->elems, 64); FREE(val); - HolderCommitmentTransaction_set_counterparty_sig(&this_ptr_conv, val_ref); +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); } -ptrArray __attribute__((export_name("TS_HolderCommitmentTransaction_get_counterparty_htlc_sigs"))) TS_HolderCommitmentTransaction_get_counterparty_htlc_sigs(uint64_t this_ptr) { - LDKHolderCommitmentTransaction 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; - LDKCVec_SignatureZ ret_var = HolderCommitmentTransaction_get_counterparty_htlc_sigs(&this_ptr_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(64, __LINE__); - memcpy(ret_conv_12_arr->elems, ret_var.data[m].compact_form, 64); - ret_arr_ptr[m] = ret_conv_12_arr; - } - - FREE(ret_var.data); - return ret_arr; +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); } -void __attribute__((export_name("TS_HolderCommitmentTransaction_set_counterparty_htlc_sigs"))) TS_HolderCommitmentTransaction_set_counterparty_htlc_sigs(uint64_t this_ptr, ptrArray val) { - LDKHolderCommitmentTransaction 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; - LDKCVec_SignatureZ val_constr; - val_constr.datalen = val->arr_len; - if (val_constr.datalen > 0) - val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements"); - else - val_constr.data = NULL; - int8_tArray* val_vals = (void*) val->elems; - for (size_t m = 0; m < val_constr.datalen; m++) { - int8_tArray val_conv_12 = val_vals[m]; - LDKSignature val_conv_12_ref; - CHECK(val_conv_12->arr_len == 64); - memcpy(val_conv_12_ref.compact_form, val_conv_12->elems, 64); FREE(val_conv_12); - val_constr.data[m] = val_conv_12_ref; - } - FREE(val); - HolderCommitmentTransaction_set_counterparty_htlc_sigs(&this_ptr_conv, val_constr); +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; } -static inline uint64_t HolderCommitmentTransaction_clone_ptr(LDKHolderCommitmentTransaction *NONNULL_PTR arg) { - LDKHolderCommitmentTransaction ret_var = HolderCommitmentTransaction_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; +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); } -int64_t __attribute__((export_name("TS_HolderCommitmentTransaction_clone_ptr"))) TS_HolderCommitmentTransaction_clone_ptr(uint64_t arg) { - LDKHolderCommitmentTransaction 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 = HolderCommitmentTransaction_clone_ptr(&arg_conv); - return ret_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); } -uint64_t __attribute__((export_name("TS_HolderCommitmentTransaction_clone"))) TS_HolderCommitmentTransaction_clone(uint64_t orig) { - LDKHolderCommitmentTransaction 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; - LDKHolderCommitmentTransaction ret_var = HolderCommitmentTransaction_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_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; } -int8_tArray __attribute__((export_name("TS_HolderCommitmentTransaction_write"))) TS_HolderCommitmentTransaction_write(uint64_t obj) { - LDKHolderCommitmentTransaction 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 = HolderCommitmentTransaction_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; +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; } -uint64_t __attribute__((export_name("TS_HolderCommitmentTransaction_read"))) TS_HolderCommitmentTransaction_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ"); - *ret_conv = HolderCommitmentTransaction_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +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; } -uint64_t __attribute__((export_name("TS_HolderCommitmentTransaction_new"))) TS_HolderCommitmentTransaction_new(uint64_t commitment_tx, int8_tArray counterparty_sig, ptrArray counterparty_htlc_sigs, int8_tArray holder_funding_key, int8_tArray counterparty_funding_key) { - LDKCommitmentTransaction commitment_tx_conv; - commitment_tx_conv.inner = untag_ptr(commitment_tx); - commitment_tx_conv.is_owned = ptr_is_owned(commitment_tx); - CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_conv); - commitment_tx_conv = CommitmentTransaction_clone(&commitment_tx_conv); - LDKSignature counterparty_sig_ref; - CHECK(counterparty_sig->arr_len == 64); - memcpy(counterparty_sig_ref.compact_form, counterparty_sig->elems, 64); FREE(counterparty_sig); - LDKCVec_SignatureZ counterparty_htlc_sigs_constr; - counterparty_htlc_sigs_constr.datalen = counterparty_htlc_sigs->arr_len; - if (counterparty_htlc_sigs_constr.datalen > 0) - counterparty_htlc_sigs_constr.data = MALLOC(counterparty_htlc_sigs_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements"); - else - counterparty_htlc_sigs_constr.data = NULL; - int8_tArray* counterparty_htlc_sigs_vals = (void*) counterparty_htlc_sigs->elems; - for (size_t m = 0; m < counterparty_htlc_sigs_constr.datalen; m++) { - int8_tArray counterparty_htlc_sigs_conv_12 = counterparty_htlc_sigs_vals[m]; - LDKSignature counterparty_htlc_sigs_conv_12_ref; - CHECK(counterparty_htlc_sigs_conv_12->arr_len == 64); - memcpy(counterparty_htlc_sigs_conv_12_ref.compact_form, counterparty_htlc_sigs_conv_12->elems, 64); FREE(counterparty_htlc_sigs_conv_12); - counterparty_htlc_sigs_constr.data[m] = counterparty_htlc_sigs_conv_12_ref; - } - FREE(counterparty_htlc_sigs); - LDKPublicKey holder_funding_key_ref; - CHECK(holder_funding_key->arr_len == 33); - memcpy(holder_funding_key_ref.compressed_form, holder_funding_key->elems, 33); FREE(holder_funding_key); - LDKPublicKey counterparty_funding_key_ref; - CHECK(counterparty_funding_key->arr_len == 33); - memcpy(counterparty_funding_key_ref.compressed_form, counterparty_funding_key->elems, 33); FREE(counterparty_funding_key); - LDKHolderCommitmentTransaction ret_var = HolderCommitmentTransaction_new(commitment_tx_conv, counterparty_sig_ref, counterparty_htlc_sigs_constr, holder_funding_key_ref, counterparty_funding_key_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; +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_BuiltCommitmentTransaction_free"))) TS_BuiltCommitmentTransaction_free(uint64_t this_obj) { - LDKBuiltCommitmentTransaction 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); - BuiltCommitmentTransaction_free(this_obj_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); + 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_shutdown_any_segwit_optional(&this_arg_conv); } -int8_tArray __attribute__((export_name("TS_BuiltCommitmentTransaction_get_transaction"))) TS_BuiltCommitmentTransaction_get_transaction(uint64_t this_ptr) { - LDKBuiltCommitmentTransaction 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; - LDKTransaction ret_var = BuiltCommitmentTransaction_get_transaction(&this_ptr_conv); - 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; +void __attribute__((export_name("TS_InitFeatures_set_shutdown_any_segwit_required"))) TS_InitFeatures_set_shutdown_any_segwit_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_shutdown_any_segwit_required(&this_arg_conv); } -void __attribute__((export_name("TS_BuiltCommitmentTransaction_set_transaction"))) TS_BuiltCommitmentTransaction_set_transaction(uint64_t this_ptr, int8_tArray val) { - LDKBuiltCommitmentTransaction 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; - LDKTransaction val_ref; - val_ref.datalen = val->arr_len; - val_ref.data = MALLOC(val_ref.datalen, "LDKTransaction Bytes"); - memcpy(val_ref.data, val->elems, val_ref.datalen); FREE(val); - val_ref.data_is_owned = true; - BuiltCommitmentTransaction_set_transaction(&this_ptr_conv, val_ref); +jboolean __attribute__((export_name("TS_InitFeatures_supports_shutdown_anysegwit"))) TS_InitFeatures_supports_shutdown_anysegwit(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_shutdown_anysegwit(&this_arg_conv); + return ret_conv; } -int8_tArray __attribute__((export_name("TS_BuiltCommitmentTransaction_get_txid"))) TS_BuiltCommitmentTransaction_get_txid(uint64_t this_ptr) { - LDKBuiltCommitmentTransaction 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(32, __LINE__); - memcpy(ret_arr->elems, *BuiltCommitmentTransaction_get_txid(&this_ptr_conv), 32); - return ret_arr; +void __attribute__((export_name("TS_NodeFeatures_set_shutdown_any_segwit_optional"))) TS_NodeFeatures_set_shutdown_any_segwit_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_shutdown_any_segwit_optional(&this_arg_conv); } -void __attribute__((export_name("TS_BuiltCommitmentTransaction_set_txid"))) TS_BuiltCommitmentTransaction_set_txid(uint64_t this_ptr, int8_tArray val) { - LDKBuiltCommitmentTransaction 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; - LDKThirtyTwoBytes val_ref; - CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); FREE(val); - BuiltCommitmentTransaction_set_txid(&this_ptr_conv, val_ref); +void __attribute__((export_name("TS_NodeFeatures_set_shutdown_any_segwit_required"))) TS_NodeFeatures_set_shutdown_any_segwit_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_shutdown_any_segwit_required(&this_arg_conv); } -uint64_t __attribute__((export_name("TS_BuiltCommitmentTransaction_new"))) TS_BuiltCommitmentTransaction_new(int8_tArray transaction_arg, int8_tArray txid_arg) { - LDKTransaction transaction_arg_ref; - transaction_arg_ref.datalen = transaction_arg->arr_len; - transaction_arg_ref.data = MALLOC(transaction_arg_ref.datalen, "LDKTransaction Bytes"); - memcpy(transaction_arg_ref.data, transaction_arg->elems, transaction_arg_ref.datalen); FREE(transaction_arg); - transaction_arg_ref.data_is_owned = true; - LDKThirtyTwoBytes txid_arg_ref; - CHECK(txid_arg->arr_len == 32); - memcpy(txid_arg_ref.data, txid_arg->elems, 32); FREE(txid_arg); - LDKBuiltCommitmentTransaction ret_var = BuiltCommitmentTransaction_new(transaction_arg_ref, txid_arg_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; +jboolean __attribute__((export_name("TS_NodeFeatures_supports_shutdown_anysegwit"))) TS_NodeFeatures_supports_shutdown_anysegwit(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_shutdown_anysegwit(&this_arg_conv); + return ret_conv; } -static inline uint64_t BuiltCommitmentTransaction_clone_ptr(LDKBuiltCommitmentTransaction *NONNULL_PTR arg) { - LDKBuiltCommitmentTransaction ret_var = BuiltCommitmentTransaction_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; +jboolean __attribute__((export_name("TS_InitFeatures_requires_shutdown_anysegwit"))) TS_InitFeatures_requires_shutdown_anysegwit(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_shutdown_anysegwit(&this_arg_conv); + return ret_conv; } -int64_t __attribute__((export_name("TS_BuiltCommitmentTransaction_clone_ptr"))) TS_BuiltCommitmentTransaction_clone_ptr(uint64_t arg) { - LDKBuiltCommitmentTransaction 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 = BuiltCommitmentTransaction_clone_ptr(&arg_conv); + +jboolean __attribute__((export_name("TS_NodeFeatures_requires_shutdown_anysegwit"))) TS_NodeFeatures_requires_shutdown_anysegwit(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_shutdown_anysegwit(&this_arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_BuiltCommitmentTransaction_clone"))) TS_BuiltCommitmentTransaction_clone(uint64_t orig) { - LDKBuiltCommitmentTransaction 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; - LDKBuiltCommitmentTransaction ret_var = BuiltCommitmentTransaction_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_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); } -int8_tArray __attribute__((export_name("TS_BuiltCommitmentTransaction_write"))) TS_BuiltCommitmentTransaction_write(uint64_t obj) { - LDKBuiltCommitmentTransaction 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 = BuiltCommitmentTransaction_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_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); } -uint64_t __attribute__((export_name("TS_BuiltCommitmentTransaction_read"))) TS_BuiltCommitmentTransaction_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ"); - *ret_conv = BuiltCommitmentTransaction_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +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; } -int8_tArray __attribute__((export_name("TS_BuiltCommitmentTransaction_get_sighash_all"))) TS_BuiltCommitmentTransaction_get_sighash_all(uint64_t this_arg, int8_tArray funding_redeemscript, int64_t channel_value_satoshis) { - LDKBuiltCommitmentTransaction this_arg_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; - LDKu8slice funding_redeemscript_ref; - funding_redeemscript_ref.datalen = funding_redeemscript->arr_len; - funding_redeemscript_ref.data = funding_redeemscript->elems; - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, BuiltCommitmentTransaction_get_sighash_all(&this_arg_conv, funding_redeemscript_ref, channel_value_satoshis).data, 32); - FREE(funding_redeemscript); - return ret_arr; + NodeFeatures_set_onion_messages_optional(&this_arg_conv); } -int8_tArray __attribute__((export_name("TS_BuiltCommitmentTransaction_sign"))) TS_BuiltCommitmentTransaction_sign(uint64_t this_arg, int8_tArray funding_key, int8_tArray funding_redeemscript, int64_t channel_value_satoshis) { - LDKBuiltCommitmentTransaction 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; - uint8_t funding_key_arr[32]; - CHECK(funding_key->arr_len == 32); - memcpy(funding_key_arr, funding_key->elems, 32); FREE(funding_key); - 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; - int8_tArray ret_arr = init_int8_tArray(64, __LINE__); - memcpy(ret_arr->elems, BuiltCommitmentTransaction_sign(&this_arg_conv, funding_key_ref, funding_redeemscript_ref, channel_value_satoshis).compact_form, 64); - FREE(funding_redeemscript); - return ret_arr; + NodeFeatures_set_onion_messages_required(&this_arg_conv); } -void __attribute__((export_name("TS_ClosingTransaction_free"))) TS_ClosingTransaction_free(uint64_t this_obj) { - LDKClosingTransaction 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); - ClosingTransaction_free(this_obj_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; } -static inline uint64_t ClosingTransaction_clone_ptr(LDKClosingTransaction *NONNULL_PTR arg) { - LDKClosingTransaction ret_var = ClosingTransaction_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; +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; } -int64_t __attribute__((export_name("TS_ClosingTransaction_clone_ptr"))) TS_ClosingTransaction_clone_ptr(uint64_t arg) { - LDKClosingTransaction 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 = ClosingTransaction_clone_ptr(&arg_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; } -uint64_t __attribute__((export_name("TS_ClosingTransaction_clone"))) TS_ClosingTransaction_clone(uint64_t orig) { - LDKClosingTransaction 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; - LDKClosingTransaction ret_var = ClosingTransaction_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_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); + 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_channel_type_optional(&this_arg_conv); } -int64_t __attribute__((export_name("TS_ClosingTransaction_hash"))) TS_ClosingTransaction_hash(uint64_t o) { - LDKClosingTransaction 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 = ClosingTransaction_hash(&o_conv); - return ret_conv; +void __attribute__((export_name("TS_InitFeatures_set_channel_type_required"))) TS_InitFeatures_set_channel_type_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_channel_type_required(&this_arg_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); +jboolean __attribute__((export_name("TS_InitFeatures_supports_channel_type"))) TS_InitFeatures_supports_channel_type(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_channel_type(&this_arg_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; - to_holder_script_ref.data = MALLOC(to_holder_script_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(to_holder_script_ref.data, to_holder_script->elems, to_holder_script_ref.datalen); FREE(to_holder_script); - LDKCVec_u8Z to_counterparty_script_ref; - to_counterparty_script_ref.datalen = to_counterparty_script->arr_len; - to_counterparty_script_ref.data = MALLOC(to_counterparty_script_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(to_counterparty_script_ref.data, to_counterparty_script->elems, to_counterparty_script_ref.datalen); FREE(to_counterparty_script); - LDKOutPoint funding_outpoint_conv; - funding_outpoint_conv.inner = untag_ptr(funding_outpoint); - funding_outpoint_conv.is_owned = ptr_is_owned(funding_outpoint); - CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_conv); - funding_outpoint_conv = OutPoint_clone(&funding_outpoint_conv); - LDKClosingTransaction ret_var = ClosingTransaction_new(to_holder_value_sat, to_counterparty_value_sat, to_holder_script_ref, to_counterparty_script_ref, funding_outpoint_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_NodeFeatures_set_channel_type_optional"))) TS_NodeFeatures_set_channel_type_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_channel_type_optional(&this_arg_conv); } -uint64_t __attribute__((export_name("TS_ClosingTransaction_trust"))) TS_ClosingTransaction_trust(uint64_t this_arg) { - LDKClosingTransaction this_arg_conv; +void __attribute__((export_name("TS_NodeFeatures_set_channel_type_required"))) TS_NodeFeatures_set_channel_type_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; - LDKTrustedClosingTransaction ret_var = ClosingTransaction_trust(&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; + NodeFeatures_set_channel_type_required(&this_arg_conv); } -uint64_t __attribute__((export_name("TS_ClosingTransaction_verify"))) TS_ClosingTransaction_verify(uint64_t this_arg, uint64_t funding_outpoint) { - LDKClosingTransaction this_arg_conv; +jboolean __attribute__((export_name("TS_NodeFeatures_supports_channel_type"))) TS_NodeFeatures_supports_channel_type(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; - LDKOutPoint funding_outpoint_conv; - funding_outpoint_conv.inner = untag_ptr(funding_outpoint); - funding_outpoint_conv.is_owned = ptr_is_owned(funding_outpoint); - CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_conv); - funding_outpoint_conv = OutPoint_clone(&funding_outpoint_conv); - LDKCResult_TrustedClosingTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedClosingTransactionNoneZ), "LDKCResult_TrustedClosingTransactionNoneZ"); - *ret_conv = ClosingTransaction_verify(&this_arg_conv, funding_outpoint_conv); - return tag_ptr(ret_conv, true); + jboolean ret_conv = NodeFeatures_supports_channel_type(&this_arg_conv); + return ret_conv; } -int64_t __attribute__((export_name("TS_ClosingTransaction_to_holder_value_sat"))) TS_ClosingTransaction_to_holder_value_sat(uint64_t this_arg) { - LDKClosingTransaction this_arg_conv; +jboolean __attribute__((export_name("TS_InitFeatures_requires_channel_type"))) TS_InitFeatures_requires_channel_type(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; - int64_t ret_conv = ClosingTransaction_to_holder_value_sat(&this_arg_conv); + jboolean ret_conv = InitFeatures_requires_channel_type(&this_arg_conv); return ret_conv; } -int64_t __attribute__((export_name("TS_ClosingTransaction_to_counterparty_value_sat"))) TS_ClosingTransaction_to_counterparty_value_sat(uint64_t this_arg) { - LDKClosingTransaction this_arg_conv; +jboolean __attribute__((export_name("TS_NodeFeatures_requires_channel_type"))) TS_NodeFeatures_requires_channel_type(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; - int64_t ret_conv = ClosingTransaction_to_counterparty_value_sat(&this_arg_conv); + jboolean ret_conv = NodeFeatures_requires_channel_type(&this_arg_conv); return ret_conv; } -int8_tArray __attribute__((export_name("TS_ClosingTransaction_to_holder_script"))) TS_ClosingTransaction_to_holder_script(uint64_t this_arg) { - LDKClosingTransaction this_arg_conv; +void __attribute__((export_name("TS_InitFeatures_set_scid_privacy_optional"))) TS_InitFeatures_set_scid_privacy_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; - LDKu8slice ret_var = ClosingTransaction_to_holder_script(&this_arg_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - return ret_arr; + InitFeatures_set_scid_privacy_optional(&this_arg_conv); } -int8_tArray __attribute__((export_name("TS_ClosingTransaction_to_counterparty_script"))) TS_ClosingTransaction_to_counterparty_script(uint64_t this_arg) { - LDKClosingTransaction this_arg_conv; +void __attribute__((export_name("TS_InitFeatures_set_scid_privacy_required"))) TS_InitFeatures_set_scid_privacy_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; - LDKu8slice ret_var = ClosingTransaction_to_counterparty_script(&this_arg_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - return ret_arr; + InitFeatures_set_scid_privacy_required(&this_arg_conv); } -void __attribute__((export_name("TS_TrustedClosingTransaction_free"))) TS_TrustedClosingTransaction_free(uint64_t this_obj) { - LDKTrustedClosingTransaction 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); - TrustedClosingTransaction_free(this_obj_conv); +jboolean __attribute__((export_name("TS_InitFeatures_supports_scid_privacy"))) TS_InitFeatures_supports_scid_privacy(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_scid_privacy(&this_arg_conv); + return ret_conv; } -int8_tArray __attribute__((export_name("TS_TrustedClosingTransaction_built_transaction"))) TS_TrustedClosingTransaction_built_transaction(uint64_t this_arg) { - LDKTrustedClosingTransaction this_arg_conv; +void __attribute__((export_name("TS_NodeFeatures_set_scid_privacy_optional"))) TS_NodeFeatures_set_scid_privacy_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; - LDKTransaction ret_var = TrustedClosingTransaction_built_transaction(&this_arg_conv); - 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; + NodeFeatures_set_scid_privacy_optional(&this_arg_conv); } -int8_tArray __attribute__((export_name("TS_TrustedClosingTransaction_get_sighash_all"))) TS_TrustedClosingTransaction_get_sighash_all(uint64_t this_arg, int8_tArray funding_redeemscript, int64_t channel_value_satoshis) { - LDKTrustedClosingTransaction this_arg_conv; +void __attribute__((export_name("TS_NodeFeatures_set_scid_privacy_required"))) TS_NodeFeatures_set_scid_privacy_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; - LDKu8slice funding_redeemscript_ref; - funding_redeemscript_ref.datalen = funding_redeemscript->arr_len; - funding_redeemscript_ref.data = funding_redeemscript->elems; - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, TrustedClosingTransaction_get_sighash_all(&this_arg_conv, funding_redeemscript_ref, channel_value_satoshis).data, 32); - FREE(funding_redeemscript); - return ret_arr; + NodeFeatures_set_scid_privacy_required(&this_arg_conv); } -int8_tArray __attribute__((export_name("TS_TrustedClosingTransaction_sign"))) TS_TrustedClosingTransaction_sign(uint64_t this_arg, int8_tArray funding_key, int8_tArray funding_redeemscript, int64_t channel_value_satoshis) { - LDKTrustedClosingTransaction this_arg_conv; +jboolean __attribute__((export_name("TS_NodeFeatures_supports_scid_privacy"))) TS_NodeFeatures_supports_scid_privacy(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; - uint8_t funding_key_arr[32]; - CHECK(funding_key->arr_len == 32); - memcpy(funding_key_arr, funding_key->elems, 32); FREE(funding_key); - 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; - int8_tArray ret_arr = init_int8_tArray(64, __LINE__); - memcpy(ret_arr->elems, TrustedClosingTransaction_sign(&this_arg_conv, funding_key_ref, funding_redeemscript_ref, channel_value_satoshis).compact_form, 64); - FREE(funding_redeemscript); - return ret_arr; + jboolean ret_conv = NodeFeatures_supports_scid_privacy(&this_arg_conv); + return ret_conv; } -void __attribute__((export_name("TS_CommitmentTransaction_free"))) TS_CommitmentTransaction_free(uint64_t this_obj) { - LDKCommitmentTransaction 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); - CommitmentTransaction_free(this_obj_conv); +void __attribute__((export_name("TS_ChannelTypeFeatures_set_scid_privacy_optional"))) TS_ChannelTypeFeatures_set_scid_privacy_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_scid_privacy_optional(&this_arg_conv); } -static inline uint64_t CommitmentTransaction_clone_ptr(LDKCommitmentTransaction *NONNULL_PTR arg) { - LDKCommitmentTransaction ret_var = CommitmentTransaction_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; +void __attribute__((export_name("TS_ChannelTypeFeatures_set_scid_privacy_required"))) TS_ChannelTypeFeatures_set_scid_privacy_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_scid_privacy_required(&this_arg_conv); } -int64_t __attribute__((export_name("TS_CommitmentTransaction_clone_ptr"))) TS_CommitmentTransaction_clone_ptr(uint64_t arg) { - LDKCommitmentTransaction 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 = CommitmentTransaction_clone_ptr(&arg_conv); + +jboolean __attribute__((export_name("TS_ChannelTypeFeatures_supports_scid_privacy"))) TS_ChannelTypeFeatures_supports_scid_privacy(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_scid_privacy(&this_arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_CommitmentTransaction_clone"))) TS_CommitmentTransaction_clone(uint64_t orig) { - LDKCommitmentTransaction 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; - LDKCommitmentTransaction ret_var = CommitmentTransaction_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_InitFeatures_requires_scid_privacy"))) TS_InitFeatures_requires_scid_privacy(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_scid_privacy(&this_arg_conv); + return ret_conv; } -int8_tArray __attribute__((export_name("TS_CommitmentTransaction_write"))) TS_CommitmentTransaction_write(uint64_t obj) { - LDKCommitmentTransaction 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 = CommitmentTransaction_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; +jboolean __attribute__((export_name("TS_NodeFeatures_requires_scid_privacy"))) TS_NodeFeatures_requires_scid_privacy(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_scid_privacy(&this_arg_conv); + return ret_conv; } -uint64_t __attribute__((export_name("TS_CommitmentTransaction_read"))) TS_CommitmentTransaction_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ"); - *ret_conv = CommitmentTransaction_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +jboolean __attribute__((export_name("TS_ChannelTypeFeatures_requires_scid_privacy"))) TS_ChannelTypeFeatures_requires_scid_privacy(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_scid_privacy(&this_arg_conv); + return ret_conv; } -int64_t __attribute__((export_name("TS_CommitmentTransaction_commitment_number"))) TS_CommitmentTransaction_commitment_number(uint64_t this_arg) { - LDKCommitmentTransaction this_arg_conv; +void __attribute__((export_name("TS_InvoiceFeatures_set_payment_metadata_optional"))) TS_InvoiceFeatures_set_payment_metadata_optional(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; - int64_t ret_conv = CommitmentTransaction_commitment_number(&this_arg_conv); - return ret_conv; + InvoiceFeatures_set_payment_metadata_optional(&this_arg_conv); } -int64_t __attribute__((export_name("TS_CommitmentTransaction_to_broadcaster_value_sat"))) TS_CommitmentTransaction_to_broadcaster_value_sat(uint64_t this_arg) { - LDKCommitmentTransaction this_arg_conv; +void __attribute__((export_name("TS_InvoiceFeatures_set_payment_metadata_required"))) TS_InvoiceFeatures_set_payment_metadata_required(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; - int64_t ret_conv = CommitmentTransaction_to_broadcaster_value_sat(&this_arg_conv); - return ret_conv; + InvoiceFeatures_set_payment_metadata_required(&this_arg_conv); } -int64_t __attribute__((export_name("TS_CommitmentTransaction_to_countersignatory_value_sat"))) TS_CommitmentTransaction_to_countersignatory_value_sat(uint64_t this_arg) { - LDKCommitmentTransaction this_arg_conv; +jboolean __attribute__((export_name("TS_InvoiceFeatures_supports_payment_metadata"))) TS_InvoiceFeatures_supports_payment_metadata(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; - int64_t ret_conv = CommitmentTransaction_to_countersignatory_value_sat(&this_arg_conv); + jboolean ret_conv = InvoiceFeatures_supports_payment_metadata(&this_arg_conv); return ret_conv; } -int32_t __attribute__((export_name("TS_CommitmentTransaction_feerate_per_kw"))) TS_CommitmentTransaction_feerate_per_kw(uint64_t this_arg) { - LDKCommitmentTransaction this_arg_conv; +jboolean __attribute__((export_name("TS_InvoiceFeatures_requires_payment_metadata"))) TS_InvoiceFeatures_requires_payment_metadata(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; - int32_t ret_conv = CommitmentTransaction_feerate_per_kw(&this_arg_conv); + jboolean ret_conv = InvoiceFeatures_requires_payment_metadata(&this_arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_CommitmentTransaction_trust"))) TS_CommitmentTransaction_trust(uint64_t this_arg) { - LDKCommitmentTransaction this_arg_conv; +void __attribute__((export_name("TS_InitFeatures_set_zero_conf_optional"))) TS_InitFeatures_set_zero_conf_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; - LDKTrustedCommitmentTransaction ret_var = CommitmentTransaction_trust(&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; + InitFeatures_set_zero_conf_optional(&this_arg_conv); } -uint64_t __attribute__((export_name("TS_CommitmentTransaction_verify"))) TS_CommitmentTransaction_verify(uint64_t this_arg, uint64_t channel_parameters, uint64_t broadcaster_keys, uint64_t countersignatory_keys) { - LDKCommitmentTransaction this_arg_conv; +void __attribute__((export_name("TS_InitFeatures_set_zero_conf_required"))) TS_InitFeatures_set_zero_conf_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; - LDKDirectedChannelTransactionParameters 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; - LDKChannelPublicKeys broadcaster_keys_conv; - broadcaster_keys_conv.inner = untag_ptr(broadcaster_keys); - broadcaster_keys_conv.is_owned = ptr_is_owned(broadcaster_keys); - CHECK_INNER_FIELD_ACCESS_OR_NULL(broadcaster_keys_conv); - broadcaster_keys_conv.is_owned = false; - LDKChannelPublicKeys countersignatory_keys_conv; - countersignatory_keys_conv.inner = untag_ptr(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_TrustedCommitmentTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedCommitmentTransactionNoneZ), "LDKCResult_TrustedCommitmentTransactionNoneZ"); - *ret_conv = CommitmentTransaction_verify(&this_arg_conv, &channel_parameters_conv, &broadcaster_keys_conv, &countersignatory_keys_conv); - return tag_ptr(ret_conv, true); -} - -void __attribute__((export_name("TS_TrustedCommitmentTransaction_free"))) TS_TrustedCommitmentTransaction_free(uint64_t this_obj) { - LDKTrustedCommitmentTransaction 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); - TrustedCommitmentTransaction_free(this_obj_conv); + InitFeatures_set_zero_conf_required(&this_arg_conv); } -int8_tArray __attribute__((export_name("TS_TrustedCommitmentTransaction_txid"))) TS_TrustedCommitmentTransaction_txid(uint64_t this_arg) { - LDKTrustedCommitmentTransaction this_arg_conv; +jboolean __attribute__((export_name("TS_InitFeatures_supports_zero_conf"))) TS_InitFeatures_supports_zero_conf(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; - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, TrustedCommitmentTransaction_txid(&this_arg_conv).data, 32); - return ret_arr; + jboolean ret_conv = InitFeatures_supports_zero_conf(&this_arg_conv); + return ret_conv; } -uint64_t __attribute__((export_name("TS_TrustedCommitmentTransaction_built_transaction"))) TS_TrustedCommitmentTransaction_built_transaction(uint64_t this_arg) { - LDKTrustedCommitmentTransaction this_arg_conv; +void __attribute__((export_name("TS_NodeFeatures_set_zero_conf_optional"))) TS_NodeFeatures_set_zero_conf_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; - LDKBuiltCommitmentTransaction ret_var = TrustedCommitmentTransaction_built_transaction(&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; + NodeFeatures_set_zero_conf_optional(&this_arg_conv); } -uint64_t __attribute__((export_name("TS_TrustedCommitmentTransaction_keys"))) TS_TrustedCommitmentTransaction_keys(uint64_t this_arg) { - LDKTrustedCommitmentTransaction this_arg_conv; +void __attribute__((export_name("TS_NodeFeatures_set_zero_conf_required"))) TS_NodeFeatures_set_zero_conf_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; - LDKTxCreationKeys ret_var = TrustedCommitmentTransaction_keys(&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; + NodeFeatures_set_zero_conf_required(&this_arg_conv); } -jboolean __attribute__((export_name("TS_TrustedCommitmentTransaction_opt_anchors"))) TS_TrustedCommitmentTransaction_opt_anchors(uint64_t this_arg) { - LDKTrustedCommitmentTransaction this_arg_conv; +jboolean __attribute__((export_name("TS_NodeFeatures_supports_zero_conf"))) TS_NodeFeatures_supports_zero_conf(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 = TrustedCommitmentTransaction_opt_anchors(&this_arg_conv); + jboolean ret_conv = NodeFeatures_supports_zero_conf(&this_arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_TrustedCommitmentTransaction_get_htlc_sigs"))) TS_TrustedCommitmentTransaction_get_htlc_sigs(uint64_t this_arg, int8_tArray htlc_base_key, uint64_t channel_parameters) { - LDKTrustedCommitmentTransaction this_arg_conv; +void __attribute__((export_name("TS_ChannelTypeFeatures_set_zero_conf_optional"))) TS_ChannelTypeFeatures_set_zero_conf_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; - 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); - 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); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_parameters_conv); - channel_parameters_conv.is_owned = false; - LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ"); - *ret_conv = TrustedCommitmentTransaction_get_htlc_sigs(&this_arg_conv, htlc_base_key_ref, &channel_parameters_conv); - return tag_ptr(ret_conv, true); -} - -int64_t __attribute__((export_name("TS_get_commitment_transaction_number_obscure_factor"))) TS_get_commitment_transaction_number_obscure_factor(int8_tArray broadcaster_payment_basepoint, int8_tArray countersignatory_payment_basepoint, jboolean outbound_from_broadcaster) { - LDKPublicKey broadcaster_payment_basepoint_ref; - CHECK(broadcaster_payment_basepoint->arr_len == 33); - memcpy(broadcaster_payment_basepoint_ref.compressed_form, broadcaster_payment_basepoint->elems, 33); FREE(broadcaster_payment_basepoint); - LDKPublicKey countersignatory_payment_basepoint_ref; - CHECK(countersignatory_payment_basepoint->arr_len == 33); - memcpy(countersignatory_payment_basepoint_ref.compressed_form, countersignatory_payment_basepoint->elems, 33); FREE(countersignatory_payment_basepoint); - int64_t ret_conv = get_commitment_transaction_number_obscure_factor(broadcaster_payment_basepoint_ref, countersignatory_payment_basepoint_ref, outbound_from_broadcaster); - return ret_conv; -} - -jboolean __attribute__((export_name("TS_InitFeatures_eq"))) TS_InitFeatures_eq(uint64_t a, uint64_t b) { - LDKInitFeatures 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; - LDKInitFeatures 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 = InitFeatures_eq(&a_conv, &b_conv); - return ret_conv; -} - -jboolean __attribute__((export_name("TS_NodeFeatures_eq"))) TS_NodeFeatures_eq(uint64_t a, uint64_t b) { - LDKNodeFeatures 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; - LDKNodeFeatures 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 = NodeFeatures_eq(&a_conv, &b_conv); - return ret_conv; -} - -jboolean __attribute__((export_name("TS_ChannelFeatures_eq"))) TS_ChannelFeatures_eq(uint64_t a, uint64_t b) { - LDKChannelFeatures 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; - LDKChannelFeatures 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 = ChannelFeatures_eq(&a_conv, &b_conv); - return ret_conv; -} - -jboolean __attribute__((export_name("TS_InvoiceFeatures_eq"))) TS_InvoiceFeatures_eq(uint64_t a, uint64_t b) { - LDKInvoiceFeatures 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; - LDKInvoiceFeatures 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 = InvoiceFeatures_eq(&a_conv, &b_conv); - 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; + ChannelTypeFeatures_set_zero_conf_optional(&this_arg_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; +void __attribute__((export_name("TS_ChannelTypeFeatures_set_zero_conf_required"))) TS_ChannelTypeFeatures_set_zero_conf_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_zero_conf_required(&this_arg_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); +jboolean __attribute__((export_name("TS_ChannelTypeFeatures_supports_zero_conf"))) TS_ChannelTypeFeatures_supports_zero_conf(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_zero_conf(&this_arg_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); +jboolean __attribute__((export_name("TS_InitFeatures_requires_zero_conf"))) TS_InitFeatures_requires_zero_conf(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_zero_conf(&this_arg_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); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKChannelTypeFeatures 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 = ChannelTypeFeatures_eq(&a_conv, &b_conv); +jboolean __attribute__((export_name("TS_NodeFeatures_requires_zero_conf"))) TS_NodeFeatures_requires_zero_conf(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_zero_conf(&this_arg_conv); return ret_conv; } -static inline uint64_t InitFeatures_clone_ptr(LDKInitFeatures *NONNULL_PTR arg) { - LDKInitFeatures ret_var = InitFeatures_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_InitFeatures_clone_ptr"))) TS_InitFeatures_clone_ptr(uint64_t arg) { - LDKInitFeatures 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 = InitFeatures_clone_ptr(&arg_conv); +jboolean __attribute__((export_name("TS_ChannelTypeFeatures_requires_zero_conf"))) TS_ChannelTypeFeatures_requires_zero_conf(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_zero_conf(&this_arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_InitFeatures_clone"))) TS_InitFeatures_clone(uint64_t orig) { - LDKInitFeatures 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; - LDKInitFeatures ret_var = InitFeatures_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 NodeFeatures_clone_ptr(LDKNodeFeatures *NONNULL_PTR arg) { - LDKNodeFeatures ret_var = NodeFeatures_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_NodeFeatures_clone_ptr"))) TS_NodeFeatures_clone_ptr(uint64_t arg) { - LDKNodeFeatures 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 = NodeFeatures_clone_ptr(&arg_conv); - return ret_conv; +void __attribute__((export_name("TS_NodeFeatures_set_keysend_optional"))) TS_NodeFeatures_set_keysend_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_keysend_optional(&this_arg_conv); } -uint64_t __attribute__((export_name("TS_NodeFeatures_clone"))) TS_NodeFeatures_clone(uint64_t orig) { - LDKNodeFeatures 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; - LDKNodeFeatures ret_var = NodeFeatures_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_NodeFeatures_set_keysend_required"))) TS_NodeFeatures_set_keysend_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_keysend_required(&this_arg_conv); } -static inline uint64_t ChannelFeatures_clone_ptr(LDKChannelFeatures *NONNULL_PTR arg) { - LDKChannelFeatures ret_var = ChannelFeatures_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_ChannelFeatures_clone_ptr"))) TS_ChannelFeatures_clone_ptr(uint64_t arg) { - LDKChannelFeatures 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 = ChannelFeatures_clone_ptr(&arg_conv); +jboolean __attribute__((export_name("TS_NodeFeatures_supports_keysend"))) TS_NodeFeatures_supports_keysend(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_keysend(&this_arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_ChannelFeatures_clone"))) TS_ChannelFeatures_clone(uint64_t orig) { - LDKChannelFeatures 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; - LDKChannelFeatures ret_var = ChannelFeatures_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 InvoiceFeatures_clone_ptr(LDKInvoiceFeatures *NONNULL_PTR arg) { - LDKInvoiceFeatures ret_var = InvoiceFeatures_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_InvoiceFeatures_clone_ptr"))) TS_InvoiceFeatures_clone_ptr(uint64_t arg) { - LDKInvoiceFeatures 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 = InvoiceFeatures_clone_ptr(&arg_conv); +jboolean __attribute__((export_name("TS_NodeFeatures_requires_keysend"))) TS_NodeFeatures_requires_keysend(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_keysend(&this_arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_InvoiceFeatures_clone"))) TS_InvoiceFeatures_clone(uint64_t orig) { - LDKInvoiceFeatures 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; - LDKInvoiceFeatures ret_var = InvoiceFeatures_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_ShutdownScript_free"))) TS_ShutdownScript_free(uint64_t this_obj) { + LDKShutdownScript 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); + ShutdownScript_free(this_obj_conv); } -static inline uint64_t OfferFeatures_clone_ptr(LDKOfferFeatures *NONNULL_PTR arg) { - LDKOfferFeatures ret_var = OfferFeatures_clone(arg); +static inline uint64_t ShutdownScript_clone_ptr(LDKShutdownScript *NONNULL_PTR arg) { + LDKShutdownScript ret_var = ShutdownScript_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; +int64_t __attribute__((export_name("TS_ShutdownScript_clone_ptr"))) TS_ShutdownScript_clone_ptr(uint64_t arg) { + LDKShutdownScript 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); + int64_t ret_conv = ShutdownScript_clone_ptr(&arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_OfferFeatures_clone"))) TS_OfferFeatures_clone(uint64_t orig) { - LDKOfferFeatures orig_conv; +uint64_t __attribute__((export_name("TS_ShutdownScript_clone"))) TS_ShutdownScript_clone(uint64_t orig) { + LDKShutdownScript 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); + LDKShutdownScript ret_var = ShutdownScript_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); +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; } -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; +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); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + InvalidShutdownScript_free(this_obj_conv); } -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; +int8_tArray __attribute__((export_name("TS_InvalidShutdownScript_get_script"))) TS_InvalidShutdownScript_get_script(uint64_t this_ptr) { + LDKInvalidShutdownScript 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; + LDKu8slice ret_var = InvalidShutdownScript_get_script(&this_ptr_conv); + 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_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); +void __attribute__((export_name("TS_InvalidShutdownScript_set_script"))) TS_InvalidShutdownScript_set_script(uint64_t this_ptr, int8_tArray val) { + LDKInvalidShutdownScript 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; + LDKCVec_u8Z val_ref; + val_ref.datalen = val->arr_len; + val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes"); + memcpy(val_ref.data, val->elems, val_ref.datalen); FREE(val); + InvalidShutdownScript_set_script(&this_ptr_conv, val_ref); +} + +uint64_t __attribute__((export_name("TS_InvalidShutdownScript_new"))) TS_InvalidShutdownScript_new(int8_tArray script_arg) { + LDKCVec_u8Z script_arg_ref; + script_arg_ref.datalen = script_arg->arr_len; + script_arg_ref.data = MALLOC(script_arg_ref.datalen, "LDKCVec_u8Z Bytes"); + memcpy(script_arg_ref.data, script_arg->elems, script_arg_ref.datalen); FREE(script_arg); + LDKInvalidShutdownScript ret_var = InvalidShutdownScript_new(script_arg_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; } -static inline uint64_t BlindedHopFeatures_clone_ptr(LDKBlindedHopFeatures *NONNULL_PTR arg) { - LDKBlindedHopFeatures ret_var = BlindedHopFeatures_clone(arg); +static inline uint64_t InvalidShutdownScript_clone_ptr(LDKInvalidShutdownScript *NONNULL_PTR arg) { + LDKInvalidShutdownScript ret_var = InvalidShutdownScript_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; +int64_t __attribute__((export_name("TS_InvalidShutdownScript_clone_ptr"))) TS_InvalidShutdownScript_clone_ptr(uint64_t arg) { + LDKInvalidShutdownScript 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); + int64_t ret_conv = InvalidShutdownScript_clone_ptr(&arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_BlindedHopFeatures_clone"))) TS_BlindedHopFeatures_clone(uint64_t orig) { - LDKBlindedHopFeatures orig_conv; +uint64_t __attribute__((export_name("TS_InvalidShutdownScript_clone"))) TS_InvalidShutdownScript_clone(uint64_t orig) { + LDKInvalidShutdownScript 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); + LDKInvalidShutdownScript ret_var = InvalidShutdownScript_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); +int8_tArray __attribute__((export_name("TS_ShutdownScript_write"))) TS_ShutdownScript_write(uint64_t obj) { + LDKShutdownScript 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 = ShutdownScript_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_ShutdownScript_read"))) TS_ShutdownScript_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ"); + *ret_conv = ShutdownScript_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +uint64_t __attribute__((export_name("TS_ShutdownScript_new_p2wpkh"))) TS_ShutdownScript_new_p2wpkh(int8_tArray pubkey_hash) { + uint8_t pubkey_hash_arr[20]; + CHECK(pubkey_hash->arr_len == 20); + memcpy(pubkey_hash_arr, pubkey_hash->elems, 20); FREE(pubkey_hash); + 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); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -int64_t __attribute__((export_name("TS_ChannelTypeFeatures_clone_ptr"))) TS_ChannelTypeFeatures_clone_ptr(uint64_t arg) { - LDKChannelTypeFeatures 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 = ChannelTypeFeatures_clone_ptr(&arg_conv); - return ret_conv; -} -uint64_t __attribute__((export_name("TS_ChannelTypeFeatures_clone"))) TS_ChannelTypeFeatures_clone(uint64_t orig) { - LDKChannelTypeFeatures 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; - LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_clone(&orig_conv); +uint64_t __attribute__((export_name("TS_ShutdownScript_new_p2wsh"))) TS_ShutdownScript_new_p2wsh(int8_tArray script_hash) { + uint8_t script_hash_arr[32]; + CHECK(script_hash->arr_len == 32); + memcpy(script_hash_arr, script_hash->elems, 32); FREE(script_hash); + 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); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -void __attribute__((export_name("TS_InitFeatures_free"))) TS_InitFeatures_free(uint64_t this_obj) { - LDKInitFeatures 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); - InitFeatures_free(this_obj_conv); +uint64_t __attribute__((export_name("TS_ShutdownScript_new_witness_program"))) TS_ShutdownScript_new_witness_program(int8_t version, int8_tArray program) { + + LDKu8slice program_ref; + program_ref.datalen = program->arr_len; + program_ref.data = program->elems; + LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ"); + *ret_conv = ShutdownScript_new_witness_program((LDKWitnessVersion){ ._0 = version }, program_ref); + FREE(program); + return tag_ptr(ret_conv, true); } -void __attribute__((export_name("TS_NodeFeatures_free"))) TS_NodeFeatures_free(uint64_t this_obj) { - LDKNodeFeatures 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); - NodeFeatures_free(this_obj_conv); +int8_tArray __attribute__((export_name("TS_ShutdownScript_into_inner"))) TS_ShutdownScript_into_inner(uint64_t this_arg) { + LDKShutdownScript 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 = ShutdownScript_clone(&this_arg_conv); + LDKCVec_u8Z ret_var = ShutdownScript_into_inner(this_arg_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_ChannelFeatures_free"))) TS_ChannelFeatures_free(uint64_t this_obj) { - LDKChannelFeatures 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); - ChannelFeatures_free(this_obj_conv); +int8_tArray __attribute__((export_name("TS_ShutdownScript_as_legacy_pubkey"))) TS_ShutdownScript_as_legacy_pubkey(uint64_t this_arg) { + LDKShutdownScript 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(33, __LINE__); + memcpy(ret_arr->elems, ShutdownScript_as_legacy_pubkey(&this_arg_conv).compressed_form, 33); + return ret_arr; } -void __attribute__((export_name("TS_InvoiceFeatures_free"))) TS_InvoiceFeatures_free(uint64_t this_obj) { - LDKInvoiceFeatures 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); - InvoiceFeatures_free(this_obj_conv); +jboolean __attribute__((export_name("TS_ShutdownScript_is_compatible"))) TS_ShutdownScript_is_compatible(uint64_t this_arg, uint64_t features) { + LDKShutdownScript 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 features_conv; + features_conv.inner = untag_ptr(features); + features_conv.is_owned = ptr_is_owned(features); + CHECK_INNER_FIELD_ACCESS_OR_NULL(features_conv); + features_conv.is_owned = false; + jboolean ret_conv = ShutdownScript_is_compatible(&this_arg_conv, &features_conv); + return ret_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_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); } -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); +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; } -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); +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; } -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); +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; } -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); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChannelTypeFeatures_free(this_obj_conv); +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_InitFeatures_empty"))) TS_InitFeatures_empty() { - LDKInitFeatures ret_var = InitFeatures_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; +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; } -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); - 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_unknown_bits(&this_arg_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; } -uint64_t __attribute__((export_name("TS_NodeFeatures_empty"))) TS_NodeFeatures_empty() { - LDKNodeFeatures ret_var = NodeFeatures_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; +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; } -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); +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; } -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; +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; } -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 = ChannelFeatures_requires_unknown_bits(&this_arg_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_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); +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; } -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_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_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); +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; } -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 = OfferFeatures_requires_unknown_bits(&this_arg_conv); - return ret_conv; +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_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); +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; } -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_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; } -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); +void __attribute__((export_name("TS_RecipientOnionFields_free"))) TS_RecipientOnionFields_free(uint64_t this_obj) { + LDKRecipientOnionFields 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); + RecipientOnionFields_free(this_obj_conv); +} + +int8_tArray __attribute__((export_name("TS_RecipientOnionFields_get_payment_secret"))) TS_RecipientOnionFields_get_payment_secret(uint64_t this_ptr) { + LDKRecipientOnionFields 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(32, __LINE__); + memcpy(ret_arr->elems, RecipientOnionFields_get_payment_secret(&this_ptr_conv).data, 32); + return ret_arr; +} + +void __attribute__((export_name("TS_RecipientOnionFields_set_payment_secret"))) TS_RecipientOnionFields_set_payment_secret(uint64_t this_ptr, int8_tArray val) { + LDKRecipientOnionFields 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; + LDKThirtyTwoBytes val_ref; + CHECK(val->arr_len == 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); + RecipientOnionFields_set_payment_secret(&this_ptr_conv, val_ref); +} + +uint64_t __attribute__((export_name("TS_RecipientOnionFields_get_payment_metadata"))) TS_RecipientOnionFields_get_payment_metadata(uint64_t this_ptr) { + LDKRecipientOnionFields 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_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); + *ret_copy = RecipientOnionFields_get_payment_metadata(&this_ptr_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -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 = Bolt12InvoiceFeatures_requires_unknown_bits(&this_arg_conv); - return ret_conv; +void __attribute__((export_name("TS_RecipientOnionFields_set_payment_metadata"))) TS_RecipientOnionFields_set_payment_metadata(uint64_t this_ptr, uint64_t val) { + LDKRecipientOnionFields 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_CVec_u8ZZ val_conv = *(LDKCOption_CVec_u8ZZ*)(val_ptr); + val_conv = COption_CVec_u8ZZ_clone((LDKCOption_CVec_u8ZZ*)untag_ptr(val)); + RecipientOnionFields_set_payment_metadata(&this_ptr_conv, val_conv); } -uint64_t __attribute__((export_name("TS_BlindedHopFeatures_empty"))) TS_BlindedHopFeatures_empty() { - LDKBlindedHopFeatures ret_var = BlindedHopFeatures_empty(); +uint64_t __attribute__((export_name("TS_RecipientOnionFields_new"))) TS_RecipientOnionFields_new(int8_tArray payment_secret_arg, uint64_t payment_metadata_arg) { + LDKThirtyTwoBytes payment_secret_arg_ref; + CHECK(payment_secret_arg->arr_len == 32); + memcpy(payment_secret_arg_ref.data, payment_secret_arg->elems, 32); FREE(payment_secret_arg); + void* payment_metadata_arg_ptr = untag_ptr(payment_metadata_arg); + CHECK_ACCESS(payment_metadata_arg_ptr); + LDKCOption_CVec_u8ZZ payment_metadata_arg_conv = *(LDKCOption_CVec_u8ZZ*)(payment_metadata_arg_ptr); + payment_metadata_arg_conv = COption_CVec_u8ZZ_clone((LDKCOption_CVec_u8ZZ*)untag_ptr(payment_metadata_arg)); + LDKRecipientOnionFields ret_var = RecipientOnionFields_new(payment_secret_arg_ref, payment_metadata_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_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(); +static inline uint64_t RecipientOnionFields_clone_ptr(LDKRecipientOnionFields *NONNULL_PTR arg) { + LDKRecipientOnionFields ret_var = RecipientOnionFields_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; } - -jboolean __attribute__((export_name("TS_ChannelTypeFeatures_requires_unknown_bits"))) TS_ChannelTypeFeatures_requires_unknown_bits(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_unknown_bits(&this_arg_conv); +int64_t __attribute__((export_name("TS_RecipientOnionFields_clone_ptr"))) TS_RecipientOnionFields_clone_ptr(uint64_t arg) { + LDKRecipientOnionFields 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 = RecipientOnionFields_clone_ptr(&arg_conv); return ret_conv; } -int8_tArray __attribute__((export_name("TS_InitFeatures_write"))) TS_InitFeatures_write(uint64_t obj) { - LDKInitFeatures 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 = InitFeatures_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_RecipientOnionFields_clone"))) TS_RecipientOnionFields_clone(uint64_t orig) { + LDKRecipientOnionFields 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; + LDKRecipientOnionFields ret_var = RecipientOnionFields_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_InitFeatures_read"))) TS_InitFeatures_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ"); - *ret_conv = InitFeatures_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +jboolean __attribute__((export_name("TS_RecipientOnionFields_eq"))) TS_RecipientOnionFields_eq(uint64_t a, uint64_t b) { + LDKRecipientOnionFields 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; + LDKRecipientOnionFields 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 = RecipientOnionFields_eq(&a_conv, &b_conv); + return ret_conv; } -int8_tArray __attribute__((export_name("TS_ChannelFeatures_write"))) TS_ChannelFeatures_write(uint64_t obj) { - LDKChannelFeatures obj_conv; +int8_tArray __attribute__((export_name("TS_RecipientOnionFields_write"))) TS_RecipientOnionFields_write(uint64_t obj) { + LDKRecipientOnionFields 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 = ChannelFeatures_write(&obj_conv); + LDKCVec_u8Z ret_var = RecipientOnionFields_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_ChannelFeatures_read"))) TS_ChannelFeatures_read(int8_tArray ser) { +uint64_t __attribute__((export_name("TS_RecipientOnionFields_read"))) TS_RecipientOnionFields_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; ser_ref.data = ser->elems; - LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ"); - *ret_conv = ChannelFeatures_read(ser_ref); + LDKCResult_RecipientOnionFieldsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RecipientOnionFieldsDecodeErrorZ), "LDKCResult_RecipientOnionFieldsDecodeErrorZ"); + *ret_conv = RecipientOnionFields_read(ser_ref); FREE(ser); return tag_ptr(ret_conv, true); } -int8_tArray __attribute__((export_name("TS_NodeFeatures_write"))) TS_NodeFeatures_write(uint64_t obj) { - LDKNodeFeatures 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 = NodeFeatures_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_RecipientOnionFields_secret_only"))) TS_RecipientOnionFields_secret_only(int8_tArray payment_secret) { + LDKThirtyTwoBytes payment_secret_ref; + CHECK(payment_secret->arr_len == 32); + memcpy(payment_secret_ref.data, payment_secret->elems, 32); FREE(payment_secret); + LDKRecipientOnionFields ret_var = RecipientOnionFields_secret_only(payment_secret_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_NodeFeatures_read"))) TS_NodeFeatures_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ"); - *ret_conv = NodeFeatures_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +uint64_t __attribute__((export_name("TS_RecipientOnionFields_spontaneous_empty"))) TS_RecipientOnionFields_spontaneous_empty() { + LDKRecipientOnionFields ret_var = RecipientOnionFields_spontaneous_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; } -int8_tArray __attribute__((export_name("TS_InvoiceFeatures_write"))) TS_InvoiceFeatures_write(uint64_t obj) { - LDKInvoiceFeatures 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 = InvoiceFeatures_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_CustomMessageReader_free"))) TS_CustomMessageReader_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); + LDKCustomMessageReader this_ptr_conv = *(LDKCustomMessageReader*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + CustomMessageReader_free(this_ptr_conv); } -uint64_t __attribute__((export_name("TS_InvoiceFeatures_read"))) TS_InvoiceFeatures_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ"); - *ret_conv = InvoiceFeatures_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +static inline uint64_t Type_clone_ptr(LDKType *NONNULL_PTR arg) { + LDKType* ret_ret = MALLOC(sizeof(LDKType), "LDKType"); + *ret_ret = Type_clone(arg); + return tag_ptr(ret_ret, 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; +int64_t __attribute__((export_name("TS_Type_clone_ptr"))) TS_Type_clone_ptr(uint64_t arg) { + void* arg_ptr = untag_ptr(arg); + if (ptr_is_owned(arg)) { CHECK_ACCESS(arg_ptr); } + LDKType* arg_conv = (LDKType*)arg_ptr; + int64_t ret_conv = Type_clone_ptr(arg_conv); + return ret_conv; } -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); +uint64_t __attribute__((export_name("TS_Type_clone"))) TS_Type_clone(uint64_t orig) { + void* orig_ptr = untag_ptr(orig); + if (ptr_is_owned(orig)) { CHECK_ACCESS(orig_ptr); } + LDKType* orig_conv = (LDKType*)orig_ptr; + LDKType* ret_ret = MALLOC(sizeof(LDKType), "LDKType"); + *ret_ret = Type_clone(orig_conv); + return tag_ptr(ret_ret, true); } -int8_tArray __attribute__((export_name("TS_ChannelTypeFeatures_write"))) TS_ChannelTypeFeatures_write(uint64_t obj) { - LDKChannelTypeFeatures 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 = ChannelTypeFeatures_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_Type_free"))) TS_Type_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); + LDKType this_ptr_conv = *(LDKType*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + Type_free(this_ptr_conv); } -uint64_t __attribute__((export_name("TS_ChannelTypeFeatures_read"))) TS_ChannelTypeFeatures_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ"); - *ret_conv = ChannelTypeFeatures_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +void __attribute__((export_name("TS_UnsignedInvoice_free"))) TS_UnsignedInvoice_free(uint64_t this_obj) { + LDKUnsignedInvoice 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); + UnsignedInvoice_free(this_obj_conv); } -void __attribute__((export_name("TS_InitFeatures_set_data_loss_protect_optional"))) TS_InitFeatures_set_data_loss_protect_optional(uint64_t this_arg) { - LDKInitFeatures this_arg_conv; +int8_tArray __attribute__((export_name("TS_UnsignedInvoice_signing_pubkey"))) TS_UnsignedInvoice_signing_pubkey(uint64_t this_arg) { + LDKUnsignedInvoice 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_data_loss_protect_optional(&this_arg_conv); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, UnsignedInvoice_signing_pubkey(&this_arg_conv).compressed_form, 33); + return ret_arr; } -void __attribute__((export_name("TS_InitFeatures_set_data_loss_protect_required"))) TS_InitFeatures_set_data_loss_protect_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_data_loss_protect_required(&this_arg_conv); +void __attribute__((export_name("TS_BlindedPayInfo_free"))) TS_BlindedPayInfo_free(uint64_t this_obj) { + LDKBlindedPayInfo 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); + BlindedPayInfo_free(this_obj_conv); } -jboolean __attribute__((export_name("TS_InitFeatures_supports_data_loss_protect"))) TS_InitFeatures_supports_data_loss_protect(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_data_loss_protect(&this_arg_conv); +int32_t __attribute__((export_name("TS_BlindedPayInfo_get_fee_base_msat"))) TS_BlindedPayInfo_get_fee_base_msat(uint64_t this_ptr) { + LDKBlindedPayInfo 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 = BlindedPayInfo_get_fee_base_msat(&this_ptr_conv); return ret_conv; } -void __attribute__((export_name("TS_NodeFeatures_set_data_loss_protect_optional"))) TS_NodeFeatures_set_data_loss_protect_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_data_loss_protect_optional(&this_arg_conv); +void __attribute__((export_name("TS_BlindedPayInfo_set_fee_base_msat"))) TS_BlindedPayInfo_set_fee_base_msat(uint64_t this_ptr, int32_t val) { + LDKBlindedPayInfo 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; + BlindedPayInfo_set_fee_base_msat(&this_ptr_conv, val); } -void __attribute__((export_name("TS_NodeFeatures_set_data_loss_protect_required"))) TS_NodeFeatures_set_data_loss_protect_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_data_loss_protect_required(&this_arg_conv); +int32_t __attribute__((export_name("TS_BlindedPayInfo_get_fee_proportional_millionths"))) TS_BlindedPayInfo_get_fee_proportional_millionths(uint64_t this_ptr) { + LDKBlindedPayInfo 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 = BlindedPayInfo_get_fee_proportional_millionths(&this_ptr_conv); + return ret_conv; } -jboolean __attribute__((export_name("TS_NodeFeatures_supports_data_loss_protect"))) TS_NodeFeatures_supports_data_loss_protect(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_data_loss_protect(&this_arg_conv); +void __attribute__((export_name("TS_BlindedPayInfo_set_fee_proportional_millionths"))) TS_BlindedPayInfo_set_fee_proportional_millionths(uint64_t this_ptr, int32_t val) { + LDKBlindedPayInfo 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; + BlindedPayInfo_set_fee_proportional_millionths(&this_ptr_conv, val); +} + +int16_t __attribute__((export_name("TS_BlindedPayInfo_get_cltv_expiry_delta"))) TS_BlindedPayInfo_get_cltv_expiry_delta(uint64_t this_ptr) { + LDKBlindedPayInfo 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; + int16_t ret_conv = BlindedPayInfo_get_cltv_expiry_delta(&this_ptr_conv); return ret_conv; } -jboolean __attribute__((export_name("TS_InitFeatures_requires_data_loss_protect"))) TS_InitFeatures_requires_data_loss_protect(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_data_loss_protect(&this_arg_conv); +void __attribute__((export_name("TS_BlindedPayInfo_set_cltv_expiry_delta"))) TS_BlindedPayInfo_set_cltv_expiry_delta(uint64_t this_ptr, int16_t val) { + LDKBlindedPayInfo 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; + BlindedPayInfo_set_cltv_expiry_delta(&this_ptr_conv, val); +} + +int64_t __attribute__((export_name("TS_BlindedPayInfo_get_htlc_minimum_msat"))) TS_BlindedPayInfo_get_htlc_minimum_msat(uint64_t this_ptr) { + LDKBlindedPayInfo 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 = BlindedPayInfo_get_htlc_minimum_msat(&this_ptr_conv); return ret_conv; } -jboolean __attribute__((export_name("TS_NodeFeatures_requires_data_loss_protect"))) TS_NodeFeatures_requires_data_loss_protect(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_data_loss_protect(&this_arg_conv); +void __attribute__((export_name("TS_BlindedPayInfo_set_htlc_minimum_msat"))) TS_BlindedPayInfo_set_htlc_minimum_msat(uint64_t this_ptr, int64_t val) { + LDKBlindedPayInfo 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; + BlindedPayInfo_set_htlc_minimum_msat(&this_ptr_conv, val); +} + +int64_t __attribute__((export_name("TS_BlindedPayInfo_get_htlc_maximum_msat"))) TS_BlindedPayInfo_get_htlc_maximum_msat(uint64_t this_ptr) { + LDKBlindedPayInfo 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 = BlindedPayInfo_get_htlc_maximum_msat(&this_ptr_conv); return ret_conv; } -void __attribute__((export_name("TS_InitFeatures_set_initial_routing_sync_optional"))) TS_InitFeatures_set_initial_routing_sync_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_initial_routing_sync_optional(&this_arg_conv); +void __attribute__((export_name("TS_BlindedPayInfo_set_htlc_maximum_msat"))) TS_BlindedPayInfo_set_htlc_maximum_msat(uint64_t this_ptr, int64_t val) { + LDKBlindedPayInfo 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; + BlindedPayInfo_set_htlc_maximum_msat(&this_ptr_conv, val); } -void __attribute__((export_name("TS_InitFeatures_set_initial_routing_sync_required"))) TS_InitFeatures_set_initial_routing_sync_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_initial_routing_sync_required(&this_arg_conv); +uint64_t __attribute__((export_name("TS_BlindedPayInfo_get_features"))) TS_BlindedPayInfo_get_features(uint64_t this_ptr) { + LDKBlindedPayInfo 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; + LDKBlindedHopFeatures ret_var = BlindedPayInfo_get_features(&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; } -jboolean __attribute__((export_name("TS_InitFeatures_initial_routing_sync"))) TS_InitFeatures_initial_routing_sync(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_initial_routing_sync(&this_arg_conv); +void __attribute__((export_name("TS_BlindedPayInfo_set_features"))) TS_BlindedPayInfo_set_features(uint64_t this_ptr, uint64_t val) { + LDKBlindedPayInfo 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; + LDKBlindedHopFeatures 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 = BlindedHopFeatures_clone(&val_conv); + BlindedPayInfo_set_features(&this_ptr_conv, val_conv); +} + +uint64_t __attribute__((export_name("TS_BlindedPayInfo_new"))) TS_BlindedPayInfo_new(int32_t fee_base_msat_arg, int32_t fee_proportional_millionths_arg, int16_t cltv_expiry_delta_arg, int64_t htlc_minimum_msat_arg, int64_t htlc_maximum_msat_arg, uint64_t features_arg) { + LDKBlindedHopFeatures features_arg_conv; + features_arg_conv.inner = untag_ptr(features_arg); + features_arg_conv.is_owned = ptr_is_owned(features_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv); + features_arg_conv = BlindedHopFeatures_clone(&features_arg_conv); + LDKBlindedPayInfo ret_var = BlindedPayInfo_new(fee_base_msat_arg, fee_proportional_millionths_arg, cltv_expiry_delta_arg, htlc_minimum_msat_arg, htlc_maximum_msat_arg, features_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; +} + +static inline uint64_t BlindedPayInfo_clone_ptr(LDKBlindedPayInfo *NONNULL_PTR arg) { + LDKBlindedPayInfo ret_var = BlindedPayInfo_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_BlindedPayInfo_clone_ptr"))) TS_BlindedPayInfo_clone_ptr(uint64_t arg) { + LDKBlindedPayInfo 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 = BlindedPayInfo_clone_ptr(&arg_conv); return ret_conv; } -void __attribute__((export_name("TS_InitFeatures_set_upfront_shutdown_script_optional"))) TS_InitFeatures_set_upfront_shutdown_script_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_upfront_shutdown_script_optional(&this_arg_conv); +uint64_t __attribute__((export_name("TS_BlindedPayInfo_clone"))) TS_BlindedPayInfo_clone(uint64_t orig) { + LDKBlindedPayInfo 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; + LDKBlindedPayInfo ret_var = BlindedPayInfo_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_InitFeatures_set_upfront_shutdown_script_required"))) TS_InitFeatures_set_upfront_shutdown_script_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_upfront_shutdown_script_required(&this_arg_conv); +int64_t __attribute__((export_name("TS_BlindedPayInfo_hash"))) TS_BlindedPayInfo_hash(uint64_t o) { + LDKBlindedPayInfo 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 = BlindedPayInfo_hash(&o_conv); + return ret_conv; } -jboolean __attribute__((export_name("TS_InitFeatures_supports_upfront_shutdown_script"))) TS_InitFeatures_supports_upfront_shutdown_script(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_upfront_shutdown_script(&this_arg_conv); +jboolean __attribute__((export_name("TS_BlindedPayInfo_eq"))) TS_BlindedPayInfo_eq(uint64_t a, uint64_t b) { + LDKBlindedPayInfo 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; + LDKBlindedPayInfo 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 = BlindedPayInfo_eq(&a_conv, &b_conv); return ret_conv; } -void __attribute__((export_name("TS_NodeFeatures_set_upfront_shutdown_script_optional"))) TS_NodeFeatures_set_upfront_shutdown_script_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_upfront_shutdown_script_optional(&this_arg_conv); +int8_tArray __attribute__((export_name("TS_BlindedPayInfo_write"))) TS_BlindedPayInfo_write(uint64_t obj) { + LDKBlindedPayInfo 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 = BlindedPayInfo_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_NodeFeatures_set_upfront_shutdown_script_required"))) TS_NodeFeatures_set_upfront_shutdown_script_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_upfront_shutdown_script_required(&this_arg_conv); +uint64_t __attribute__((export_name("TS_BlindedPayInfo_read"))) TS_BlindedPayInfo_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_BlindedPayInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPayInfoDecodeErrorZ), "LDKCResult_BlindedPayInfoDecodeErrorZ"); + *ret_conv = BlindedPayInfo_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -jboolean __attribute__((export_name("TS_NodeFeatures_supports_upfront_shutdown_script"))) TS_NodeFeatures_supports_upfront_shutdown_script(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_upfront_shutdown_script(&this_arg_conv); - return ret_conv; +void __attribute__((export_name("TS_UnsignedInvoiceRequest_free"))) TS_UnsignedInvoiceRequest_free(uint64_t this_obj) { + LDKUnsignedInvoiceRequest 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); + UnsignedInvoiceRequest_free(this_obj_conv); } -jboolean __attribute__((export_name("TS_InitFeatures_requires_upfront_shutdown_script"))) TS_InitFeatures_requires_upfront_shutdown_script(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_upfront_shutdown_script(&this_arg_conv); +void __attribute__((export_name("TS_InvoiceRequest_free"))) TS_InvoiceRequest_free(uint64_t this_obj) { + LDKInvoiceRequest 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); + InvoiceRequest_free(this_obj_conv); +} + +static inline uint64_t InvoiceRequest_clone_ptr(LDKInvoiceRequest *NONNULL_PTR arg) { + LDKInvoiceRequest ret_var = InvoiceRequest_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_InvoiceRequest_clone_ptr"))) TS_InvoiceRequest_clone_ptr(uint64_t arg) { + LDKInvoiceRequest 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 = InvoiceRequest_clone_ptr(&arg_conv); return ret_conv; } -jboolean __attribute__((export_name("TS_NodeFeatures_requires_upfront_shutdown_script"))) TS_NodeFeatures_requires_upfront_shutdown_script(uint64_t this_arg) { - LDKNodeFeatures this_arg_conv; +uint64_t __attribute__((export_name("TS_InvoiceRequest_clone"))) TS_InvoiceRequest_clone(uint64_t orig) { + LDKInvoiceRequest 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; + LDKInvoiceRequest ret_var = InvoiceRequest_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; +} + +int8_tArray __attribute__((export_name("TS_InvoiceRequest_metadata"))) TS_InvoiceRequest_metadata(uint64_t this_arg) { + LDKInvoiceRequest 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_upfront_shutdown_script(&this_arg_conv); - return ret_conv; + LDKu8slice ret_var = InvoiceRequest_metadata(&this_arg_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + return ret_arr; } -void __attribute__((export_name("TS_InitFeatures_set_gossip_queries_optional"))) TS_InitFeatures_set_gossip_queries_optional(uint64_t this_arg) { - LDKInitFeatures this_arg_conv; +int8_tArray __attribute__((export_name("TS_InvoiceRequest_chain"))) TS_InvoiceRequest_chain(uint64_t this_arg) { + LDKInvoiceRequest 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_gossip_queries_optional(&this_arg_conv); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, InvoiceRequest_chain(&this_arg_conv).data, 32); + return ret_arr; } -void __attribute__((export_name("TS_InitFeatures_set_gossip_queries_required"))) TS_InitFeatures_set_gossip_queries_required(uint64_t this_arg) { - LDKInitFeatures this_arg_conv; +uint64_t __attribute__((export_name("TS_InvoiceRequest_amount_msats"))) TS_InvoiceRequest_amount_msats(uint64_t this_arg) { + LDKInvoiceRequest 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_gossip_queries_required(&this_arg_conv); + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = InvoiceRequest_amount_msats(&this_arg_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -jboolean __attribute__((export_name("TS_InitFeatures_supports_gossip_queries"))) TS_InitFeatures_supports_gossip_queries(uint64_t this_arg) { - LDKInitFeatures this_arg_conv; +uint64_t __attribute__((export_name("TS_InvoiceRequest_features"))) TS_InvoiceRequest_features(uint64_t this_arg) { + LDKInvoiceRequest 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_gossip_queries(&this_arg_conv); - return ret_conv; + LDKInvoiceRequestFeatures ret_var = InvoiceRequest_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; } -void __attribute__((export_name("TS_NodeFeatures_set_gossip_queries_optional"))) TS_NodeFeatures_set_gossip_queries_optional(uint64_t this_arg) { - LDKNodeFeatures this_arg_conv; +uint64_t __attribute__((export_name("TS_InvoiceRequest_quantity"))) TS_InvoiceRequest_quantity(uint64_t this_arg) { + LDKInvoiceRequest 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_gossip_queries_optional(&this_arg_conv); + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = InvoiceRequest_quantity(&this_arg_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void __attribute__((export_name("TS_NodeFeatures_set_gossip_queries_required"))) TS_NodeFeatures_set_gossip_queries_required(uint64_t this_arg) { - LDKNodeFeatures this_arg_conv; +int8_tArray __attribute__((export_name("TS_InvoiceRequest_payer_id"))) TS_InvoiceRequest_payer_id(uint64_t this_arg) { + LDKInvoiceRequest 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_gossip_queries_required(&this_arg_conv); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, InvoiceRequest_payer_id(&this_arg_conv).compressed_form, 33); + return ret_arr; } -jboolean __attribute__((export_name("TS_NodeFeatures_supports_gossip_queries"))) TS_NodeFeatures_supports_gossip_queries(uint64_t this_arg) { - LDKNodeFeatures this_arg_conv; +uint64_t __attribute__((export_name("TS_InvoiceRequest_payer_note"))) TS_InvoiceRequest_payer_note(uint64_t this_arg) { + LDKInvoiceRequest 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_gossip_queries(&this_arg_conv); + LDKPrintableString ret_var = InvoiceRequest_payer_note(&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; +} + +int8_tArray __attribute__((export_name("TS_InvoiceRequest_write"))) TS_InvoiceRequest_write(uint64_t obj) { + LDKInvoiceRequest 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 = InvoiceRequest_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_Offer_free"))) TS_Offer_free(uint64_t this_obj) { + LDKOffer 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); + Offer_free(this_obj_conv); +} + +static inline uint64_t Offer_clone_ptr(LDKOffer *NONNULL_PTR arg) { + LDKOffer ret_var = Offer_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_Offer_clone_ptr"))) TS_Offer_clone_ptr(uint64_t arg) { + LDKOffer 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 = Offer_clone_ptr(&arg_conv); return ret_conv; } -jboolean __attribute__((export_name("TS_InitFeatures_requires_gossip_queries"))) TS_InitFeatures_requires_gossip_queries(uint64_t this_arg) { - LDKInitFeatures this_arg_conv; +uint64_t __attribute__((export_name("TS_Offer_clone"))) TS_Offer_clone(uint64_t orig) { + LDKOffer 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; + LDKOffer ret_var = Offer_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; +} + +ptrArray __attribute__((export_name("TS_Offer_chains"))) TS_Offer_chains(uint64_t this_arg) { + LDKOffer 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_gossip_queries(&this_arg_conv); - return ret_conv; + LDKCVec_ChainHashZ ret_var = Offer_chains(&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; + } + + FREE(ret_var.data); + return ret_arr; } -jboolean __attribute__((export_name("TS_NodeFeatures_requires_gossip_queries"))) TS_NodeFeatures_requires_gossip_queries(uint64_t this_arg) { - LDKNodeFeatures this_arg_conv; +jboolean __attribute__((export_name("TS_Offer_supports_chain"))) TS_Offer_supports_chain(uint64_t this_arg, int8_tArray chain) { + LDKOffer 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_gossip_queries(&this_arg_conv); + LDKThirtyTwoBytes chain_ref; + CHECK(chain->arr_len == 32); + memcpy(chain_ref.data, chain->elems, 32); FREE(chain); + jboolean ret_conv = Offer_supports_chain(&this_arg_conv, chain_ref); return ret_conv; } -void __attribute__((export_name("TS_InitFeatures_set_variable_length_onion_optional"))) TS_InitFeatures_set_variable_length_onion_optional(uint64_t this_arg) { - LDKInitFeatures this_arg_conv; +uint64_t __attribute__((export_name("TS_Offer_metadata"))) TS_Offer_metadata(uint64_t this_arg) { + LDKOffer 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_variable_length_onion_optional(&this_arg_conv); + LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); + *ret_copy = Offer_metadata(&this_arg_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void __attribute__((export_name("TS_InitFeatures_set_variable_length_onion_required"))) TS_InitFeatures_set_variable_length_onion_required(uint64_t this_arg) { - LDKInitFeatures this_arg_conv; +uint64_t __attribute__((export_name("TS_Offer_amount"))) TS_Offer_amount(uint64_t this_arg) { + LDKOffer 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_variable_length_onion_required(&this_arg_conv); + LDKAmount ret_var = Offer_amount(&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; } -jboolean __attribute__((export_name("TS_InitFeatures_supports_variable_length_onion"))) TS_InitFeatures_supports_variable_length_onion(uint64_t this_arg) { - LDKInitFeatures this_arg_conv; +uint64_t __attribute__((export_name("TS_Offer_description"))) TS_Offer_description(uint64_t this_arg) { + LDKOffer 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_variable_length_onion(&this_arg_conv); - return ret_conv; + LDKPrintableString ret_var = Offer_description(&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; } -void __attribute__((export_name("TS_NodeFeatures_set_variable_length_onion_optional"))) TS_NodeFeatures_set_variable_length_onion_optional(uint64_t this_arg) { - LDKNodeFeatures this_arg_conv; +uint64_t __attribute__((export_name("TS_Offer_features"))) TS_Offer_features(uint64_t this_arg) { + LDKOffer 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_variable_length_onion_optional(&this_arg_conv); + LDKOfferFeatures ret_var = Offer_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; } -void __attribute__((export_name("TS_NodeFeatures_set_variable_length_onion_required"))) TS_NodeFeatures_set_variable_length_onion_required(uint64_t this_arg) { - LDKNodeFeatures this_arg_conv; +uint64_t __attribute__((export_name("TS_Offer_absolute_expiry"))) TS_Offer_absolute_expiry(uint64_t this_arg) { + LDKOffer 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_variable_length_onion_required(&this_arg_conv); + LDKCOption_DurationZ *ret_copy = MALLOC(sizeof(LDKCOption_DurationZ), "LDKCOption_DurationZ"); + *ret_copy = Offer_absolute_expiry(&this_arg_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -jboolean __attribute__((export_name("TS_NodeFeatures_supports_variable_length_onion"))) TS_NodeFeatures_supports_variable_length_onion(uint64_t this_arg) { - LDKNodeFeatures this_arg_conv; +uint64_t __attribute__((export_name("TS_Offer_issuer"))) TS_Offer_issuer(uint64_t this_arg) { + LDKOffer 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_variable_length_onion(&this_arg_conv); - return ret_conv; + LDKPrintableString ret_var = Offer_issuer(&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; } -void __attribute__((export_name("TS_InvoiceFeatures_set_variable_length_onion_optional"))) TS_InvoiceFeatures_set_variable_length_onion_optional(uint64_t this_arg) { - LDKInvoiceFeatures this_arg_conv; +uint64_tArray __attribute__((export_name("TS_Offer_paths"))) TS_Offer_paths(uint64_t this_arg) { + LDKOffer 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; - InvoiceFeatures_set_variable_length_onion_optional(&this_arg_conv); + LDKCVec_BlindedPathZ ret_var = Offer_paths(&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 n = 0; n < ret_var.datalen; n++) { + LDKBlindedPath ret_conv_13_var = ret_var.data[n]; + uint64_t ret_conv_13_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_13_var); + ret_conv_13_ref = tag_ptr(ret_conv_13_var.inner, ret_conv_13_var.is_owned); + ret_arr_ptr[n] = ret_conv_13_ref; + } + + FREE(ret_var.data); + return ret_arr; } -void __attribute__((export_name("TS_InvoiceFeatures_set_variable_length_onion_required"))) TS_InvoiceFeatures_set_variable_length_onion_required(uint64_t this_arg) { - LDKInvoiceFeatures this_arg_conv; +uint64_t __attribute__((export_name("TS_Offer_supported_quantity"))) TS_Offer_supported_quantity(uint64_t this_arg) { + LDKOffer 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; - InvoiceFeatures_set_variable_length_onion_required(&this_arg_conv); + LDKQuantity ret_var = Offer_supported_quantity(&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; } -jboolean __attribute__((export_name("TS_InvoiceFeatures_supports_variable_length_onion"))) TS_InvoiceFeatures_supports_variable_length_onion(uint64_t this_arg) { - LDKInvoiceFeatures this_arg_conv; +jboolean __attribute__((export_name("TS_Offer_is_valid_quantity"))) TS_Offer_is_valid_quantity(uint64_t this_arg, int64_t quantity) { + LDKOffer 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_supports_variable_length_onion(&this_arg_conv); + jboolean ret_conv = Offer_is_valid_quantity(&this_arg_conv, quantity); return ret_conv; } -jboolean __attribute__((export_name("TS_InitFeatures_requires_variable_length_onion"))) TS_InitFeatures_requires_variable_length_onion(uint64_t this_arg) { - LDKInitFeatures this_arg_conv; +jboolean __attribute__((export_name("TS_Offer_expects_quantity"))) TS_Offer_expects_quantity(uint64_t this_arg) { + LDKOffer 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_variable_length_onion(&this_arg_conv); + jboolean ret_conv = Offer_expects_quantity(&this_arg_conv); return ret_conv; } -jboolean __attribute__((export_name("TS_NodeFeatures_requires_variable_length_onion"))) TS_NodeFeatures_requires_variable_length_onion(uint64_t this_arg) { - LDKNodeFeatures this_arg_conv; +int8_tArray __attribute__((export_name("TS_Offer_signing_pubkey"))) TS_Offer_signing_pubkey(uint64_t this_arg) { + LDKOffer 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_variable_length_onion(&this_arg_conv); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, Offer_signing_pubkey(&this_arg_conv).compressed_form, 33); + return ret_arr; +} + +int8_tArray __attribute__((export_name("TS_Offer_write"))) TS_Offer_write(uint64_t obj) { + LDKOffer 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 = Offer_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_Amount_free"))) TS_Amount_free(uint64_t this_obj) { + LDKAmount 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); + Amount_free(this_obj_conv); +} + +static inline uint64_t Amount_clone_ptr(LDKAmount *NONNULL_PTR arg) { + LDKAmount ret_var = Amount_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_Amount_clone_ptr"))) TS_Amount_clone_ptr(uint64_t arg) { + LDKAmount 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 = Amount_clone_ptr(&arg_conv); return ret_conv; } -jboolean __attribute__((export_name("TS_InvoiceFeatures_requires_variable_length_onion"))) TS_InvoiceFeatures_requires_variable_length_onion(uint64_t this_arg) { - LDKInvoiceFeatures this_arg_conv; +uint64_t __attribute__((export_name("TS_Amount_clone"))) TS_Amount_clone(uint64_t orig) { + LDKAmount 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; + LDKAmount ret_var = Amount_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_Quantity_free"))) TS_Quantity_free(uint64_t this_obj) { + LDKQuantity 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); + Quantity_free(this_obj_conv); +} + +static inline uint64_t Quantity_clone_ptr(LDKQuantity *NONNULL_PTR arg) { + LDKQuantity ret_var = Quantity_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_Quantity_clone_ptr"))) TS_Quantity_clone_ptr(uint64_t arg) { + LDKQuantity 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 = Quantity_clone_ptr(&arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_Quantity_clone"))) TS_Quantity_clone(uint64_t orig) { + LDKQuantity 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; + LDKQuantity ret_var = Quantity_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_Refund_free"))) TS_Refund_free(uint64_t this_obj) { + LDKRefund 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); + Refund_free(this_obj_conv); +} + +static inline uint64_t Refund_clone_ptr(LDKRefund *NONNULL_PTR arg) { + LDKRefund ret_var = Refund_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_Refund_clone_ptr"))) TS_Refund_clone_ptr(uint64_t arg) { + LDKRefund 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 = Refund_clone_ptr(&arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_Refund_clone"))) TS_Refund_clone(uint64_t orig) { + LDKRefund 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; + LDKRefund ret_var = Refund_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_Refund_description"))) TS_Refund_description(uint64_t this_arg) { + LDKRefund 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_variable_length_onion(&this_arg_conv); - return ret_conv; + LDKPrintableString ret_var = Refund_description(&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; } -void __attribute__((export_name("TS_InitFeatures_set_static_remote_key_optional"))) TS_InitFeatures_set_static_remote_key_optional(uint64_t this_arg) { - LDKInitFeatures this_arg_conv; +uint64_t __attribute__((export_name("TS_Refund_absolute_expiry"))) TS_Refund_absolute_expiry(uint64_t this_arg) { + LDKRefund 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_static_remote_key_optional(&this_arg_conv); + LDKCOption_DurationZ *ret_copy = MALLOC(sizeof(LDKCOption_DurationZ), "LDKCOption_DurationZ"); + *ret_copy = Refund_absolute_expiry(&this_arg_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void __attribute__((export_name("TS_InitFeatures_set_static_remote_key_required"))) TS_InitFeatures_set_static_remote_key_required(uint64_t this_arg) { - LDKInitFeatures this_arg_conv; +uint64_t __attribute__((export_name("TS_Refund_issuer"))) TS_Refund_issuer(uint64_t this_arg) { + LDKRefund 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_static_remote_key_required(&this_arg_conv); + LDKPrintableString ret_var = Refund_issuer(&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; } -jboolean __attribute__((export_name("TS_InitFeatures_supports_static_remote_key"))) TS_InitFeatures_supports_static_remote_key(uint64_t this_arg) { - LDKInitFeatures this_arg_conv; +uint64_tArray __attribute__((export_name("TS_Refund_paths"))) TS_Refund_paths(uint64_t this_arg) { + LDKRefund 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_static_remote_key(&this_arg_conv); - return ret_conv; + LDKCVec_BlindedPathZ ret_var = Refund_paths(&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 n = 0; n < ret_var.datalen; n++) { + LDKBlindedPath ret_conv_13_var = ret_var.data[n]; + uint64_t ret_conv_13_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_13_var); + ret_conv_13_ref = tag_ptr(ret_conv_13_var.inner, ret_conv_13_var.is_owned); + ret_arr_ptr[n] = ret_conv_13_ref; + } + + FREE(ret_var.data); + return ret_arr; } -void __attribute__((export_name("TS_NodeFeatures_set_static_remote_key_optional"))) TS_NodeFeatures_set_static_remote_key_optional(uint64_t this_arg) { - LDKNodeFeatures this_arg_conv; +int8_tArray __attribute__((export_name("TS_Refund_metadata"))) TS_Refund_metadata(uint64_t this_arg) { + LDKRefund 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_static_remote_key_optional(&this_arg_conv); + LDKu8slice ret_var = Refund_metadata(&this_arg_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + return ret_arr; } -void __attribute__((export_name("TS_NodeFeatures_set_static_remote_key_required"))) TS_NodeFeatures_set_static_remote_key_required(uint64_t this_arg) { - LDKNodeFeatures this_arg_conv; +int8_tArray __attribute__((export_name("TS_Refund_chain"))) TS_Refund_chain(uint64_t this_arg) { + LDKRefund 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_static_remote_key_required(&this_arg_conv); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, Refund_chain(&this_arg_conv).data, 32); + return ret_arr; } -jboolean __attribute__((export_name("TS_NodeFeatures_supports_static_remote_key"))) TS_NodeFeatures_supports_static_remote_key(uint64_t this_arg) { - LDKNodeFeatures this_arg_conv; +int64_t __attribute__((export_name("TS_Refund_amount_msats"))) TS_Refund_amount_msats(uint64_t this_arg) { + LDKRefund 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_static_remote_key(&this_arg_conv); + int64_t ret_conv = Refund_amount_msats(&this_arg_conv); return ret_conv; } -void __attribute__((export_name("TS_ChannelTypeFeatures_set_static_remote_key_optional"))) TS_ChannelTypeFeatures_set_static_remote_key_optional(uint64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +uint64_t __attribute__((export_name("TS_Refund_features"))) TS_Refund_features(uint64_t this_arg) { + LDKRefund 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_static_remote_key_optional(&this_arg_conv); + LDKInvoiceRequestFeatures ret_var = Refund_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; } -void __attribute__((export_name("TS_ChannelTypeFeatures_set_static_remote_key_required"))) TS_ChannelTypeFeatures_set_static_remote_key_required(uint64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +uint64_t __attribute__((export_name("TS_Refund_quantity"))) TS_Refund_quantity(uint64_t this_arg) { + LDKRefund 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_static_remote_key_required(&this_arg_conv); + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = Refund_quantity(&this_arg_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -jboolean __attribute__((export_name("TS_ChannelTypeFeatures_supports_static_remote_key"))) TS_ChannelTypeFeatures_supports_static_remote_key(uint64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +int8_tArray __attribute__((export_name("TS_Refund_payer_id"))) TS_Refund_payer_id(uint64_t this_arg) { + LDKRefund 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_static_remote_key(&this_arg_conv); - return ret_conv; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, Refund_payer_id(&this_arg_conv).compressed_form, 33); + return ret_arr; } -jboolean __attribute__((export_name("TS_InitFeatures_requires_static_remote_key"))) TS_InitFeatures_requires_static_remote_key(uint64_t this_arg) { - LDKInitFeatures this_arg_conv; +uint64_t __attribute__((export_name("TS_Refund_payer_note"))) TS_Refund_payer_note(uint64_t this_arg) { + LDKRefund 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_static_remote_key(&this_arg_conv); + LDKPrintableString ret_var = Refund_payer_note(&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; +} + +int8_tArray __attribute__((export_name("TS_Refund_write"))) TS_Refund_write(uint64_t obj) { + LDKRefund 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 = Refund_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; +} + +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; } -jboolean __attribute__((export_name("TS_NodeFeatures_requires_static_remote_key"))) TS_NodeFeatures_requires_static_remote_key(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_static_remote_key(&this_arg_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; } -jboolean __attribute__((export_name("TS_ChannelTypeFeatures_requires_static_remote_key"))) TS_ChannelTypeFeatures_requires_static_remote_key(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_static_remote_key(&this_arg_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_InitFeatures_set_payment_secret_optional"))) TS_InitFeatures_set_payment_secret_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_payment_secret_optional(&this_arg_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); } -void __attribute__((export_name("TS_InitFeatures_set_payment_secret_required"))) TS_InitFeatures_set_payment_secret_required(uint64_t this_arg) { - LDKInitFeatures this_arg_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; - InitFeatures_set_payment_secret_required(&this_arg_conv); + 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); } -jboolean __attribute__((export_name("TS_InitFeatures_supports_payment_secret"))) TS_InitFeatures_supports_payment_secret(uint64_t this_arg) { - LDKInitFeatures this_arg_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; - jboolean ret_conv = InitFeatures_supports_payment_secret(&this_arg_conv); + 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); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + NodeId_free(this_obj_conv); +} + +static inline uint64_t NodeId_clone_ptr(LDKNodeId *NONNULL_PTR arg) { + LDKNodeId ret_var = NodeId_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_NodeId_clone_ptr"))) TS_NodeId_clone_ptr(uint64_t arg) { + LDKNodeId 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 = NodeId_clone_ptr(&arg_conv); return ret_conv; } -void __attribute__((export_name("TS_NodeFeatures_set_payment_secret_optional"))) TS_NodeFeatures_set_payment_secret_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_payment_secret_optional(&this_arg_conv); +uint64_t __attribute__((export_name("TS_NodeId_clone"))) TS_NodeId_clone(uint64_t orig) { + LDKNodeId 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; + LDKNodeId ret_var = NodeId_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_NodeFeatures_set_payment_secret_required"))) TS_NodeFeatures_set_payment_secret_required(uint64_t this_arg) { - LDKNodeFeatures this_arg_conv; +uint64_t __attribute__((export_name("TS_NodeId_from_pubkey"))) TS_NodeId_from_pubkey(int8_tArray pubkey) { + LDKPublicKey pubkey_ref; + CHECK(pubkey->arr_len == 33); + memcpy(pubkey_ref.compressed_form, pubkey->elems, 33); FREE(pubkey); + LDKNodeId ret_var = NodeId_from_pubkey(pubkey_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; +} + +int8_tArray __attribute__((export_name("TS_NodeId_as_slice"))) TS_NodeId_as_slice(uint64_t this_arg) { + LDKNodeId 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_payment_secret_required(&this_arg_conv); + LDKu8slice ret_var = NodeId_as_slice(&this_arg_conv); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); + memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + return ret_arr; } -jboolean __attribute__((export_name("TS_NodeFeatures_supports_payment_secret"))) TS_NodeFeatures_supports_payment_secret(uint64_t this_arg) { - LDKNodeFeatures this_arg_conv; +uint64_t __attribute__((export_name("TS_NodeId_as_pubkey"))) TS_NodeId_as_pubkey(uint64_t this_arg) { + LDKNodeId 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_payment_secret(&this_arg_conv); + LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ"); + *ret_conv = NodeId_as_pubkey(&this_arg_conv); + return tag_ptr(ret_conv, true); +} + +int64_t __attribute__((export_name("TS_NodeId_hash"))) TS_NodeId_hash(uint64_t o) { + LDKNodeId 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 = NodeId_hash(&o_conv); return ret_conv; } -void __attribute__((export_name("TS_InvoiceFeatures_set_payment_secret_optional"))) TS_InvoiceFeatures_set_payment_secret_optional(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; - InvoiceFeatures_set_payment_secret_optional(&this_arg_conv); +int8_tArray __attribute__((export_name("TS_NodeId_write"))) TS_NodeId_write(uint64_t obj) { + LDKNodeId 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 = NodeId_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_NodeId_read"))) TS_NodeId_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ"); + *ret_conv = NodeId_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +void __attribute__((export_name("TS_NetworkGraph_free"))) TS_NetworkGraph_free(uint64_t this_obj) { + LDKNetworkGraph 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); + NetworkGraph_free(this_obj_conv); +} + +void __attribute__((export_name("TS_ReadOnlyNetworkGraph_free"))) TS_ReadOnlyNetworkGraph_free(uint64_t this_obj) { + LDKReadOnlyNetworkGraph 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); + ReadOnlyNetworkGraph_free(this_obj_conv); } -void __attribute__((export_name("TS_InvoiceFeatures_set_payment_secret_required"))) TS_InvoiceFeatures_set_payment_secret_required(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; - InvoiceFeatures_set_payment_secret_required(&this_arg_conv); +void __attribute__((export_name("TS_NetworkUpdate_free"))) TS_NetworkUpdate_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); + LDKNetworkUpdate this_ptr_conv = *(LDKNetworkUpdate*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + NetworkUpdate_free(this_ptr_conv); } -jboolean __attribute__((export_name("TS_InvoiceFeatures_supports_payment_secret"))) TS_InvoiceFeatures_supports_payment_secret(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_supports_payment_secret(&this_arg_conv); - return ret_conv; +static inline uint64_t NetworkUpdate_clone_ptr(LDKNetworkUpdate *NONNULL_PTR arg) { + LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate"); + *ret_copy = NetworkUpdate_clone(arg); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } - -jboolean __attribute__((export_name("TS_InitFeatures_requires_payment_secret"))) TS_InitFeatures_requires_payment_secret(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_payment_secret(&this_arg_conv); +int64_t __attribute__((export_name("TS_NetworkUpdate_clone_ptr"))) TS_NetworkUpdate_clone_ptr(uint64_t arg) { + LDKNetworkUpdate* arg_conv = (LDKNetworkUpdate*)untag_ptr(arg); + int64_t ret_conv = NetworkUpdate_clone_ptr(arg_conv); return ret_conv; } -jboolean __attribute__((export_name("TS_NodeFeatures_requires_payment_secret"))) TS_NodeFeatures_requires_payment_secret(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_payment_secret(&this_arg_conv); - return ret_conv; +uint64_t __attribute__((export_name("TS_NetworkUpdate_clone"))) TS_NetworkUpdate_clone(uint64_t orig) { + LDKNetworkUpdate* orig_conv = (LDKNetworkUpdate*)untag_ptr(orig); + LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate"); + *ret_copy = NetworkUpdate_clone(orig_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -jboolean __attribute__((export_name("TS_InvoiceFeatures_requires_payment_secret"))) TS_InvoiceFeatures_requires_payment_secret(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_payment_secret(&this_arg_conv); - return ret_conv; +uint64_t __attribute__((export_name("TS_NetworkUpdate_channel_update_message"))) TS_NetworkUpdate_channel_update_message(uint64_t msg) { + LDKChannelUpdate 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 = ChannelUpdate_clone(&msg_conv); + LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate"); + *ret_copy = NetworkUpdate_channel_update_message(msg_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void __attribute__((export_name("TS_InitFeatures_set_basic_mpp_optional"))) TS_InitFeatures_set_basic_mpp_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_basic_mpp_optional(&this_arg_conv); +uint64_t __attribute__((export_name("TS_NetworkUpdate_channel_failure"))) TS_NetworkUpdate_channel_failure(int64_t short_channel_id, jboolean is_permanent) { + LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate"); + *ret_copy = NetworkUpdate_channel_failure(short_channel_id, is_permanent); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void __attribute__((export_name("TS_InitFeatures_set_basic_mpp_required"))) TS_InitFeatures_set_basic_mpp_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_basic_mpp_required(&this_arg_conv); +uint64_t __attribute__((export_name("TS_NetworkUpdate_node_failure"))) TS_NetworkUpdate_node_failure(int8_tArray node_id, jboolean 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); + LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate"); + *ret_copy = NetworkUpdate_node_failure(node_id_ref, is_permanent); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -jboolean __attribute__((export_name("TS_InitFeatures_supports_basic_mpp"))) TS_InitFeatures_supports_basic_mpp(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_basic_mpp(&this_arg_conv); +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; } -void __attribute__((export_name("TS_NodeFeatures_set_basic_mpp_optional"))) TS_NodeFeatures_set_basic_mpp_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_basic_mpp_optional(&this_arg_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); + 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_NodeFeatures_set_basic_mpp_required"))) TS_NodeFeatures_set_basic_mpp_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_basic_mpp_required(&this_arg_conv); +uint64_t __attribute__((export_name("TS_NetworkUpdate_read"))) TS_NetworkUpdate_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ"); + *ret_conv = NetworkUpdate_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -jboolean __attribute__((export_name("TS_NodeFeatures_supports_basic_mpp"))) TS_NodeFeatures_supports_basic_mpp(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_basic_mpp(&this_arg_conv); - return ret_conv; +void __attribute__((export_name("TS_P2PGossipSync_free"))) TS_P2PGossipSync_free(uint64_t this_obj) { + LDKP2PGossipSync 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); + P2PGossipSync_free(this_obj_conv); } -void __attribute__((export_name("TS_InvoiceFeatures_set_basic_mpp_optional"))) TS_InvoiceFeatures_set_basic_mpp_optional(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; - InvoiceFeatures_set_basic_mpp_optional(&this_arg_conv); +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* 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 (utxo_lookup_conv.some.free == LDKUtxoLookup_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKUtxoLookup_JCalls_cloned(&utxo_lookup_conv.some); + } + } + 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); + } + 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_InvoiceFeatures_set_basic_mpp_required"))) TS_InvoiceFeatures_set_basic_mpp_required(uint64_t this_arg) { - LDKInvoiceFeatures this_arg_conv; +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; - InvoiceFeatures_set_basic_mpp_required(&this_arg_conv); + 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 (utxo_lookup_conv.some.free == LDKUtxoLookup_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKUtxoLookup_JCalls_cloned(&utxo_lookup_conv.some); + } + } + P2PGossipSync_add_utxo_lookup(&this_arg_conv, utxo_lookup_conv); } -jboolean __attribute__((export_name("TS_InvoiceFeatures_supports_basic_mpp"))) TS_InvoiceFeatures_supports_basic_mpp(uint64_t this_arg) { - LDKInvoiceFeatures this_arg_conv; +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; - jboolean ret_conv = InvoiceFeatures_supports_basic_mpp(&this_arg_conv); - return ret_conv; + LDKNetworkUpdate* network_update_conv = (LDKNetworkUpdate*)untag_ptr(network_update); + NetworkGraph_handle_network_update(&this_arg_conv, network_update_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; +uint64_t __attribute__((export_name("TS_P2PGossipSync_as_RoutingMessageHandler"))) TS_P2PGossipSync_as_RoutingMessageHandler(uint64_t this_arg) { + 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; - Bolt12InvoiceFeatures_set_basic_mpp_optional(&this_arg_conv); + LDKRoutingMessageHandler* ret_ret = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler"); + *ret_ret = P2PGossipSync_as_RoutingMessageHandler(&this_arg_conv); + return tag_ptr(ret_ret, true); } -void __attribute__((export_name("TS_Bolt12InvoiceFeatures_set_basic_mpp_required"))) TS_Bolt12InvoiceFeatures_set_basic_mpp_required(uint64_t this_arg) { - LDKBolt12InvoiceFeatures this_arg_conv; +uint64_t __attribute__((export_name("TS_P2PGossipSync_as_MessageSendEventsProvider"))) TS_P2PGossipSync_as_MessageSendEventsProvider(uint64_t this_arg) { + 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; - Bolt12InvoiceFeatures_set_basic_mpp_required(&this_arg_conv); + LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider"); + *ret_ret = P2PGossipSync_as_MessageSendEventsProvider(&this_arg_conv); + return tag_ptr(ret_ret, true); } -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; +void __attribute__((export_name("TS_ChannelUpdateInfo_free"))) TS_ChannelUpdateInfo_free(uint64_t this_obj) { + LDKChannelUpdateInfo 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); + ChannelUpdateInfo_free(this_obj_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); - 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_basic_mpp(&this_arg_conv); +int32_t __attribute__((export_name("TS_ChannelUpdateInfo_get_last_update"))) TS_ChannelUpdateInfo_get_last_update(uint64_t this_ptr) { + LDKChannelUpdateInfo 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 = ChannelUpdateInfo_get_last_update(&this_ptr_conv); return ret_conv; } -jboolean __attribute__((export_name("TS_NodeFeatures_requires_basic_mpp"))) TS_NodeFeatures_requires_basic_mpp(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_basic_mpp(&this_arg_conv); - return ret_conv; +void __attribute__((export_name("TS_ChannelUpdateInfo_set_last_update"))) TS_ChannelUpdateInfo_set_last_update(uint64_t this_ptr, int32_t val) { + LDKChannelUpdateInfo 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; + ChannelUpdateInfo_set_last_update(&this_ptr_conv, val); } -jboolean __attribute__((export_name("TS_InvoiceFeatures_requires_basic_mpp"))) TS_InvoiceFeatures_requires_basic_mpp(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_basic_mpp(&this_arg_conv); +jboolean __attribute__((export_name("TS_ChannelUpdateInfo_get_enabled"))) TS_ChannelUpdateInfo_get_enabled(uint64_t this_ptr) { + LDKChannelUpdateInfo 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 = ChannelUpdateInfo_get_enabled(&this_ptr_conv); 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_ChannelUpdateInfo_set_enabled"))) TS_ChannelUpdateInfo_set_enabled(uint64_t this_ptr, jboolean val) { + LDKChannelUpdateInfo 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; + ChannelUpdateInfo_set_enabled(&this_ptr_conv, val); } -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); - 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_wumbo_optional(&this_arg_conv); +int16_t __attribute__((export_name("TS_ChannelUpdateInfo_get_cltv_expiry_delta"))) TS_ChannelUpdateInfo_get_cltv_expiry_delta(uint64_t this_ptr) { + LDKChannelUpdateInfo 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; + int16_t ret_conv = ChannelUpdateInfo_get_cltv_expiry_delta(&this_ptr_conv); + return ret_conv; } -void __attribute__((export_name("TS_InitFeatures_set_wumbo_required"))) TS_InitFeatures_set_wumbo_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_wumbo_required(&this_arg_conv); +void __attribute__((export_name("TS_ChannelUpdateInfo_set_cltv_expiry_delta"))) TS_ChannelUpdateInfo_set_cltv_expiry_delta(uint64_t this_ptr, int16_t val) { + LDKChannelUpdateInfo 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; + ChannelUpdateInfo_set_cltv_expiry_delta(&this_ptr_conv, val); } -jboolean __attribute__((export_name("TS_InitFeatures_supports_wumbo"))) TS_InitFeatures_supports_wumbo(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_wumbo(&this_arg_conv); +int64_t __attribute__((export_name("TS_ChannelUpdateInfo_get_htlc_minimum_msat"))) TS_ChannelUpdateInfo_get_htlc_minimum_msat(uint64_t this_ptr) { + LDKChannelUpdateInfo 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 = ChannelUpdateInfo_get_htlc_minimum_msat(&this_ptr_conv); return ret_conv; } -void __attribute__((export_name("TS_NodeFeatures_set_wumbo_optional"))) TS_NodeFeatures_set_wumbo_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_wumbo_optional(&this_arg_conv); +void __attribute__((export_name("TS_ChannelUpdateInfo_set_htlc_minimum_msat"))) TS_ChannelUpdateInfo_set_htlc_minimum_msat(uint64_t this_ptr, int64_t val) { + LDKChannelUpdateInfo 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; + ChannelUpdateInfo_set_htlc_minimum_msat(&this_ptr_conv, val); } -void __attribute__((export_name("TS_NodeFeatures_set_wumbo_required"))) TS_NodeFeatures_set_wumbo_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_wumbo_required(&this_arg_conv); +int64_t __attribute__((export_name("TS_ChannelUpdateInfo_get_htlc_maximum_msat"))) TS_ChannelUpdateInfo_get_htlc_maximum_msat(uint64_t this_ptr) { + LDKChannelUpdateInfo 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 = ChannelUpdateInfo_get_htlc_maximum_msat(&this_ptr_conv); + return ret_conv; } -jboolean __attribute__((export_name("TS_NodeFeatures_supports_wumbo"))) TS_NodeFeatures_supports_wumbo(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_wumbo(&this_arg_conv); - return ret_conv; +void __attribute__((export_name("TS_ChannelUpdateInfo_set_htlc_maximum_msat"))) TS_ChannelUpdateInfo_set_htlc_maximum_msat(uint64_t this_ptr, int64_t val) { + LDKChannelUpdateInfo 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; + ChannelUpdateInfo_set_htlc_maximum_msat(&this_ptr_conv, val); } -jboolean __attribute__((export_name("TS_InitFeatures_requires_wumbo"))) TS_InitFeatures_requires_wumbo(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_wumbo(&this_arg_conv); - return ret_conv; +uint64_t __attribute__((export_name("TS_ChannelUpdateInfo_get_fees"))) TS_ChannelUpdateInfo_get_fees(uint64_t this_ptr) { + LDKChannelUpdateInfo 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 = ChannelUpdateInfo_get_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; } -jboolean __attribute__((export_name("TS_NodeFeatures_requires_wumbo"))) TS_NodeFeatures_requires_wumbo(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_wumbo(&this_arg_conv); - return ret_conv; +void __attribute__((export_name("TS_ChannelUpdateInfo_set_fees"))) TS_ChannelUpdateInfo_set_fees(uint64_t this_ptr, uint64_t val) { + LDKChannelUpdateInfo 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); + ChannelUpdateInfo_set_fees(&this_ptr_conv, val_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); +uint64_t __attribute__((export_name("TS_ChannelUpdateInfo_get_last_update_message"))) TS_ChannelUpdateInfo_get_last_update_message(uint64_t this_ptr) { + LDKChannelUpdateInfo 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; + LDKChannelUpdate ret_var = ChannelUpdateInfo_get_last_update_message(&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_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); +void __attribute__((export_name("TS_ChannelUpdateInfo_set_last_update_message"))) TS_ChannelUpdateInfo_set_last_update_message(uint64_t this_ptr, uint64_t val) { + LDKChannelUpdateInfo 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; + LDKChannelUpdate 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 = ChannelUpdate_clone(&val_conv); + ChannelUpdateInfo_set_last_update_message(&this_ptr_conv, val_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; +uint64_t __attribute__((export_name("TS_ChannelUpdateInfo_new"))) TS_ChannelUpdateInfo_new(int32_t last_update_arg, jboolean enabled_arg, int16_t cltv_expiry_delta_arg, int64_t htlc_minimum_msat_arg, int64_t htlc_maximum_msat_arg, uint64_t fees_arg, uint64_t last_update_message_arg) { + LDKRoutingFees fees_arg_conv; + fees_arg_conv.inner = untag_ptr(fees_arg); + fees_arg_conv.is_owned = ptr_is_owned(fees_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(fees_arg_conv); + fees_arg_conv = RoutingFees_clone(&fees_arg_conv); + LDKChannelUpdate last_update_message_arg_conv; + last_update_message_arg_conv.inner = untag_ptr(last_update_message_arg); + last_update_message_arg_conv.is_owned = ptr_is_owned(last_update_message_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(last_update_message_arg_conv); + last_update_message_arg_conv = ChannelUpdate_clone(&last_update_message_arg_conv); + LDKChannelUpdateInfo ret_var = ChannelUpdateInfo_new(last_update_arg, enabled_arg, cltv_expiry_delta_arg, htlc_minimum_msat_arg, htlc_maximum_msat_arg, fees_arg_conv, last_update_message_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_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); +static inline uint64_t ChannelUpdateInfo_clone_ptr(LDKChannelUpdateInfo *NONNULL_PTR arg) { + LDKChannelUpdateInfo ret_var = ChannelUpdateInfo_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_ChannelUpdateInfo_clone_ptr"))) TS_ChannelUpdateInfo_clone_ptr(uint64_t arg) { + LDKChannelUpdateInfo 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 = ChannelUpdateInfo_clone_ptr(&arg_conv); + return ret_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); +uint64_t __attribute__((export_name("TS_ChannelUpdateInfo_clone"))) TS_ChannelUpdateInfo_clone(uint64_t orig) { + LDKChannelUpdateInfo 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; + LDKChannelUpdateInfo ret_var = ChannelUpdateInfo_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_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); +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; } -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); +int8_tArray __attribute__((export_name("TS_ChannelUpdateInfo_write"))) TS_ChannelUpdateInfo_write(uint64_t obj) { + LDKChannelUpdateInfo 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 = ChannelUpdateInfo_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_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); +uint64_t __attribute__((export_name("TS_ChannelUpdateInfo_read"))) TS_ChannelUpdateInfo_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_ChannelUpdateInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateInfoDecodeErrorZ), "LDKCResult_ChannelUpdateInfoDecodeErrorZ"); + *ret_conv = ChannelUpdateInfo_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -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; +void __attribute__((export_name("TS_ChannelInfo_free"))) TS_ChannelInfo_free(uint64_t this_obj) { + LDKChannelInfo 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); + ChannelInfo_free(this_obj_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; +uint64_t __attribute__((export_name("TS_ChannelInfo_get_features"))) TS_ChannelInfo_get_features(uint64_t this_ptr) { + LDKChannelInfo 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; + LDKChannelFeatures ret_var = ChannelInfo_get_features(&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; } -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; +void __attribute__((export_name("TS_ChannelInfo_set_features"))) TS_ChannelInfo_set_features(uint64_t this_ptr, uint64_t val) { + LDKChannelInfo 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; + LDKChannelFeatures 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 = ChannelFeatures_clone(&val_conv); + ChannelInfo_set_features(&this_ptr_conv, val_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; +uint64_t __attribute__((export_name("TS_ChannelInfo_get_node_one"))) TS_ChannelInfo_get_node_one(uint64_t this_ptr) { + LDKChannelInfo 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; + LDKNodeId ret_var = ChannelInfo_get_node_one(&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_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); - 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_shutdown_any_segwit_optional(&this_arg_conv); +void __attribute__((export_name("TS_ChannelInfo_set_node_one"))) TS_ChannelInfo_set_node_one(uint64_t this_ptr, uint64_t val) { + LDKChannelInfo 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; + 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); + ChannelInfo_set_node_one(&this_ptr_conv, val_conv); } -void __attribute__((export_name("TS_InitFeatures_set_shutdown_any_segwit_required"))) TS_InitFeatures_set_shutdown_any_segwit_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_shutdown_any_segwit_required(&this_arg_conv); +uint64_t __attribute__((export_name("TS_ChannelInfo_get_one_to_two"))) TS_ChannelInfo_get_one_to_two(uint64_t this_ptr) { + LDKChannelInfo 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; + LDKChannelUpdateInfo ret_var = ChannelInfo_get_one_to_two(&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; } -jboolean __attribute__((export_name("TS_InitFeatures_supports_shutdown_anysegwit"))) TS_InitFeatures_supports_shutdown_anysegwit(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_shutdown_anysegwit(&this_arg_conv); - return ret_conv; +void __attribute__((export_name("TS_ChannelInfo_set_one_to_two"))) TS_ChannelInfo_set_one_to_two(uint64_t this_ptr, uint64_t val) { + LDKChannelInfo 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; + LDKChannelUpdateInfo 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 = ChannelUpdateInfo_clone(&val_conv); + ChannelInfo_set_one_to_two(&this_ptr_conv, val_conv); } -void __attribute__((export_name("TS_NodeFeatures_set_shutdown_any_segwit_optional"))) TS_NodeFeatures_set_shutdown_any_segwit_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_shutdown_any_segwit_optional(&this_arg_conv); +uint64_t __attribute__((export_name("TS_ChannelInfo_get_node_two"))) TS_ChannelInfo_get_node_two(uint64_t this_ptr) { + LDKChannelInfo 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; + LDKNodeId ret_var = ChannelInfo_get_node_two(&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_NodeFeatures_set_shutdown_any_segwit_required"))) TS_NodeFeatures_set_shutdown_any_segwit_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_shutdown_any_segwit_required(&this_arg_conv); +void __attribute__((export_name("TS_ChannelInfo_set_node_two"))) TS_ChannelInfo_set_node_two(uint64_t this_ptr, uint64_t val) { + LDKChannelInfo 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; + 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); + ChannelInfo_set_node_two(&this_ptr_conv, val_conv); } -jboolean __attribute__((export_name("TS_NodeFeatures_supports_shutdown_anysegwit"))) TS_NodeFeatures_supports_shutdown_anysegwit(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_shutdown_anysegwit(&this_arg_conv); - return ret_conv; +uint64_t __attribute__((export_name("TS_ChannelInfo_get_two_to_one"))) TS_ChannelInfo_get_two_to_one(uint64_t this_ptr) { + LDKChannelInfo 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; + LDKChannelUpdateInfo ret_var = ChannelInfo_get_two_to_one(&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; } -jboolean __attribute__((export_name("TS_InitFeatures_requires_shutdown_anysegwit"))) TS_InitFeatures_requires_shutdown_anysegwit(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_shutdown_anysegwit(&this_arg_conv); - return ret_conv; +void __attribute__((export_name("TS_ChannelInfo_set_two_to_one"))) TS_ChannelInfo_set_two_to_one(uint64_t this_ptr, uint64_t val) { + LDKChannelInfo 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; + LDKChannelUpdateInfo 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 = ChannelUpdateInfo_clone(&val_conv); + ChannelInfo_set_two_to_one(&this_ptr_conv, val_conv); } -jboolean __attribute__((export_name("TS_NodeFeatures_requires_shutdown_anysegwit"))) TS_NodeFeatures_requires_shutdown_anysegwit(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_shutdown_anysegwit(&this_arg_conv); - return ret_conv; +uint64_t __attribute__((export_name("TS_ChannelInfo_get_capacity_sats"))) TS_ChannelInfo_get_capacity_sats(uint64_t this_ptr) { + LDKChannelInfo 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_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = ChannelInfo_get_capacity_sats(&this_ptr_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -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_ChannelInfo_set_capacity_sats"))) TS_ChannelInfo_set_capacity_sats(uint64_t this_ptr, uint64_t val) { + LDKChannelInfo 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_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); + ChannelInfo_set_capacity_sats(&this_ptr_conv, val_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); +uint64_t __attribute__((export_name("TS_ChannelInfo_get_announcement_message"))) TS_ChannelInfo_get_announcement_message(uint64_t this_ptr) { + LDKChannelInfo 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; + LDKChannelAnnouncement ret_var = ChannelInfo_get_announcement_message(&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; } -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_ChannelInfo_set_announcement_message"))) TS_ChannelInfo_set_announcement_message(uint64_t this_ptr, uint64_t val) { + LDKChannelInfo 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; + LDKChannelAnnouncement 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 = ChannelAnnouncement_clone(&val_conv); + ChannelInfo_set_announcement_message(&this_ptr_conv, val_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); +static inline uint64_t ChannelInfo_clone_ptr(LDKChannelInfo *NONNULL_PTR arg) { + LDKChannelInfo ret_var = ChannelInfo_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; } - -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); +int64_t __attribute__((export_name("TS_ChannelInfo_clone_ptr"))) TS_ChannelInfo_clone_ptr(uint64_t arg) { + LDKChannelInfo 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 = ChannelInfo_clone_ptr(&arg_conv); + return ret_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; +uint64_t __attribute__((export_name("TS_ChannelInfo_clone"))) TS_ChannelInfo_clone(uint64_t orig) { + LDKChannelInfo 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; + LDKChannelInfo ret_var = ChannelInfo_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_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); +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; } -jboolean __attribute__((export_name("TS_NodeFeatures_requires_onion_messages"))) TS_NodeFeatures_requires_onion_messages(uint64_t this_arg) { - LDKNodeFeatures this_arg_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); 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; + LDKChannelUpdateInfo ret_var = ChannelInfo_get_directional_info(&this_arg_conv, channel_flags); + 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_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); - 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_channel_type_optional(&this_arg_conv); +int8_tArray __attribute__((export_name("TS_ChannelInfo_write"))) TS_ChannelInfo_write(uint64_t obj) { + LDKChannelInfo 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 = ChannelInfo_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_InitFeatures_set_channel_type_required"))) TS_InitFeatures_set_channel_type_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_channel_type_required(&this_arg_conv); +uint64_t __attribute__((export_name("TS_ChannelInfo_read"))) TS_ChannelInfo_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ"); + *ret_conv = ChannelInfo_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -jboolean __attribute__((export_name("TS_InitFeatures_supports_channel_type"))) TS_InitFeatures_supports_channel_type(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_channel_type(&this_arg_conv); - return ret_conv; +void __attribute__((export_name("TS_DirectedChannelInfo_free"))) TS_DirectedChannelInfo_free(uint64_t this_obj) { + LDKDirectedChannelInfo 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); + DirectedChannelInfo_free(this_obj_conv); } -void __attribute__((export_name("TS_NodeFeatures_set_channel_type_optional"))) TS_NodeFeatures_set_channel_type_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_channel_type_optional(&this_arg_conv); +static inline uint64_t DirectedChannelInfo_clone_ptr(LDKDirectedChannelInfo *NONNULL_PTR arg) { + LDKDirectedChannelInfo ret_var = DirectedChannelInfo_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_DirectedChannelInfo_clone_ptr"))) TS_DirectedChannelInfo_clone_ptr(uint64_t arg) { + LDKDirectedChannelInfo 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 = DirectedChannelInfo_clone_ptr(&arg_conv); + return ret_conv; } -void __attribute__((export_name("TS_NodeFeatures_set_channel_type_required"))) TS_NodeFeatures_set_channel_type_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_channel_type_required(&this_arg_conv); +uint64_t __attribute__((export_name("TS_DirectedChannelInfo_clone"))) TS_DirectedChannelInfo_clone(uint64_t orig) { + LDKDirectedChannelInfo 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; + LDKDirectedChannelInfo ret_var = DirectedChannelInfo_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_NodeFeatures_supports_channel_type"))) TS_NodeFeatures_supports_channel_type(uint64_t this_arg) { - LDKNodeFeatures this_arg_conv; +uint64_t __attribute__((export_name("TS_DirectedChannelInfo_channel"))) TS_DirectedChannelInfo_channel(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; - jboolean ret_conv = NodeFeatures_supports_channel_type(&this_arg_conv); - return ret_conv; + LDKChannelInfo ret_var = DirectedChannelInfo_channel(&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; } -jboolean __attribute__((export_name("TS_InitFeatures_requires_channel_type"))) TS_InitFeatures_requires_channel_type(uint64_t this_arg) { - LDKInitFeatures this_arg_conv; +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); 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_channel_type(&this_arg_conv); + int64_t ret_conv = DirectedChannelInfo_htlc_maximum_msat(&this_arg_conv); return ret_conv; } -jboolean __attribute__((export_name("TS_NodeFeatures_requires_channel_type"))) TS_NodeFeatures_requires_channel_type(uint64_t this_arg) { - LDKNodeFeatures this_arg_conv; +uint64_t __attribute__((export_name("TS_DirectedChannelInfo_effective_capacity"))) TS_DirectedChannelInfo_effective_capacity(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; - jboolean ret_conv = NodeFeatures_requires_channel_type(&this_arg_conv); - return ret_conv; + LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); + *ret_copy = DirectedChannelInfo_effective_capacity(&this_arg_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void __attribute__((export_name("TS_InitFeatures_set_scid_privacy_optional"))) TS_InitFeatures_set_scid_privacy_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_scid_privacy_optional(&this_arg_conv); +void __attribute__((export_name("TS_EffectiveCapacity_free"))) TS_EffectiveCapacity_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); + LDKEffectiveCapacity this_ptr_conv = *(LDKEffectiveCapacity*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + EffectiveCapacity_free(this_ptr_conv); } -void __attribute__((export_name("TS_InitFeatures_set_scid_privacy_required"))) TS_InitFeatures_set_scid_privacy_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_scid_privacy_required(&this_arg_conv); +static inline uint64_t EffectiveCapacity_clone_ptr(LDKEffectiveCapacity *NONNULL_PTR arg) { + LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); + *ret_copy = EffectiveCapacity_clone(arg); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } - -jboolean __attribute__((export_name("TS_InitFeatures_supports_scid_privacy"))) TS_InitFeatures_supports_scid_privacy(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_scid_privacy(&this_arg_conv); +int64_t __attribute__((export_name("TS_EffectiveCapacity_clone_ptr"))) TS_EffectiveCapacity_clone_ptr(uint64_t arg) { + LDKEffectiveCapacity* arg_conv = (LDKEffectiveCapacity*)untag_ptr(arg); + int64_t ret_conv = EffectiveCapacity_clone_ptr(arg_conv); return ret_conv; } -void __attribute__((export_name("TS_NodeFeatures_set_scid_privacy_optional"))) TS_NodeFeatures_set_scid_privacy_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_scid_privacy_optional(&this_arg_conv); +uint64_t __attribute__((export_name("TS_EffectiveCapacity_clone"))) TS_EffectiveCapacity_clone(uint64_t orig) { + LDKEffectiveCapacity* orig_conv = (LDKEffectiveCapacity*)untag_ptr(orig); + LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); + *ret_copy = EffectiveCapacity_clone(orig_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void __attribute__((export_name("TS_NodeFeatures_set_scid_privacy_required"))) TS_NodeFeatures_set_scid_privacy_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_scid_privacy_required(&this_arg_conv); +uint64_t __attribute__((export_name("TS_EffectiveCapacity_exact_liquidity"))) TS_EffectiveCapacity_exact_liquidity(int64_t liquidity_msat) { + LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); + *ret_copy = EffectiveCapacity_exact_liquidity(liquidity_msat); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -jboolean __attribute__((export_name("TS_NodeFeatures_supports_scid_privacy"))) TS_NodeFeatures_supports_scid_privacy(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_scid_privacy(&this_arg_conv); - return ret_conv; +uint64_t __attribute__((export_name("TS_EffectiveCapacity_maximum_htlc"))) TS_EffectiveCapacity_maximum_htlc(int64_t amount_msat) { + LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); + *ret_copy = EffectiveCapacity_maximum_htlc(amount_msat); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void __attribute__((export_name("TS_ChannelTypeFeatures_set_scid_privacy_optional"))) TS_ChannelTypeFeatures_set_scid_privacy_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_scid_privacy_optional(&this_arg_conv); +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); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void __attribute__((export_name("TS_ChannelTypeFeatures_set_scid_privacy_required"))) TS_ChannelTypeFeatures_set_scid_privacy_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_scid_privacy_required(&this_arg_conv); +uint64_t __attribute__((export_name("TS_EffectiveCapacity_infinite"))) TS_EffectiveCapacity_infinite() { + LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); + *ret_copy = EffectiveCapacity_infinite(); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -jboolean __attribute__((export_name("TS_ChannelTypeFeatures_supports_scid_privacy"))) TS_ChannelTypeFeatures_supports_scid_privacy(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_scid_privacy(&this_arg_conv); - return ret_conv; +uint64_t __attribute__((export_name("TS_EffectiveCapacity_unknown"))) TS_EffectiveCapacity_unknown() { + LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); + *ret_copy = EffectiveCapacity_unknown(); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -jboolean __attribute__((export_name("TS_InitFeatures_requires_scid_privacy"))) TS_InitFeatures_requires_scid_privacy(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_scid_privacy(&this_arg_conv); +int64_t __attribute__((export_name("TS_EffectiveCapacity_as_msat"))) TS_EffectiveCapacity_as_msat(uint64_t this_arg) { + LDKEffectiveCapacity* this_arg_conv = (LDKEffectiveCapacity*)untag_ptr(this_arg); + int64_t ret_conv = EffectiveCapacity_as_msat(this_arg_conv); return ret_conv; } -jboolean __attribute__((export_name("TS_NodeFeatures_requires_scid_privacy"))) TS_NodeFeatures_requires_scid_privacy(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_scid_privacy(&this_arg_conv); +void __attribute__((export_name("TS_RoutingFees_free"))) TS_RoutingFees_free(uint64_t this_obj) { + LDKRoutingFees 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); + RoutingFees_free(this_obj_conv); +} + +int32_t __attribute__((export_name("TS_RoutingFees_get_base_msat"))) TS_RoutingFees_get_base_msat(uint64_t this_ptr) { + LDKRoutingFees 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 = RoutingFees_get_base_msat(&this_ptr_conv); return ret_conv; } -jboolean __attribute__((export_name("TS_ChannelTypeFeatures_requires_scid_privacy"))) TS_ChannelTypeFeatures_requires_scid_privacy(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_scid_privacy(&this_arg_conv); +void __attribute__((export_name("TS_RoutingFees_set_base_msat"))) TS_RoutingFees_set_base_msat(uint64_t this_ptr, int32_t val) { + LDKRoutingFees 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; + RoutingFees_set_base_msat(&this_ptr_conv, val); +} + +int32_t __attribute__((export_name("TS_RoutingFees_get_proportional_millionths"))) TS_RoutingFees_get_proportional_millionths(uint64_t this_ptr) { + LDKRoutingFees 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 = RoutingFees_get_proportional_millionths(&this_ptr_conv); return ret_conv; } -void __attribute__((export_name("TS_InitFeatures_set_zero_conf_optional"))) TS_InitFeatures_set_zero_conf_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_zero_conf_optional(&this_arg_conv); +void __attribute__((export_name("TS_RoutingFees_set_proportional_millionths"))) TS_RoutingFees_set_proportional_millionths(uint64_t this_ptr, int32_t val) { + LDKRoutingFees 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; + RoutingFees_set_proportional_millionths(&this_ptr_conv, val); } -void __attribute__((export_name("TS_InitFeatures_set_zero_conf_required"))) TS_InitFeatures_set_zero_conf_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_zero_conf_required(&this_arg_conv); +uint64_t __attribute__((export_name("TS_RoutingFees_new"))) TS_RoutingFees_new(int32_t base_msat_arg, int32_t proportional_millionths_arg) { + LDKRoutingFees ret_var = RoutingFees_new(base_msat_arg, 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_InitFeatures_supports_zero_conf"))) TS_InitFeatures_supports_zero_conf(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_zero_conf(&this_arg_conv); +jboolean __attribute__((export_name("TS_RoutingFees_eq"))) TS_RoutingFees_eq(uint64_t a, uint64_t b) { + LDKRoutingFees 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; + LDKRoutingFees 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 = RoutingFees_eq(&a_conv, &b_conv); return ret_conv; } -void __attribute__((export_name("TS_NodeFeatures_set_zero_conf_optional"))) TS_NodeFeatures_set_zero_conf_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_zero_conf_optional(&this_arg_conv); +static inline uint64_t RoutingFees_clone_ptr(LDKRoutingFees *NONNULL_PTR arg) { + LDKRoutingFees ret_var = RoutingFees_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_RoutingFees_clone_ptr"))) TS_RoutingFees_clone_ptr(uint64_t arg) { + LDKRoutingFees 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 = RoutingFees_clone_ptr(&arg_conv); + return ret_conv; } -void __attribute__((export_name("TS_NodeFeatures_set_zero_conf_required"))) TS_NodeFeatures_set_zero_conf_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_zero_conf_required(&this_arg_conv); +uint64_t __attribute__((export_name("TS_RoutingFees_clone"))) TS_RoutingFees_clone(uint64_t orig) { + LDKRoutingFees 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; + LDKRoutingFees ret_var = RoutingFees_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_NodeFeatures_supports_zero_conf"))) TS_NodeFeatures_supports_zero_conf(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_zero_conf(&this_arg_conv); +int64_t __attribute__((export_name("TS_RoutingFees_hash"))) TS_RoutingFees_hash(uint64_t o) { + LDKRoutingFees 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 = RoutingFees_hash(&o_conv); return ret_conv; } -void __attribute__((export_name("TS_ChannelTypeFeatures_set_zero_conf_optional"))) TS_ChannelTypeFeatures_set_zero_conf_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_zero_conf_optional(&this_arg_conv); +int8_tArray __attribute__((export_name("TS_RoutingFees_write"))) TS_RoutingFees_write(uint64_t obj) { + LDKRoutingFees 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 = RoutingFees_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_ChannelTypeFeatures_set_zero_conf_required"))) TS_ChannelTypeFeatures_set_zero_conf_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_zero_conf_required(&this_arg_conv); +uint64_t __attribute__((export_name("TS_RoutingFees_read"))) TS_RoutingFees_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ"); + *ret_conv = RoutingFees_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -jboolean __attribute__((export_name("TS_ChannelTypeFeatures_supports_zero_conf"))) TS_ChannelTypeFeatures_supports_zero_conf(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_zero_conf(&this_arg_conv); - return ret_conv; +void __attribute__((export_name("TS_NodeAnnouncementInfo_free"))) TS_NodeAnnouncementInfo_free(uint64_t this_obj) { + LDKNodeAnnouncementInfo 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); + NodeAnnouncementInfo_free(this_obj_conv); } -jboolean __attribute__((export_name("TS_InitFeatures_requires_zero_conf"))) TS_InitFeatures_requires_zero_conf(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_zero_conf(&this_arg_conv); - return ret_conv; +uint64_t __attribute__((export_name("TS_NodeAnnouncementInfo_get_features"))) TS_NodeAnnouncementInfo_get_features(uint64_t this_ptr) { + LDKNodeAnnouncementInfo 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; + LDKNodeFeatures ret_var = NodeAnnouncementInfo_get_features(&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; } -jboolean __attribute__((export_name("TS_NodeFeatures_requires_zero_conf"))) TS_NodeFeatures_requires_zero_conf(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_zero_conf(&this_arg_conv); - return ret_conv; +void __attribute__((export_name("TS_NodeAnnouncementInfo_set_features"))) TS_NodeAnnouncementInfo_set_features(uint64_t this_ptr, uint64_t val) { + LDKNodeAnnouncementInfo 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; + LDKNodeFeatures 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 = NodeFeatures_clone(&val_conv); + NodeAnnouncementInfo_set_features(&this_ptr_conv, val_conv); } -jboolean __attribute__((export_name("TS_ChannelTypeFeatures_requires_zero_conf"))) TS_ChannelTypeFeatures_requires_zero_conf(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_zero_conf(&this_arg_conv); +int32_t __attribute__((export_name("TS_NodeAnnouncementInfo_get_last_update"))) TS_NodeAnnouncementInfo_get_last_update(uint64_t this_ptr) { + LDKNodeAnnouncementInfo 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 = NodeAnnouncementInfo_get_last_update(&this_ptr_conv); return ret_conv; } -void __attribute__((export_name("TS_NodeFeatures_set_keysend_optional"))) TS_NodeFeatures_set_keysend_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_keysend_optional(&this_arg_conv); +void __attribute__((export_name("TS_NodeAnnouncementInfo_set_last_update"))) TS_NodeAnnouncementInfo_set_last_update(uint64_t this_ptr, int32_t val) { + LDKNodeAnnouncementInfo 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; + NodeAnnouncementInfo_set_last_update(&this_ptr_conv, val); } -void __attribute__((export_name("TS_NodeFeatures_set_keysend_required"))) TS_NodeFeatures_set_keysend_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_keysend_required(&this_arg_conv); +int8_tArray __attribute__((export_name("TS_NodeAnnouncementInfo_get_rgb"))) TS_NodeAnnouncementInfo_get_rgb(uint64_t this_ptr) { + LDKNodeAnnouncementInfo 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(3, __LINE__); + memcpy(ret_arr->elems, *NodeAnnouncementInfo_get_rgb(&this_ptr_conv), 3); + return ret_arr; } -jboolean __attribute__((export_name("TS_NodeFeatures_supports_keysend"))) TS_NodeFeatures_supports_keysend(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_keysend(&this_arg_conv); - return ret_conv; +void __attribute__((export_name("TS_NodeAnnouncementInfo_set_rgb"))) TS_NodeAnnouncementInfo_set_rgb(uint64_t this_ptr, int8_tArray val) { + LDKNodeAnnouncementInfo 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; + LDKThreeBytes val_ref; + CHECK(val->arr_len == 3); + memcpy(val_ref.data, val->elems, 3); FREE(val); + NodeAnnouncementInfo_set_rgb(&this_ptr_conv, val_ref); } -jboolean __attribute__((export_name("TS_NodeFeatures_requires_keysend"))) TS_NodeFeatures_requires_keysend(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_keysend(&this_arg_conv); - return ret_conv; +uint64_t __attribute__((export_name("TS_NodeAnnouncementInfo_get_alias"))) TS_NodeAnnouncementInfo_get_alias(uint64_t this_ptr) { + LDKNodeAnnouncementInfo 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; + LDKNodeAlias ret_var = NodeAnnouncementInfo_get_alias(&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_ShutdownScript_free"))) TS_ShutdownScript_free(uint64_t this_obj) { - LDKShutdownScript 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); - ShutdownScript_free(this_obj_conv); +void __attribute__((export_name("TS_NodeAnnouncementInfo_set_alias"))) TS_NodeAnnouncementInfo_set_alias(uint64_t this_ptr, uint64_t val) { + LDKNodeAnnouncementInfo 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; + LDKNodeAlias 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 = NodeAlias_clone(&val_conv); + NodeAnnouncementInfo_set_alias(&this_ptr_conv, val_conv); +} + +uint64_t __attribute__((export_name("TS_NodeAnnouncementInfo_get_announcement_message"))) TS_NodeAnnouncementInfo_get_announcement_message(uint64_t this_ptr) { + LDKNodeAnnouncementInfo 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; + LDKNodeAnnouncement ret_var = NodeAnnouncementInfo_get_announcement_message(&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_NodeAnnouncementInfo_set_announcement_message"))) TS_NodeAnnouncementInfo_set_announcement_message(uint64_t this_ptr, uint64_t val) { + LDKNodeAnnouncementInfo 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; + LDKNodeAnnouncement 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 = NodeAnnouncement_clone(&val_conv); + NodeAnnouncementInfo_set_announcement_message(&this_ptr_conv, val_conv); +} + +uint64_t __attribute__((export_name("TS_NodeAnnouncementInfo_new"))) TS_NodeAnnouncementInfo_new(uint64_t features_arg, int32_t last_update_arg, int8_tArray rgb_arg, uint64_t alias_arg, uint64_t announcement_message_arg) { + LDKNodeFeatures features_arg_conv; + features_arg_conv.inner = untag_ptr(features_arg); + features_arg_conv.is_owned = ptr_is_owned(features_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv); + features_arg_conv = NodeFeatures_clone(&features_arg_conv); + LDKThreeBytes rgb_arg_ref; + CHECK(rgb_arg->arr_len == 3); + memcpy(rgb_arg_ref.data, rgb_arg->elems, 3); FREE(rgb_arg); + LDKNodeAlias alias_arg_conv; + alias_arg_conv.inner = untag_ptr(alias_arg); + alias_arg_conv.is_owned = ptr_is_owned(alias_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(alias_arg_conv); + alias_arg_conv = NodeAlias_clone(&alias_arg_conv); + LDKNodeAnnouncement announcement_message_arg_conv; + announcement_message_arg_conv.inner = untag_ptr(announcement_message_arg); + announcement_message_arg_conv.is_owned = ptr_is_owned(announcement_message_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(announcement_message_arg_conv); + announcement_message_arg_conv = NodeAnnouncement_clone(&announcement_message_arg_conv); + LDKNodeAnnouncementInfo ret_var = NodeAnnouncementInfo_new(features_arg_conv, last_update_arg, rgb_arg_ref, alias_arg_conv, announcement_message_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; } -static inline uint64_t ShutdownScript_clone_ptr(LDKShutdownScript *NONNULL_PTR arg) { - LDKShutdownScript ret_var = ShutdownScript_clone(arg); +static inline uint64_t NodeAnnouncementInfo_clone_ptr(LDKNodeAnnouncementInfo *NONNULL_PTR arg) { + LDKNodeAnnouncementInfo ret_var = NodeAnnouncementInfo_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_ShutdownScript_clone_ptr"))) TS_ShutdownScript_clone_ptr(uint64_t arg) { - LDKShutdownScript arg_conv; +int64_t __attribute__((export_name("TS_NodeAnnouncementInfo_clone_ptr"))) TS_NodeAnnouncementInfo_clone_ptr(uint64_t arg) { + LDKNodeAnnouncementInfo 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 = ShutdownScript_clone_ptr(&arg_conv); + int64_t ret_conv = NodeAnnouncementInfo_clone_ptr(&arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_ShutdownScript_clone"))) TS_ShutdownScript_clone(uint64_t orig) { - LDKShutdownScript orig_conv; +uint64_t __attribute__((export_name("TS_NodeAnnouncementInfo_clone"))) TS_NodeAnnouncementInfo_clone(uint64_t orig) { + LDKNodeAnnouncementInfo 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; - LDKShutdownScript ret_var = ShutdownScript_clone(&orig_conv); + LDKNodeAnnouncementInfo ret_var = NodeAnnouncementInfo_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_ShutdownScript_eq"))) TS_ShutdownScript_eq(uint64_t a, uint64_t b) { - LDKShutdownScript a_conv; +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; - LDKShutdownScript b_conv; + 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 = ShutdownScript_eq(&a_conv, &b_conv); + jboolean ret_conv = NodeAnnouncementInfo_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; +uint64_tArray __attribute__((export_name("TS_NodeAnnouncementInfo_addresses"))) TS_NodeAnnouncementInfo_addresses(uint64_t this_arg) { + LDKNodeAnnouncementInfo 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_NetAddressZ ret_var = NodeAnnouncementInfo_addresses(&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 m = 0; m < ret_var.datalen; m++) { + LDKNetAddress *ret_conv_12_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress"); + *ret_conv_12_copy = ret_var.data[m]; + uint64_t ret_conv_12_ref = tag_ptr(ret_conv_12_copy, true); + ret_arr_ptr[m] = ret_conv_12_ref; + } + + FREE(ret_var.data); + return ret_arr; +} + +int8_tArray __attribute__((export_name("TS_NodeAnnouncementInfo_write"))) TS_NodeAnnouncementInfo_write(uint64_t obj) { + LDKNodeAnnouncementInfo 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 = NodeAnnouncementInfo_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_NodeAnnouncementInfo_read"))) TS_NodeAnnouncementInfo_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ"); + *ret_conv = NodeAnnouncementInfo_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +void __attribute__((export_name("TS_NodeAlias_free"))) TS_NodeAlias_free(uint64_t this_obj) { + LDKNodeAlias 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); - InvalidShutdownScript_free(this_obj_conv); + NodeAlias_free(this_obj_conv); } -int8_tArray __attribute__((export_name("TS_InvalidShutdownScript_get_script"))) TS_InvalidShutdownScript_get_script(uint64_t this_ptr) { - LDKInvalidShutdownScript this_ptr_conv; +int8_tArray __attribute__((export_name("TS_NodeAlias_get_a"))) TS_NodeAlias_get_a(uint64_t this_ptr) { + LDKNodeAlias 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; - LDKu8slice ret_var = InvalidShutdownScript_get_script(&this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, *NodeAlias_get_a(&this_ptr_conv), 32); return ret_arr; } -void __attribute__((export_name("TS_InvalidShutdownScript_set_script"))) TS_InvalidShutdownScript_set_script(uint64_t this_ptr, int8_tArray val) { - LDKInvalidShutdownScript this_ptr_conv; +void __attribute__((export_name("TS_NodeAlias_set_a"))) TS_NodeAlias_set_a(uint64_t this_ptr, int8_tArray val) { + LDKNodeAlias 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; - LDKCVec_u8Z val_ref; - val_ref.datalen = val->arr_len; - val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(val_ref.data, val->elems, val_ref.datalen); FREE(val); - InvalidShutdownScript_set_script(&this_ptr_conv, val_ref); + LDKThirtyTwoBytes val_ref; + CHECK(val->arr_len == 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); + NodeAlias_set_a(&this_ptr_conv, val_ref); } -uint64_t __attribute__((export_name("TS_InvalidShutdownScript_new"))) TS_InvalidShutdownScript_new(int8_tArray script_arg) { - LDKCVec_u8Z script_arg_ref; - script_arg_ref.datalen = script_arg->arr_len; - script_arg_ref.data = MALLOC(script_arg_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(script_arg_ref.data, script_arg->elems, script_arg_ref.datalen); FREE(script_arg); - LDKInvalidShutdownScript ret_var = InvalidShutdownScript_new(script_arg_ref); +uint64_t __attribute__((export_name("TS_NodeAlias_new"))) TS_NodeAlias_new(int8_tArray a_arg) { + LDKThirtyTwoBytes a_arg_ref; + CHECK(a_arg->arr_len == 32); + memcpy(a_arg_ref.data, a_arg->elems, 32); FREE(a_arg); + LDKNodeAlias ret_var = NodeAlias_new(a_arg_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; } -static inline uint64_t InvalidShutdownScript_clone_ptr(LDKInvalidShutdownScript *NONNULL_PTR arg) { - LDKInvalidShutdownScript ret_var = InvalidShutdownScript_clone(arg); +static inline uint64_t NodeAlias_clone_ptr(LDKNodeAlias *NONNULL_PTR arg) { + LDKNodeAlias ret_var = NodeAlias_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_InvalidShutdownScript_clone_ptr"))) TS_InvalidShutdownScript_clone_ptr(uint64_t arg) { - LDKInvalidShutdownScript arg_conv; +int64_t __attribute__((export_name("TS_NodeAlias_clone_ptr"))) TS_NodeAlias_clone_ptr(uint64_t arg) { + LDKNodeAlias 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 = InvalidShutdownScript_clone_ptr(&arg_conv); + int64_t ret_conv = NodeAlias_clone_ptr(&arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_InvalidShutdownScript_clone"))) TS_InvalidShutdownScript_clone(uint64_t orig) { - LDKInvalidShutdownScript orig_conv; +uint64_t __attribute__((export_name("TS_NodeAlias_clone"))) TS_NodeAlias_clone(uint64_t orig) { + LDKNodeAlias 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; - LDKInvalidShutdownScript ret_var = InvalidShutdownScript_clone(&orig_conv); + LDKNodeAlias ret_var = NodeAlias_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; } -int8_tArray __attribute__((export_name("TS_ShutdownScript_write"))) TS_ShutdownScript_write(uint64_t obj) { - LDKShutdownScript obj_conv; +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); 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 = ShutdownScript_write(&obj_conv); + LDKCVec_u8Z ret_var = NodeAlias_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_ShutdownScript_read"))) TS_ShutdownScript_read(int8_tArray ser) { +uint64_t __attribute__((export_name("TS_NodeAlias_read"))) TS_NodeAlias_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; ser_ref.data = ser->elems; - LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ"); - *ret_conv = ShutdownScript_read(ser_ref); + LDKCResult_NodeAliasDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAliasDecodeErrorZ), "LDKCResult_NodeAliasDecodeErrorZ"); + *ret_conv = NodeAlias_read(ser_ref); FREE(ser); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_ShutdownScript_new_p2wpkh"))) TS_ShutdownScript_new_p2wpkh(int8_tArray pubkey_hash) { - uint8_t pubkey_hash_arr[20]; - CHECK(pubkey_hash->arr_len == 20); - memcpy(pubkey_hash_arr, pubkey_hash->elems, 20); FREE(pubkey_hash); - 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); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -uint64_t __attribute__((export_name("TS_ShutdownScript_new_p2wsh"))) TS_ShutdownScript_new_p2wsh(int8_tArray script_hash) { - uint8_t script_hash_arr[32]; - CHECK(script_hash->arr_len == 32); - memcpy(script_hash_arr, script_hash->elems, 32); FREE(script_hash); - 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); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +void __attribute__((export_name("TS_NodeInfo_free"))) TS_NodeInfo_free(uint64_t this_obj) { + LDKNodeInfo 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); + NodeInfo_free(this_obj_conv); } -uint64_t __attribute__((export_name("TS_ShutdownScript_new_witness_program"))) TS_ShutdownScript_new_witness_program(int8_t version, int8_tArray program) { +int64_tArray __attribute__((export_name("TS_NodeInfo_get_channels"))) TS_NodeInfo_get_channels(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; + LDKCVec_u64Z ret_var = NodeInfo_get_channels(&this_ptr_conv); + int64_tArray ret_arr = NULL; + ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); + int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); + for (size_t i = 0; i < ret_var.datalen; i++) { + int64_t ret_conv_8_conv = ret_var.data[i]; + ret_arr_ptr[i] = ret_conv_8_conv; + } - LDKu8slice program_ref; - program_ref.datalen = program->arr_len; - program_ref.data = program->elems; - LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ"); - *ret_conv = ShutdownScript_new_witness_program((LDKWitnessVersion){ ._0 = version }, program_ref); - FREE(program); - return tag_ptr(ret_conv, true); -} - -int8_tArray __attribute__((export_name("TS_ShutdownScript_into_inner"))) TS_ShutdownScript_into_inner(uint64_t this_arg) { - LDKShutdownScript 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 = ShutdownScript_clone(&this_arg_conv); - LDKCVec_u8Z ret_var = ShutdownScript_into_inner(this_arg_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_ShutdownScript_as_legacy_pubkey"))) TS_ShutdownScript_as_legacy_pubkey(uint64_t this_arg) { - LDKShutdownScript 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(33, __LINE__); - memcpy(ret_arr->elems, ShutdownScript_as_legacy_pubkey(&this_arg_conv).compressed_form, 33); + FREE(ret_var.data); return ret_arr; } -jboolean __attribute__((export_name("TS_ShutdownScript_is_compatible"))) TS_ShutdownScript_is_compatible(uint64_t this_arg, uint64_t features) { - LDKShutdownScript 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 features_conv; - features_conv.inner = untag_ptr(features); - features_conv.is_owned = ptr_is_owned(features); - CHECK_INNER_FIELD_ACCESS_OR_NULL(features_conv); - features_conv.is_owned = false; - jboolean ret_conv = ShutdownScript_is_compatible(&this_arg_conv, &features_conv); - 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); +void __attribute__((export_name("TS_NodeInfo_set_channels"))) TS_NodeInfo_set_channels(uint64_t this_ptr, int64_tArray 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; + LDKCVec_u64Z val_constr; + val_constr.datalen = val->arr_len; + if (val_constr.datalen > 0) + val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); + else + val_constr.data = NULL; + int64_t* val_vals = val->elems; + for (size_t i = 0; i < val_constr.datalen; i++) { + int64_t val_conv_8 = val_vals[i]; + val_constr.data[i] = val_conv_8; + } + FREE(val); + NodeInfo_set_channels(&this_ptr_conv, val_constr); } -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); +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); + 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; + LDKNodeAnnouncementInfo ret_var = NodeInfo_get_announcement_info(&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; } -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; +void __attribute__((export_name("TS_NodeInfo_set_announcement_info"))) TS_NodeInfo_set_announcement_info(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; + LDKNodeAnnouncementInfo 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 = NodeAnnouncementInfo_clone(&val_conv); + NodeInfo_set_announcement_info(&this_ptr_conv, val_conv); } -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); +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 = MALLOC(channels_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); + else + channels_arg_constr.data = NULL; + int64_t* channels_arg_vals = channels_arg->elems; + for (size_t i = 0; i < channels_arg_constr.datalen; i++) { + int64_t channels_arg_conv_8 = channels_arg_vals[i]; + channels_arg_constr.data[i] = channels_arg_conv_8; + } + FREE(channels_arg); + 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, 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_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; +static inline uint64_t NodeInfo_clone_ptr(LDKNodeInfo *NONNULL_PTR arg) { + LDKNodeInfo ret_var = NodeInfo_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; } - -uint32_t __attribute__((export_name("TS_RetryableSendFailure_payment_expired"))) TS_RetryableSendFailure_payment_expired() { - uint32_t ret_conv = LDKRetryableSendFailure_to_js(RetryableSendFailure_payment_expired()); +int64_t __attribute__((export_name("TS_NodeInfo_clone_ptr"))) TS_NodeInfo_clone_ptr(uint64_t arg) { + LDKNodeInfo 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 = NodeInfo_clone_ptr(&arg_conv); 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; +uint64_t __attribute__((export_name("TS_NodeInfo_clone"))) TS_NodeInfo_clone(uint64_t orig) { + LDKNodeInfo 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; + LDKNodeInfo ret_var = NodeInfo_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; } -uint32_t __attribute__((export_name("TS_RetryableSendFailure_duplicate_payment"))) TS_RetryableSendFailure_duplicate_payment() { - uint32_t ret_conv = LDKRetryableSendFailure_to_js(RetryableSendFailure_duplicate_payment()); +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; } -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); +int8_tArray __attribute__((export_name("TS_NodeInfo_write"))) TS_NodeInfo_write(uint64_t obj) { + LDKNodeInfo 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 = NodeInfo_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; } -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_NodeInfo_read"))) TS_NodeInfo_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ"); + *ret_conv = NodeInfo_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -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; +int8_tArray __attribute__((export_name("TS_NetworkGraph_write"))) TS_NetworkGraph_write(uint64_t obj) { + LDKNetworkGraph 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 = NetworkGraph_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_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_NetworkGraph_read"))) TS_NetworkGraph_read(int8_tArray ser, uint64_t arg) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + void* arg_ptr = untag_ptr(arg); + CHECK_ACCESS(arg_ptr); + LDKLogger arg_conv = *(LDKLogger*)(arg_ptr); + if (arg_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&arg_conv); + } + LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ"); + *ret_conv = NetworkGraph_read(ser_ref, arg_conv); + FREE(ser); + return tag_ptr(ret_conv, true); } -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; +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 (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); } - 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); + 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 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); +uint64_t __attribute__((export_name("TS_NetworkGraph_read_only"))) TS_NetworkGraph_read_only(uint64_t this_arg) { + 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; + LDKReadOnlyNetworkGraph ret_var = NetworkGraph_read_only(&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_PaymentSendFailure_duplicate_payment"))) TS_PaymentSendFailure_duplicate_payment() { - LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); - *ret_copy = PaymentSendFailure_duplicate_payment(); +uint64_t __attribute__((export_name("TS_NetworkGraph_get_last_rapid_gossip_sync_timestamp"))) TS_NetworkGraph_get_last_rapid_gossip_sync_timestamp(uint64_t this_arg) { + 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; + LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); + *ret_copy = NetworkGraph_get_last_rapid_gossip_sync_timestamp(&this_arg_conv); 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_NetworkGraph_set_last_rapid_gossip_sync_timestamp"))) TS_NetworkGraph_set_last_rapid_gossip_sync_timestamp(uint64_t this_arg, int32_t last_rapid_gossip_sync_timestamp) { + 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_set_last_rapid_gossip_sync_timestamp(&this_arg_conv, last_rapid_gossip_sync_timestamp); } -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); - CHECK_ACCESS(this_ptr_ptr); - LDKCustomMessageReader this_ptr_conv = *(LDKCustomMessageReader*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - CustomMessageReader_free(this_ptr_conv); +uint64_t __attribute__((export_name("TS_NetworkGraph_update_node_from_announcement"))) TS_NetworkGraph_update_node_from_announcement(uint64_t this_arg, uint64_t msg) { + 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; + 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.is_owned = false; + LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); + *ret_conv = NetworkGraph_update_node_from_announcement(&this_arg_conv, &msg_conv); + return tag_ptr(ret_conv, true); } -static inline uint64_t Type_clone_ptr(LDKType *NONNULL_PTR arg) { - LDKType* ret_ret = MALLOC(sizeof(LDKType), "LDKType"); - *ret_ret = Type_clone(arg); - return tag_ptr(ret_ret, true); +uint64_t __attribute__((export_name("TS_NetworkGraph_update_node_from_unsigned_announcement"))) TS_NetworkGraph_update_node_from_unsigned_announcement(uint64_t this_arg, uint64_t msg) { + 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; + LDKUnsignedNodeAnnouncement 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_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); + *ret_conv = NetworkGraph_update_node_from_unsigned_announcement(&this_arg_conv, &msg_conv); + return tag_ptr(ret_conv, true); } -int64_t __attribute__((export_name("TS_Type_clone_ptr"))) TS_Type_clone_ptr(uint64_t arg) { - void* arg_ptr = untag_ptr(arg); - if (ptr_is_owned(arg)) { CHECK_ACCESS(arg_ptr); } - LDKType* arg_conv = (LDKType*)arg_ptr; - int64_t ret_conv = Type_clone_ptr(arg_conv); - return ret_conv; + +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); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + 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.is_owned = false; + 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 (utxo_lookup_conv.some.free == LDKUtxoLookup_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + 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, utxo_lookup_conv); + return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_Type_clone"))) TS_Type_clone(uint64_t orig) { - void* orig_ptr = untag_ptr(orig); - if (ptr_is_owned(orig)) { CHECK_ACCESS(orig_ptr); } - LDKType* orig_conv = (LDKType*)orig_ptr; - LDKType* ret_ret = MALLOC(sizeof(LDKType), "LDKType"); - *ret_ret = Type_clone(orig_conv); - return tag_ptr(ret_ret, 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 utxo_lookup) { + 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; + 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; + 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 (utxo_lookup_conv.some.free == LDKUtxoLookup_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + 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, utxo_lookup_conv); + return tag_ptr(ret_conv, true); } -void __attribute__((export_name("TS_Type_free"))) TS_Type_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); - LDKType this_ptr_conv = *(LDKType*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - Type_free(this_ptr_conv); +uint64_t __attribute__((export_name("TS_NetworkGraph_add_channel_from_partial_announcement"))) TS_NetworkGraph_add_channel_from_partial_announcement(uint64_t this_arg, int64_t short_channel_id, int64_t timestamp, uint64_t features, int8_tArray node_id_1, int8_tArray node_id_2) { + 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; + LDKChannelFeatures features_conv; + features_conv.inner = untag_ptr(features); + features_conv.is_owned = ptr_is_owned(features); + CHECK_INNER_FIELD_ACCESS_OR_NULL(features_conv); + features_conv = ChannelFeatures_clone(&features_conv); + LDKPublicKey node_id_1_ref; + CHECK(node_id_1->arr_len == 33); + memcpy(node_id_1_ref.compressed_form, node_id_1->elems, 33); FREE(node_id_1); + LDKPublicKey node_id_2_ref; + CHECK(node_id_2->arr_len == 33); + memcpy(node_id_2_ref.compressed_form, node_id_2->elems, 33); FREE(node_id_2); + LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); + *ret_conv = NetworkGraph_add_channel_from_partial_announcement(&this_arg_conv, short_channel_id, timestamp, features_conv, node_id_1_ref, node_id_2_ref); + return tag_ptr(ret_conv, true); } -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; +void __attribute__((export_name("TS_NetworkGraph_channel_failed_permanent"))) TS_NetworkGraph_channel_failed_permanent(uint64_t this_arg, int64_t short_channel_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; + NetworkGraph_channel_failed_permanent(&this_arg_conv, short_channel_id); } -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; +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_permanent(&this_arg_conv, node_id_ref); } -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_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_and_tracking_with_time(&this_arg_conv, current_time_unix); } -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); +uint64_t __attribute__((export_name("TS_NetworkGraph_update_channel"))) TS_NetworkGraph_update_channel(uint64_t this_arg, uint64_t msg) { + 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; + LDKChannelUpdate 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_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); + *ret_conv = NetworkGraph_update_channel(&this_arg_conv, &msg_conv); + return tag_ptr(ret_conv, true); } -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); +uint64_t __attribute__((export_name("TS_NetworkGraph_update_channel_unsigned"))) TS_NetworkGraph_update_channel_unsigned(uint64_t this_arg, uint64_t msg) { + 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; + LDKUnsignedChannelUpdate 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_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); + *ret_conv = NetworkGraph_update_channel_unsigned(&this_arg_conv, &msg_conv); + return tag_ptr(ret_conv, true); +} + +uint64_t __attribute__((export_name("TS_ReadOnlyNetworkGraph_channel"))) TS_ReadOnlyNetworkGraph_channel(uint64_t this_arg, int64_t short_channel_id) { + LDKReadOnlyNetworkGraph 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; + LDKChannelInfo ret_var = ReadOnlyNetworkGraph_channel(&this_arg_conv, short_channel_id); + 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_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; + +int64_tArray __attribute__((export_name("TS_ReadOnlyNetworkGraph_list_channels"))) TS_ReadOnlyNetworkGraph_list_channels(uint64_t this_arg) { + LDKReadOnlyNetworkGraph 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_u64Z ret_var = ReadOnlyNetworkGraph_list_channels(&this_arg_conv); + int64_tArray ret_arr = NULL; + ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); + int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); + for (size_t i = 0; i < ret_var.datalen; i++) { + int64_t ret_conv_8_conv = ret_var.data[i]; + ret_arr_ptr[i] = ret_conv_8_conv; + } + + FREE(ret_var.data); + return ret_arr; } -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); +uint64_t __attribute__((export_name("TS_ReadOnlyNetworkGraph_node"))) TS_ReadOnlyNetworkGraph_node(uint64_t this_arg, uint64_t node_id) { + LDKReadOnlyNetworkGraph 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 node_id_conv; + node_id_conv.inner = untag_ptr(node_id); + node_id_conv.is_owned = ptr_is_owned(node_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv); + node_id_conv.is_owned = false; + LDKNodeInfo ret_var = ReadOnlyNetworkGraph_node(&this_arg_conv, &node_id_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_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_tArray __attribute__((export_name("TS_ReadOnlyNetworkGraph_list_nodes"))) TS_ReadOnlyNetworkGraph_list_nodes(uint64_t this_arg) { + LDKReadOnlyNetworkGraph 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_NodeIdZ ret_var = ReadOnlyNetworkGraph_list_nodes(&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 i = 0; i < ret_var.datalen; i++) { + LDKNodeId ret_conv_8_var = ret_var.data[i]; + uint64_t ret_conv_8_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_8_var); + ret_conv_8_ref = tag_ptr(ret_conv_8_var.inner, ret_conv_8_var.is_owned); + ret_arr_ptr[i] = ret_conv_8_ref; + } + + FREE(ret_var.data); + return ret_arr; } -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 __attribute__((export_name("TS_ReadOnlyNetworkGraph_get_addresses"))) TS_ReadOnlyNetworkGraph_get_addresses(uint64_t this_arg, int8_tArray pubkey) { + LDKReadOnlyNetworkGraph 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); + LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ"); + *ret_copy = ReadOnlyNetworkGraph_get_addresses(&this_arg_conv, pubkey_ref); 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; +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); - UtxoFuture_free(this_obj_conv); + DefaultRouter_free(this_obj_conv); } -static inline uint64_t UtxoFuture_clone_ptr(LDKUtxoFuture *NONNULL_PTR arg) { - LDKUtxoFuture ret_var = UtxoFuture_clone(arg); +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; } -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_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_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; +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); } -uint64_t __attribute__((export_name("TS_UtxoFuture_new"))) TS_UtxoFuture_new() { - LDKUtxoFuture ret_var = UtxoFuture_new(); +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; } -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); +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; } - -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; + +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; - 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); + 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_NodeId_free"))) TS_NodeId_free(uint64_t this_obj) { - LDKNodeId this_obj_conv; +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); - NodeId_free(this_obj_conv); + InFlightHtlcs_free(this_obj_conv); } -static inline uint64_t NodeId_clone_ptr(LDKNodeId *NONNULL_PTR arg) { - LDKNodeId ret_var = NodeId_clone(arg); +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_NodeId_clone_ptr"))) TS_NodeId_clone_ptr(uint64_t arg) { - LDKNodeId arg_conv; +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 = NodeId_clone_ptr(&arg_conv); + int64_t ret_conv = InFlightHtlcs_clone_ptr(&arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_NodeId_clone"))) TS_NodeId_clone(uint64_t orig) { - LDKNodeId orig_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; - LDKNodeId ret_var = NodeId_clone(&orig_conv); + 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_NodeId_from_pubkey"))) TS_NodeId_from_pubkey(int8_tArray pubkey) { - LDKPublicKey pubkey_ref; - CHECK(pubkey->arr_len == 33); - memcpy(pubkey_ref.compressed_form, pubkey->elems, 33); FREE(pubkey); - LDKNodeId ret_var = NodeId_from_pubkey(pubkey_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; } -int8_tArray __attribute__((export_name("TS_NodeId_as_slice"))) TS_NodeId_as_slice(uint64_t this_arg) { - LDKNodeId this_arg_conv; +void __attribute__((export_name("TS_InFlightHtlcs_process_path"))) TS_InFlightHtlcs_process_path(uint64_t this_arg, uint64_t path, int8_tArray payer_node_id) { + 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; - LDKu8slice ret_var = NodeId_as_slice(&this_arg_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - return ret_arr; + LDKPath path_conv; + path_conv.inner = untag_ptr(path); + path_conv.is_owned = ptr_is_owned(path); + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); + path_conv.is_owned = false; + LDKPublicKey payer_node_id_ref; + CHECK(payer_node_id->arr_len == 33); + memcpy(payer_node_id_ref.compressed_form, payer_node_id->elems, 33); FREE(payer_node_id); + InFlightHtlcs_process_path(&this_arg_conv, &path_conv, payer_node_id_ref); } -int64_t __attribute__((export_name("TS_NodeId_hash"))) TS_NodeId_hash(uint64_t o) { - LDKNodeId 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 = NodeId_hash(&o_conv); - return ret_conv; +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_NodeId_write"))) TS_NodeId_write(uint64_t obj) { - LDKNodeId obj_conv; +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 = NodeId_write(&obj_conv); + 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_NodeId_read"))) TS_NodeId_read(int8_tArray ser) { +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_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ"); - *ret_conv = NodeId_read(ser_ref); + 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_NetworkGraph_free"))) TS_NetworkGraph_free(uint64_t this_obj) { - LDKNetworkGraph 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); - NetworkGraph_free(this_obj_conv); -} - -void __attribute__((export_name("TS_ReadOnlyNetworkGraph_free"))) TS_ReadOnlyNetworkGraph_free(uint64_t this_obj) { - LDKReadOnlyNetworkGraph this_obj_conv; +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); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ReadOnlyNetworkGraph_free(this_obj_conv); -} - -void __attribute__((export_name("TS_NetworkUpdate_free"))) TS_NetworkUpdate_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); - LDKNetworkUpdate this_ptr_conv = *(LDKNetworkUpdate*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - NetworkUpdate_free(this_ptr_conv); -} - -static inline uint64_t NetworkUpdate_clone_ptr(LDKNetworkUpdate *NONNULL_PTR arg) { - LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate"); - *ret_copy = NetworkUpdate_clone(arg); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} -int64_t __attribute__((export_name("TS_NetworkUpdate_clone_ptr"))) TS_NetworkUpdate_clone_ptr(uint64_t arg) { - LDKNetworkUpdate* arg_conv = (LDKNetworkUpdate*)untag_ptr(arg); - int64_t ret_conv = NetworkUpdate_clone_ptr(arg_conv); - return ret_conv; -} - -uint64_t __attribute__((export_name("TS_NetworkUpdate_clone"))) TS_NetworkUpdate_clone(uint64_t orig) { - LDKNetworkUpdate* orig_conv = (LDKNetworkUpdate*)untag_ptr(orig); - LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate"); - *ret_copy = NetworkUpdate_clone(orig_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -uint64_t __attribute__((export_name("TS_NetworkUpdate_channel_update_message"))) TS_NetworkUpdate_channel_update_message(uint64_t msg) { - LDKChannelUpdate 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 = ChannelUpdate_clone(&msg_conv); - LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate"); - *ret_copy = NetworkUpdate_channel_update_message(msg_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -uint64_t __attribute__((export_name("TS_NetworkUpdate_channel_failure"))) TS_NetworkUpdate_channel_failure(int64_t short_channel_id, jboolean is_permanent) { - LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate"); - *ret_copy = NetworkUpdate_channel_failure(short_channel_id, is_permanent); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -uint64_t __attribute__((export_name("TS_NetworkUpdate_node_failure"))) TS_NetworkUpdate_node_failure(int8_tArray node_id, jboolean 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); - LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate"); - *ret_copy = NetworkUpdate_node_failure(node_id_ref, is_permanent); - uint64_t ret_ref = tag_ptr(ret_copy, true); - 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; + RouteHop_free(this_obj_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); - 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); +int8_tArray __attribute__((export_name("TS_RouteHop_get_pubkey"))) TS_RouteHop_get_pubkey(uint64_t this_ptr) { + LDKRouteHop 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, RouteHop_get_pubkey(&this_ptr_conv).compressed_form, 33); return ret_arr; } -uint64_t __attribute__((export_name("TS_NetworkUpdate_read"))) TS_NetworkUpdate_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ"); - *ret_conv = NetworkUpdate_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); -} - -void __attribute__((export_name("TS_P2PGossipSync_free"))) TS_P2PGossipSync_free(uint64_t this_obj) { - LDKP2PGossipSync 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); - P2PGossipSync_free(this_obj_conv); +void __attribute__((export_name("TS_RouteHop_set_pubkey"))) TS_RouteHop_set_pubkey(uint64_t this_ptr, int8_tArray val) { + LDKRouteHop 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); + RouteHop_set_pubkey(&this_ptr_conv, val_ref); } -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* 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 (utxo_lookup_conv.some.free == LDKUtxoLookup_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKUtxoLookup_JCalls_cloned(&utxo_lookup_conv.some); - } - } - 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); - } - LDKP2PGossipSync ret_var = P2PGossipSync_new(&network_graph_conv, utxo_lookup_conv, logger_conv); +uint64_t __attribute__((export_name("TS_RouteHop_get_node_features"))) TS_RouteHop_get_node_features(uint64_t this_ptr) { + LDKRouteHop 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; + LDKNodeFeatures ret_var = RouteHop_get_node_features(&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_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* 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 (utxo_lookup_conv.some.free == LDKUtxoLookup_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKUtxoLookup_JCalls_cloned(&utxo_lookup_conv.some); - } - } - P2PGossipSync_add_utxo_lookup(&this_arg_conv, utxo_lookup_conv); -} - -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; - 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) { - 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; - LDKRoutingMessageHandler* ret_ret = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler"); - *ret_ret = P2PGossipSync_as_RoutingMessageHandler(&this_arg_conv); - return tag_ptr(ret_ret, true); +void __attribute__((export_name("TS_RouteHop_set_node_features"))) TS_RouteHop_set_node_features(uint64_t this_ptr, uint64_t val) { + LDKRouteHop 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; + LDKNodeFeatures 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 = NodeFeatures_clone(&val_conv); + RouteHop_set_node_features(&this_ptr_conv, val_conv); } -uint64_t __attribute__((export_name("TS_P2PGossipSync_as_MessageSendEventsProvider"))) TS_P2PGossipSync_as_MessageSendEventsProvider(uint64_t this_arg) { - 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; - LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider"); - *ret_ret = P2PGossipSync_as_MessageSendEventsProvider(&this_arg_conv); - return tag_ptr(ret_ret, true); +int64_t __attribute__((export_name("TS_RouteHop_get_short_channel_id"))) TS_RouteHop_get_short_channel_id(uint64_t this_ptr) { + LDKRouteHop 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 = RouteHop_get_short_channel_id(&this_ptr_conv); + return ret_conv; } -void __attribute__((export_name("TS_ChannelUpdateInfo_free"))) TS_ChannelUpdateInfo_free(uint64_t this_obj) { - LDKChannelUpdateInfo 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); - ChannelUpdateInfo_free(this_obj_conv); +void __attribute__((export_name("TS_RouteHop_set_short_channel_id"))) TS_RouteHop_set_short_channel_id(uint64_t this_ptr, int64_t val) { + LDKRouteHop 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; + RouteHop_set_short_channel_id(&this_ptr_conv, val); } -int32_t __attribute__((export_name("TS_ChannelUpdateInfo_get_last_update"))) TS_ChannelUpdateInfo_get_last_update(uint64_t this_ptr) { - LDKChannelUpdateInfo this_ptr_conv; +uint64_t __attribute__((export_name("TS_RouteHop_get_channel_features"))) TS_RouteHop_get_channel_features(uint64_t this_ptr) { + LDKRouteHop 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 = ChannelUpdateInfo_get_last_update(&this_ptr_conv); - return ret_conv; + LDKChannelFeatures ret_var = RouteHop_get_channel_features(&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_ChannelUpdateInfo_set_last_update"))) TS_ChannelUpdateInfo_set_last_update(uint64_t this_ptr, int32_t val) { - LDKChannelUpdateInfo this_ptr_conv; +void __attribute__((export_name("TS_RouteHop_set_channel_features"))) TS_RouteHop_set_channel_features(uint64_t this_ptr, uint64_t val) { + LDKRouteHop 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; - ChannelUpdateInfo_set_last_update(&this_ptr_conv, val); + LDKChannelFeatures 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 = ChannelFeatures_clone(&val_conv); + RouteHop_set_channel_features(&this_ptr_conv, val_conv); } -jboolean __attribute__((export_name("TS_ChannelUpdateInfo_get_enabled"))) TS_ChannelUpdateInfo_get_enabled(uint64_t this_ptr) { - LDKChannelUpdateInfo this_ptr_conv; +int64_t __attribute__((export_name("TS_RouteHop_get_fee_msat"))) TS_RouteHop_get_fee_msat(uint64_t this_ptr) { + LDKRouteHop 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 = ChannelUpdateInfo_get_enabled(&this_ptr_conv); + int64_t ret_conv = RouteHop_get_fee_msat(&this_ptr_conv); return ret_conv; } -void __attribute__((export_name("TS_ChannelUpdateInfo_set_enabled"))) TS_ChannelUpdateInfo_set_enabled(uint64_t this_ptr, jboolean val) { - LDKChannelUpdateInfo this_ptr_conv; +void __attribute__((export_name("TS_RouteHop_set_fee_msat"))) TS_RouteHop_set_fee_msat(uint64_t this_ptr, int64_t val) { + LDKRouteHop 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; - ChannelUpdateInfo_set_enabled(&this_ptr_conv, val); + RouteHop_set_fee_msat(&this_ptr_conv, val); } -int16_t __attribute__((export_name("TS_ChannelUpdateInfo_get_cltv_expiry_delta"))) TS_ChannelUpdateInfo_get_cltv_expiry_delta(uint64_t this_ptr) { - LDKChannelUpdateInfo this_ptr_conv; +int32_t __attribute__((export_name("TS_RouteHop_get_cltv_expiry_delta"))) TS_RouteHop_get_cltv_expiry_delta(uint64_t this_ptr) { + LDKRouteHop 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; - int16_t ret_conv = ChannelUpdateInfo_get_cltv_expiry_delta(&this_ptr_conv); + int32_t ret_conv = RouteHop_get_cltv_expiry_delta(&this_ptr_conv); return ret_conv; } -void __attribute__((export_name("TS_ChannelUpdateInfo_set_cltv_expiry_delta"))) TS_ChannelUpdateInfo_set_cltv_expiry_delta(uint64_t this_ptr, int16_t val) { - LDKChannelUpdateInfo this_ptr_conv; +void __attribute__((export_name("TS_RouteHop_set_cltv_expiry_delta"))) TS_RouteHop_set_cltv_expiry_delta(uint64_t this_ptr, int32_t val) { + LDKRouteHop 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; - ChannelUpdateInfo_set_cltv_expiry_delta(&this_ptr_conv, val); + RouteHop_set_cltv_expiry_delta(&this_ptr_conv, val); } -int64_t __attribute__((export_name("TS_ChannelUpdateInfo_get_htlc_minimum_msat"))) TS_ChannelUpdateInfo_get_htlc_minimum_msat(uint64_t this_ptr) { - LDKChannelUpdateInfo this_ptr_conv; +uint64_t __attribute__((export_name("TS_RouteHop_new"))) TS_RouteHop_new(int8_tArray pubkey_arg, uint64_t node_features_arg, int64_t short_channel_id_arg, uint64_t channel_features_arg, int64_t fee_msat_arg, int32_t cltv_expiry_delta_arg) { + LDKPublicKey pubkey_arg_ref; + CHECK(pubkey_arg->arr_len == 33); + memcpy(pubkey_arg_ref.compressed_form, pubkey_arg->elems, 33); FREE(pubkey_arg); + LDKNodeFeatures node_features_arg_conv; + node_features_arg_conv.inner = untag_ptr(node_features_arg); + node_features_arg_conv.is_owned = ptr_is_owned(node_features_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(node_features_arg_conv); + node_features_arg_conv = NodeFeatures_clone(&node_features_arg_conv); + LDKChannelFeatures channel_features_arg_conv; + channel_features_arg_conv.inner = untag_ptr(channel_features_arg); + channel_features_arg_conv.is_owned = ptr_is_owned(channel_features_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_features_arg_conv); + channel_features_arg_conv = ChannelFeatures_clone(&channel_features_arg_conv); + LDKRouteHop ret_var = RouteHop_new(pubkey_arg_ref, node_features_arg_conv, short_channel_id_arg, channel_features_arg_conv, fee_msat_arg, 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_ref; +} + +static inline uint64_t RouteHop_clone_ptr(LDKRouteHop *NONNULL_PTR arg) { + LDKRouteHop ret_var = RouteHop_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_RouteHop_clone_ptr"))) TS_RouteHop_clone_ptr(uint64_t arg) { + LDKRouteHop 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 = RouteHop_clone_ptr(&arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_RouteHop_clone"))) TS_RouteHop_clone(uint64_t orig) { + LDKRouteHop 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; + LDKRouteHop ret_var = RouteHop_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_RouteHop_hash"))) TS_RouteHop_hash(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.is_owned = false; + int64_t ret_conv = RouteHop_hash(&o_conv); + return ret_conv; +} + +jboolean __attribute__((export_name("TS_RouteHop_eq"))) TS_RouteHop_eq(uint64_t a, uint64_t b) { + LDKRouteHop 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; + LDKRouteHop 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 = RouteHop_eq(&a_conv, &b_conv); + return ret_conv; +} + +int8_tArray __attribute__((export_name("TS_RouteHop_write"))) TS_RouteHop_write(uint64_t obj) { + LDKRouteHop 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 = RouteHop_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_RouteHop_read"))) TS_RouteHop_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ"); + *ret_conv = RouteHop_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +void __attribute__((export_name("TS_BlindedTail_free"))) TS_BlindedTail_free(uint64_t this_obj) { + LDKBlindedTail 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); + BlindedTail_free(this_obj_conv); +} + +uint64_tArray __attribute__((export_name("TS_BlindedTail_get_hops"))) TS_BlindedTail_get_hops(uint64_t this_ptr) { + LDKBlindedTail 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 = ChannelUpdateInfo_get_htlc_minimum_msat(&this_ptr_conv); - return ret_conv; + LDKCVec_BlindedHopZ ret_var = BlindedTail_get_hops(&this_ptr_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 m = 0; m < ret_var.datalen; m++) { + LDKBlindedHop ret_conv_12_var = ret_var.data[m]; + uint64_t ret_conv_12_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_12_var); + ret_conv_12_ref = tag_ptr(ret_conv_12_var.inner, ret_conv_12_var.is_owned); + ret_arr_ptr[m] = ret_conv_12_ref; + } + + FREE(ret_var.data); + return ret_arr; } -void __attribute__((export_name("TS_ChannelUpdateInfo_set_htlc_minimum_msat"))) TS_ChannelUpdateInfo_set_htlc_minimum_msat(uint64_t this_ptr, int64_t val) { - LDKChannelUpdateInfo this_ptr_conv; +void __attribute__((export_name("TS_BlindedTail_set_hops"))) TS_BlindedTail_set_hops(uint64_t this_ptr, uint64_tArray val) { + LDKBlindedTail 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; - ChannelUpdateInfo_set_htlc_minimum_msat(&this_ptr_conv, val); + LDKCVec_BlindedHopZ val_constr; + val_constr.datalen = val->arr_len; + if (val_constr.datalen > 0) + val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKBlindedHop), "LDKCVec_BlindedHopZ Elements"); + else + val_constr.data = NULL; + uint64_t* val_vals = val->elems; + for (size_t m = 0; m < val_constr.datalen; m++) { + uint64_t val_conv_12 = val_vals[m]; + LDKBlindedHop val_conv_12_conv; + val_conv_12_conv.inner = untag_ptr(val_conv_12); + val_conv_12_conv.is_owned = ptr_is_owned(val_conv_12); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_12_conv); + val_conv_12_conv = BlindedHop_clone(&val_conv_12_conv); + val_constr.data[m] = val_conv_12_conv; + } + FREE(val); + BlindedTail_set_hops(&this_ptr_conv, val_constr); } -int64_t __attribute__((export_name("TS_ChannelUpdateInfo_get_htlc_maximum_msat"))) TS_ChannelUpdateInfo_get_htlc_maximum_msat(uint64_t this_ptr) { - LDKChannelUpdateInfo this_ptr_conv; +int8_tArray __attribute__((export_name("TS_BlindedTail_get_blinding_point"))) TS_BlindedTail_get_blinding_point(uint64_t this_ptr) { + LDKBlindedTail 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 = ChannelUpdateInfo_get_htlc_maximum_msat(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, BlindedTail_get_blinding_point(&this_ptr_conv).compressed_form, 33); + return ret_arr; } -void __attribute__((export_name("TS_ChannelUpdateInfo_set_htlc_maximum_msat"))) TS_ChannelUpdateInfo_set_htlc_maximum_msat(uint64_t this_ptr, int64_t val) { - LDKChannelUpdateInfo this_ptr_conv; +void __attribute__((export_name("TS_BlindedTail_set_blinding_point"))) TS_BlindedTail_set_blinding_point(uint64_t this_ptr, int8_tArray val) { + LDKBlindedTail 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; - ChannelUpdateInfo_set_htlc_maximum_msat(&this_ptr_conv, val); + LDKPublicKey val_ref; + CHECK(val->arr_len == 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); + BlindedTail_set_blinding_point(&this_ptr_conv, val_ref); } -uint64_t __attribute__((export_name("TS_ChannelUpdateInfo_get_fees"))) TS_ChannelUpdateInfo_get_fees(uint64_t this_ptr) { - LDKChannelUpdateInfo this_ptr_conv; +int32_t __attribute__((export_name("TS_BlindedTail_get_excess_final_cltv_expiry_delta"))) TS_BlindedTail_get_excess_final_cltv_expiry_delta(uint64_t this_ptr) { + LDKBlindedTail 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 = ChannelUpdateInfo_get_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; + int32_t ret_conv = BlindedTail_get_excess_final_cltv_expiry_delta(&this_ptr_conv); + return ret_conv; } -void __attribute__((export_name("TS_ChannelUpdateInfo_set_fees"))) TS_ChannelUpdateInfo_set_fees(uint64_t this_ptr, uint64_t val) { - LDKChannelUpdateInfo this_ptr_conv; +void __attribute__((export_name("TS_BlindedTail_set_excess_final_cltv_expiry_delta"))) TS_BlindedTail_set_excess_final_cltv_expiry_delta(uint64_t this_ptr, int32_t val) { + LDKBlindedTail 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); - ChannelUpdateInfo_set_fees(&this_ptr_conv, val_conv); + BlindedTail_set_excess_final_cltv_expiry_delta(&this_ptr_conv, val); } -uint64_t __attribute__((export_name("TS_ChannelUpdateInfo_get_last_update_message"))) TS_ChannelUpdateInfo_get_last_update_message(uint64_t this_ptr) { - LDKChannelUpdateInfo this_ptr_conv; +int64_t __attribute__((export_name("TS_BlindedTail_get_final_value_msat"))) TS_BlindedTail_get_final_value_msat(uint64_t this_ptr) { + LDKBlindedTail 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; - LDKChannelUpdate ret_var = ChannelUpdateInfo_get_last_update_message(&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; + int64_t ret_conv = BlindedTail_get_final_value_msat(&this_ptr_conv); + return ret_conv; } -void __attribute__((export_name("TS_ChannelUpdateInfo_set_last_update_message"))) TS_ChannelUpdateInfo_set_last_update_message(uint64_t this_ptr, uint64_t val) { - LDKChannelUpdateInfo this_ptr_conv; +void __attribute__((export_name("TS_BlindedTail_set_final_value_msat"))) TS_BlindedTail_set_final_value_msat(uint64_t this_ptr, int64_t val) { + LDKBlindedTail 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; - LDKChannelUpdate 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 = ChannelUpdate_clone(&val_conv); - ChannelUpdateInfo_set_last_update_message(&this_ptr_conv, val_conv); + BlindedTail_set_final_value_msat(&this_ptr_conv, val); } -uint64_t __attribute__((export_name("TS_ChannelUpdateInfo_new"))) TS_ChannelUpdateInfo_new(int32_t last_update_arg, jboolean enabled_arg, int16_t cltv_expiry_delta_arg, int64_t htlc_minimum_msat_arg, int64_t htlc_maximum_msat_arg, uint64_t fees_arg, uint64_t last_update_message_arg) { - LDKRoutingFees fees_arg_conv; - fees_arg_conv.inner = untag_ptr(fees_arg); - fees_arg_conv.is_owned = ptr_is_owned(fees_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(fees_arg_conv); - fees_arg_conv = RoutingFees_clone(&fees_arg_conv); - LDKChannelUpdate last_update_message_arg_conv; - last_update_message_arg_conv.inner = untag_ptr(last_update_message_arg); - last_update_message_arg_conv.is_owned = ptr_is_owned(last_update_message_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(last_update_message_arg_conv); - last_update_message_arg_conv = ChannelUpdate_clone(&last_update_message_arg_conv); - LDKChannelUpdateInfo ret_var = ChannelUpdateInfo_new(last_update_arg, enabled_arg, cltv_expiry_delta_arg, htlc_minimum_msat_arg, htlc_maximum_msat_arg, fees_arg_conv, last_update_message_arg_conv); +uint64_t __attribute__((export_name("TS_BlindedTail_new"))) TS_BlindedTail_new(uint64_tArray hops_arg, int8_tArray blinding_point_arg, int32_t excess_final_cltv_expiry_delta_arg, int64_t final_value_msat_arg) { + LDKCVec_BlindedHopZ hops_arg_constr; + hops_arg_constr.datalen = hops_arg->arr_len; + if (hops_arg_constr.datalen > 0) + hops_arg_constr.data = MALLOC(hops_arg_constr.datalen * sizeof(LDKBlindedHop), "LDKCVec_BlindedHopZ Elements"); + else + hops_arg_constr.data = NULL; + uint64_t* hops_arg_vals = hops_arg->elems; + for (size_t m = 0; m < hops_arg_constr.datalen; m++) { + uint64_t hops_arg_conv_12 = hops_arg_vals[m]; + LDKBlindedHop hops_arg_conv_12_conv; + hops_arg_conv_12_conv.inner = untag_ptr(hops_arg_conv_12); + hops_arg_conv_12_conv.is_owned = ptr_is_owned(hops_arg_conv_12); + CHECK_INNER_FIELD_ACCESS_OR_NULL(hops_arg_conv_12_conv); + hops_arg_conv_12_conv = BlindedHop_clone(&hops_arg_conv_12_conv); + hops_arg_constr.data[m] = hops_arg_conv_12_conv; + } + FREE(hops_arg); + LDKPublicKey blinding_point_arg_ref; + CHECK(blinding_point_arg->arr_len == 33); + memcpy(blinding_point_arg_ref.compressed_form, blinding_point_arg->elems, 33); FREE(blinding_point_arg); + LDKBlindedTail ret_var = BlindedTail_new(hops_arg_constr, blinding_point_arg_ref, excess_final_cltv_expiry_delta_arg, 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; } -static inline uint64_t ChannelUpdateInfo_clone_ptr(LDKChannelUpdateInfo *NONNULL_PTR arg) { - LDKChannelUpdateInfo ret_var = ChannelUpdateInfo_clone(arg); +static inline uint64_t BlindedTail_clone_ptr(LDKBlindedTail *NONNULL_PTR arg) { + LDKBlindedTail ret_var = BlindedTail_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_ChannelUpdateInfo_clone_ptr"))) TS_ChannelUpdateInfo_clone_ptr(uint64_t arg) { - LDKChannelUpdateInfo arg_conv; +int64_t __attribute__((export_name("TS_BlindedTail_clone_ptr"))) TS_BlindedTail_clone_ptr(uint64_t arg) { + LDKBlindedTail 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 = ChannelUpdateInfo_clone_ptr(&arg_conv); + int64_t ret_conv = BlindedTail_clone_ptr(&arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_ChannelUpdateInfo_clone"))) TS_ChannelUpdateInfo_clone(uint64_t orig) { - LDKChannelUpdateInfo orig_conv; +uint64_t __attribute__((export_name("TS_BlindedTail_clone"))) TS_BlindedTail_clone(uint64_t orig) { + LDKBlindedTail 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; - LDKChannelUpdateInfo ret_var = ChannelUpdateInfo_clone(&orig_conv); + LDKBlindedTail ret_var = BlindedTail_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_ChannelUpdateInfo_eq"))) TS_ChannelUpdateInfo_eq(uint64_t a, uint64_t b) { - LDKChannelUpdateInfo a_conv; +int64_t __attribute__((export_name("TS_BlindedTail_hash"))) TS_BlindedTail_hash(uint64_t o) { + LDKBlindedTail 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 = BlindedTail_hash(&o_conv); + return ret_conv; +} + +jboolean __attribute__((export_name("TS_BlindedTail_eq"))) TS_BlindedTail_eq(uint64_t a, uint64_t b) { + LDKBlindedTail 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; + LDKBlindedTail 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); + jboolean ret_conv = BlindedTail_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; +int8_tArray __attribute__((export_name("TS_BlindedTail_write"))) TS_BlindedTail_write(uint64_t obj) { + LDKBlindedTail 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 = ChannelUpdateInfo_write(&obj_conv); + LDKCVec_u8Z ret_var = BlindedTail_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_ChannelUpdateInfo_read"))) TS_ChannelUpdateInfo_read(int8_tArray ser) { +uint64_t __attribute__((export_name("TS_BlindedTail_read"))) TS_BlindedTail_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; ser_ref.data = ser->elems; - LDKCResult_ChannelUpdateInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateInfoDecodeErrorZ), "LDKCResult_ChannelUpdateInfoDecodeErrorZ"); - *ret_conv = ChannelUpdateInfo_read(ser_ref); + LDKCResult_BlindedTailDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedTailDecodeErrorZ), "LDKCResult_BlindedTailDecodeErrorZ"); + *ret_conv = BlindedTail_read(ser_ref); FREE(ser); return tag_ptr(ret_conv, true); } -void __attribute__((export_name("TS_ChannelInfo_free"))) TS_ChannelInfo_free(uint64_t this_obj) { - LDKChannelInfo this_obj_conv; +void __attribute__((export_name("TS_Path_free"))) TS_Path_free(uint64_t this_obj) { + LDKPath 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); - ChannelInfo_free(this_obj_conv); + Path_free(this_obj_conv); } -uint64_t __attribute__((export_name("TS_ChannelInfo_get_features"))) TS_ChannelInfo_get_features(uint64_t this_ptr) { - LDKChannelInfo this_ptr_conv; +uint64_tArray __attribute__((export_name("TS_Path_get_hops"))) TS_Path_get_hops(uint64_t this_ptr) { + LDKPath 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; - LDKChannelFeatures ret_var = ChannelInfo_get_features(&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; + LDKCVec_RouteHopZ ret_var = Path_get_hops(&this_ptr_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 k = 0; k < ret_var.datalen; k++) { + LDKRouteHop ret_conv_10_var = ret_var.data[k]; + uint64_t ret_conv_10_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_10_var); + ret_conv_10_ref = tag_ptr(ret_conv_10_var.inner, ret_conv_10_var.is_owned); + ret_arr_ptr[k] = ret_conv_10_ref; + } + + FREE(ret_var.data); + return ret_arr; } -void __attribute__((export_name("TS_ChannelInfo_set_features"))) TS_ChannelInfo_set_features(uint64_t this_ptr, uint64_t val) { - LDKChannelInfo this_ptr_conv; +void __attribute__((export_name("TS_Path_set_hops"))) TS_Path_set_hops(uint64_t this_ptr, uint64_tArray val) { + LDKPath 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; - LDKChannelFeatures 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 = ChannelFeatures_clone(&val_conv); - ChannelInfo_set_features(&this_ptr_conv, val_conv); + LDKCVec_RouteHopZ val_constr; + val_constr.datalen = val->arr_len; + if (val_constr.datalen > 0) + val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements"); + else + val_constr.data = NULL; + uint64_t* val_vals = val->elems; + for (size_t k = 0; k < val_constr.datalen; k++) { + uint64_t val_conv_10 = val_vals[k]; + LDKRouteHop val_conv_10_conv; + val_conv_10_conv.inner = untag_ptr(val_conv_10); + val_conv_10_conv.is_owned = ptr_is_owned(val_conv_10); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_10_conv); + val_conv_10_conv = RouteHop_clone(&val_conv_10_conv); + val_constr.data[k] = val_conv_10_conv; + } + FREE(val); + Path_set_hops(&this_ptr_conv, val_constr); } -uint64_t __attribute__((export_name("TS_ChannelInfo_get_node_one"))) TS_ChannelInfo_get_node_one(uint64_t this_ptr) { - LDKChannelInfo this_ptr_conv; +uint64_t __attribute__((export_name("TS_Path_get_blinded_tail"))) TS_Path_get_blinded_tail(uint64_t this_ptr) { + LDKPath 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; - LDKNodeId ret_var = ChannelInfo_get_node_one(&this_ptr_conv); + LDKBlindedTail ret_var = Path_get_blinded_tail(&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_ChannelInfo_set_node_one"))) TS_ChannelInfo_set_node_one(uint64_t this_ptr, uint64_t val) { - LDKChannelInfo this_ptr_conv; +void __attribute__((export_name("TS_Path_set_blinded_tail"))) TS_Path_set_blinded_tail(uint64_t this_ptr, uint64_t val) { + LDKPath 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; - LDKNodeId val_conv; + LDKBlindedTail 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); - ChannelInfo_set_node_one(&this_ptr_conv, val_conv); + val_conv = BlindedTail_clone(&val_conv); + Path_set_blinded_tail(&this_ptr_conv, val_conv); } -uint64_t __attribute__((export_name("TS_ChannelInfo_get_one_to_two"))) TS_ChannelInfo_get_one_to_two(uint64_t this_ptr) { - LDKChannelInfo 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; - LDKChannelUpdateInfo ret_var = ChannelInfo_get_one_to_two(&this_ptr_conv); +uint64_t __attribute__((export_name("TS_Path_new"))) TS_Path_new(uint64_tArray hops_arg, uint64_t blinded_tail_arg) { + LDKCVec_RouteHopZ hops_arg_constr; + hops_arg_constr.datalen = hops_arg->arr_len; + if (hops_arg_constr.datalen > 0) + hops_arg_constr.data = MALLOC(hops_arg_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements"); + else + hops_arg_constr.data = NULL; + uint64_t* hops_arg_vals = hops_arg->elems; + for (size_t k = 0; k < hops_arg_constr.datalen; k++) { + uint64_t hops_arg_conv_10 = hops_arg_vals[k]; + LDKRouteHop hops_arg_conv_10_conv; + hops_arg_conv_10_conv.inner = untag_ptr(hops_arg_conv_10); + hops_arg_conv_10_conv.is_owned = ptr_is_owned(hops_arg_conv_10); + CHECK_INNER_FIELD_ACCESS_OR_NULL(hops_arg_conv_10_conv); + hops_arg_conv_10_conv = RouteHop_clone(&hops_arg_conv_10_conv); + hops_arg_constr.data[k] = hops_arg_conv_10_conv; + } + FREE(hops_arg); + LDKBlindedTail blinded_tail_arg_conv; + blinded_tail_arg_conv.inner = untag_ptr(blinded_tail_arg); + blinded_tail_arg_conv.is_owned = ptr_is_owned(blinded_tail_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(blinded_tail_arg_conv); + blinded_tail_arg_conv = BlindedTail_clone(&blinded_tail_arg_conv); + LDKPath ret_var = Path_new(hops_arg_constr, blinded_tail_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_ChannelInfo_set_one_to_two"))) TS_ChannelInfo_set_one_to_two(uint64_t this_ptr, uint64_t val) { - LDKChannelInfo 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; - LDKChannelUpdateInfo 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 = ChannelUpdateInfo_clone(&val_conv); - ChannelInfo_set_one_to_two(&this_ptr_conv, val_conv); -} - -uint64_t __attribute__((export_name("TS_ChannelInfo_get_node_two"))) TS_ChannelInfo_get_node_two(uint64_t this_ptr) { - LDKChannelInfo 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; - LDKNodeId ret_var = ChannelInfo_get_node_two(&this_ptr_conv); +static inline uint64_t Path_clone_ptr(LDKPath *NONNULL_PTR arg) { + LDKPath ret_var = Path_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; } - -void __attribute__((export_name("TS_ChannelInfo_set_node_two"))) TS_ChannelInfo_set_node_two(uint64_t this_ptr, uint64_t val) { - LDKChannelInfo 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; - 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); - ChannelInfo_set_node_two(&this_ptr_conv, val_conv); +int64_t __attribute__((export_name("TS_Path_clone_ptr"))) TS_Path_clone_ptr(uint64_t arg) { + LDKPath 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 = Path_clone_ptr(&arg_conv); + return ret_conv; } -uint64_t __attribute__((export_name("TS_ChannelInfo_get_two_to_one"))) TS_ChannelInfo_get_two_to_one(uint64_t this_ptr) { - LDKChannelInfo 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; - LDKChannelUpdateInfo ret_var = ChannelInfo_get_two_to_one(&this_ptr_conv); +uint64_t __attribute__((export_name("TS_Path_clone"))) TS_Path_clone(uint64_t orig) { + LDKPath 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; + LDKPath ret_var = Path_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_ChannelInfo_set_two_to_one"))) TS_ChannelInfo_set_two_to_one(uint64_t this_ptr, uint64_t val) { - LDKChannelInfo 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; - LDKChannelUpdateInfo 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 = ChannelUpdateInfo_clone(&val_conv); - ChannelInfo_set_two_to_one(&this_ptr_conv, val_conv); +int64_t __attribute__((export_name("TS_Path_hash"))) TS_Path_hash(uint64_t o) { + LDKPath 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 = Path_hash(&o_conv); + return ret_conv; } -uint64_t __attribute__((export_name("TS_ChannelInfo_get_capacity_sats"))) TS_ChannelInfo_get_capacity_sats(uint64_t this_ptr) { - LDKChannelInfo this_ptr_conv; +jboolean __attribute__((export_name("TS_Path_eq"))) TS_Path_eq(uint64_t a, uint64_t b) { + LDKPath 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; + LDKPath 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 = Path_eq(&a_conv, &b_conv); + return ret_conv; +} + +int64_t __attribute__((export_name("TS_Path_fee_msat"))) TS_Path_fee_msat(uint64_t this_arg) { + LDKPath 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 = Path_fee_msat(&this_arg_conv); + return ret_conv; +} + +int64_t __attribute__((export_name("TS_Path_final_value_msat"))) TS_Path_final_value_msat(uint64_t this_arg) { + LDKPath 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 = Path_final_value_msat(&this_arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_Path_final_cltv_expiry_delta"))) TS_Path_final_cltv_expiry_delta(uint64_t this_arg) { + LDKPath 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; + LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); + *ret_copy = Path_final_cltv_expiry_delta(&this_arg_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void __attribute__((export_name("TS_Route_free"))) TS_Route_free(uint64_t this_obj) { + LDKRoute 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); + Route_free(this_obj_conv); +} + +uint64_tArray __attribute__((export_name("TS_Route_get_paths"))) TS_Route_get_paths(uint64_t this_ptr) { + LDKRoute 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_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = ChannelInfo_get_capacity_sats(&this_ptr_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + LDKCVec_PathZ ret_var = Route_get_paths(&this_ptr_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 g = 0; g < ret_var.datalen; g++) { + LDKPath ret_conv_6_var = ret_var.data[g]; + uint64_t ret_conv_6_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_6_var); + ret_conv_6_ref = tag_ptr(ret_conv_6_var.inner, ret_conv_6_var.is_owned); + ret_arr_ptr[g] = ret_conv_6_ref; + } + + FREE(ret_var.data); + return ret_arr; } -void __attribute__((export_name("TS_ChannelInfo_set_capacity_sats"))) TS_ChannelInfo_set_capacity_sats(uint64_t this_ptr, uint64_t val) { - LDKChannelInfo this_ptr_conv; +void __attribute__((export_name("TS_Route_set_paths"))) TS_Route_set_paths(uint64_t this_ptr, uint64_tArray val) { + LDKRoute 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_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); - val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); - ChannelInfo_set_capacity_sats(&this_ptr_conv, val_conv); + LDKCVec_PathZ val_constr; + val_constr.datalen = val->arr_len; + if (val_constr.datalen > 0) + val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKPath), "LDKCVec_PathZ Elements"); + else + val_constr.data = NULL; + uint64_t* val_vals = val->elems; + for (size_t g = 0; g < val_constr.datalen; g++) { + uint64_t val_conv_6 = val_vals[g]; + LDKPath val_conv_6_conv; + val_conv_6_conv.inner = untag_ptr(val_conv_6); + val_conv_6_conv.is_owned = ptr_is_owned(val_conv_6); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_6_conv); + val_conv_6_conv = Path_clone(&val_conv_6_conv); + val_constr.data[g] = val_conv_6_conv; + } + FREE(val); + Route_set_paths(&this_ptr_conv, val_constr); } -uint64_t __attribute__((export_name("TS_ChannelInfo_get_announcement_message"))) TS_ChannelInfo_get_announcement_message(uint64_t this_ptr) { - LDKChannelInfo this_ptr_conv; +uint64_t __attribute__((export_name("TS_Route_get_payment_params"))) TS_Route_get_payment_params(uint64_t this_ptr) { + LDKRoute 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; - LDKChannelAnnouncement ret_var = ChannelInfo_get_announcement_message(&this_ptr_conv); + LDKPaymentParameters ret_var = Route_get_payment_params(&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_ChannelInfo_set_announcement_message"))) TS_ChannelInfo_set_announcement_message(uint64_t this_ptr, uint64_t val) { - LDKChannelInfo this_ptr_conv; +void __attribute__((export_name("TS_Route_set_payment_params"))) TS_Route_set_payment_params(uint64_t this_ptr, uint64_t val) { + LDKRoute 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; - LDKChannelAnnouncement val_conv; + LDKPaymentParameters 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 = ChannelAnnouncement_clone(&val_conv); - ChannelInfo_set_announcement_message(&this_ptr_conv, val_conv); + val_conv = PaymentParameters_clone(&val_conv); + Route_set_payment_params(&this_ptr_conv, val_conv); } -static inline uint64_t ChannelInfo_clone_ptr(LDKChannelInfo *NONNULL_PTR arg) { - LDKChannelInfo ret_var = ChannelInfo_clone(arg); +uint64_t __attribute__((export_name("TS_Route_new"))) TS_Route_new(uint64_tArray paths_arg, uint64_t payment_params_arg) { + LDKCVec_PathZ paths_arg_constr; + paths_arg_constr.datalen = paths_arg->arr_len; + if (paths_arg_constr.datalen > 0) + paths_arg_constr.data = MALLOC(paths_arg_constr.datalen * sizeof(LDKPath), "LDKCVec_PathZ Elements"); + else + paths_arg_constr.data = NULL; + uint64_t* paths_arg_vals = paths_arg->elems; + for (size_t g = 0; g < paths_arg_constr.datalen; g++) { + uint64_t paths_arg_conv_6 = paths_arg_vals[g]; + LDKPath paths_arg_conv_6_conv; + paths_arg_conv_6_conv.inner = untag_ptr(paths_arg_conv_6); + paths_arg_conv_6_conv.is_owned = ptr_is_owned(paths_arg_conv_6); + CHECK_INNER_FIELD_ACCESS_OR_NULL(paths_arg_conv_6_conv); + paths_arg_conv_6_conv = Path_clone(&paths_arg_conv_6_conv); + paths_arg_constr.data[g] = paths_arg_conv_6_conv; + } + FREE(paths_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); + LDKRoute ret_var = Route_new(paths_arg_constr, payment_params_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_ChannelInfo_clone_ptr"))) TS_ChannelInfo_clone_ptr(uint64_t arg) { - LDKChannelInfo arg_conv; + +static inline uint64_t Route_clone_ptr(LDKRoute *NONNULL_PTR arg) { + LDKRoute ret_var = Route_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_Route_clone_ptr"))) TS_Route_clone_ptr(uint64_t arg) { + LDKRoute 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 = ChannelInfo_clone_ptr(&arg_conv); + int64_t ret_conv = Route_clone_ptr(&arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_ChannelInfo_clone"))) TS_ChannelInfo_clone(uint64_t orig) { - LDKChannelInfo orig_conv; +uint64_t __attribute__((export_name("TS_Route_clone"))) TS_Route_clone(uint64_t orig) { + LDKRoute 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; - LDKChannelInfo ret_var = ChannelInfo_clone(&orig_conv); + LDKRoute ret_var = Route_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_ChannelInfo_eq"))) TS_ChannelInfo_eq(uint64_t a, uint64_t b) { - LDKChannelInfo a_conv; +int64_t __attribute__((export_name("TS_Route_hash"))) TS_Route_hash(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.is_owned = false; + int64_t ret_conv = Route_hash(&o_conv); + return ret_conv; +} + +jboolean __attribute__((export_name("TS_Route_eq"))) TS_Route_eq(uint64_t a, uint64_t b) { + LDKRoute 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; + LDKRoute 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); + jboolean ret_conv = Route_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; +int64_t __attribute__((export_name("TS_Route_get_total_fees"))) TS_Route_get_total_fees(uint64_t this_arg) { + LDKRoute 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 = ChannelInfo_get_directional_info(&this_arg_conv, channel_flags); - 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 ret_conv = Route_get_total_fees(&this_arg_conv); + return ret_conv; } -int8_tArray __attribute__((export_name("TS_ChannelInfo_write"))) TS_ChannelInfo_write(uint64_t obj) { - LDKChannelInfo obj_conv; +int64_t __attribute__((export_name("TS_Route_get_total_amount"))) TS_Route_get_total_amount(uint64_t this_arg) { + LDKRoute 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 = Route_get_total_amount(&this_arg_conv); + return ret_conv; +} + +int8_tArray __attribute__((export_name("TS_Route_write"))) TS_Route_write(uint64_t obj) { + LDKRoute 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 = ChannelInfo_write(&obj_conv); + LDKCVec_u8Z ret_var = Route_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_ChannelInfo_read"))) TS_ChannelInfo_read(int8_tArray ser) { +uint64_t __attribute__((export_name("TS_Route_read"))) TS_Route_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; ser_ref.data = ser->elems; - LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ"); - *ret_conv = ChannelInfo_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); -} - -void __attribute__((export_name("TS_DirectedChannelInfo_free"))) TS_DirectedChannelInfo_free(uint64_t this_obj) { - LDKDirectedChannelInfo 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); - DirectedChannelInfo_free(this_obj_conv); -} - -static inline uint64_t DirectedChannelInfo_clone_ptr(LDKDirectedChannelInfo *NONNULL_PTR arg) { - LDKDirectedChannelInfo ret_var = DirectedChannelInfo_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_DirectedChannelInfo_clone_ptr"))) TS_DirectedChannelInfo_clone_ptr(uint64_t arg) { - LDKDirectedChannelInfo 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 = DirectedChannelInfo_clone_ptr(&arg_conv); - return ret_conv; -} - -uint64_t __attribute__((export_name("TS_DirectedChannelInfo_clone"))) TS_DirectedChannelInfo_clone(uint64_t orig) { - LDKDirectedChannelInfo 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; - LDKDirectedChannelInfo ret_var = DirectedChannelInfo_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_DirectedChannelInfo_channel"))) TS_DirectedChannelInfo_channel(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; - LDKChannelInfo ret_var = DirectedChannelInfo_channel(&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); - 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 = DirectedChannelInfo_htlc_maximum_msat(&this_arg_conv); - return ret_conv; -} - -uint64_t __attribute__((export_name("TS_DirectedChannelInfo_effective_capacity"))) TS_DirectedChannelInfo_effective_capacity(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; - LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); - *ret_copy = DirectedChannelInfo_effective_capacity(&this_arg_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -void __attribute__((export_name("TS_EffectiveCapacity_free"))) TS_EffectiveCapacity_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); - LDKEffectiveCapacity this_ptr_conv = *(LDKEffectiveCapacity*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - EffectiveCapacity_free(this_ptr_conv); -} - -static inline uint64_t EffectiveCapacity_clone_ptr(LDKEffectiveCapacity *NONNULL_PTR arg) { - LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); - *ret_copy = EffectiveCapacity_clone(arg); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} -int64_t __attribute__((export_name("TS_EffectiveCapacity_clone_ptr"))) TS_EffectiveCapacity_clone_ptr(uint64_t arg) { - LDKEffectiveCapacity* arg_conv = (LDKEffectiveCapacity*)untag_ptr(arg); - int64_t ret_conv = EffectiveCapacity_clone_ptr(arg_conv); - return ret_conv; -} - -uint64_t __attribute__((export_name("TS_EffectiveCapacity_clone"))) TS_EffectiveCapacity_clone(uint64_t orig) { - LDKEffectiveCapacity* orig_conv = (LDKEffectiveCapacity*)untag_ptr(orig); - LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); - *ret_copy = EffectiveCapacity_clone(orig_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -uint64_t __attribute__((export_name("TS_EffectiveCapacity_exact_liquidity"))) TS_EffectiveCapacity_exact_liquidity(int64_t liquidity_msat) { - LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); - *ret_copy = EffectiveCapacity_exact_liquidity(liquidity_msat); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -uint64_t __attribute__((export_name("TS_EffectiveCapacity_maximum_htlc"))) TS_EffectiveCapacity_maximum_htlc(int64_t amount_msat) { - LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); - *ret_copy = EffectiveCapacity_maximum_htlc(amount_msat); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -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); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -uint64_t __attribute__((export_name("TS_EffectiveCapacity_infinite"))) TS_EffectiveCapacity_infinite() { - LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); - *ret_copy = EffectiveCapacity_infinite(); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -uint64_t __attribute__((export_name("TS_EffectiveCapacity_unknown"))) TS_EffectiveCapacity_unknown() { - LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); - *ret_copy = EffectiveCapacity_unknown(); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -int64_t __attribute__((export_name("TS_EffectiveCapacity_as_msat"))) TS_EffectiveCapacity_as_msat(uint64_t this_arg) { - LDKEffectiveCapacity* this_arg_conv = (LDKEffectiveCapacity*)untag_ptr(this_arg); - int64_t ret_conv = EffectiveCapacity_as_msat(this_arg_conv); - return ret_conv; + LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ"); + *ret_conv = Route_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -void __attribute__((export_name("TS_RoutingFees_free"))) TS_RoutingFees_free(uint64_t this_obj) { - LDKRoutingFees this_obj_conv; +void __attribute__((export_name("TS_RouteParameters_free"))) TS_RouteParameters_free(uint64_t this_obj) { + LDKRouteParameters 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); - RoutingFees_free(this_obj_conv); + RouteParameters_free(this_obj_conv); } -int32_t __attribute__((export_name("TS_RoutingFees_get_base_msat"))) TS_RoutingFees_get_base_msat(uint64_t this_ptr) { - LDKRoutingFees this_ptr_conv; +uint64_t __attribute__((export_name("TS_RouteParameters_get_payment_params"))) TS_RouteParameters_get_payment_params(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 = RoutingFees_get_base_msat(&this_ptr_conv); - return ret_conv; + LDKPaymentParameters ret_var = RouteParameters_get_payment_params(&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_RoutingFees_set_base_msat"))) TS_RoutingFees_set_base_msat(uint64_t this_ptr, int32_t val) { - LDKRoutingFees this_ptr_conv; +void __attribute__((export_name("TS_RouteParameters_set_payment_params"))) TS_RouteParameters_set_payment_params(uint64_t this_ptr, uint64_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; - RoutingFees_set_base_msat(&this_ptr_conv, val); + LDKPaymentParameters 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 = PaymentParameters_clone(&val_conv); + RouteParameters_set_payment_params(&this_ptr_conv, val_conv); } -int32_t __attribute__((export_name("TS_RoutingFees_get_proportional_millionths"))) TS_RoutingFees_get_proportional_millionths(uint64_t this_ptr) { - LDKRoutingFees this_ptr_conv; +int64_t __attribute__((export_name("TS_RouteParameters_get_final_value_msat"))) TS_RouteParameters_get_final_value_msat(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 = RoutingFees_get_proportional_millionths(&this_ptr_conv); + int64_t ret_conv = RouteParameters_get_final_value_msat(&this_ptr_conv); return ret_conv; } -void __attribute__((export_name("TS_RoutingFees_set_proportional_millionths"))) TS_RoutingFees_set_proportional_millionths(uint64_t this_ptr, int32_t val) { - LDKRoutingFees this_ptr_conv; +void __attribute__((export_name("TS_RouteParameters_set_final_value_msat"))) TS_RouteParameters_set_final_value_msat(uint64_t this_ptr, int64_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; - RoutingFees_set_proportional_millionths(&this_ptr_conv, val); + RouteParameters_set_final_value_msat(&this_ptr_conv, val); } -uint64_t __attribute__((export_name("TS_RoutingFees_new"))) TS_RoutingFees_new(int32_t base_msat_arg, int32_t proportional_millionths_arg) { - LDKRoutingFees ret_var = RoutingFees_new(base_msat_arg, proportional_millionths_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); 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_RoutingFees_eq"))) TS_RoutingFees_eq(uint64_t a, uint64_t b) { - LDKRoutingFees 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; - LDKRoutingFees 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 = RoutingFees_eq(&a_conv, &b_conv); - return ret_conv; -} - -static inline uint64_t RoutingFees_clone_ptr(LDKRoutingFees *NONNULL_PTR arg) { - LDKRoutingFees ret_var = RoutingFees_clone(arg); +static inline uint64_t RouteParameters_clone_ptr(LDKRouteParameters *NONNULL_PTR arg) { + LDKRouteParameters ret_var = RouteParameters_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_RoutingFees_clone_ptr"))) TS_RoutingFees_clone_ptr(uint64_t arg) { - LDKRoutingFees arg_conv; +int64_t __attribute__((export_name("TS_RouteParameters_clone_ptr"))) TS_RouteParameters_clone_ptr(uint64_t arg) { + LDKRouteParameters 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 = RoutingFees_clone_ptr(&arg_conv); + int64_t ret_conv = RouteParameters_clone_ptr(&arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_RoutingFees_clone"))) TS_RoutingFees_clone(uint64_t orig) { - LDKRoutingFees orig_conv; +uint64_t __attribute__((export_name("TS_RouteParameters_clone"))) TS_RouteParameters_clone(uint64_t orig) { + LDKRouteParameters 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; - LDKRoutingFees ret_var = RoutingFees_clone(&orig_conv); + LDKRouteParameters ret_var = RouteParameters_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_RoutingFees_hash"))) TS_RoutingFees_hash(uint64_t o) { - LDKRoutingFees 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 = RoutingFees_hash(&o_conv); +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_RoutingFees_write"))) TS_RoutingFees_write(uint64_t obj) { - LDKRoutingFees obj_conv; +int8_tArray __attribute__((export_name("TS_RouteParameters_write"))) TS_RouteParameters_write(uint64_t obj) { + LDKRouteParameters 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 = RoutingFees_write(&obj_conv); + LDKCVec_u8Z ret_var = RouteParameters_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_RoutingFees_read"))) TS_RoutingFees_read(int8_tArray ser) { +uint64_t __attribute__((export_name("TS_RouteParameters_read"))) TS_RouteParameters_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; ser_ref.data = ser->elems; - LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ"); - *ret_conv = RoutingFees_read(ser_ref); + LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ"); + *ret_conv = RouteParameters_read(ser_ref); FREE(ser); return tag_ptr(ret_conv, true); } -void __attribute__((export_name("TS_NodeAnnouncementInfo_free"))) TS_NodeAnnouncementInfo_free(uint64_t this_obj) { - LDKNodeAnnouncementInfo this_obj_conv; +void __attribute__((export_name("TS_PaymentParameters_free"))) TS_PaymentParameters_free(uint64_t this_obj) { + LDKPaymentParameters 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); - NodeAnnouncementInfo_free(this_obj_conv); + PaymentParameters_free(this_obj_conv); } -uint64_t __attribute__((export_name("TS_NodeAnnouncementInfo_get_features"))) TS_NodeAnnouncementInfo_get_features(uint64_t this_ptr) { - LDKNodeAnnouncementInfo this_ptr_conv; +int8_tArray __attribute__((export_name("TS_PaymentParameters_get_payee_pubkey"))) TS_PaymentParameters_get_payee_pubkey(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; - LDKNodeFeatures ret_var = NodeAnnouncementInfo_get_features(&this_ptr_conv); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, PaymentParameters_get_payee_pubkey(&this_ptr_conv).compressed_form, 33); + return ret_arr; +} + +void __attribute__((export_name("TS_PaymentParameters_set_payee_pubkey"))) TS_PaymentParameters_set_payee_pubkey(uint64_t this_ptr, int8_tArray 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; + LDKPublicKey val_ref; + CHECK(val->arr_len == 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); + PaymentParameters_set_payee_pubkey(&this_ptr_conv, val_ref); +} + +uint64_t __attribute__((export_name("TS_PaymentParameters_get_features"))) TS_PaymentParameters_get_features(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; + LDKInvoiceFeatures ret_var = PaymentParameters_get_features(&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_NodeAnnouncementInfo_set_features"))) TS_NodeAnnouncementInfo_set_features(uint64_t this_ptr, uint64_t val) { - LDKNodeAnnouncementInfo this_ptr_conv; +void __attribute__((export_name("TS_PaymentParameters_set_features"))) TS_PaymentParameters_set_features(uint64_t this_ptr, uint64_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; - LDKNodeFeatures val_conv; + LDKInvoiceFeatures 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 = NodeFeatures_clone(&val_conv); - NodeAnnouncementInfo_set_features(&this_ptr_conv, val_conv); + val_conv = InvoiceFeatures_clone(&val_conv); + PaymentParameters_set_features(&this_ptr_conv, val_conv); } -int32_t __attribute__((export_name("TS_NodeAnnouncementInfo_get_last_update"))) TS_NodeAnnouncementInfo_get_last_update(uint64_t this_ptr) { - LDKNodeAnnouncementInfo this_ptr_conv; +uint64_t __attribute__((export_name("TS_PaymentParameters_get_route_hints"))) TS_PaymentParameters_get_route_hints(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 = NodeAnnouncementInfo_get_last_update(&this_ptr_conv); + LDKHints *ret_copy = MALLOC(sizeof(LDKHints), "LDKHints"); + *ret_copy = PaymentParameters_get_route_hints(&this_ptr_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void __attribute__((export_name("TS_PaymentParameters_set_route_hints"))) TS_PaymentParameters_set_route_hints(uint64_t this_ptr, uint64_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; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKHints val_conv = *(LDKHints*)(val_ptr); + val_conv = Hints_clone((LDKHints*)untag_ptr(val)); + PaymentParameters_set_route_hints(&this_ptr_conv, val_conv); +} + +uint64_t __attribute__((export_name("TS_PaymentParameters_get_expiry_time"))) TS_PaymentParameters_get_expiry_time(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; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = PaymentParameters_get_expiry_time(&this_ptr_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void __attribute__((export_name("TS_PaymentParameters_set_expiry_time"))) TS_PaymentParameters_set_expiry_time(uint64_t this_ptr, uint64_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; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); + PaymentParameters_set_expiry_time(&this_ptr_conv, val_conv); +} + +int32_t __attribute__((export_name("TS_PaymentParameters_get_max_total_cltv_expiry_delta"))) TS_PaymentParameters_get_max_total_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_max_total_cltv_expiry_delta(&this_ptr_conv); return ret_conv; } -void __attribute__((export_name("TS_NodeAnnouncementInfo_set_last_update"))) TS_NodeAnnouncementInfo_set_last_update(uint64_t this_ptr, int32_t val) { - LDKNodeAnnouncementInfo this_ptr_conv; +void __attribute__((export_name("TS_PaymentParameters_set_max_total_cltv_expiry_delta"))) TS_PaymentParameters_set_max_total_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; - NodeAnnouncementInfo_set_last_update(&this_ptr_conv, val); + PaymentParameters_set_max_total_cltv_expiry_delta(&this_ptr_conv, val); } -int8_tArray __attribute__((export_name("TS_NodeAnnouncementInfo_get_rgb"))) TS_NodeAnnouncementInfo_get_rgb(uint64_t this_ptr) { - LDKNodeAnnouncementInfo this_ptr_conv; +int8_t __attribute__((export_name("TS_PaymentParameters_get_max_path_count"))) TS_PaymentParameters_get_max_path_count(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; - int8_tArray ret_arr = init_int8_tArray(3, __LINE__); - memcpy(ret_arr->elems, *NodeAnnouncementInfo_get_rgb(&this_ptr_conv), 3); - return ret_arr; + int8_t ret_conv = PaymentParameters_get_max_path_count(&this_ptr_conv); + return ret_conv; } -void __attribute__((export_name("TS_NodeAnnouncementInfo_set_rgb"))) TS_NodeAnnouncementInfo_set_rgb(uint64_t this_ptr, int8_tArray val) { - LDKNodeAnnouncementInfo this_ptr_conv; +void __attribute__((export_name("TS_PaymentParameters_set_max_path_count"))) TS_PaymentParameters_set_max_path_count(uint64_t this_ptr, int8_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; - LDKThreeBytes val_ref; - CHECK(val->arr_len == 3); - memcpy(val_ref.data, val->elems, 3); FREE(val); - NodeAnnouncementInfo_set_rgb(&this_ptr_conv, val_ref); + PaymentParameters_set_max_path_count(&this_ptr_conv, val); } -uint64_t __attribute__((export_name("TS_NodeAnnouncementInfo_get_alias"))) TS_NodeAnnouncementInfo_get_alias(uint64_t this_ptr) { - LDKNodeAnnouncementInfo this_ptr_conv; +int8_t __attribute__((export_name("TS_PaymentParameters_get_max_channel_saturation_power_of_half"))) TS_PaymentParameters_get_max_channel_saturation_power_of_half(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; - LDKNodeAlias ret_var = NodeAnnouncementInfo_get_alias(&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; + int8_t ret_conv = PaymentParameters_get_max_channel_saturation_power_of_half(&this_ptr_conv); + return ret_conv; } -void __attribute__((export_name("TS_NodeAnnouncementInfo_set_alias"))) TS_NodeAnnouncementInfo_set_alias(uint64_t this_ptr, uint64_t val) { - LDKNodeAnnouncementInfo this_ptr_conv; +void __attribute__((export_name("TS_PaymentParameters_set_max_channel_saturation_power_of_half"))) TS_PaymentParameters_set_max_channel_saturation_power_of_half(uint64_t this_ptr, int8_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; - LDKNodeAlias 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 = NodeAlias_clone(&val_conv); - NodeAnnouncementInfo_set_alias(&this_ptr_conv, val_conv); + PaymentParameters_set_max_channel_saturation_power_of_half(&this_ptr_conv, val); } -uint64_tArray __attribute__((export_name("TS_NodeAnnouncementInfo_get_addresses"))) TS_NodeAnnouncementInfo_get_addresses(uint64_t this_ptr) { - LDKNodeAnnouncementInfo this_ptr_conv; +int64_tArray __attribute__((export_name("TS_PaymentParameters_get_previously_failed_channels"))) TS_PaymentParameters_get_previously_failed_channels(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; - LDKCVec_NetAddressZ ret_var = NodeAnnouncementInfo_get_addresses(&this_ptr_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 m = 0; m < ret_var.datalen; m++) { - LDKNetAddress *ret_conv_12_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress"); - *ret_conv_12_copy = ret_var.data[m]; - uint64_t ret_conv_12_ref = tag_ptr(ret_conv_12_copy, true); - ret_arr_ptr[m] = ret_conv_12_ref; + LDKCVec_u64Z ret_var = PaymentParameters_get_previously_failed_channels(&this_ptr_conv); + int64_tArray ret_arr = NULL; + ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); + int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); + for (size_t i = 0; i < ret_var.datalen; i++) { + int64_t ret_conv_8_conv = ret_var.data[i]; + ret_arr_ptr[i] = ret_conv_8_conv; } FREE(ret_var.data); return ret_arr; } -void __attribute__((export_name("TS_NodeAnnouncementInfo_set_addresses"))) TS_NodeAnnouncementInfo_set_addresses(uint64_t this_ptr, uint64_tArray val) { - LDKNodeAnnouncementInfo this_ptr_conv; +void __attribute__((export_name("TS_PaymentParameters_set_previously_failed_channels"))) TS_PaymentParameters_set_previously_failed_channels(uint64_t this_ptr, int64_tArray 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; - LDKCVec_NetAddressZ val_constr; + LDKCVec_u64Z val_constr; val_constr.datalen = val->arr_len; if (val_constr.datalen > 0) - val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements"); + val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); else val_constr.data = NULL; - uint64_t* val_vals = val->elems; - for (size_t m = 0; m < val_constr.datalen; m++) { - uint64_t val_conv_12 = val_vals[m]; - void* val_conv_12_ptr = untag_ptr(val_conv_12); - CHECK_ACCESS(val_conv_12_ptr); - LDKNetAddress val_conv_12_conv = *(LDKNetAddress*)(val_conv_12_ptr); - val_conv_12_conv = NetAddress_clone((LDKNetAddress*)untag_ptr(val_conv_12)); - val_constr.data[m] = val_conv_12_conv; + int64_t* val_vals = val->elems; + for (size_t i = 0; i < val_constr.datalen; i++) { + int64_t val_conv_8 = val_vals[i]; + val_constr.data[i] = val_conv_8; } FREE(val); - NodeAnnouncementInfo_set_addresses(&this_ptr_conv, val_constr); + PaymentParameters_set_previously_failed_channels(&this_ptr_conv, val_constr); } -uint64_t __attribute__((export_name("TS_NodeAnnouncementInfo_get_announcement_message"))) TS_NodeAnnouncementInfo_get_announcement_message(uint64_t this_ptr) { - LDKNodeAnnouncementInfo this_ptr_conv; +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; - LDKNodeAnnouncement ret_var = NodeAnnouncementInfo_get_announcement_message(&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; + int32_t ret_conv = PaymentParameters_get_final_cltv_expiry_delta(&this_ptr_conv); + return ret_conv; } -void __attribute__((export_name("TS_NodeAnnouncementInfo_set_announcement_message"))) TS_NodeAnnouncementInfo_set_announcement_message(uint64_t this_ptr, uint64_t val) { - LDKNodeAnnouncementInfo this_ptr_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; - LDKNodeAnnouncement 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 = NodeAnnouncement_clone(&val_conv); - NodeAnnouncementInfo_set_announcement_message(&this_ptr_conv, val_conv); + PaymentParameters_set_final_cltv_expiry_delta(&this_ptr_conv, val); } -uint64_t __attribute__((export_name("TS_NodeAnnouncementInfo_new"))) TS_NodeAnnouncementInfo_new(uint64_t features_arg, int32_t last_update_arg, int8_tArray rgb_arg, uint64_t alias_arg, uint64_tArray addresses_arg, uint64_t announcement_message_arg) { - LDKNodeFeatures features_arg_conv; +uint64_t __attribute__((export_name("TS_PaymentParameters_new"))) TS_PaymentParameters_new(int8_tArray payee_pubkey_arg, uint64_t features_arg, uint64_t 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); + LDKInvoiceFeatures features_arg_conv; features_arg_conv.inner = untag_ptr(features_arg); features_arg_conv.is_owned = ptr_is_owned(features_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv); - features_arg_conv = NodeFeatures_clone(&features_arg_conv); - LDKThreeBytes rgb_arg_ref; - CHECK(rgb_arg->arr_len == 3); - memcpy(rgb_arg_ref.data, rgb_arg->elems, 3); FREE(rgb_arg); - LDKNodeAlias alias_arg_conv; - alias_arg_conv.inner = untag_ptr(alias_arg); - alias_arg_conv.is_owned = ptr_is_owned(alias_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(alias_arg_conv); - alias_arg_conv = NodeAlias_clone(&alias_arg_conv); - LDKCVec_NetAddressZ addresses_arg_constr; - addresses_arg_constr.datalen = addresses_arg->arr_len; - if (addresses_arg_constr.datalen > 0) - addresses_arg_constr.data = MALLOC(addresses_arg_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements"); + features_arg_conv = InvoiceFeatures_clone(&features_arg_conv); + void* route_hints_arg_ptr = untag_ptr(route_hints_arg); + CHECK_ACCESS(route_hints_arg_ptr); + LDKHints route_hints_arg_conv = *(LDKHints*)(route_hints_arg_ptr); + route_hints_arg_conv = Hints_clone((LDKHints*)untag_ptr(route_hints_arg)); + void* expiry_time_arg_ptr = untag_ptr(expiry_time_arg); + CHECK_ACCESS(expiry_time_arg_ptr); + LDKCOption_u64Z expiry_time_arg_conv = *(LDKCOption_u64Z*)(expiry_time_arg_ptr); + expiry_time_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(expiry_time_arg)); + LDKCVec_u64Z previously_failed_channels_arg_constr; + previously_failed_channels_arg_constr.datalen = previously_failed_channels_arg->arr_len; + if (previously_failed_channels_arg_constr.datalen > 0) + previously_failed_channels_arg_constr.data = MALLOC(previously_failed_channels_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); else - addresses_arg_constr.data = NULL; - uint64_t* addresses_arg_vals = addresses_arg->elems; - for (size_t m = 0; m < addresses_arg_constr.datalen; m++) { - uint64_t addresses_arg_conv_12 = addresses_arg_vals[m]; - void* addresses_arg_conv_12_ptr = untag_ptr(addresses_arg_conv_12); - CHECK_ACCESS(addresses_arg_conv_12_ptr); - LDKNetAddress addresses_arg_conv_12_conv = *(LDKNetAddress*)(addresses_arg_conv_12_ptr); - addresses_arg_constr.data[m] = addresses_arg_conv_12_conv; - } - FREE(addresses_arg); - LDKNodeAnnouncement announcement_message_arg_conv; - announcement_message_arg_conv.inner = untag_ptr(announcement_message_arg); - announcement_message_arg_conv.is_owned = ptr_is_owned(announcement_message_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(announcement_message_arg_conv); - announcement_message_arg_conv = NodeAnnouncement_clone(&announcement_message_arg_conv); - LDKNodeAnnouncementInfo ret_var = NodeAnnouncementInfo_new(features_arg_conv, last_update_arg, rgb_arg_ref, alias_arg_conv, addresses_arg_constr, announcement_message_arg_conv); + previously_failed_channels_arg_constr.data = NULL; + int64_t* previously_failed_channels_arg_vals = previously_failed_channels_arg->elems; + for (size_t i = 0; i < previously_failed_channels_arg_constr.datalen; i++) { + int64_t previously_failed_channels_arg_conv_8 = previously_failed_channels_arg_vals[i]; + 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_conv, 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_ref; } -static inline uint64_t NodeAnnouncementInfo_clone_ptr(LDKNodeAnnouncementInfo *NONNULL_PTR arg) { - LDKNodeAnnouncementInfo ret_var = NodeAnnouncementInfo_clone(arg); +static inline uint64_t PaymentParameters_clone_ptr(LDKPaymentParameters *NONNULL_PTR arg) { + LDKPaymentParameters ret_var = PaymentParameters_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_NodeAnnouncementInfo_clone_ptr"))) TS_NodeAnnouncementInfo_clone_ptr(uint64_t arg) { - LDKNodeAnnouncementInfo arg_conv; +int64_t __attribute__((export_name("TS_PaymentParameters_clone_ptr"))) TS_PaymentParameters_clone_ptr(uint64_t arg) { + LDKPaymentParameters 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 = NodeAnnouncementInfo_clone_ptr(&arg_conv); + int64_t ret_conv = PaymentParameters_clone_ptr(&arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_NodeAnnouncementInfo_clone"))) TS_NodeAnnouncementInfo_clone(uint64_t orig) { - LDKNodeAnnouncementInfo orig_conv; +uint64_t __attribute__((export_name("TS_PaymentParameters_clone"))) TS_PaymentParameters_clone(uint64_t orig) { + LDKPaymentParameters 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; - LDKNodeAnnouncementInfo ret_var = NodeAnnouncementInfo_clone(&orig_conv); + LDKPaymentParameters ret_var = PaymentParameters_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_NodeAnnouncementInfo_eq"))) TS_NodeAnnouncementInfo_eq(uint64_t a, uint64_t b) { - LDKNodeAnnouncementInfo a_conv; +int64_t __attribute__((export_name("TS_PaymentParameters_hash"))) TS_PaymentParameters_hash(uint64_t o) { + LDKPaymentParameters 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 = PaymentParameters_hash(&o_conv); + return ret_conv; +} + +jboolean __attribute__((export_name("TS_PaymentParameters_eq"))) TS_PaymentParameters_eq(uint64_t a, uint64_t b) { + LDKPaymentParameters 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; + LDKPaymentParameters 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); + jboolean ret_conv = PaymentParameters_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; +int8_tArray __attribute__((export_name("TS_PaymentParameters_write"))) TS_PaymentParameters_write(uint64_t obj) { + LDKPaymentParameters 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 = NodeAnnouncementInfo_write(&obj_conv); + LDKCVec_u8Z ret_var = PaymentParameters_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_NodeAnnouncementInfo_read"))) TS_NodeAnnouncementInfo_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_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ"); - *ret_conv = NodeAnnouncementInfo_read(ser_ref); + LDKCResult_PaymentParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentParametersDecodeErrorZ), "LDKCResult_PaymentParametersDecodeErrorZ"); + *ret_conv = PaymentParameters_read(ser_ref, arg); FREE(ser); return tag_ptr(ret_conv, true); } -void __attribute__((export_name("TS_NodeAlias_free"))) TS_NodeAlias_free(uint64_t this_obj) { - LDKNodeAlias 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); - NodeAlias_free(this_obj_conv); -} - -int8_tArray __attribute__((export_name("TS_NodeAlias_get_a"))) TS_NodeAlias_get_a(uint64_t this_ptr) { - LDKNodeAlias 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(32, __LINE__); - memcpy(ret_arr->elems, *NodeAlias_get_a(&this_ptr_conv), 32); - return ret_arr; -} - -void __attribute__((export_name("TS_NodeAlias_set_a"))) TS_NodeAlias_set_a(uint64_t this_ptr, int8_tArray val) { - LDKNodeAlias 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; - LDKThirtyTwoBytes val_ref; - CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); FREE(val); - NodeAlias_set_a(&this_ptr_conv, val_ref); -} - -uint64_t __attribute__((export_name("TS_NodeAlias_new"))) TS_NodeAlias_new(int8_tArray a_arg) { - LDKThirtyTwoBytes a_arg_ref; - CHECK(a_arg->arr_len == 32); - memcpy(a_arg_ref.data, a_arg->elems, 32); FREE(a_arg); - LDKNodeAlias ret_var = NodeAlias_new(a_arg_ref); +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, 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; } -static inline uint64_t NodeAlias_clone_ptr(LDKNodeAlias *NONNULL_PTR arg) { - LDKNodeAlias ret_var = NodeAlias_clone(arg); +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, 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; } -int64_t __attribute__((export_name("TS_NodeAlias_clone_ptr"))) TS_NodeAlias_clone_ptr(uint64_t arg) { - LDKNodeAlias 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 = NodeAlias_clone_ptr(&arg_conv); + +void __attribute__((export_name("TS_Hints_free"))) TS_Hints_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); + LDKHints this_ptr_conv = *(LDKHints*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + Hints_free(this_ptr_conv); +} + +static inline uint64_t Hints_clone_ptr(LDKHints *NONNULL_PTR arg) { + LDKHints *ret_copy = MALLOC(sizeof(LDKHints), "LDKHints"); + *ret_copy = Hints_clone(arg); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t __attribute__((export_name("TS_Hints_clone_ptr"))) TS_Hints_clone_ptr(uint64_t arg) { + LDKHints* arg_conv = (LDKHints*)untag_ptr(arg); + int64_t ret_conv = Hints_clone_ptr(arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_NodeAlias_clone"))) TS_NodeAlias_clone(uint64_t orig) { - LDKNodeAlias 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; - LDKNodeAlias ret_var = NodeAlias_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); +uint64_t __attribute__((export_name("TS_Hints_clone"))) TS_Hints_clone(uint64_t orig) { + LDKHints* orig_conv = (LDKHints*)untag_ptr(orig); + LDKHints *ret_copy = MALLOC(sizeof(LDKHints), "LDKHints"); + *ret_copy = Hints_clone(orig_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); 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; +uint64_t __attribute__((export_name("TS_Hints_blinded"))) TS_Hints_blinded(uint64_tArray a) { + LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ a_constr; + a_constr.datalen = a->arr_len; + if (a_constr.datalen > 0) + a_constr.data = MALLOC(a_constr.datalen * sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ Elements"); + else + a_constr.data = NULL; + uint64_t* a_vals = a->elems; + for (size_t l = 0; l < a_constr.datalen; l++) { + uint64_t a_conv_37 = a_vals[l]; + void* a_conv_37_ptr = untag_ptr(a_conv_37); + CHECK_ACCESS(a_conv_37_ptr); + LDKC2Tuple_BlindedPayInfoBlindedPathZ a_conv_37_conv = *(LDKC2Tuple_BlindedPayInfoBlindedPathZ*)(a_conv_37_ptr); + a_conv_37_conv = C2Tuple_BlindedPayInfoBlindedPathZ_clone((LDKC2Tuple_BlindedPayInfoBlindedPathZ*)untag_ptr(a_conv_37)); + a_constr.data[l] = a_conv_37_conv; + } + FREE(a); + LDKHints *ret_copy = MALLOC(sizeof(LDKHints), "LDKHints"); + *ret_copy = Hints_blinded(a_constr); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int8_tArray __attribute__((export_name("TS_NodeAlias_write"))) TS_NodeAlias_write(uint64_t obj) { - LDKNodeAlias 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 = NodeAlias_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_Hints_clear"))) TS_Hints_clear(uint64_tArray a) { + LDKCVec_RouteHintZ a_constr; + a_constr.datalen = a->arr_len; + if (a_constr.datalen > 0) + a_constr.data = MALLOC(a_constr.datalen * sizeof(LDKRouteHint), "LDKCVec_RouteHintZ Elements"); + else + a_constr.data = NULL; + uint64_t* a_vals = a->elems; + for (size_t l = 0; l < a_constr.datalen; l++) { + uint64_t a_conv_11 = a_vals[l]; + LDKRouteHint a_conv_11_conv; + a_conv_11_conv.inner = untag_ptr(a_conv_11); + a_conv_11_conv.is_owned = ptr_is_owned(a_conv_11); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv_11_conv); + a_conv_11_conv = RouteHint_clone(&a_conv_11_conv); + a_constr.data[l] = a_conv_11_conv; + } + FREE(a); + LDKHints *ret_copy = MALLOC(sizeof(LDKHints), "LDKHints"); + *ret_copy = Hints_clear(a_constr); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -uint64_t __attribute__((export_name("TS_NodeAlias_read"))) TS_NodeAlias_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_NodeAliasDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAliasDecodeErrorZ), "LDKCResult_NodeAliasDecodeErrorZ"); - *ret_conv = NodeAlias_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +int64_t __attribute__((export_name("TS_Hints_hash"))) TS_Hints_hash(uint64_t o) { + LDKHints* o_conv = (LDKHints*)untag_ptr(o); + int64_t ret_conv = Hints_hash(o_conv); + return ret_conv; } -void __attribute__((export_name("TS_NodeInfo_free"))) TS_NodeInfo_free(uint64_t this_obj) { - LDKNodeInfo this_obj_conv; +jboolean __attribute__((export_name("TS_Hints_eq"))) TS_Hints_eq(uint64_t a, uint64_t b) { + LDKHints* a_conv = (LDKHints*)untag_ptr(a); + LDKHints* b_conv = (LDKHints*)untag_ptr(b); + jboolean ret_conv = Hints_eq(a_conv, b_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_RouteHint_free"))) TS_RouteHint_free(uint64_t this_obj) { + LDKRouteHint 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); - NodeInfo_free(this_obj_conv); + RouteHint_free(this_obj_conv); } -int64_tArray __attribute__((export_name("TS_NodeInfo_get_channels"))) TS_NodeInfo_get_channels(uint64_t this_ptr) { - LDKNodeInfo this_ptr_conv; +uint64_tArray __attribute__((export_name("TS_RouteHint_get_a"))) TS_RouteHint_get_a(uint64_t this_ptr) { + LDKRouteHint 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; - LDKCVec_u64Z ret_var = NodeInfo_get_channels(&this_ptr_conv); - int64_tArray ret_arr = NULL; - ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); - int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); - for (size_t i = 0; i < ret_var.datalen; i++) { - int64_t ret_conv_8_conv = ret_var.data[i]; - ret_arr_ptr[i] = ret_conv_8_conv; + LDKCVec_RouteHintHopZ ret_var = RouteHint_get_a(&this_ptr_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++) { + LDKRouteHintHop ret_conv_14_var = ret_var.data[o]; + uint64_t ret_conv_14_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_14_var); + ret_conv_14_ref = tag_ptr(ret_conv_14_var.inner, ret_conv_14_var.is_owned); + ret_arr_ptr[o] = ret_conv_14_ref; } FREE(ret_var.data); return ret_arr; } -void __attribute__((export_name("TS_NodeInfo_set_channels"))) TS_NodeInfo_set_channels(uint64_t this_ptr, int64_tArray val) { - LDKNodeInfo this_ptr_conv; +void __attribute__((export_name("TS_RouteHint_set_a"))) TS_RouteHint_set_a(uint64_t this_ptr, uint64_tArray val) { + LDKRouteHint 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; - LDKCVec_u64Z val_constr; + LDKCVec_RouteHintHopZ val_constr; val_constr.datalen = val->arr_len; if (val_constr.datalen > 0) - val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); + val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKRouteHintHop), "LDKCVec_RouteHintHopZ Elements"); else val_constr.data = NULL; - int64_t* val_vals = val->elems; - for (size_t i = 0; i < val_constr.datalen; i++) { - int64_t val_conv_8 = val_vals[i]; - val_constr.data[i] = val_conv_8; + uint64_t* val_vals = val->elems; + for (size_t o = 0; o < val_constr.datalen; o++) { + uint64_t val_conv_14 = val_vals[o]; + LDKRouteHintHop val_conv_14_conv; + val_conv_14_conv.inner = untag_ptr(val_conv_14); + val_conv_14_conv.is_owned = ptr_is_owned(val_conv_14); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_14_conv); + val_conv_14_conv = RouteHintHop_clone(&val_conv_14_conv); + val_constr.data[o] = val_conv_14_conv; } FREE(val); - NodeInfo_set_channels(&this_ptr_conv, val_constr); -} - -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); - 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; - LDKNodeAnnouncementInfo ret_var = NodeInfo_get_announcement_info(&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_announcement_info"))) TS_NodeInfo_set_announcement_info(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; - LDKNodeAnnouncementInfo 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 = NodeAnnouncementInfo_clone(&val_conv); - NodeInfo_set_announcement_info(&this_ptr_conv, val_conv); + RouteHint_set_a(&this_ptr_conv, val_constr); } -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 = MALLOC(channels_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); +uint64_t __attribute__((export_name("TS_RouteHint_new"))) TS_RouteHint_new(uint64_tArray a_arg) { + LDKCVec_RouteHintHopZ a_arg_constr; + a_arg_constr.datalen = a_arg->arr_len; + if (a_arg_constr.datalen > 0) + a_arg_constr.data = MALLOC(a_arg_constr.datalen * sizeof(LDKRouteHintHop), "LDKCVec_RouteHintHopZ Elements"); else - channels_arg_constr.data = NULL; - int64_t* channels_arg_vals = channels_arg->elems; - for (size_t i = 0; i < channels_arg_constr.datalen; i++) { - int64_t channels_arg_conv_8 = channels_arg_vals[i]; - channels_arg_constr.data[i] = channels_arg_conv_8; + a_arg_constr.data = NULL; + uint64_t* a_arg_vals = a_arg->elems; + for (size_t o = 0; o < a_arg_constr.datalen; o++) { + uint64_t a_arg_conv_14 = a_arg_vals[o]; + LDKRouteHintHop a_arg_conv_14_conv; + a_arg_conv_14_conv.inner = untag_ptr(a_arg_conv_14); + a_arg_conv_14_conv.is_owned = ptr_is_owned(a_arg_conv_14); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_arg_conv_14_conv); + a_arg_conv_14_conv = RouteHintHop_clone(&a_arg_conv_14_conv); + a_arg_constr.data[o] = a_arg_conv_14_conv; } - FREE(channels_arg); - 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, announcement_info_arg_conv); + FREE(a_arg); + LDKRouteHint ret_var = RouteHint_new(a_arg_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); return ret_ref; } -static inline uint64_t NodeInfo_clone_ptr(LDKNodeInfo *NONNULL_PTR arg) { - LDKNodeInfo ret_var = NodeInfo_clone(arg); +static inline uint64_t RouteHint_clone_ptr(LDKRouteHint *NONNULL_PTR arg) { + LDKRouteHint ret_var = RouteHint_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_NodeInfo_clone_ptr"))) TS_NodeInfo_clone_ptr(uint64_t arg) { - LDKNodeInfo arg_conv; +int64_t __attribute__((export_name("TS_RouteHint_clone_ptr"))) TS_RouteHint_clone_ptr(uint64_t arg) { + LDKRouteHint 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 = NodeInfo_clone_ptr(&arg_conv); + int64_t ret_conv = RouteHint_clone_ptr(&arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_NodeInfo_clone"))) TS_NodeInfo_clone(uint64_t orig) { - LDKNodeInfo orig_conv; +uint64_t __attribute__((export_name("TS_RouteHint_clone"))) TS_RouteHint_clone(uint64_t orig) { + LDKRouteHint 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; - LDKNodeInfo ret_var = NodeInfo_clone(&orig_conv); + LDKRouteHint ret_var = RouteHint_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_NodeInfo_eq"))) TS_NodeInfo_eq(uint64_t a, uint64_t b) { - LDKNodeInfo a_conv; +int64_t __attribute__((export_name("TS_RouteHint_hash"))) TS_RouteHint_hash(uint64_t o) { + LDKRouteHint 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 = RouteHint_hash(&o_conv); + return ret_conv; +} + +jboolean __attribute__((export_name("TS_RouteHint_eq"))) TS_RouteHint_eq(uint64_t a, uint64_t b) { + LDKRouteHint 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; + LDKRouteHint 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); + jboolean ret_conv = RouteHint_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; +int8_tArray __attribute__((export_name("TS_RouteHint_write"))) TS_RouteHint_write(uint64_t obj) { + LDKRouteHint 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 = NodeInfo_write(&obj_conv); + LDKCVec_u8Z ret_var = RouteHint_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_NodeInfo_read"))) TS_NodeInfo_read(int8_tArray ser) { +uint64_t __attribute__((export_name("TS_RouteHint_read"))) TS_RouteHint_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; ser_ref.data = ser->elems; - LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ"); - *ret_conv = NodeInfo_read(ser_ref); + LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ"); + *ret_conv = RouteHint_read(ser_ref); FREE(ser); return tag_ptr(ret_conv, true); } -int8_tArray __attribute__((export_name("TS_NetworkGraph_write"))) TS_NetworkGraph_write(uint64_t obj) { - LDKNetworkGraph 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 = NetworkGraph_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); +void __attribute__((export_name("TS_RouteHintHop_free"))) TS_RouteHintHop_free(uint64_t this_obj) { + LDKRouteHintHop 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); + RouteHintHop_free(this_obj_conv); +} + +int8_tArray __attribute__((export_name("TS_RouteHintHop_get_src_node_id"))) TS_RouteHintHop_get_src_node_id(uint64_t this_ptr) { + LDKRouteHintHop 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, RouteHintHop_get_src_node_id(&this_ptr_conv).compressed_form, 33); return ret_arr; } -uint64_t __attribute__((export_name("TS_NetworkGraph_read"))) TS_NetworkGraph_read(int8_tArray ser, uint64_t arg) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - void* arg_ptr = untag_ptr(arg); - CHECK_ACCESS(arg_ptr); - LDKLogger arg_conv = *(LDKLogger*)(arg_ptr); - if (arg_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&arg_conv); - } - LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ"); - *ret_conv = NetworkGraph_read(ser_ref, arg_conv); - FREE(ser); - return tag_ptr(ret_conv, true); +void __attribute__((export_name("TS_RouteHintHop_set_src_node_id"))) TS_RouteHintHop_set_src_node_id(uint64_t this_ptr, int8_tArray val) { + LDKRouteHintHop 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); + RouteHintHop_set_src_node_id(&this_ptr_conv, val_ref); } -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 (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); - } - 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 ret_ref; +int64_t __attribute__((export_name("TS_RouteHintHop_get_short_channel_id"))) TS_RouteHintHop_get_short_channel_id(uint64_t this_ptr) { + LDKRouteHintHop 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 = RouteHintHop_get_short_channel_id(&this_ptr_conv); + return ret_conv; } -uint64_t __attribute__((export_name("TS_NetworkGraph_read_only"))) TS_NetworkGraph_read_only(uint64_t this_arg) { - 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; - LDKReadOnlyNetworkGraph ret_var = NetworkGraph_read_only(&this_arg_conv); +void __attribute__((export_name("TS_RouteHintHop_set_short_channel_id"))) TS_RouteHintHop_set_short_channel_id(uint64_t this_ptr, int64_t val) { + LDKRouteHintHop 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; + RouteHintHop_set_short_channel_id(&this_ptr_conv, val); +} + +uint64_t __attribute__((export_name("TS_RouteHintHop_get_fees"))) TS_RouteHintHop_get_fees(uint64_t this_ptr) { + LDKRouteHintHop 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 = RouteHintHop_get_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; } -uint64_t __attribute__((export_name("TS_NetworkGraph_get_last_rapid_gossip_sync_timestamp"))) TS_NetworkGraph_get_last_rapid_gossip_sync_timestamp(uint64_t this_arg) { - 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; - LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); - *ret_copy = NetworkGraph_get_last_rapid_gossip_sync_timestamp(&this_arg_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -void __attribute__((export_name("TS_NetworkGraph_set_last_rapid_gossip_sync_timestamp"))) TS_NetworkGraph_set_last_rapid_gossip_sync_timestamp(uint64_t this_arg, int32_t last_rapid_gossip_sync_timestamp) { - 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_set_last_rapid_gossip_sync_timestamp(&this_arg_conv, last_rapid_gossip_sync_timestamp); -} - -uint64_t __attribute__((export_name("TS_NetworkGraph_update_node_from_announcement"))) TS_NetworkGraph_update_node_from_announcement(uint64_t this_arg, uint64_t msg) { - 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; - 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.is_owned = false; - LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); - *ret_conv = NetworkGraph_update_node_from_announcement(&this_arg_conv, &msg_conv); - return tag_ptr(ret_conv, true); -} - -uint64_t __attribute__((export_name("TS_NetworkGraph_update_node_from_unsigned_announcement"))) TS_NetworkGraph_update_node_from_unsigned_announcement(uint64_t this_arg, uint64_t msg) { - 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; - LDKUnsignedNodeAnnouncement 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_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); - *ret_conv = NetworkGraph_update_node_from_unsigned_announcement(&this_arg_conv, &msg_conv); - 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 utxo_lookup) { - 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; - 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.is_owned = false; - 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 (utxo_lookup_conv.some.free == LDKUtxoLookup_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - 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, utxo_lookup_conv); - return tag_ptr(ret_conv, true); +void __attribute__((export_name("TS_RouteHintHop_set_fees"))) TS_RouteHintHop_set_fees(uint64_t this_ptr, uint64_t val) { + LDKRouteHintHop 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); + RouteHintHop_set_fees(&this_ptr_conv, val_conv); } -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); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - 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; - 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 (utxo_lookup_conv.some.free == LDKUtxoLookup_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - 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, utxo_lookup_conv); - return tag_ptr(ret_conv, true); +int16_t __attribute__((export_name("TS_RouteHintHop_get_cltv_expiry_delta"))) TS_RouteHintHop_get_cltv_expiry_delta(uint64_t this_ptr) { + LDKRouteHintHop 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; + int16_t ret_conv = RouteHintHop_get_cltv_expiry_delta(&this_ptr_conv); + return ret_conv; } -uint64_t __attribute__((export_name("TS_NetworkGraph_add_channel_from_partial_announcement"))) TS_NetworkGraph_add_channel_from_partial_announcement(uint64_t this_arg, int64_t short_channel_id, int64_t timestamp, uint64_t features, int8_tArray node_id_1, int8_tArray node_id_2) { - 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; - LDKChannelFeatures features_conv; - features_conv.inner = untag_ptr(features); - features_conv.is_owned = ptr_is_owned(features); - CHECK_INNER_FIELD_ACCESS_OR_NULL(features_conv); - features_conv = ChannelFeatures_clone(&features_conv); - LDKPublicKey node_id_1_ref; - CHECK(node_id_1->arr_len == 33); - memcpy(node_id_1_ref.compressed_form, node_id_1->elems, 33); FREE(node_id_1); - LDKPublicKey node_id_2_ref; - CHECK(node_id_2->arr_len == 33); - memcpy(node_id_2_ref.compressed_form, node_id_2->elems, 33); FREE(node_id_2); - LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); - *ret_conv = NetworkGraph_add_channel_from_partial_announcement(&this_arg_conv, short_channel_id, timestamp, features_conv, node_id_1_ref, node_id_2_ref); - return tag_ptr(ret_conv, true); +void __attribute__((export_name("TS_RouteHintHop_set_cltv_expiry_delta"))) TS_RouteHintHop_set_cltv_expiry_delta(uint64_t this_ptr, int16_t val) { + LDKRouteHintHop 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; + RouteHintHop_set_cltv_expiry_delta(&this_ptr_conv, val); } -void __attribute__((export_name("TS_NetworkGraph_channel_failed"))) TS_NetworkGraph_channel_failed(uint64_t this_arg, int64_t short_channel_id, jboolean is_permanent) { - 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_channel_failed(&this_arg_conv, short_channel_id, is_permanent); +uint64_t __attribute__((export_name("TS_RouteHintHop_get_htlc_minimum_msat"))) TS_RouteHintHop_get_htlc_minimum_msat(uint64_t this_ptr) { + LDKRouteHintHop 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_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = RouteHintHop_get_htlc_minimum_msat(&this_ptr_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -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_permanent(&this_arg_conv, node_id_ref); +void __attribute__((export_name("TS_RouteHintHop_set_htlc_minimum_msat"))) TS_RouteHintHop_set_htlc_minimum_msat(uint64_t this_ptr, uint64_t val) { + LDKRouteHintHop 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_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); + RouteHintHop_set_htlc_minimum_msat(&this_ptr_conv, val_conv); } -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_and_tracking_with_time(&this_arg_conv, current_time_unix); +uint64_t __attribute__((export_name("TS_RouteHintHop_get_htlc_maximum_msat"))) TS_RouteHintHop_get_htlc_maximum_msat(uint64_t this_ptr) { + LDKRouteHintHop 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_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = RouteHintHop_get_htlc_maximum_msat(&this_ptr_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -uint64_t __attribute__((export_name("TS_NetworkGraph_update_channel"))) TS_NetworkGraph_update_channel(uint64_t this_arg, uint64_t msg) { - 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; - LDKChannelUpdate 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_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); - *ret_conv = NetworkGraph_update_channel(&this_arg_conv, &msg_conv); - return tag_ptr(ret_conv, true); +void __attribute__((export_name("TS_RouteHintHop_set_htlc_maximum_msat"))) TS_RouteHintHop_set_htlc_maximum_msat(uint64_t this_ptr, uint64_t val) { + LDKRouteHintHop 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_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); + RouteHintHop_set_htlc_maximum_msat(&this_ptr_conv, val_conv); } -uint64_t __attribute__((export_name("TS_NetworkGraph_update_channel_unsigned"))) TS_NetworkGraph_update_channel_unsigned(uint64_t this_arg, uint64_t msg) { - 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; - LDKUnsignedChannelUpdate 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_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); - *ret_conv = NetworkGraph_update_channel_unsigned(&this_arg_conv, &msg_conv); - return tag_ptr(ret_conv, true); +uint64_t __attribute__((export_name("TS_RouteHintHop_new"))) TS_RouteHintHop_new(int8_tArray src_node_id_arg, int64_t short_channel_id_arg, uint64_t fees_arg, int16_t cltv_expiry_delta_arg, uint64_t htlc_minimum_msat_arg, uint64_t htlc_maximum_msat_arg) { + LDKPublicKey src_node_id_arg_ref; + CHECK(src_node_id_arg->arr_len == 33); + memcpy(src_node_id_arg_ref.compressed_form, src_node_id_arg->elems, 33); FREE(src_node_id_arg); + LDKRoutingFees fees_arg_conv; + fees_arg_conv.inner = untag_ptr(fees_arg); + fees_arg_conv.is_owned = ptr_is_owned(fees_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(fees_arg_conv); + fees_arg_conv = RoutingFees_clone(&fees_arg_conv); + void* htlc_minimum_msat_arg_ptr = untag_ptr(htlc_minimum_msat_arg); + CHECK_ACCESS(htlc_minimum_msat_arg_ptr); + LDKCOption_u64Z htlc_minimum_msat_arg_conv = *(LDKCOption_u64Z*)(htlc_minimum_msat_arg_ptr); + htlc_minimum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(htlc_minimum_msat_arg)); + void* htlc_maximum_msat_arg_ptr = untag_ptr(htlc_maximum_msat_arg); + CHECK_ACCESS(htlc_maximum_msat_arg_ptr); + LDKCOption_u64Z htlc_maximum_msat_arg_conv = *(LDKCOption_u64Z*)(htlc_maximum_msat_arg_ptr); + htlc_maximum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(htlc_maximum_msat_arg)); + LDKRouteHintHop ret_var = RouteHintHop_new(src_node_id_arg_ref, short_channel_id_arg, fees_arg_conv, cltv_expiry_delta_arg, htlc_minimum_msat_arg_conv, htlc_maximum_msat_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_ReadOnlyNetworkGraph_channel"))) TS_ReadOnlyNetworkGraph_channel(uint64_t this_arg, int64_t short_channel_id) { - LDKReadOnlyNetworkGraph 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; - LDKChannelInfo ret_var = ReadOnlyNetworkGraph_channel(&this_arg_conv, short_channel_id); +static inline uint64_t RouteHintHop_clone_ptr(LDKRouteHintHop *NONNULL_PTR arg) { + LDKRouteHintHop ret_var = RouteHintHop_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_tArray __attribute__((export_name("TS_ReadOnlyNetworkGraph_list_channels"))) TS_ReadOnlyNetworkGraph_list_channels(uint64_t this_arg) { - LDKReadOnlyNetworkGraph 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_u64Z ret_var = ReadOnlyNetworkGraph_list_channels(&this_arg_conv); - int64_tArray ret_arr = NULL; - ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); - int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); - for (size_t i = 0; i < ret_var.datalen; i++) { - int64_t ret_conv_8_conv = ret_var.data[i]; - ret_arr_ptr[i] = ret_conv_8_conv; - } - - FREE(ret_var.data); - return ret_arr; +int64_t __attribute__((export_name("TS_RouteHintHop_clone_ptr"))) TS_RouteHintHop_clone_ptr(uint64_t arg) { + LDKRouteHintHop 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 = RouteHintHop_clone_ptr(&arg_conv); + return ret_conv; } -uint64_t __attribute__((export_name("TS_ReadOnlyNetworkGraph_node"))) TS_ReadOnlyNetworkGraph_node(uint64_t this_arg, uint64_t node_id) { - LDKReadOnlyNetworkGraph 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 node_id_conv; - node_id_conv.inner = untag_ptr(node_id); - node_id_conv.is_owned = ptr_is_owned(node_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv); - node_id_conv.is_owned = false; - LDKNodeInfo ret_var = ReadOnlyNetworkGraph_node(&this_arg_conv, &node_id_conv); +uint64_t __attribute__((export_name("TS_RouteHintHop_clone"))) TS_RouteHintHop_clone(uint64_t orig) { + LDKRouteHintHop 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; + LDKRouteHintHop ret_var = RouteHintHop_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_tArray __attribute__((export_name("TS_ReadOnlyNetworkGraph_list_nodes"))) TS_ReadOnlyNetworkGraph_list_nodes(uint64_t this_arg) { - LDKReadOnlyNetworkGraph 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_NodeIdZ ret_var = ReadOnlyNetworkGraph_list_nodes(&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 i = 0; i < ret_var.datalen; i++) { - LDKNodeId ret_conv_8_var = ret_var.data[i]; - uint64_t ret_conv_8_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_8_var); - ret_conv_8_ref = tag_ptr(ret_conv_8_var.inner, ret_conv_8_var.is_owned); - ret_arr_ptr[i] = ret_conv_8_ref; - } - - FREE(ret_var.data); - return ret_arr; +int64_t __attribute__((export_name("TS_RouteHintHop_hash"))) TS_RouteHintHop_hash(uint64_t o) { + LDKRouteHintHop 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 = RouteHintHop_hash(&o_conv); + return ret_conv; } -uint64_t __attribute__((export_name("TS_ReadOnlyNetworkGraph_get_addresses"))) TS_ReadOnlyNetworkGraph_get_addresses(uint64_t this_arg, int8_tArray pubkey) { - LDKReadOnlyNetworkGraph 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); - LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ"); - *ret_copy = ReadOnlyNetworkGraph_get_addresses(&this_arg_conv, pubkey_ref); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jboolean __attribute__((export_name("TS_RouteHintHop_eq"))) TS_RouteHintHop_eq(uint64_t a, uint64_t b) { + LDKRouteHintHop 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; + LDKRouteHintHop 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 = RouteHintHop_eq(&a_conv, &b_conv); + return ret_conv; } -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); +int8_tArray __attribute__((export_name("TS_RouteHintHop_write"))) TS_RouteHintHop_write(uint64_t obj) { + LDKRouteHintHop 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 = RouteHintHop_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_DefaultRouter_new"))) TS_DefaultRouter_new(uint64_t network_graph, uint64_t logger, int8_tArray random_seed_bytes, uint64_t scorer) { +uint64_t __attribute__((export_name("TS_RouteHintHop_read"))) TS_RouteHintHop_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ"); + *ret_conv = RouteHintHop_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +uint64_t __attribute__((export_name("TS_find_route"))) TS_find_route(int8_tArray our_node_pubkey, uint64_t route_params, uint64_t network_graph, uint64_tArray first_hops, uint64_t logger, uint64_t scorer, int8_tArray random_seed_bytes) { + LDKPublicKey our_node_pubkey_ref; + CHECK(our_node_pubkey->arr_len == 33); + memcpy(our_node_pubkey_ref.compressed_form, our_node_pubkey->elems, 33); FREE(our_node_pubkey); + 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; 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; + 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* logger_ptr = untag_ptr(logger); CHECK_ACCESS(logger_ptr); LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); @@ -44918,2949 +48009,2579 @@ uint64_t __attribute__((export_name("TS_DefaultRouter_new"))) TS_DefaultRouter_ // 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 (ptr_is_owned(scorer)) { CHECK_ACCESS(scorer_ptr); } + LDKScore* scorer_conv = (LDKScore*)scorer_ptr; + 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); + 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); } + return tag_ptr(ret_conv, true); +} + +uint64_t __attribute__((export_name("TS_build_route_from_hops"))) TS_build_route_from_hops(int8_tArray our_node_pubkey, ptrArray hops, uint64_t route_params, uint64_t network_graph, uint64_t logger, int8_tArray random_seed_bytes) { + LDKPublicKey our_node_pubkey_ref; + CHECK(our_node_pubkey->arr_len == 33); + memcpy(our_node_pubkey_ref.compressed_form, our_node_pubkey->elems, 33); FREE(our_node_pubkey); + LDKCVec_PublicKeyZ hops_constr; + hops_constr.datalen = hops->arr_len; + if (hops_constr.datalen > 0) + hops_constr.data = MALLOC(hops_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements"); + else + hops_constr.data = NULL; + int8_tArray* hops_vals = (void*) hops->elems; + for (size_t m = 0; m < hops_constr.datalen; m++) { + int8_tArray hops_conv_12 = hops_vals[m]; + LDKPublicKey hops_conv_12_ref; + CHECK(hops_conv_12->arr_len == 33); + memcpy(hops_conv_12_ref.compressed_form, hops_conv_12->elems, 33); FREE(hops_conv_12); + hops_constr.data[m] = hops_conv_12_ref; + } + FREE(hops); + 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; + 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. - LDKLockableScore_JCalls_cloned(&scorer_conv); + LDKLogger_JCalls_cloned(&logger_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; + 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); + 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); } -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_Score_free"))) TS_Score_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); + LDKScore this_ptr_conv = *(LDKScore*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + Score_free(this_ptr_conv); } -void __attribute__((export_name("TS_Router_free"))) TS_Router_free(uint64_t this_ptr) { +void __attribute__((export_name("TS_LockableScore_free"))) TS_LockableScore_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); + LDKLockableScore this_ptr_conv = *(LDKLockableScore*)(this_ptr_ptr); FREE(untag_ptr(this_ptr)); - Router_free(this_ptr_conv); + LockableScore_free(this_ptr_conv); } -void __attribute__((export_name("TS_ScorerAccountingForInFlightHtlcs_free"))) TS_ScorerAccountingForInFlightHtlcs_free(uint64_t this_obj) { - LDKScorerAccountingForInFlightHtlcs this_obj_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); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ScorerAccountingForInFlightHtlcs_free(this_obj_conv); + MultiThreadedLockableScore_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; +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); } -int8_tArray __attribute__((export_name("TS_ScorerAccountingForInFlightHtlcs_write"))) TS_ScorerAccountingForInFlightHtlcs_write(uint64_t obj) { - LDKScorerAccountingForInFlightHtlcs 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 = ScorerAccountingForInFlightHtlcs_write(&obj_conv); + 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_ScorerAccountingForInFlightHtlcs_as_Score"))) TS_ScorerAccountingForInFlightHtlcs_as_Score(uint64_t this_arg) { - LDKScorerAccountingForInFlightHtlcs this_arg_conv; +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; - LDKScore* ret_ret = MALLOC(sizeof(LDKScore), "LDKScore"); - *ret_ret = ScorerAccountingForInFlightHtlcs_as_Score(&this_arg_conv); + LDKLockableScore* ret_ret = MALLOC(sizeof(LDKLockableScore), "LDKLockableScore"); + *ret_ret = MultiThreadedLockableScore_as_LockableScore(&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; +int8_tArray __attribute__((export_name("TS_MultiThreadedLockableScore_write"))) TS_MultiThreadedLockableScore_write(uint64_t obj) { + LDKMultiThreadedLockableScore 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 = MultiThreadedLockableScore_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_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); + LDKScore score_conv = *(LDKScore*)(score_ptr); + if (score_conv.free == LDKScore_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKScore_JCalls_cloned(&score_conv); + } + LDKMultiThreadedLockableScore ret_var = MultiThreadedLockableScore_new(score_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_ChannelUsage_free"))) TS_ChannelUsage_free(uint64_t this_obj) { + LDKChannelUsage 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); + ChannelUsage_free(this_obj_conv); } -static inline uint64_t InFlightHtlcs_clone_ptr(LDKInFlightHtlcs *NONNULL_PTR arg) { - LDKInFlightHtlcs ret_var = InFlightHtlcs_clone(arg); +int64_t __attribute__((export_name("TS_ChannelUsage_get_amount_msat"))) TS_ChannelUsage_get_amount_msat(uint64_t this_ptr) { + LDKChannelUsage 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 = ChannelUsage_get_amount_msat(&this_ptr_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_ChannelUsage_set_amount_msat"))) TS_ChannelUsage_set_amount_msat(uint64_t this_ptr, int64_t val) { + LDKChannelUsage 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; + ChannelUsage_set_amount_msat(&this_ptr_conv, val); +} + +int64_t __attribute__((export_name("TS_ChannelUsage_get_inflight_htlc_msat"))) TS_ChannelUsage_get_inflight_htlc_msat(uint64_t this_ptr) { + LDKChannelUsage 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 = ChannelUsage_get_inflight_htlc_msat(&this_ptr_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_ChannelUsage_set_inflight_htlc_msat"))) TS_ChannelUsage_set_inflight_htlc_msat(uint64_t this_ptr, int64_t val) { + LDKChannelUsage 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; + ChannelUsage_set_inflight_htlc_msat(&this_ptr_conv, val); +} + +uint64_t __attribute__((export_name("TS_ChannelUsage_get_effective_capacity"))) TS_ChannelUsage_get_effective_capacity(uint64_t this_ptr) { + LDKChannelUsage 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; + LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); + *ret_copy = ChannelUsage_get_effective_capacity(&this_ptr_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void __attribute__((export_name("TS_ChannelUsage_set_effective_capacity"))) TS_ChannelUsage_set_effective_capacity(uint64_t this_ptr, uint64_t val) { + LDKChannelUsage 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); + LDKEffectiveCapacity val_conv = *(LDKEffectiveCapacity*)(val_ptr); + val_conv = EffectiveCapacity_clone((LDKEffectiveCapacity*)untag_ptr(val)); + ChannelUsage_set_effective_capacity(&this_ptr_conv, val_conv); +} + +uint64_t __attribute__((export_name("TS_ChannelUsage_new"))) TS_ChannelUsage_new(int64_t amount_msat_arg, int64_t inflight_htlc_msat_arg, uint64_t effective_capacity_arg) { + void* effective_capacity_arg_ptr = untag_ptr(effective_capacity_arg); + CHECK_ACCESS(effective_capacity_arg_ptr); + LDKEffectiveCapacity effective_capacity_arg_conv = *(LDKEffectiveCapacity*)(effective_capacity_arg_ptr); + effective_capacity_arg_conv = EffectiveCapacity_clone((LDKEffectiveCapacity*)untag_ptr(effective_capacity_arg)); + LDKChannelUsage ret_var = ChannelUsage_new(amount_msat_arg, inflight_htlc_msat_arg, effective_capacity_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_InFlightHtlcs_clone_ptr"))) TS_InFlightHtlcs_clone_ptr(uint64_t arg) { - LDKInFlightHtlcs arg_conv; + +static inline uint64_t ChannelUsage_clone_ptr(LDKChannelUsage *NONNULL_PTR arg) { + LDKChannelUsage ret_var = ChannelUsage_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_ChannelUsage_clone_ptr"))) TS_ChannelUsage_clone_ptr(uint64_t arg) { + LDKChannelUsage 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); + int64_t ret_conv = ChannelUsage_clone_ptr(&arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_InFlightHtlcs_clone"))) TS_InFlightHtlcs_clone(uint64_t orig) { - LDKInFlightHtlcs orig_conv; +uint64_t __attribute__((export_name("TS_ChannelUsage_clone"))) TS_ChannelUsage_clone(uint64_t orig) { + LDKChannelUsage 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); + LDKChannelUsage ret_var = ChannelUsage_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(); +void __attribute__((export_name("TS_FixedPenaltyScorer_free"))) TS_FixedPenaltyScorer_free(uint64_t this_obj) { + LDKFixedPenaltyScorer 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); + FixedPenaltyScorer_free(this_obj_conv); +} + +static inline uint64_t FixedPenaltyScorer_clone_ptr(LDKFixedPenaltyScorer *NONNULL_PTR arg) { + LDKFixedPenaltyScorer ret_var = FixedPenaltyScorer_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_FixedPenaltyScorer_clone_ptr"))) TS_FixedPenaltyScorer_clone_ptr(uint64_t arg) { + LDKFixedPenaltyScorer 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 = FixedPenaltyScorer_clone_ptr(&arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_FixedPenaltyScorer_clone"))) TS_FixedPenaltyScorer_clone(uint64_t orig) { + LDKFixedPenaltyScorer 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; + LDKFixedPenaltyScorer ret_var = FixedPenaltyScorer_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_FixedPenaltyScorer_with_penalty"))) TS_FixedPenaltyScorer_with_penalty(int64_t penalty_msat) { + LDKFixedPenaltyScorer ret_var = FixedPenaltyScorer_with_penalty(penalty_msat); 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; +uint64_t __attribute__((export_name("TS_FixedPenaltyScorer_as_Score"))) TS_FixedPenaltyScorer_as_Score(uint64_t this_arg) { + LDKFixedPenaltyScorer 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; + LDKScore* ret_ret = MALLOC(sizeof(LDKScore), "LDKScore"); + *ret_ret = FixedPenaltyScorer_as_Score(&this_arg_conv); + return tag_ptr(ret_ret, true); } -int8_tArray __attribute__((export_name("TS_InFlightHtlcs_write"))) TS_InFlightHtlcs_write(uint64_t obj) { - LDKInFlightHtlcs obj_conv; +int8_tArray __attribute__((export_name("TS_FixedPenaltyScorer_write"))) TS_FixedPenaltyScorer_write(uint64_t obj) { + LDKFixedPenaltyScorer 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); + LDKCVec_u8Z ret_var = FixedPenaltyScorer_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) { +uint64_t __attribute__((export_name("TS_FixedPenaltyScorer_read"))) TS_FixedPenaltyScorer_read(int8_tArray ser, int64_t arg) { 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); + LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ"); + *ret_conv = FixedPenaltyScorer_read(ser_ref, arg); 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; +void __attribute__((export_name("TS_ProbabilisticScorer_free"))) TS_ProbabilisticScorer_free(uint64_t this_obj) { + LDKProbabilisticScorer 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); - RouteHop_free(this_obj_conv); + ProbabilisticScorer_free(this_obj_conv); } -int8_tArray __attribute__((export_name("TS_RouteHop_get_pubkey"))) TS_RouteHop_get_pubkey(uint64_t this_ptr) { - LDKRouteHop this_ptr_conv; +void __attribute__((export_name("TS_ProbabilisticScoringParameters_free"))) TS_ProbabilisticScoringParameters_free(uint64_t this_obj) { + LDKProbabilisticScoringParameters 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); + ProbabilisticScoringParameters_free(this_obj_conv); +} + +int64_t __attribute__((export_name("TS_ProbabilisticScoringParameters_get_base_penalty_msat"))) TS_ProbabilisticScoringParameters_get_base_penalty_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; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, RouteHop_get_pubkey(&this_ptr_conv).compressed_form, 33); - return ret_arr; + int64_t ret_conv = ProbabilisticScoringParameters_get_base_penalty_msat(&this_ptr_conv); + return ret_conv; } -void __attribute__((export_name("TS_RouteHop_set_pubkey"))) TS_RouteHop_set_pubkey(uint64_t this_ptr, int8_tArray val) { - LDKRouteHop this_ptr_conv; +void __attribute__((export_name("TS_ProbabilisticScoringParameters_set_base_penalty_msat"))) TS_ProbabilisticScoringParameters_set_base_penalty_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; - LDKPublicKey val_ref; - CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); - RouteHop_set_pubkey(&this_ptr_conv, val_ref); + ProbabilisticScoringParameters_set_base_penalty_msat(&this_ptr_conv, val); } -uint64_t __attribute__((export_name("TS_RouteHop_get_node_features"))) TS_RouteHop_get_node_features(uint64_t this_ptr) { - LDKRouteHop this_ptr_conv; +int64_t __attribute__((export_name("TS_ProbabilisticScoringParameters_get_base_penalty_amount_multiplier_msat"))) TS_ProbabilisticScoringParameters_get_base_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; - LDKNodeFeatures ret_var = RouteHop_get_node_features(&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; + int64_t ret_conv = ProbabilisticScoringParameters_get_base_penalty_amount_multiplier_msat(&this_ptr_conv); + return ret_conv; } -void __attribute__((export_name("TS_RouteHop_set_node_features"))) TS_RouteHop_set_node_features(uint64_t this_ptr, uint64_t val) { - LDKRouteHop this_ptr_conv; +void __attribute__((export_name("TS_ProbabilisticScoringParameters_set_base_penalty_amount_multiplier_msat"))) TS_ProbabilisticScoringParameters_set_base_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; - LDKNodeFeatures 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 = NodeFeatures_clone(&val_conv); - RouteHop_set_node_features(&this_ptr_conv, val_conv); + ProbabilisticScoringParameters_set_base_penalty_amount_multiplier_msat(&this_ptr_conv, val); } -int64_t __attribute__((export_name("TS_RouteHop_get_short_channel_id"))) TS_RouteHop_get_short_channel_id(uint64_t this_ptr) { - LDKRouteHop this_ptr_conv; +int64_t __attribute__((export_name("TS_ProbabilisticScoringParameters_get_liquidity_penalty_multiplier_msat"))) TS_ProbabilisticScoringParameters_get_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 = RouteHop_get_short_channel_id(&this_ptr_conv); + int64_t ret_conv = ProbabilisticScoringParameters_get_liquidity_penalty_multiplier_msat(&this_ptr_conv); return ret_conv; } -void __attribute__((export_name("TS_RouteHop_set_short_channel_id"))) TS_RouteHop_set_short_channel_id(uint64_t this_ptr, int64_t val) { - LDKRouteHop this_ptr_conv; +void __attribute__((export_name("TS_ProbabilisticScoringParameters_set_liquidity_penalty_multiplier_msat"))) TS_ProbabilisticScoringParameters_set_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; - RouteHop_set_short_channel_id(&this_ptr_conv, val); + ProbabilisticScoringParameters_set_liquidity_penalty_multiplier_msat(&this_ptr_conv, val); } -uint64_t __attribute__((export_name("TS_RouteHop_get_channel_features"))) TS_RouteHop_get_channel_features(uint64_t this_ptr) { - LDKRouteHop this_ptr_conv; +int64_t __attribute__((export_name("TS_ProbabilisticScoringParameters_get_liquidity_offset_half_life"))) TS_ProbabilisticScoringParameters_get_liquidity_offset_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; - LDKChannelFeatures ret_var = RouteHop_get_channel_features(&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; + int64_t ret_conv = ProbabilisticScoringParameters_get_liquidity_offset_half_life(&this_ptr_conv); + return ret_conv; } -void __attribute__((export_name("TS_RouteHop_set_channel_features"))) TS_RouteHop_set_channel_features(uint64_t this_ptr, uint64_t val) { - LDKRouteHop this_ptr_conv; +void __attribute__((export_name("TS_ProbabilisticScoringParameters_set_liquidity_offset_half_life"))) TS_ProbabilisticScoringParameters_set_liquidity_offset_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; - LDKChannelFeatures 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 = ChannelFeatures_clone(&val_conv); - RouteHop_set_channel_features(&this_ptr_conv, val_conv); + ProbabilisticScoringParameters_set_liquidity_offset_half_life(&this_ptr_conv, val); } -int64_t __attribute__((export_name("TS_RouteHop_get_fee_msat"))) TS_RouteHop_get_fee_msat(uint64_t this_ptr) { - LDKRouteHop this_ptr_conv; +int64_t __attribute__((export_name("TS_ProbabilisticScoringParameters_get_liquidity_penalty_amount_multiplier_msat"))) TS_ProbabilisticScoringParameters_get_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 = RouteHop_get_fee_msat(&this_ptr_conv); + int64_t ret_conv = ProbabilisticScoringParameters_get_liquidity_penalty_amount_multiplier_msat(&this_ptr_conv); return ret_conv; } -void __attribute__((export_name("TS_RouteHop_set_fee_msat"))) TS_RouteHop_set_fee_msat(uint64_t this_ptr, int64_t val) { - LDKRouteHop this_ptr_conv; +void __attribute__((export_name("TS_ProbabilisticScoringParameters_set_liquidity_penalty_amount_multiplier_msat"))) TS_ProbabilisticScoringParameters_set_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; - RouteHop_set_fee_msat(&this_ptr_conv, val); + ProbabilisticScoringParameters_set_liquidity_penalty_amount_multiplier_msat(&this_ptr_conv, val); } -int32_t __attribute__((export_name("TS_RouteHop_get_cltv_expiry_delta"))) TS_RouteHop_get_cltv_expiry_delta(uint64_t this_ptr) { - LDKRouteHop this_ptr_conv; +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; - int32_t ret_conv = RouteHop_get_cltv_expiry_delta(&this_ptr_conv); + int64_t ret_conv = ProbabilisticScoringParameters_get_historical_liquidity_penalty_multiplier_msat(&this_ptr_conv); return ret_conv; } -void __attribute__((export_name("TS_RouteHop_set_cltv_expiry_delta"))) TS_RouteHop_set_cltv_expiry_delta(uint64_t this_ptr, int32_t val) { - LDKRouteHop this_ptr_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; - RouteHop_set_cltv_expiry_delta(&this_ptr_conv, val); -} - -uint64_t __attribute__((export_name("TS_RouteHop_new"))) TS_RouteHop_new(int8_tArray pubkey_arg, uint64_t node_features_arg, int64_t short_channel_id_arg, uint64_t channel_features_arg, int64_t fee_msat_arg, int32_t cltv_expiry_delta_arg) { - LDKPublicKey pubkey_arg_ref; - CHECK(pubkey_arg->arr_len == 33); - memcpy(pubkey_arg_ref.compressed_form, pubkey_arg->elems, 33); FREE(pubkey_arg); - LDKNodeFeatures node_features_arg_conv; - node_features_arg_conv.inner = untag_ptr(node_features_arg); - node_features_arg_conv.is_owned = ptr_is_owned(node_features_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(node_features_arg_conv); - node_features_arg_conv = NodeFeatures_clone(&node_features_arg_conv); - LDKChannelFeatures channel_features_arg_conv; - channel_features_arg_conv.inner = untag_ptr(channel_features_arg); - channel_features_arg_conv.is_owned = ptr_is_owned(channel_features_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_features_arg_conv); - channel_features_arg_conv = ChannelFeatures_clone(&channel_features_arg_conv); - LDKRouteHop ret_var = RouteHop_new(pubkey_arg_ref, node_features_arg_conv, short_channel_id_arg, channel_features_arg_conv, fee_msat_arg, 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_ref; + ProbabilisticScoringParameters_set_historical_liquidity_penalty_multiplier_msat(&this_ptr_conv, val); } -static inline uint64_t RouteHop_clone_ptr(LDKRouteHop *NONNULL_PTR arg) { - LDKRouteHop ret_var = RouteHop_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_RouteHop_clone_ptr"))) TS_RouteHop_clone_ptr(uint64_t arg) { - LDKRouteHop 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 = RouteHop_clone_ptr(&arg_conv); +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; } -uint64_t __attribute__((export_name("TS_RouteHop_clone"))) TS_RouteHop_clone(uint64_t orig) { - LDKRouteHop 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; - LDKRouteHop ret_var = RouteHop_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_RouteHop_hash"))) TS_RouteHop_hash(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.is_owned = false; - int64_t ret_conv = RouteHop_hash(&o_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); } -jboolean __attribute__((export_name("TS_RouteHop_eq"))) TS_RouteHop_eq(uint64_t a, uint64_t b) { - LDKRouteHop 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; - LDKRouteHop 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 = RouteHop_eq(&a_conv, &b_conv); +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; } -int8_tArray __attribute__((export_name("TS_RouteHop_write"))) TS_RouteHop_write(uint64_t obj) { - LDKRouteHop 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 = RouteHop_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_RouteHop_read"))) TS_RouteHop_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ"); - *ret_conv = RouteHop_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); -} - -void __attribute__((export_name("TS_Route_free"))) TS_Route_free(uint64_t this_obj) { - LDKRoute 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); - Route_free(this_obj_conv); -} - -ptrArray __attribute__((export_name("TS_Route_get_paths"))) TS_Route_get_paths(uint64_t this_ptr) { - LDKRoute this_ptr_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; - LDKCVec_CVec_RouteHopZZ ret_var = Route_get_paths(&this_ptr_conv); - ptrArray ret_arr = NULL; - ret_arr = init_ptrArray(ret_var.datalen, __LINE__); - uint64_tArray *ret_arr_ptr = (uint64_tArray*)(((uint8_t*)ret_arr) + 8); - for (size_t m = 0; m < ret_var.datalen; m++) { - LDKCVec_RouteHopZ ret_conv_12_var = ret_var.data[m]; - uint64_tArray ret_conv_12_arr = NULL; - ret_conv_12_arr = init_uint64_tArray(ret_conv_12_var.datalen, __LINE__); - uint64_t *ret_conv_12_arr_ptr = (uint64_t*)(((uint8_t*)ret_conv_12_arr) + 8); - for (size_t k = 0; k < ret_conv_12_var.datalen; k++) { - LDKRouteHop ret_conv_12_conv_10_var = ret_conv_12_var.data[k]; - uint64_t ret_conv_12_conv_10_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_12_conv_10_var); - ret_conv_12_conv_10_ref = tag_ptr(ret_conv_12_conv_10_var.inner, ret_conv_12_conv_10_var.is_owned); - ret_conv_12_arr_ptr[k] = ret_conv_12_conv_10_ref; - } - - FREE(ret_conv_12_var.data); - ret_arr_ptr[m] = ret_conv_12_arr; - } - - FREE(ret_var.data); - return ret_arr; + ProbabilisticScoringParameters_set_historical_no_updates_half_life(&this_ptr_conv, val); } -void __attribute__((export_name("TS_Route_set_paths"))) TS_Route_set_paths(uint64_t this_ptr, ptrArray val) { - LDKRoute this_ptr_conv; +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); 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; - LDKCVec_CVec_RouteHopZZ val_constr; - val_constr.datalen = val->arr_len; - if (val_constr.datalen > 0) - val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKCVec_RouteHopZ), "LDKCVec_CVec_RouteHopZZ Elements"); - else - val_constr.data = NULL; - uint64_tArray* val_vals = (void*) val->elems; - for (size_t m = 0; m < val_constr.datalen; m++) { - uint64_tArray val_conv_12 = val_vals[m]; - LDKCVec_RouteHopZ val_conv_12_constr; - val_conv_12_constr.datalen = val_conv_12->arr_len; - if (val_conv_12_constr.datalen > 0) - val_conv_12_constr.data = MALLOC(val_conv_12_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements"); - else - val_conv_12_constr.data = NULL; - uint64_t* val_conv_12_vals = val_conv_12->elems; - for (size_t k = 0; k < val_conv_12_constr.datalen; k++) { - uint64_t val_conv_12_conv_10 = val_conv_12_vals[k]; - LDKRouteHop val_conv_12_conv_10_conv; - val_conv_12_conv_10_conv.inner = untag_ptr(val_conv_12_conv_10); - val_conv_12_conv_10_conv.is_owned = ptr_is_owned(val_conv_12_conv_10); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_12_conv_10_conv); - val_conv_12_conv_10_conv = RouteHop_clone(&val_conv_12_conv_10_conv); - val_conv_12_constr.data[k] = val_conv_12_conv_10_conv; - } - FREE(val_conv_12); - val_constr.data[m] = val_conv_12_constr; - } - FREE(val); - Route_set_paths(&this_ptr_conv, val_constr); + int64_t ret_conv = ProbabilisticScoringParameters_get_anti_probing_penalty_msat(&this_ptr_conv); + return ret_conv; } -uint64_t __attribute__((export_name("TS_Route_get_payment_params"))) TS_Route_get_payment_params(uint64_t this_ptr) { - LDKRoute this_ptr_conv; +void __attribute__((export_name("TS_ProbabilisticScoringParameters_set_anti_probing_penalty_msat"))) TS_ProbabilisticScoringParameters_set_anti_probing_penalty_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; - LDKPaymentParameters ret_var = Route_get_payment_params(&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; + ProbabilisticScoringParameters_set_anti_probing_penalty_msat(&this_ptr_conv, val); } -void __attribute__((export_name("TS_Route_set_payment_params"))) TS_Route_set_payment_params(uint64_t this_ptr, uint64_t val) { - LDKRoute this_ptr_conv; +int64_t __attribute__((export_name("TS_ProbabilisticScoringParameters_get_considered_impossible_penalty_msat"))) TS_ProbabilisticScoringParameters_get_considered_impossible_penalty_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; - LDKPaymentParameters 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 = PaymentParameters_clone(&val_conv); - Route_set_payment_params(&this_ptr_conv, val_conv); + int64_t ret_conv = ProbabilisticScoringParameters_get_considered_impossible_penalty_msat(&this_ptr_conv); + return ret_conv; } -uint64_t __attribute__((export_name("TS_Route_new"))) TS_Route_new(ptrArray paths_arg, uint64_t payment_params_arg) { - LDKCVec_CVec_RouteHopZZ paths_arg_constr; - paths_arg_constr.datalen = paths_arg->arr_len; - if (paths_arg_constr.datalen > 0) - paths_arg_constr.data = MALLOC(paths_arg_constr.datalen * sizeof(LDKCVec_RouteHopZ), "LDKCVec_CVec_RouteHopZZ Elements"); - else - paths_arg_constr.data = NULL; - uint64_tArray* paths_arg_vals = (void*) paths_arg->elems; - for (size_t m = 0; m < paths_arg_constr.datalen; m++) { - uint64_tArray paths_arg_conv_12 = paths_arg_vals[m]; - LDKCVec_RouteHopZ paths_arg_conv_12_constr; - paths_arg_conv_12_constr.datalen = paths_arg_conv_12->arr_len; - if (paths_arg_conv_12_constr.datalen > 0) - paths_arg_conv_12_constr.data = MALLOC(paths_arg_conv_12_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements"); - else - paths_arg_conv_12_constr.data = NULL; - uint64_t* paths_arg_conv_12_vals = paths_arg_conv_12->elems; - for (size_t k = 0; k < paths_arg_conv_12_constr.datalen; k++) { - uint64_t paths_arg_conv_12_conv_10 = paths_arg_conv_12_vals[k]; - LDKRouteHop paths_arg_conv_12_conv_10_conv; - paths_arg_conv_12_conv_10_conv.inner = untag_ptr(paths_arg_conv_12_conv_10); - paths_arg_conv_12_conv_10_conv.is_owned = ptr_is_owned(paths_arg_conv_12_conv_10); - CHECK_INNER_FIELD_ACCESS_OR_NULL(paths_arg_conv_12_conv_10_conv); - paths_arg_conv_12_conv_10_conv = RouteHop_clone(&paths_arg_conv_12_conv_10_conv); - paths_arg_conv_12_constr.data[k] = paths_arg_conv_12_conv_10_conv; - } - FREE(paths_arg_conv_12); - paths_arg_constr.data[m] = paths_arg_conv_12_constr; - } - FREE(paths_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); - LDKRoute ret_var = Route_new(paths_arg_constr, payment_params_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_ProbabilisticScoringParameters_set_considered_impossible_penalty_msat"))) TS_ProbabilisticScoringParameters_set_considered_impossible_penalty_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_considered_impossible_penalty_msat(&this_ptr_conv, val); } -static inline uint64_t Route_clone_ptr(LDKRoute *NONNULL_PTR arg) { - LDKRoute ret_var = Route_clone(arg); +static inline uint64_t ProbabilisticScoringParameters_clone_ptr(LDKProbabilisticScoringParameters *NONNULL_PTR arg) { + LDKProbabilisticScoringParameters ret_var = ProbabilisticScoringParameters_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_Route_clone_ptr"))) TS_Route_clone_ptr(uint64_t arg) { - LDKRoute arg_conv; +int64_t __attribute__((export_name("TS_ProbabilisticScoringParameters_clone_ptr"))) TS_ProbabilisticScoringParameters_clone_ptr(uint64_t arg) { + LDKProbabilisticScoringParameters 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 = Route_clone_ptr(&arg_conv); + int64_t ret_conv = ProbabilisticScoringParameters_clone_ptr(&arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_Route_clone"))) TS_Route_clone(uint64_t orig) { - LDKRoute orig_conv; +uint64_t __attribute__((export_name("TS_ProbabilisticScoringParameters_clone"))) TS_ProbabilisticScoringParameters_clone(uint64_t orig) { + LDKProbabilisticScoringParameters 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; - LDKRoute ret_var = Route_clone(&orig_conv); + LDKProbabilisticScoringParameters ret_var = ProbabilisticScoringParameters_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_Route_hash"))) TS_Route_hash(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.is_owned = false; - int64_t ret_conv = Route_hash(&o_conv); - return ret_conv; -} - -jboolean __attribute__((export_name("TS_Route_eq"))) TS_Route_eq(uint64_t a, uint64_t b) { - LDKRoute 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; - LDKRoute 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 = Route_eq(&a_conv, &b_conv); - return ret_conv; +uint64_t __attribute__((export_name("TS_ProbabilisticScorer_new"))) TS_ProbabilisticScorer_new(uint64_t params, uint64_t network_graph, uint64_t logger) { + LDKProbabilisticScoringParameters params_conv; + params_conv.inner = untag_ptr(params); + params_conv.is_owned = ptr_is_owned(params); + CHECK_INNER_FIELD_ACCESS_OR_NULL(params_conv); + params_conv = ProbabilisticScoringParameters_clone(¶ms_conv); + 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); + } + LDKProbabilisticScorer ret_var = ProbabilisticScorer_new(params_conv, &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; } -int64_t __attribute__((export_name("TS_Route_get_total_fees"))) TS_Route_get_total_fees(uint64_t this_arg) { - LDKRoute this_arg_conv; +void __attribute__((export_name("TS_ProbabilisticScorer_debug_log_liquidity_stats"))) TS_ProbabilisticScorer_debug_log_liquidity_stats(uint64_t this_arg) { + 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; - int64_t ret_conv = Route_get_total_fees(&this_arg_conv); - return ret_conv; + ProbabilisticScorer_debug_log_liquidity_stats(&this_arg_conv); } -int64_t __attribute__((export_name("TS_Route_get_total_amount"))) TS_Route_get_total_amount(uint64_t this_arg) { - LDKRoute this_arg_conv; +uint64_t __attribute__((export_name("TS_ProbabilisticScorer_estimated_channel_liquidity_range"))) TS_ProbabilisticScorer_estimated_channel_liquidity_range(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; - int64_t ret_conv = Route_get_total_amount(&this_arg_conv); - return ret_conv; -} - -int8_tArray __attribute__((export_name("TS_Route_write"))) TS_Route_write(uint64_t obj) { - LDKRoute 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 = Route_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_Route_read"))) TS_Route_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ"); - *ret_conv = Route_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); + 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_u64u64ZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_u64u64ZZ), "LDKCOption_C2Tuple_u64u64ZZ"); + *ret_copy = ProbabilisticScorer_estimated_channel_liquidity_range(&this_arg_conv, scid, &target_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void __attribute__((export_name("TS_RouteParameters_free"))) TS_RouteParameters_free(uint64_t this_obj) { - LDKRouteParameters 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); - RouteParameters_free(this_obj_conv); +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; } -uint64_t __attribute__((export_name("TS_RouteParameters_get_payment_params"))) TS_RouteParameters_get_payment_params(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; - LDKPaymentParameters ret_var = RouteParameters_get_payment_params(&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_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); + 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 node_id_conv; + node_id_conv.inner = untag_ptr(node_id); + node_id_conv.is_owned = ptr_is_owned(node_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv); + node_id_conv.is_owned = false; + ProbabilisticScorer_add_banned(&this_arg_conv, &node_id_conv); } -void __attribute__((export_name("TS_RouteParameters_set_payment_params"))) TS_RouteParameters_set_payment_params(uint64_t this_ptr, uint64_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; - LDKPaymentParameters 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 = PaymentParameters_clone(&val_conv); - RouteParameters_set_payment_params(&this_ptr_conv, val_conv); +void __attribute__((export_name("TS_ProbabilisticScorer_remove_banned"))) TS_ProbabilisticScorer_remove_banned(uint64_t this_arg, uint64_t node_id) { + 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 node_id_conv; + node_id_conv.inner = untag_ptr(node_id); + node_id_conv.is_owned = ptr_is_owned(node_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv); + node_id_conv.is_owned = false; + ProbabilisticScorer_remove_banned(&this_arg_conv, &node_id_conv); } -int64_t __attribute__((export_name("TS_RouteParameters_get_final_value_msat"))) TS_RouteParameters_get_final_value_msat(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; - int64_t ret_conv = RouteParameters_get_final_value_msat(&this_ptr_conv); - return ret_conv; +void __attribute__((export_name("TS_ProbabilisticScorer_set_manual_penalty"))) TS_ProbabilisticScorer_set_manual_penalty(uint64_t this_arg, uint64_t node_id, int64_t penalty) { + 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 node_id_conv; + node_id_conv.inner = untag_ptr(node_id); + node_id_conv.is_owned = ptr_is_owned(node_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv); + node_id_conv.is_owned = false; + ProbabilisticScorer_set_manual_penalty(&this_arg_conv, &node_id_conv, penalty); } -void __attribute__((export_name("TS_RouteParameters_set_final_value_msat"))) TS_RouteParameters_set_final_value_msat(uint64_t this_ptr, int64_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_value_msat(&this_ptr_conv, val); +void __attribute__((export_name("TS_ProbabilisticScorer_remove_manual_penalty"))) TS_ProbabilisticScorer_remove_manual_penalty(uint64_t this_arg, uint64_t node_id) { + 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 node_id_conv; + node_id_conv.inner = untag_ptr(node_id); + node_id_conv.is_owned = ptr_is_owned(node_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv); + node_id_conv.is_owned = false; + ProbabilisticScorer_remove_manual_penalty(&this_arg_conv, &node_id_conv); } -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); - 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_ProbabilisticScorer_clear_manual_penalties"))) TS_ProbabilisticScorer_clear_manual_penalties(uint64_t this_arg) { + 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; + ProbabilisticScorer_clear_manual_penalties(&this_arg_conv); } -static inline uint64_t RouteParameters_clone_ptr(LDKRouteParameters *NONNULL_PTR arg) { - LDKRouteParameters ret_var = RouteParameters_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_RouteParameters_clone_ptr"))) TS_RouteParameters_clone_ptr(uint64_t arg) { - LDKRouteParameters 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 = RouteParameters_clone_ptr(&arg_conv); - return ret_conv; +void __attribute__((export_name("TS_ProbabilisticScoringParameters_add_banned_from_list"))) TS_ProbabilisticScoringParameters_add_banned_from_list(uint64_t this_arg, uint64_tArray node_ids) { + LDKProbabilisticScoringParameters 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_NodeIdZ node_ids_constr; + node_ids_constr.datalen = node_ids->arr_len; + if (node_ids_constr.datalen > 0) + node_ids_constr.data = MALLOC(node_ids_constr.datalen * sizeof(LDKNodeId), "LDKCVec_NodeIdZ Elements"); + else + node_ids_constr.data = NULL; + uint64_t* node_ids_vals = node_ids->elems; + for (size_t i = 0; i < node_ids_constr.datalen; i++) { + uint64_t node_ids_conv_8 = node_ids_vals[i]; + LDKNodeId node_ids_conv_8_conv; + node_ids_conv_8_conv.inner = untag_ptr(node_ids_conv_8); + node_ids_conv_8_conv.is_owned = ptr_is_owned(node_ids_conv_8); + CHECK_INNER_FIELD_ACCESS_OR_NULL(node_ids_conv_8_conv); + node_ids_conv_8_conv = NodeId_clone(&node_ids_conv_8_conv); + node_ids_constr.data[i] = node_ids_conv_8_conv; + } + FREE(node_ids); + ProbabilisticScoringParameters_add_banned_from_list(&this_arg_conv, node_ids_constr); } -uint64_t __attribute__((export_name("TS_RouteParameters_clone"))) TS_RouteParameters_clone(uint64_t orig) { - LDKRouteParameters 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; - LDKRouteParameters ret_var = RouteParameters_clone(&orig_conv); +uint64_t __attribute__((export_name("TS_ProbabilisticScoringParameters_default"))) TS_ProbabilisticScoringParameters_default() { + LDKProbabilisticScoringParameters ret_var = ProbabilisticScoringParameters_default(); 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; +uint64_t __attribute__((export_name("TS_ProbabilisticScorer_as_Score"))) TS_ProbabilisticScorer_as_Score(uint64_t this_arg) { + 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; + LDKScore* ret_ret = MALLOC(sizeof(LDKScore), "LDKScore"); + *ret_ret = ProbabilisticScorer_as_Score(&this_arg_conv); + return tag_ptr(ret_ret, true); } -int8_tArray __attribute__((export_name("TS_RouteParameters_write"))) TS_RouteParameters_write(uint64_t obj) { - LDKRouteParameters obj_conv; +int8_tArray __attribute__((export_name("TS_ProbabilisticScorer_write"))) TS_ProbabilisticScorer_write(uint64_t obj) { + LDKProbabilisticScorer 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 = RouteParameters_write(&obj_conv); + LDKCVec_u8Z ret_var = ProbabilisticScorer_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_RouteParameters_read"))) TS_RouteParameters_read(int8_tArray ser) { +uint64_t __attribute__((export_name("TS_ProbabilisticScorer_read"))) TS_ProbabilisticScorer_read(int8_tArray ser, uint64_t arg_a, uint64_t arg_b, uint64_t arg_c) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; ser_ref.data = ser->elems; - LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ"); - *ret_conv = RouteParameters_read(ser_ref); + LDKProbabilisticScoringParameters arg_a_conv; + arg_a_conv.inner = untag_ptr(arg_a); + arg_a_conv.is_owned = ptr_is_owned(arg_a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_a_conv); + arg_a_conv = ProbabilisticScoringParameters_clone(&arg_a_conv); + LDKNetworkGraph arg_b_conv; + arg_b_conv.inner = untag_ptr(arg_b); + arg_b_conv.is_owned = ptr_is_owned(arg_b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_b_conv); + arg_b_conv.is_owned = false; + void* arg_c_ptr = untag_ptr(arg_c); + CHECK_ACCESS(arg_c_ptr); + LDKLogger arg_c_conv = *(LDKLogger*)(arg_c_ptr); + if (arg_c_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&arg_c_conv); + } + LDKCResult_ProbabilisticScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ProbabilisticScorerDecodeErrorZ), "LDKCResult_ProbabilisticScorerDecodeErrorZ"); + *ret_conv = ProbabilisticScorer_read(ser_ref, arg_a_conv, &arg_b_conv, arg_c_conv); FREE(ser); return tag_ptr(ret_conv, true); } -void __attribute__((export_name("TS_PaymentParameters_free"))) TS_PaymentParameters_free(uint64_t this_obj) { - LDKPaymentParameters this_obj_conv; +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); - PaymentParameters_free(this_obj_conv); + OnionMessenger_free(this_obj_conv); } -int8_tArray __attribute__((export_name("TS_PaymentParameters_get_payee_pubkey"))) TS_PaymentParameters_get_payee_pubkey(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; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, PaymentParameters_get_payee_pubkey(&this_ptr_conv).compressed_form, 33); - return ret_arr; +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); } -void __attribute__((export_name("TS_PaymentParameters_set_payee_pubkey"))) TS_PaymentParameters_set_payee_pubkey(uint64_t this_ptr, int8_tArray 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; - LDKPublicKey val_ref; - CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); - PaymentParameters_set_payee_pubkey(&this_ptr_conv, val_ref); +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_PaymentParameters_get_features"))) TS_PaymentParameters_get_features(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; - LDKInvoiceFeatures ret_var = PaymentParameters_get_features(&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); +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; } -void __attribute__((export_name("TS_PaymentParameters_set_features"))) TS_PaymentParameters_set_features(uint64_t this_ptr, uint64_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; - LDKInvoiceFeatures 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 = InvoiceFeatures_clone(&val_conv); - PaymentParameters_set_features(&this_ptr_conv, val_conv); +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_tArray __attribute__((export_name("TS_PaymentParameters_get_route_hints"))) TS_PaymentParameters_get_route_hints(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; - LDKCVec_RouteHintZ ret_var = PaymentParameters_get_route_hints(&this_ptr_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 l = 0; l < ret_var.datalen; l++) { - LDKRouteHint ret_conv_11_var = ret_var.data[l]; - uint64_t ret_conv_11_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_11_var); - ret_conv_11_ref = tag_ptr(ret_conv_11_var.inner, ret_conv_11_var.is_owned); - ret_arr_ptr[l] = ret_conv_11_ref; - } - - FREE(ret_var.data); - return ret_arr; +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_PaymentParameters_set_route_hints"))) TS_PaymentParameters_set_route_hints(uint64_t this_ptr, uint64_tArray 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; - LDKCVec_RouteHintZ val_constr; - val_constr.datalen = val->arr_len; - if (val_constr.datalen > 0) - val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKRouteHint), "LDKCVec_RouteHintZ Elements"); - else - val_constr.data = NULL; - uint64_t* val_vals = val->elems; - for (size_t l = 0; l < val_constr.datalen; l++) { - uint64_t val_conv_11 = val_vals[l]; - LDKRouteHint val_conv_11_conv; - val_conv_11_conv.inner = untag_ptr(val_conv_11); - val_conv_11_conv.is_owned = ptr_is_owned(val_conv_11); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_11_conv); - val_conv_11_conv = RouteHint_clone(&val_conv_11_conv); - val_constr.data[l] = val_conv_11_conv; - } - FREE(val); - PaymentParameters_set_route_hints(&this_ptr_conv, val_constr); +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); } -uint64_t __attribute__((export_name("TS_PaymentParameters_get_expiry_time"))) TS_PaymentParameters_get_expiry_time(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; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = PaymentParameters_get_expiry_time(&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; +} -void __attribute__((export_name("TS_PaymentParameters_set_expiry_time"))) TS_PaymentParameters_set_expiry_time(uint64_t this_ptr, uint64_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; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); - val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); - PaymentParameters_set_expiry_time(&this_ptr_conv, val_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; } -int32_t __attribute__((export_name("TS_PaymentParameters_get_max_total_cltv_expiry_delta"))) TS_PaymentParameters_get_max_total_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_max_total_cltv_expiry_delta(&this_ptr_conv); - return ret_conv; +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; } -void __attribute__((export_name("TS_PaymentParameters_set_max_total_cltv_expiry_delta"))) TS_PaymentParameters_set_max_total_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_max_total_cltv_expiry_delta(&this_ptr_conv, val); +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; } -int8_t __attribute__((export_name("TS_PaymentParameters_get_max_path_count"))) TS_PaymentParameters_get_max_path_count(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; - int8_t ret_conv = PaymentParameters_get_max_path_count(&this_ptr_conv); - return ret_conv; +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; } -void __attribute__((export_name("TS_PaymentParameters_set_max_path_count"))) TS_PaymentParameters_set_max_path_count(uint64_t this_ptr, int8_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_max_path_count(&this_ptr_conv, val); +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; } -int8_t __attribute__((export_name("TS_PaymentParameters_get_max_channel_saturation_power_of_half"))) TS_PaymentParameters_get_max_channel_saturation_power_of_half(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; - int8_t ret_conv = PaymentParameters_get_max_channel_saturation_power_of_half(&this_ptr_conv); - return ret_conv; +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; } -void __attribute__((export_name("TS_PaymentParameters_set_max_channel_saturation_power_of_half"))) TS_PaymentParameters_set_max_channel_saturation_power_of_half(uint64_t this_ptr, int8_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_max_channel_saturation_power_of_half(&this_ptr_conv, val); +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; } -int64_tArray __attribute__((export_name("TS_PaymentParameters_get_previously_failed_channels"))) TS_PaymentParameters_get_previously_failed_channels(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; - LDKCVec_u64Z ret_var = PaymentParameters_get_previously_failed_channels(&this_ptr_conv); - int64_tArray ret_arr = NULL; - ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); - int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); - for (size_t i = 0; i < ret_var.datalen; i++) { - int64_t ret_conv_8_conv = ret_var.data[i]; - ret_arr_ptr[i] = ret_conv_8_conv; - } - - FREE(ret_var.data); - return ret_arr; +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; } -void __attribute__((export_name("TS_PaymentParameters_set_previously_failed_channels"))) TS_PaymentParameters_set_previously_failed_channels(uint64_t this_ptr, int64_tArray 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; - LDKCVec_u64Z val_constr; - val_constr.datalen = val->arr_len; - if (val_constr.datalen > 0) - val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); - else - val_constr.data = NULL; - int64_t* val_vals = val->elems; - for (size_t i = 0; i < val_constr.datalen; i++) { - int64_t val_conv_8 = val_vals[i]; - val_constr.data[i] = val_conv_8; - } - FREE(val); - PaymentParameters_set_previously_failed_channels(&this_ptr_conv, val_constr); +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; } -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); +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_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); +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_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); - LDKInvoiceFeatures features_arg_conv; - features_arg_conv.inner = untag_ptr(features_arg); - features_arg_conv.is_owned = ptr_is_owned(features_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv); - features_arg_conv = InvoiceFeatures_clone(&features_arg_conv); - LDKCVec_RouteHintZ route_hints_arg_constr; - route_hints_arg_constr.datalen = route_hints_arg->arr_len; - if (route_hints_arg_constr.datalen > 0) - route_hints_arg_constr.data = MALLOC(route_hints_arg_constr.datalen * sizeof(LDKRouteHint), "LDKCVec_RouteHintZ Elements"); - else - route_hints_arg_constr.data = NULL; - uint64_t* route_hints_arg_vals = route_hints_arg->elems; - for (size_t l = 0; l < route_hints_arg_constr.datalen; l++) { - uint64_t route_hints_arg_conv_11 = route_hints_arg_vals[l]; - LDKRouteHint route_hints_arg_conv_11_conv; - route_hints_arg_conv_11_conv.inner = untag_ptr(route_hints_arg_conv_11); - route_hints_arg_conv_11_conv.is_owned = ptr_is_owned(route_hints_arg_conv_11); - CHECK_INNER_FIELD_ACCESS_OR_NULL(route_hints_arg_conv_11_conv); - route_hints_arg_conv_11_conv = RouteHint_clone(&route_hints_arg_conv_11_conv); - route_hints_arg_constr.data[l] = route_hints_arg_conv_11_conv; - } - FREE(route_hints_arg); - void* expiry_time_arg_ptr = untag_ptr(expiry_time_arg); - CHECK_ACCESS(expiry_time_arg_ptr); - LDKCOption_u64Z expiry_time_arg_conv = *(LDKCOption_u64Z*)(expiry_time_arg_ptr); - expiry_time_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(expiry_time_arg)); - LDKCVec_u64Z previously_failed_channels_arg_constr; - previously_failed_channels_arg_constr.datalen = previously_failed_channels_arg->arr_len; - if (previously_failed_channels_arg_constr.datalen > 0) - previously_failed_channels_arg_constr.data = MALLOC(previously_failed_channels_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); - else - previously_failed_channels_arg_constr.data = NULL; - int64_t* previously_failed_channels_arg_vals = previously_failed_channels_arg->elems; - for (size_t i = 0; i < previously_failed_channels_arg_constr.datalen; i++) { - int64_t previously_failed_channels_arg_conv_8 = previously_failed_channels_arg_vals[i]; - previously_failed_channels_arg_constr.data[i] = previously_failed_channels_arg_conv_8; +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); } - 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, final_cltv_expiry_delta_arg); + 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; } -static inline uint64_t PaymentParameters_clone_ptr(LDKPaymentParameters *NONNULL_PTR arg) { - LDKPaymentParameters ret_var = PaymentParameters_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_PaymentParameters_clone_ptr"))) TS_PaymentParameters_clone_ptr(uint64_t arg) { - LDKPaymentParameters 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 = PaymentParameters_clone_ptr(&arg_conv); - return ret_conv; +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_PaymentParameters_clone"))) TS_PaymentParameters_clone(uint64_t orig) { - LDKPaymentParameters 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; - LDKPaymentParameters ret_var = PaymentParameters_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_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); } -int64_t __attribute__((export_name("TS_PaymentParameters_hash"))) TS_PaymentParameters_hash(uint64_t o) { - LDKPaymentParameters 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 = PaymentParameters_hash(&o_conv); - return ret_conv; +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); } -jboolean __attribute__((export_name("TS_PaymentParameters_eq"))) TS_PaymentParameters_eq(uint64_t a, uint64_t b) { - LDKPaymentParameters 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; - LDKPaymentParameters 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 = PaymentParameters_eq(&a_conv, &b_conv); - return ret_conv; +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); } -int8_tArray __attribute__((export_name("TS_PaymentParameters_write"))) TS_PaymentParameters_write(uint64_t obj) { - LDKPaymentParameters 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 = PaymentParameters_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; +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; } - -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, arg); - FREE(ser); - return tag_ptr(ret_conv, true); +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_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, 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); +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_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, 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); +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; } -void __attribute__((export_name("TS_RouteHint_free"))) TS_RouteHint_free(uint64_t this_obj) { - LDKRouteHint 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); - RouteHint_free(this_obj_conv); +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_tArray __attribute__((export_name("TS_RouteHint_get_a"))) TS_RouteHint_get_a(uint64_t this_ptr) { - LDKRouteHint 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; - LDKCVec_RouteHintHopZ ret_var = RouteHint_get_a(&this_ptr_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++) { - LDKRouteHintHop ret_conv_14_var = ret_var.data[o]; - uint64_t ret_conv_14_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_14_var); - ret_conv_14_ref = tag_ptr(ret_conv_14_var.inner, ret_conv_14_var.is_owned); - ret_arr_ptr[o] = ret_conv_14_ref; - } - - FREE(ret_var.data); - return ret_arr; +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_RouteHint_set_a"))) TS_RouteHint_set_a(uint64_t this_ptr, uint64_tArray val) { - LDKRouteHint 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; - LDKCVec_RouteHintHopZ val_constr; - val_constr.datalen = val->arr_len; - if (val_constr.datalen > 0) - val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKRouteHintHop), "LDKCVec_RouteHintHopZ Elements"); - else - val_constr.data = NULL; - uint64_t* val_vals = val->elems; - for (size_t o = 0; o < val_constr.datalen; o++) { - uint64_t val_conv_14 = val_vals[o]; - LDKRouteHintHop val_conv_14_conv; - val_conv_14_conv.inner = untag_ptr(val_conv_14); - val_conv_14_conv.is_owned = ptr_is_owned(val_conv_14); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_14_conv); - val_conv_14_conv = RouteHintHop_clone(&val_conv_14_conv); - val_constr.data[o] = val_conv_14_conv; - } - FREE(val); - RouteHint_set_a(&this_ptr_conv, val_constr); +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); } -uint64_t __attribute__((export_name("TS_RouteHint_new"))) TS_RouteHint_new(uint64_tArray a_arg) { - LDKCVec_RouteHintHopZ a_arg_constr; - a_arg_constr.datalen = a_arg->arr_len; - if (a_arg_constr.datalen > 0) - a_arg_constr.data = MALLOC(a_arg_constr.datalen * sizeof(LDKRouteHintHop), "LDKCVec_RouteHintHopZ Elements"); - else - a_arg_constr.data = NULL; - uint64_t* a_arg_vals = a_arg->elems; - for (size_t o = 0; o < a_arg_constr.datalen; o++) { - uint64_t a_arg_conv_14 = a_arg_vals[o]; - LDKRouteHintHop a_arg_conv_14_conv; - a_arg_conv_14_conv.inner = untag_ptr(a_arg_conv_14); - a_arg_conv_14_conv.is_owned = ptr_is_owned(a_arg_conv_14); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_arg_conv_14_conv); - a_arg_conv_14_conv = RouteHintHop_clone(&a_arg_conv_14_conv); - a_arg_constr.data[o] = a_arg_conv_14_conv; - } - FREE(a_arg); - LDKRouteHint ret_var = RouteHint_new(a_arg_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); - return ret_ref; +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 RouteHint_clone_ptr(LDKRouteHint *NONNULL_PTR arg) { - LDKRouteHint ret_var = RouteHint_clone(arg); +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_RouteHint_clone_ptr"))) TS_RouteHint_clone_ptr(uint64_t arg) { - LDKRouteHint arg_conv; +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 = RouteHint_clone_ptr(&arg_conv); + int64_t ret_conv = BlindedPath_clone_ptr(&arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_RouteHint_clone"))) TS_RouteHint_clone(uint64_t orig) { - LDKRouteHint orig_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; - LDKRouteHint ret_var = RouteHint_clone(&orig_conv); + 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; } -int64_t __attribute__((export_name("TS_RouteHint_hash"))) TS_RouteHint_hash(uint64_t o) { - LDKRouteHint o_conv; +int64_t __attribute__((export_name("TS_BlindedPath_hash"))) TS_BlindedPath_hash(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.is_owned = false; - int64_t ret_conv = RouteHint_hash(&o_conv); + int64_t ret_conv = BlindedPath_hash(&o_conv); return ret_conv; } -jboolean __attribute__((export_name("TS_RouteHint_eq"))) TS_RouteHint_eq(uint64_t a, uint64_t b) { - LDKRouteHint a_conv; +jboolean __attribute__((export_name("TS_BlindedPath_eq"))) TS_BlindedPath_eq(uint64_t a, uint64_t b) { + 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.is_owned = false; - LDKRouteHint b_conv; + LDKBlindedPath 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 = RouteHint_eq(&a_conv, &b_conv); + jboolean ret_conv = BlindedPath_eq(&a_conv, &b_conv); return ret_conv; } -int8_tArray __attribute__((export_name("TS_RouteHint_write"))) TS_RouteHint_write(uint64_t obj) { - LDKRouteHint 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 = RouteHint_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_RouteHint_read"))) TS_RouteHint_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ"); - *ret_conv = RouteHint_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); -} - -void __attribute__((export_name("TS_RouteHintHop_free"))) TS_RouteHintHop_free(uint64_t this_obj) { - LDKRouteHintHop this_obj_conv; +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); - RouteHintHop_free(this_obj_conv); -} - -int8_tArray __attribute__((export_name("TS_RouteHintHop_get_src_node_id"))) TS_RouteHintHop_get_src_node_id(uint64_t this_ptr) { - LDKRouteHintHop 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, RouteHintHop_get_src_node_id(&this_ptr_conv).compressed_form, 33); - return ret_arr; -} - -void __attribute__((export_name("TS_RouteHintHop_set_src_node_id"))) TS_RouteHintHop_set_src_node_id(uint64_t this_ptr, int8_tArray val) { - LDKRouteHintHop 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); - RouteHintHop_set_src_node_id(&this_ptr_conv, val_ref); -} - -int64_t __attribute__((export_name("TS_RouteHintHop_get_short_channel_id"))) TS_RouteHintHop_get_short_channel_id(uint64_t this_ptr) { - LDKRouteHintHop 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 = RouteHintHop_get_short_channel_id(&this_ptr_conv); - return ret_conv; -} - -void __attribute__((export_name("TS_RouteHintHop_set_short_channel_id"))) TS_RouteHintHop_set_short_channel_id(uint64_t this_ptr, int64_t val) { - LDKRouteHintHop 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; - RouteHintHop_set_short_channel_id(&this_ptr_conv, val); -} - -uint64_t __attribute__((export_name("TS_RouteHintHop_get_fees"))) TS_RouteHintHop_get_fees(uint64_t this_ptr) { - LDKRouteHintHop 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 = RouteHintHop_get_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_RouteHintHop_set_fees"))) TS_RouteHintHop_set_fees(uint64_t this_ptr, uint64_t val) { - LDKRouteHintHop 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); - RouteHintHop_set_fees(&this_ptr_conv, val_conv); -} - -int16_t __attribute__((export_name("TS_RouteHintHop_get_cltv_expiry_delta"))) TS_RouteHintHop_get_cltv_expiry_delta(uint64_t this_ptr) { - LDKRouteHintHop 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; - int16_t ret_conv = RouteHintHop_get_cltv_expiry_delta(&this_ptr_conv); - return ret_conv; -} - -void __attribute__((export_name("TS_RouteHintHop_set_cltv_expiry_delta"))) TS_RouteHintHop_set_cltv_expiry_delta(uint64_t this_ptr, int16_t val) { - LDKRouteHintHop 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; - RouteHintHop_set_cltv_expiry_delta(&this_ptr_conv, val); -} - -uint64_t __attribute__((export_name("TS_RouteHintHop_get_htlc_minimum_msat"))) TS_RouteHintHop_get_htlc_minimum_msat(uint64_t this_ptr) { - LDKRouteHintHop 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_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = RouteHintHop_get_htlc_minimum_msat(&this_ptr_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -void __attribute__((export_name("TS_RouteHintHop_set_htlc_minimum_msat"))) TS_RouteHintHop_set_htlc_minimum_msat(uint64_t this_ptr, uint64_t val) { - LDKRouteHintHop 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_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); - val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); - RouteHintHop_set_htlc_minimum_msat(&this_ptr_conv, val_conv); -} - -uint64_t __attribute__((export_name("TS_RouteHintHop_get_htlc_maximum_msat"))) TS_RouteHintHop_get_htlc_maximum_msat(uint64_t this_ptr) { - LDKRouteHintHop 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_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = RouteHintHop_get_htlc_maximum_msat(&this_ptr_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -void __attribute__((export_name("TS_RouteHintHop_set_htlc_maximum_msat"))) TS_RouteHintHop_set_htlc_maximum_msat(uint64_t this_ptr, uint64_t val) { - LDKRouteHintHop 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_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); - val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); - RouteHintHop_set_htlc_maximum_msat(&this_ptr_conv, val_conv); -} - -uint64_t __attribute__((export_name("TS_RouteHintHop_new"))) TS_RouteHintHop_new(int8_tArray src_node_id_arg, int64_t short_channel_id_arg, uint64_t fees_arg, int16_t cltv_expiry_delta_arg, uint64_t htlc_minimum_msat_arg, uint64_t htlc_maximum_msat_arg) { - LDKPublicKey src_node_id_arg_ref; - CHECK(src_node_id_arg->arr_len == 33); - memcpy(src_node_id_arg_ref.compressed_form, src_node_id_arg->elems, 33); FREE(src_node_id_arg); - LDKRoutingFees fees_arg_conv; - fees_arg_conv.inner = untag_ptr(fees_arg); - fees_arg_conv.is_owned = ptr_is_owned(fees_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(fees_arg_conv); - fees_arg_conv = RoutingFees_clone(&fees_arg_conv); - void* htlc_minimum_msat_arg_ptr = untag_ptr(htlc_minimum_msat_arg); - CHECK_ACCESS(htlc_minimum_msat_arg_ptr); - LDKCOption_u64Z htlc_minimum_msat_arg_conv = *(LDKCOption_u64Z*)(htlc_minimum_msat_arg_ptr); - htlc_minimum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(htlc_minimum_msat_arg)); - void* htlc_maximum_msat_arg_ptr = untag_ptr(htlc_maximum_msat_arg); - CHECK_ACCESS(htlc_maximum_msat_arg_ptr); - LDKCOption_u64Z htlc_maximum_msat_arg_conv = *(LDKCOption_u64Z*)(htlc_maximum_msat_arg_ptr); - htlc_maximum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(htlc_maximum_msat_arg)); - LDKRouteHintHop ret_var = RouteHintHop_new(src_node_id_arg_ref, short_channel_id_arg, fees_arg_conv, cltv_expiry_delta_arg, htlc_minimum_msat_arg_conv, htlc_maximum_msat_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; + BlindedHop_free(this_obj_conv); } -static inline uint64_t RouteHintHop_clone_ptr(LDKRouteHintHop *NONNULL_PTR arg) { - LDKRouteHintHop ret_var = RouteHintHop_clone(arg); +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_RouteHintHop_clone_ptr"))) TS_RouteHintHop_clone_ptr(uint64_t arg) { - LDKRouteHintHop arg_conv; +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 = RouteHintHop_clone_ptr(&arg_conv); + int64_t ret_conv = BlindedHop_clone_ptr(&arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_RouteHintHop_clone"))) TS_RouteHintHop_clone(uint64_t orig) { - LDKRouteHintHop orig_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; - LDKRouteHintHop ret_var = RouteHintHop_clone(&orig_conv); + 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; } -int64_t __attribute__((export_name("TS_RouteHintHop_hash"))) TS_RouteHintHop_hash(uint64_t o) { - LDKRouteHintHop o_conv; +int64_t __attribute__((export_name("TS_BlindedHop_hash"))) TS_BlindedHop_hash(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.is_owned = false; - int64_t ret_conv = RouteHintHop_hash(&o_conv); + int64_t ret_conv = BlindedHop_hash(&o_conv); return ret_conv; } -jboolean __attribute__((export_name("TS_RouteHintHop_eq"))) TS_RouteHintHop_eq(uint64_t a, uint64_t b) { - LDKRouteHintHop a_conv; +jboolean __attribute__((export_name("TS_BlindedHop_eq"))) TS_BlindedHop_eq(uint64_t a, uint64_t b) { + LDKBlindedHop 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; - LDKRouteHintHop b_conv; + LDKBlindedHop 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 = RouteHintHop_eq(&a_conv, &b_conv); + jboolean ret_conv = BlindedHop_eq(&a_conv, &b_conv); return ret_conv; } -int8_tArray __attribute__((export_name("TS_RouteHintHop_write"))) TS_RouteHintHop_write(uint64_t obj) { - LDKRouteHintHop obj_conv; +uint64_t __attribute__((export_name("TS_BlindedPath_new_for_message"))) TS_BlindedPath_new_for_message(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_for_message(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 = RouteHintHop_write(&obj_conv); + 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_RouteHintHop_read"))) TS_RouteHintHop_read(int8_tArray ser) { +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_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ"); - *ret_conv = RouteHintHop_read(ser_ref); + LDKCResult_BlindedPathDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathDecodeErrorZ), "LDKCResult_BlindedPathDecodeErrorZ"); + *ret_conv = BlindedPath_read(ser_ref); FREE(ser); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_find_route"))) TS_find_route(int8_tArray our_node_pubkey, uint64_t route_params, uint64_t network_graph, uint64_tArray first_hops, uint64_t logger, uint64_t scorer, int8_tArray random_seed_bytes) { - LDKPublicKey our_node_pubkey_ref; - CHECK(our_node_pubkey->arr_len == 33); - memcpy(our_node_pubkey_ref.compressed_form, our_node_pubkey->elems, 33); FREE(our_node_pubkey); - 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; - 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; - 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* 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* scorer_ptr = untag_ptr(scorer); - if (ptr_is_owned(scorer)) { CHECK_ACCESS(scorer_ptr); } - LDKScore* scorer_conv = (LDKScore*)scorer_ptr; - 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); - 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); } - 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_build_route_from_hops"))) TS_build_route_from_hops(int8_tArray our_node_pubkey, ptrArray hops, uint64_t route_params, uint64_t network_graph, uint64_t logger, int8_tArray random_seed_bytes) { - LDKPublicKey our_node_pubkey_ref; - CHECK(our_node_pubkey->arr_len == 33); - memcpy(our_node_pubkey_ref.compressed_form, our_node_pubkey->elems, 33); FREE(our_node_pubkey); - LDKCVec_PublicKeyZ hops_constr; - hops_constr.datalen = hops->arr_len; - if (hops_constr.datalen > 0) - hops_constr.data = MALLOC(hops_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements"); - else - hops_constr.data = NULL; - int8_tArray* hops_vals = (void*) hops->elems; - for (size_t m = 0; m < hops_constr.datalen; m++) { - int8_tArray hops_conv_12 = hops_vals[m]; - LDKPublicKey hops_conv_12_ref; - CHECK(hops_conv_12->arr_len == 33); - memcpy(hops_conv_12_ref.compressed_form, hops_conv_12->elems, 33); FREE(hops_conv_12); - hops_constr.data[m] = hops_conv_12_ref; - } - FREE(hops); - 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; - 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); - } - 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); - 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); +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_Score_free"))) TS_Score_free(uint64_t this_ptr) { +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); CHECK_ACCESS(this_ptr_ptr); - LDKScore this_ptr_conv = *(LDKScore*)(this_ptr_ptr); + LDKPaymentPurpose this_ptr_conv = *(LDKPaymentPurpose*)(this_ptr_ptr); FREE(untag_ptr(this_ptr)); - Score_free(this_ptr_conv); + PaymentPurpose_free(this_ptr_conv); } -void __attribute__((export_name("TS_LockableScore_free"))) TS_LockableScore_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); - LDKLockableScore this_ptr_conv = *(LDKLockableScore*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - LockableScore_free(this_ptr_conv); +static inline uint64_t PaymentPurpose_clone_ptr(LDKPaymentPurpose *NONNULL_PTR arg) { + LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose"); + *ret_copy = PaymentPurpose_clone(arg); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t __attribute__((export_name("TS_PaymentPurpose_clone_ptr"))) TS_PaymentPurpose_clone_ptr(uint64_t arg) { + LDKPaymentPurpose* arg_conv = (LDKPaymentPurpose*)untag_ptr(arg); + int64_t ret_conv = PaymentPurpose_clone_ptr(arg_conv); + return ret_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); +uint64_t __attribute__((export_name("TS_PaymentPurpose_clone"))) TS_PaymentPurpose_clone(uint64_t orig) { + LDKPaymentPurpose* orig_conv = (LDKPaymentPurpose*)untag_ptr(orig); + LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose"); + *ret_copy = PaymentPurpose_clone(orig_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -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); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - MultiThreadedLockableScore_free(this_obj_conv); +uint64_t __attribute__((export_name("TS_PaymentPurpose_invoice_payment"))) TS_PaymentPurpose_invoice_payment(int8_tArray payment_preimage, int8_tArray payment_secret) { + LDKThirtyTwoBytes payment_preimage_ref; + CHECK(payment_preimage->arr_len == 32); + memcpy(payment_preimage_ref.data, payment_preimage->elems, 32); FREE(payment_preimage); + LDKThirtyTwoBytes payment_secret_ref; + CHECK(payment_secret->arr_len == 32); + memcpy(payment_secret_ref.data, payment_secret->elems, 32); FREE(payment_secret); + LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose"); + *ret_copy = PaymentPurpose_invoice_payment(payment_preimage_ref, payment_secret_ref); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -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_PaymentPurpose_spontaneous_payment"))) TS_PaymentPurpose_spontaneous_payment(int8_tArray a) { + LDKThirtyTwoBytes a_ref; + CHECK(a->arr_len == 32); + memcpy(a_ref.data, a->elems, 32); FREE(a); + LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose"); + *ret_copy = PaymentPurpose_spontaneous_payment(a_ref); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -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); +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_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 __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); 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); +uint64_t __attribute__((export_name("TS_PaymentPurpose_read"))) TS_PaymentPurpose_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ"); + *ret_conv = PaymentPurpose_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -int8_tArray __attribute__((export_name("TS_MultiThreadedLockableScore_write"))) TS_MultiThreadedLockableScore_write(uint64_t obj) { - LDKMultiThreadedLockableScore 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 = MultiThreadedLockableScore_write(&obj_conv); +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_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_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); } -uint64_t __attribute__((export_name("TS_MultiThreadedLockableScore_new"))) TS_MultiThreadedLockableScore_new(uint64_t score) { - void* score_ptr = untag_ptr(score); - CHECK_ACCESS(score_ptr); - LDKScore score_conv = *(LDKScore*)(score_ptr); - if (score_conv.free == LDKScore_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKScore_JCalls_cloned(&score_conv); - } - LDKMultiThreadedLockableScore ret_var = MultiThreadedLockableScore_new(score_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); +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); + CHECK_ACCESS(this_ptr_ptr); + LDKClosureReason this_ptr_conv = *(LDKClosureReason*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + ClosureReason_free(this_ptr_conv); +} + +static inline uint64_t ClosureReason_clone_ptr(LDKClosureReason *NONNULL_PTR arg) { + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_clone(arg); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } +int64_t __attribute__((export_name("TS_ClosureReason_clone_ptr"))) TS_ClosureReason_clone_ptr(uint64_t arg) { + LDKClosureReason* arg_conv = (LDKClosureReason*)untag_ptr(arg); + int64_t ret_conv = ClosureReason_clone_ptr(arg_conv); + return ret_conv; +} -void __attribute__((export_name("TS_ChannelUsage_free"))) TS_ChannelUsage_free(uint64_t this_obj) { - LDKChannelUsage 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); - ChannelUsage_free(this_obj_conv); +uint64_t __attribute__((export_name("TS_ClosureReason_clone"))) TS_ClosureReason_clone(uint64_t orig) { + LDKClosureReason* orig_conv = (LDKClosureReason*)untag_ptr(orig); + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_clone(orig_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t __attribute__((export_name("TS_ChannelUsage_get_amount_msat"))) TS_ChannelUsage_get_amount_msat(uint64_t this_ptr) { - LDKChannelUsage 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 = ChannelUsage_get_amount_msat(&this_ptr_conv); - return ret_conv; +uint64_t __attribute__((export_name("TS_ClosureReason_counterparty_force_closed"))) TS_ClosureReason_counterparty_force_closed(uint64_t peer_msg) { + LDKUntrustedString peer_msg_conv; + peer_msg_conv.inner = untag_ptr(peer_msg); + peer_msg_conv.is_owned = ptr_is_owned(peer_msg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(peer_msg_conv); + peer_msg_conv = UntrustedString_clone(&peer_msg_conv); + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_counterparty_force_closed(peer_msg_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void __attribute__((export_name("TS_ChannelUsage_set_amount_msat"))) TS_ChannelUsage_set_amount_msat(uint64_t this_ptr, int64_t val) { - LDKChannelUsage 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; - ChannelUsage_set_amount_msat(&this_ptr_conv, val); +uint64_t __attribute__((export_name("TS_ClosureReason_holder_force_closed"))) TS_ClosureReason_holder_force_closed() { + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_holder_force_closed(); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t __attribute__((export_name("TS_ChannelUsage_get_inflight_htlc_msat"))) TS_ChannelUsage_get_inflight_htlc_msat(uint64_t this_ptr) { - LDKChannelUsage 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 = ChannelUsage_get_inflight_htlc_msat(&this_ptr_conv); - return ret_conv; +uint64_t __attribute__((export_name("TS_ClosureReason_cooperative_closure"))) TS_ClosureReason_cooperative_closure() { + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_cooperative_closure(); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void __attribute__((export_name("TS_ChannelUsage_set_inflight_htlc_msat"))) TS_ChannelUsage_set_inflight_htlc_msat(uint64_t this_ptr, int64_t val) { - LDKChannelUsage 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; - ChannelUsage_set_inflight_htlc_msat(&this_ptr_conv, val); +uint64_t __attribute__((export_name("TS_ClosureReason_commitment_tx_confirmed"))) TS_ClosureReason_commitment_tx_confirmed() { + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_commitment_tx_confirmed(); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -uint64_t __attribute__((export_name("TS_ChannelUsage_get_effective_capacity"))) TS_ChannelUsage_get_effective_capacity(uint64_t this_ptr) { - LDKChannelUsage 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; - LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); - *ret_copy = ChannelUsage_get_effective_capacity(&this_ptr_conv); +uint64_t __attribute__((export_name("TS_ClosureReason_funding_timed_out"))) TS_ClosureReason_funding_timed_out() { + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_funding_timed_out(); uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -void __attribute__((export_name("TS_ChannelUsage_set_effective_capacity"))) TS_ChannelUsage_set_effective_capacity(uint64_t this_ptr, uint64_t val) { - LDKChannelUsage 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); - LDKEffectiveCapacity val_conv = *(LDKEffectiveCapacity*)(val_ptr); - val_conv = EffectiveCapacity_clone((LDKEffectiveCapacity*)untag_ptr(val)); - ChannelUsage_set_effective_capacity(&this_ptr_conv, val_conv); +uint64_t __attribute__((export_name("TS_ClosureReason_processing_error"))) TS_ClosureReason_processing_error(jstring err) { + LDKStr err_conv = str_ref_to_owned_c(err); + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_processing_error(err_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -uint64_t __attribute__((export_name("TS_ChannelUsage_new"))) TS_ChannelUsage_new(int64_t amount_msat_arg, int64_t inflight_htlc_msat_arg, uint64_t effective_capacity_arg) { - void* effective_capacity_arg_ptr = untag_ptr(effective_capacity_arg); - CHECK_ACCESS(effective_capacity_arg_ptr); - LDKEffectiveCapacity effective_capacity_arg_conv = *(LDKEffectiveCapacity*)(effective_capacity_arg_ptr); - effective_capacity_arg_conv = EffectiveCapacity_clone((LDKEffectiveCapacity*)untag_ptr(effective_capacity_arg)); - LDKChannelUsage ret_var = ChannelUsage_new(amount_msat_arg, inflight_htlc_msat_arg, effective_capacity_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); +uint64_t __attribute__((export_name("TS_ClosureReason_disconnected_peer"))) TS_ClosureReason_disconnected_peer() { + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_disconnected_peer(); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +uint64_t __attribute__((export_name("TS_ClosureReason_outdated_channel_manager"))) TS_ClosureReason_outdated_channel_manager() { + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_outdated_channel_manager(); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -static inline uint64_t ChannelUsage_clone_ptr(LDKChannelUsage *NONNULL_PTR arg) { - LDKChannelUsage ret_var = ChannelUsage_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); +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); + 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_ClosureReason_read"))) TS_ClosureReason_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ"); + *ret_conv = ClosureReason_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +void __attribute__((export_name("TS_HTLCDestination_free"))) TS_HTLCDestination_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); + LDKHTLCDestination this_ptr_conv = *(LDKHTLCDestination*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + HTLCDestination_free(this_ptr_conv); +} + +static inline uint64_t HTLCDestination_clone_ptr(LDKHTLCDestination *NONNULL_PTR arg) { + LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination"); + *ret_copy = HTLCDestination_clone(arg); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t __attribute__((export_name("TS_ChannelUsage_clone_ptr"))) TS_ChannelUsage_clone_ptr(uint64_t arg) { - LDKChannelUsage 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 = ChannelUsage_clone_ptr(&arg_conv); +int64_t __attribute__((export_name("TS_HTLCDestination_clone_ptr"))) TS_HTLCDestination_clone_ptr(uint64_t arg) { + LDKHTLCDestination* arg_conv = (LDKHTLCDestination*)untag_ptr(arg); + int64_t ret_conv = HTLCDestination_clone_ptr(arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_ChannelUsage_clone"))) TS_ChannelUsage_clone(uint64_t orig) { - LDKChannelUsage 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; - LDKChannelUsage ret_var = ChannelUsage_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); +uint64_t __attribute__((export_name("TS_HTLCDestination_clone"))) TS_HTLCDestination_clone(uint64_t orig) { + LDKHTLCDestination* orig_conv = (LDKHTLCDestination*)untag_ptr(orig); + LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination"); + *ret_copy = HTLCDestination_clone(orig_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -void __attribute__((export_name("TS_FixedPenaltyScorer_free"))) TS_FixedPenaltyScorer_free(uint64_t this_obj) { - LDKFixedPenaltyScorer 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); - FixedPenaltyScorer_free(this_obj_conv); +uint64_t __attribute__((export_name("TS_HTLCDestination_next_hop_channel"))) TS_HTLCDestination_next_hop_channel(int8_tArray node_id, int8_tArray channel_id) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKThirtyTwoBytes channel_id_ref; + CHECK(channel_id->arr_len == 32); + memcpy(channel_id_ref.data, channel_id->elems, 32); FREE(channel_id); + LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination"); + *ret_copy = HTLCDestination_next_hop_channel(node_id_ref, channel_id_ref); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -static inline uint64_t FixedPenaltyScorer_clone_ptr(LDKFixedPenaltyScorer *NONNULL_PTR arg) { - LDKFixedPenaltyScorer ret_var = FixedPenaltyScorer_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); +uint64_t __attribute__((export_name("TS_HTLCDestination_unknown_next_hop"))) TS_HTLCDestination_unknown_next_hop(int64_t requested_forward_scid) { + LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination"); + *ret_copy = HTLCDestination_unknown_next_hop(requested_forward_scid); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t __attribute__((export_name("TS_FixedPenaltyScorer_clone_ptr"))) TS_FixedPenaltyScorer_clone_ptr(uint64_t arg) { - LDKFixedPenaltyScorer 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 = FixedPenaltyScorer_clone_ptr(&arg_conv); - return ret_conv; -} -uint64_t __attribute__((export_name("TS_FixedPenaltyScorer_clone"))) TS_FixedPenaltyScorer_clone(uint64_t orig) { - LDKFixedPenaltyScorer 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; - LDKFixedPenaltyScorer ret_var = FixedPenaltyScorer_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); +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_FixedPenaltyScorer_with_penalty"))) TS_FixedPenaltyScorer_with_penalty(int64_t penalty_msat) { - LDKFixedPenaltyScorer ret_var = FixedPenaltyScorer_with_penalty(penalty_msat); - 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_HTLCDestination_failed_payment"))) TS_HTLCDestination_failed_payment(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); + LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination"); + *ret_copy = HTLCDestination_failed_payment(payment_hash_ref); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -uint64_t __attribute__((export_name("TS_FixedPenaltyScorer_as_Score"))) TS_FixedPenaltyScorer_as_Score(uint64_t this_arg) { - LDKFixedPenaltyScorer 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 = FixedPenaltyScorer_as_Score(&this_arg_conv); - return tag_ptr(ret_ret, true); +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_FixedPenaltyScorer_write"))) TS_FixedPenaltyScorer_write(uint64_t obj) { - LDKFixedPenaltyScorer 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 = FixedPenaltyScorer_write(&obj_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); 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_FixedPenaltyScorer_read"))) TS_FixedPenaltyScorer_read(int8_tArray ser, int64_t arg) { +uint64_t __attribute__((export_name("TS_HTLCDestination_read"))) TS_HTLCDestination_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; ser_ref.data = ser->elems; - LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ"); - *ret_conv = FixedPenaltyScorer_read(ser_ref, arg); + LDKCResult_COption_HTLCDestinationZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_HTLCDestinationZDecodeErrorZ), "LDKCResult_COption_HTLCDestinationZDecodeErrorZ"); + *ret_conv = HTLCDestination_read(ser_ref); FREE(ser); return tag_ptr(ret_conv, true); } -void __attribute__((export_name("TS_ProbabilisticScorer_free"))) TS_ProbabilisticScorer_free(uint64_t this_obj) { - LDKProbabilisticScorer 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); - ProbabilisticScorer_free(this_obj_conv); -} - -void __attribute__((export_name("TS_ProbabilisticScoringParameters_free"))) TS_ProbabilisticScoringParameters_free(uint64_t this_obj) { - LDKProbabilisticScoringParameters 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); - ProbabilisticScoringParameters_free(this_obj_conv); -} - -int64_t __attribute__((export_name("TS_ProbabilisticScoringParameters_get_base_penalty_msat"))) TS_ProbabilisticScoringParameters_get_base_penalty_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_base_penalty_msat(&this_ptr_conv); +uint32_t __attribute__((export_name("TS_PaymentFailureReason_clone"))) TS_PaymentFailureReason_clone(uint64_t orig) { + LDKPaymentFailureReason* orig_conv = (LDKPaymentFailureReason*)untag_ptr(orig); + uint32_t ret_conv = LDKPaymentFailureReason_to_js(PaymentFailureReason_clone(orig_conv)); return ret_conv; } -void __attribute__((export_name("TS_ProbabilisticScoringParameters_set_base_penalty_msat"))) TS_ProbabilisticScoringParameters_set_base_penalty_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_base_penalty_msat(&this_ptr_conv, val); -} - -int64_t __attribute__((export_name("TS_ProbabilisticScoringParameters_get_base_penalty_amount_multiplier_msat"))) TS_ProbabilisticScoringParameters_get_base_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_base_penalty_amount_multiplier_msat(&this_ptr_conv); +uint32_t __attribute__((export_name("TS_PaymentFailureReason_recipient_rejected"))) TS_PaymentFailureReason_recipient_rejected() { + uint32_t ret_conv = LDKPaymentFailureReason_to_js(PaymentFailureReason_recipient_rejected()); return ret_conv; } -void __attribute__((export_name("TS_ProbabilisticScoringParameters_set_base_penalty_amount_multiplier_msat"))) TS_ProbabilisticScoringParameters_set_base_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_base_penalty_amount_multiplier_msat(&this_ptr_conv, val); +uint32_t __attribute__((export_name("TS_PaymentFailureReason_user_abandoned"))) TS_PaymentFailureReason_user_abandoned() { + uint32_t ret_conv = LDKPaymentFailureReason_to_js(PaymentFailureReason_user_abandoned()); + return ret_conv; } -int64_t __attribute__((export_name("TS_ProbabilisticScoringParameters_get_liquidity_penalty_multiplier_msat"))) TS_ProbabilisticScoringParameters_get_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_liquidity_penalty_multiplier_msat(&this_ptr_conv); +uint32_t __attribute__((export_name("TS_PaymentFailureReason_retries_exhausted"))) TS_PaymentFailureReason_retries_exhausted() { + uint32_t ret_conv = LDKPaymentFailureReason_to_js(PaymentFailureReason_retries_exhausted()); return ret_conv; } -void __attribute__((export_name("TS_ProbabilisticScoringParameters_set_liquidity_penalty_multiplier_msat"))) TS_ProbabilisticScoringParameters_set_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_liquidity_penalty_multiplier_msat(&this_ptr_conv, val); +uint32_t __attribute__((export_name("TS_PaymentFailureReason_payment_expired"))) TS_PaymentFailureReason_payment_expired() { + uint32_t ret_conv = LDKPaymentFailureReason_to_js(PaymentFailureReason_payment_expired()); + return ret_conv; } -int64_t __attribute__((export_name("TS_ProbabilisticScoringParameters_get_liquidity_offset_half_life"))) TS_ProbabilisticScoringParameters_get_liquidity_offset_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_liquidity_offset_half_life(&this_ptr_conv); +uint32_t __attribute__((export_name("TS_PaymentFailureReason_route_not_found"))) TS_PaymentFailureReason_route_not_found() { + uint32_t ret_conv = LDKPaymentFailureReason_to_js(PaymentFailureReason_route_not_found()); return ret_conv; } -void __attribute__((export_name("TS_ProbabilisticScoringParameters_set_liquidity_offset_half_life"))) TS_ProbabilisticScoringParameters_set_liquidity_offset_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_liquidity_offset_half_life(&this_ptr_conv, val); +uint32_t __attribute__((export_name("TS_PaymentFailureReason_unexpected_error"))) TS_PaymentFailureReason_unexpected_error() { + uint32_t ret_conv = LDKPaymentFailureReason_to_js(PaymentFailureReason_unexpected_error()); + return ret_conv; } -int64_t __attribute__((export_name("TS_ProbabilisticScoringParameters_get_liquidity_penalty_amount_multiplier_msat"))) TS_ProbabilisticScoringParameters_get_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_liquidity_penalty_amount_multiplier_msat(&this_ptr_conv); +jboolean __attribute__((export_name("TS_PaymentFailureReason_eq"))) TS_PaymentFailureReason_eq(uint64_t a, uint64_t b) { + LDKPaymentFailureReason* a_conv = (LDKPaymentFailureReason*)untag_ptr(a); + LDKPaymentFailureReason* b_conv = (LDKPaymentFailureReason*)untag_ptr(b); + jboolean ret_conv = PaymentFailureReason_eq(a_conv, b_conv); return ret_conv; } -void __attribute__((export_name("TS_ProbabilisticScoringParameters_set_liquidity_penalty_amount_multiplier_msat"))) TS_ProbabilisticScoringParameters_set_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_liquidity_penalty_amount_multiplier_msat(&this_ptr_conv, val); +int8_tArray __attribute__((export_name("TS_PaymentFailureReason_write"))) TS_PaymentFailureReason_write(uint64_t obj) { + LDKPaymentFailureReason* obj_conv = (LDKPaymentFailureReason*)untag_ptr(obj); + LDKCVec_u8Z ret_var = PaymentFailureReason_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; } -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; +uint64_t __attribute__((export_name("TS_PaymentFailureReason_read"))) TS_PaymentFailureReason_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_PaymentFailureReasonDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentFailureReasonDecodeErrorZ), "LDKCResult_PaymentFailureReasonDecodeErrorZ"); + *ret_conv = PaymentFailureReason_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -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); +void __attribute__((export_name("TS_Event_free"))) TS_Event_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); + LDKEvent this_ptr_conv = *(LDKEvent*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + Event_free(this_ptr_conv); } -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); +static inline uint64_t Event_clone_ptr(LDKEvent *NONNULL_PTR arg) { + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_clone(arg); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t __attribute__((export_name("TS_Event_clone_ptr"))) TS_Event_clone_ptr(uint64_t arg) { + LDKEvent* arg_conv = (LDKEvent*)untag_ptr(arg); + int64_t ret_conv = Event_clone_ptr(arg_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); +uint64_t __attribute__((export_name("TS_Event_clone"))) TS_Event_clone(uint64_t orig) { + LDKEvent* orig_conv = (LDKEvent*)untag_ptr(orig); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_clone(orig_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -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; +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); + 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); + LDKCVec_u8Z output_script_ref; + 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_ref); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -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); +uint64_t __attribute__((export_name("TS_Event_payment_claimable"))) TS_Event_payment_claimable(int8_tArray receiver_node_id, int8_tArray payment_hash, uint64_t onion_fields, int64_t amount_msat, uint64_t purpose, int8_tArray via_channel_id, uint64_t via_user_channel_id, uint64_t claim_deadline) { + 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); + LDKRecipientOnionFields onion_fields_conv; + onion_fields_conv.inner = untag_ptr(onion_fields); + onion_fields_conv.is_owned = ptr_is_owned(onion_fields); + CHECK_INNER_FIELD_ACCESS_OR_NULL(onion_fields_conv); + onion_fields_conv = RecipientOnionFields_clone(&onion_fields_conv); + void* purpose_ptr = untag_ptr(purpose); + 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)); + void* claim_deadline_ptr = untag_ptr(claim_deadline); + CHECK_ACCESS(claim_deadline_ptr); + LDKCOption_u32Z claim_deadline_conv = *(LDKCOption_u32Z*)(claim_deadline_ptr); + claim_deadline_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(claim_deadline)); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_payment_claimable(receiver_node_id_ref, payment_hash_ref, onion_fields_conv, amount_msat, purpose_conv, via_channel_id_ref, via_user_channel_id_conv, claim_deadline_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -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); - 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_anti_probing_penalty_msat(&this_ptr_conv); - return ret_conv; +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); + void* purpose_ptr = untag_ptr(purpose); + CHECK_ACCESS(purpose_ptr); + 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(receiver_node_id_ref, payment_hash_ref, amount_msat, purpose_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void __attribute__((export_name("TS_ProbabilisticScoringParameters_set_anti_probing_penalty_msat"))) TS_ProbabilisticScoringParameters_set_anti_probing_penalty_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_anti_probing_penalty_msat(&this_ptr_conv, val); +uint64_t __attribute__((export_name("TS_Event_payment_sent"))) TS_Event_payment_sent(int8_tArray payment_id, int8_tArray payment_preimage, int8_tArray payment_hash, uint64_t fee_paid_msat) { + LDKThirtyTwoBytes payment_id_ref; + CHECK(payment_id->arr_len == 32); + memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); + LDKThirtyTwoBytes payment_preimage_ref; + CHECK(payment_preimage->arr_len == 32); + memcpy(payment_preimage_ref.data, payment_preimage->elems, 32); FREE(payment_preimage); + LDKThirtyTwoBytes payment_hash_ref; + CHECK(payment_hash->arr_len == 32); + memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); + void* fee_paid_msat_ptr = untag_ptr(fee_paid_msat); + CHECK_ACCESS(fee_paid_msat_ptr); + LDKCOption_u64Z fee_paid_msat_conv = *(LDKCOption_u64Z*)(fee_paid_msat_ptr); + fee_paid_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(fee_paid_msat)); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_payment_sent(payment_id_ref, payment_preimage_ref, payment_hash_ref, fee_paid_msat_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t __attribute__((export_name("TS_ProbabilisticScoringParameters_get_considered_impossible_penalty_msat"))) TS_ProbabilisticScoringParameters_get_considered_impossible_penalty_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_considered_impossible_penalty_msat(&this_ptr_conv); - return ret_conv; +uint64_t __attribute__((export_name("TS_Event_payment_failed"))) TS_Event_payment_failed(int8_tArray payment_id, int8_tArray payment_hash, uint64_t reason) { + 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* reason_ptr = untag_ptr(reason); + CHECK_ACCESS(reason_ptr); + LDKCOption_PaymentFailureReasonZ reason_conv = *(LDKCOption_PaymentFailureReasonZ*)(reason_ptr); + reason_conv = COption_PaymentFailureReasonZ_clone((LDKCOption_PaymentFailureReasonZ*)untag_ptr(reason)); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_payment_failed(payment_id_ref, payment_hash_ref, reason_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void __attribute__((export_name("TS_ProbabilisticScoringParameters_set_considered_impossible_penalty_msat"))) TS_ProbabilisticScoringParameters_set_considered_impossible_penalty_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_considered_impossible_penalty_msat(&this_ptr_conv, val); +uint64_t __attribute__((export_name("TS_Event_payment_path_successful"))) TS_Event_payment_path_successful(int8_tArray payment_id, int8_tArray payment_hash, uint64_t path) { + 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); + LDKPath path_conv; + path_conv.inner = untag_ptr(path); + path_conv.is_owned = ptr_is_owned(path); + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); + path_conv = Path_clone(&path_conv); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_payment_path_successful(payment_id_ref, payment_hash_ref, path_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -static inline uint64_t ProbabilisticScoringParameters_clone_ptr(LDKProbabilisticScoringParameters *NONNULL_PTR arg) { - LDKProbabilisticScoringParameters ret_var = ProbabilisticScoringParameters_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); +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_t path, uint64_t short_channel_id) { + 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* failure_ptr = untag_ptr(failure); + CHECK_ACCESS(failure_ptr); + LDKPathFailure failure_conv = *(LDKPathFailure*)(failure_ptr); + failure_conv = PathFailure_clone((LDKPathFailure*)untag_ptr(failure)); + LDKPath path_conv; + path_conv.inner = untag_ptr(path); + path_conv.is_owned = ptr_is_owned(path); + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); + path_conv = Path_clone(&path_conv); + void* short_channel_id_ptr = untag_ptr(short_channel_id); + CHECK_ACCESS(short_channel_id_ptr); + LDKCOption_u64Z short_channel_id_conv = *(LDKCOption_u64Z*)(short_channel_id_ptr); + short_channel_id_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(short_channel_id)); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_payment_path_failed(payment_id_ref, payment_hash_ref, payment_failed_permanently, failure_conv, path_conv, short_channel_id_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t __attribute__((export_name("TS_ProbabilisticScoringParameters_clone_ptr"))) TS_ProbabilisticScoringParameters_clone_ptr(uint64_t arg) { - LDKProbabilisticScoringParameters 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 = ProbabilisticScoringParameters_clone_ptr(&arg_conv); - return ret_conv; -} -uint64_t __attribute__((export_name("TS_ProbabilisticScoringParameters_clone"))) TS_ProbabilisticScoringParameters_clone(uint64_t orig) { - LDKProbabilisticScoringParameters 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; - LDKProbabilisticScoringParameters ret_var = ProbabilisticScoringParameters_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); +uint64_t __attribute__((export_name("TS_Event_probe_successful"))) TS_Event_probe_successful(int8_tArray payment_id, int8_tArray payment_hash, uint64_t path) { + 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); + LDKPath path_conv; + path_conv.inner = untag_ptr(path); + path_conv.is_owned = ptr_is_owned(path); + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); + path_conv = Path_clone(&path_conv); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_probe_successful(payment_id_ref, payment_hash_ref, path_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -uint64_t __attribute__((export_name("TS_ProbabilisticScorer_new"))) TS_ProbabilisticScorer_new(uint64_t params, uint64_t network_graph, uint64_t logger) { - LDKProbabilisticScoringParameters params_conv; - params_conv.inner = untag_ptr(params); - params_conv.is_owned = ptr_is_owned(params); - CHECK_INNER_FIELD_ACCESS_OR_NULL(params_conv); - params_conv = ProbabilisticScoringParameters_clone(¶ms_conv); - 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); - } - LDKProbabilisticScorer ret_var = ProbabilisticScorer_new(params_conv, &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); +uint64_t __attribute__((export_name("TS_Event_probe_failed"))) TS_Event_probe_failed(int8_tArray payment_id, int8_tArray payment_hash, uint64_t path, uint64_t short_channel_id) { + 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); + LDKPath path_conv; + path_conv.inner = untag_ptr(path); + path_conv.is_owned = ptr_is_owned(path); + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv); + path_conv = Path_clone(&path_conv); + void* short_channel_id_ptr = untag_ptr(short_channel_id); + CHECK_ACCESS(short_channel_id_ptr); + LDKCOption_u64Z short_channel_id_conv = *(LDKCOption_u64Z*)(short_channel_id_ptr); + short_channel_id_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(short_channel_id)); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_probe_failed(payment_id_ref, payment_hash_ref, path_conv, short_channel_id_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -void __attribute__((export_name("TS_ProbabilisticScorer_debug_log_liquidity_stats"))) TS_ProbabilisticScorer_debug_log_liquidity_stats(uint64_t this_arg) { - 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; - ProbabilisticScorer_debug_log_liquidity_stats(&this_arg_conv); +uint64_t __attribute__((export_name("TS_Event_pending_htlcs_forwardable"))) TS_Event_pending_htlcs_forwardable(int64_t time_forwardable) { + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_pending_htlcs_forwardable(time_forwardable); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -uint64_t __attribute__((export_name("TS_ProbabilisticScorer_estimated_channel_liquidity_range"))) TS_ProbabilisticScorer_estimated_channel_liquidity_range(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_u64u64ZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_u64u64ZZ), "LDKCOption_C2Tuple_u64u64ZZ"); - *ret_copy = ProbabilisticScorer_estimated_channel_liquidity_range(&this_arg_conv, scid, &target_conv); +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_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 __attribute__((export_name("TS_Event_spendable_outputs"))) TS_Event_spendable_outputs(uint64_tArray outputs) { + LDKCVec_SpendableOutputDescriptorZ outputs_constr; + outputs_constr.datalen = outputs->arr_len; + if (outputs_constr.datalen > 0) + outputs_constr.data = MALLOC(outputs_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements"); + else + outputs_constr.data = NULL; + uint64_t* outputs_vals = outputs->elems; + for (size_t b = 0; b < outputs_constr.datalen; b++) { + uint64_t outputs_conv_27 = outputs_vals[b]; + void* outputs_conv_27_ptr = untag_ptr(outputs_conv_27); + CHECK_ACCESS(outputs_conv_27_ptr); + LDKSpendableOutputDescriptor outputs_conv_27_conv = *(LDKSpendableOutputDescriptor*)(outputs_conv_27_ptr); + outputs_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)untag_ptr(outputs_conv_27)); + outputs_constr.data[b] = outputs_conv_27_conv; + } + FREE(outputs); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_spendable_outputs(outputs_constr); 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); - 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 node_id_conv; - node_id_conv.inner = untag_ptr(node_id); - node_id_conv.is_owned = ptr_is_owned(node_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv); - node_id_conv.is_owned = false; - ProbabilisticScorer_add_banned(&this_arg_conv, &node_id_conv); +uint64_t __attribute__((export_name("TS_Event_payment_forwarded"))) TS_Event_payment_forwarded(int8_tArray prev_channel_id, int8_tArray next_channel_id, uint64_t fee_earned_msat, jboolean claim_from_onchain_tx, uint64_t outbound_amount_forwarded_msat) { + LDKThirtyTwoBytes prev_channel_id_ref; + CHECK(prev_channel_id->arr_len == 32); + memcpy(prev_channel_id_ref.data, prev_channel_id->elems, 32); FREE(prev_channel_id); + LDKThirtyTwoBytes next_channel_id_ref; + CHECK(next_channel_id->arr_len == 32); + memcpy(next_channel_id_ref.data, next_channel_id->elems, 32); FREE(next_channel_id); + void* fee_earned_msat_ptr = untag_ptr(fee_earned_msat); + CHECK_ACCESS(fee_earned_msat_ptr); + LDKCOption_u64Z fee_earned_msat_conv = *(LDKCOption_u64Z*)(fee_earned_msat_ptr); + fee_earned_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(fee_earned_msat)); + void* outbound_amount_forwarded_msat_ptr = untag_ptr(outbound_amount_forwarded_msat); + CHECK_ACCESS(outbound_amount_forwarded_msat_ptr); + LDKCOption_u64Z outbound_amount_forwarded_msat_conv = *(LDKCOption_u64Z*)(outbound_amount_forwarded_msat_ptr); + outbound_amount_forwarded_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(outbound_amount_forwarded_msat)); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_payment_forwarded(prev_channel_id_ref, next_channel_id_ref, fee_earned_msat_conv, claim_from_onchain_tx, outbound_amount_forwarded_msat_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void __attribute__((export_name("TS_ProbabilisticScorer_remove_banned"))) TS_ProbabilisticScorer_remove_banned(uint64_t this_arg, uint64_t node_id) { - 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 node_id_conv; - node_id_conv.inner = untag_ptr(node_id); - node_id_conv.is_owned = ptr_is_owned(node_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv); - node_id_conv.is_owned = false; - ProbabilisticScorer_remove_banned(&this_arg_conv, &node_id_conv); +uint64_t __attribute__((export_name("TS_Event_channel_pending"))) TS_Event_channel_pending(int8_tArray channel_id, int8_tArray user_channel_id, int8_tArray former_temporary_channel_id, int8_tArray counterparty_node_id, uint64_t funding_txo) { + 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); + LDKThirtyTwoBytes former_temporary_channel_id_ref; + CHECK(former_temporary_channel_id->arr_len == 32); + memcpy(former_temporary_channel_id_ref.data, former_temporary_channel_id->elems, 32); FREE(former_temporary_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); + 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); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_channel_pending(channel_id_ref, user_channel_id_ref, former_temporary_channel_id_ref, counterparty_node_id_ref, funding_txo_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void __attribute__((export_name("TS_ProbabilisticScorer_set_manual_penalty"))) TS_ProbabilisticScorer_set_manual_penalty(uint64_t this_arg, uint64_t node_id, int64_t penalty) { - 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 node_id_conv; - node_id_conv.inner = untag_ptr(node_id); - node_id_conv.is_owned = ptr_is_owned(node_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv); - node_id_conv.is_owned = false; - ProbabilisticScorer_set_manual_penalty(&this_arg_conv, &node_id_conv, penalty); +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; } -void __attribute__((export_name("TS_ProbabilisticScorer_remove_manual_penalty"))) TS_ProbabilisticScorer_remove_manual_penalty(uint64_t this_arg, uint64_t node_id) { - 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 node_id_conv; - node_id_conv.inner = untag_ptr(node_id); - node_id_conv.is_owned = ptr_is_owned(node_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv); - node_id_conv.is_owned = false; - ProbabilisticScorer_remove_manual_penalty(&this_arg_conv, &node_id_conv); +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_ref, reason_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void __attribute__((export_name("TS_ProbabilisticScorer_clear_manual_penalties"))) TS_ProbabilisticScorer_clear_manual_penalties(uint64_t this_arg) { - 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; - ProbabilisticScorer_clear_manual_penalties(&this_arg_conv); +uint64_t __attribute__((export_name("TS_Event_discard_funding"))) TS_Event_discard_funding(int8_tArray channel_id, int8_tArray transaction) { + LDKThirtyTwoBytes channel_id_ref; + CHECK(channel_id->arr_len == 32); + memcpy(channel_id_ref.data, channel_id->elems, 32); FREE(channel_id); + LDKTransaction transaction_ref; + transaction_ref.datalen = transaction->arr_len; + transaction_ref.data = MALLOC(transaction_ref.datalen, "LDKTransaction Bytes"); + memcpy(transaction_ref.data, transaction->elems, transaction_ref.datalen); FREE(transaction); + transaction_ref.data_is_owned = true; + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_discard_funding(channel_id_ref, transaction_ref); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void __attribute__((export_name("TS_ProbabilisticScoringParameters_add_banned_from_list"))) TS_ProbabilisticScoringParameters_add_banned_from_list(uint64_t this_arg, uint64_tArray node_ids) { - LDKProbabilisticScoringParameters 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_NodeIdZ node_ids_constr; - node_ids_constr.datalen = node_ids->arr_len; - if (node_ids_constr.datalen > 0) - node_ids_constr.data = MALLOC(node_ids_constr.datalen * sizeof(LDKNodeId), "LDKCVec_NodeIdZ Elements"); - else - node_ids_constr.data = NULL; - uint64_t* node_ids_vals = node_ids->elems; - for (size_t i = 0; i < node_ids_constr.datalen; i++) { - uint64_t node_ids_conv_8 = node_ids_vals[i]; - LDKNodeId node_ids_conv_8_conv; - node_ids_conv_8_conv.inner = untag_ptr(node_ids_conv_8); - node_ids_conv_8_conv.is_owned = ptr_is_owned(node_ids_conv_8); - CHECK_INNER_FIELD_ACCESS_OR_NULL(node_ids_conv_8_conv); - node_ids_conv_8_conv = NodeId_clone(&node_ids_conv_8_conv); - node_ids_constr.data[i] = node_ids_conv_8_conv; - } - FREE(node_ids); - ProbabilisticScoringParameters_add_banned_from_list(&this_arg_conv, node_ids_constr); +uint64_t __attribute__((export_name("TS_Event_open_channel_request"))) TS_Event_open_channel_request(int8_tArray temporary_channel_id, int8_tArray counterparty_node_id, int64_t funding_satoshis, int64_t push_msat, uint64_t channel_type) { + 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); + 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_open_channel_request(temporary_channel_id_ref, counterparty_node_id_ref, funding_satoshis, push_msat, channel_type_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -uint64_t __attribute__((export_name("TS_ProbabilisticScoringParameters_default"))) TS_ProbabilisticScoringParameters_default() { - LDKProbabilisticScoringParameters ret_var = ProbabilisticScoringParameters_default(); - 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_Event_htlchandling_failed"))) TS_Event_htlchandling_failed(int8_tArray prev_channel_id, uint64_t failed_next_destination) { + LDKThirtyTwoBytes prev_channel_id_ref; + CHECK(prev_channel_id->arr_len == 32); + memcpy(prev_channel_id_ref.data, prev_channel_id->elems, 32); FREE(prev_channel_id); + void* failed_next_destination_ptr = untag_ptr(failed_next_destination); + CHECK_ACCESS(failed_next_destination_ptr); + LDKHTLCDestination failed_next_destination_conv = *(LDKHTLCDestination*)(failed_next_destination_ptr); + failed_next_destination_conv = HTLCDestination_clone((LDKHTLCDestination*)untag_ptr(failed_next_destination)); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_htlchandling_failed(prev_channel_id_ref, failed_next_destination_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -uint64_t __attribute__((export_name("TS_ProbabilisticScorer_as_Score"))) TS_ProbabilisticScorer_as_Score(uint64_t this_arg) { - 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; - LDKScore* ret_ret = MALLOC(sizeof(LDKScore), "LDKScore"); - *ret_ret = ProbabilisticScorer_as_Score(&this_arg_conv); - return tag_ptr(ret_ret, true); +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_ProbabilisticScorer_write"))) TS_ProbabilisticScorer_write(uint64_t obj) { - LDKProbabilisticScorer 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 = ProbabilisticScorer_write(&obj_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); 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_ProbabilisticScorer_read"))) TS_ProbabilisticScorer_read(int8_tArray ser, uint64_t arg_a, uint64_t arg_b, uint64_t arg_c) { +uint64_t __attribute__((export_name("TS_Event_read"))) TS_Event_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; ser_ref.data = ser->elems; - LDKProbabilisticScoringParameters arg_a_conv; - arg_a_conv.inner = untag_ptr(arg_a); - arg_a_conv.is_owned = ptr_is_owned(arg_a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_a_conv); - arg_a_conv = ProbabilisticScoringParameters_clone(&arg_a_conv); - LDKNetworkGraph arg_b_conv; - arg_b_conv.inner = untag_ptr(arg_b); - arg_b_conv.is_owned = ptr_is_owned(arg_b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_b_conv); - arg_b_conv.is_owned = false; - void* arg_c_ptr = untag_ptr(arg_c); - CHECK_ACCESS(arg_c_ptr); - LDKLogger arg_c_conv = *(LDKLogger*)(arg_c_ptr); - if (arg_c_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&arg_c_conv); - } - LDKCResult_ProbabilisticScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ProbabilisticScorerDecodeErrorZ), "LDKCResult_ProbabilisticScorerDecodeErrorZ"); - *ret_conv = ProbabilisticScorer_read(ser_ref, arg_a_conv, &arg_b_conv, arg_c_conv); + LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ"); + *ret_conv = Event_read(ser_ref); FREE(ser); 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); +void __attribute__((export_name("TS_MessageSendEvent_free"))) TS_MessageSendEvent_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); + LDKMessageSendEvent this_ptr_conv = *(LDKMessageSendEvent*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + MessageSendEvent_free(this_ptr_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); +static inline uint64_t MessageSendEvent_clone_ptr(LDKMessageSendEvent *NONNULL_PTR arg) { + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_clone(arg); + uint64_t ret_ref = tag_ptr(ret_copy, true); 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); +int64_t __attribute__((export_name("TS_MessageSendEvent_clone_ptr"))) TS_MessageSendEvent_clone_ptr(uint64_t arg) { + LDKMessageSendEvent* arg_conv = (LDKMessageSendEvent*)untag_ptr(arg); + int64_t ret_conv = MessageSendEvent_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); +uint64_t __attribute__((export_name("TS_MessageSendEvent_clone"))) TS_MessageSendEvent_clone(uint64_t orig) { + LDKMessageSendEvent* orig_conv = (LDKMessageSendEvent*)untag_ptr(orig); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_clone(orig_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); 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); +uint64_t __attribute__((export_name("TS_MessageSendEvent_send_accept_channel"))) TS_MessageSendEvent_send_accept_channel(int8_tArray node_id, uint64_t msg) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + 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 = AcceptChannel_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_accept_channel(node_id_ref, msg_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); 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); +uint64_t __attribute__((export_name("TS_MessageSendEvent_send_open_channel"))) TS_MessageSendEvent_send_open_channel(int8_tArray node_id, uint64_t msg) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + 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 = OpenChannel_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_open_channel(node_id_ref, msg_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); 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); +uint64_t __attribute__((export_name("TS_MessageSendEvent_send_funding_created"))) TS_MessageSendEvent_send_funding_created(int8_tArray node_id, uint64_t msg) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKFundingCreated 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 = FundingCreated_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_funding_created(node_id_ref, msg_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -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); +uint64_t __attribute__((export_name("TS_MessageSendEvent_send_funding_signed"))) TS_MessageSendEvent_send_funding_signed(int8_tArray node_id, uint64_t msg) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKFundingSigned 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 = FundingSigned_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_funding_signed(node_id_ref, msg_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -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); +uint64_t __attribute__((export_name("TS_MessageSendEvent_send_channel_ready"))) TS_MessageSendEvent_send_channel_ready(int8_tArray node_id, uint64_t msg) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKChannelReady 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 = ChannelReady_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_channel_ready(node_id_ref, msg_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -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 __attribute__((export_name("TS_MessageSendEvent_send_announcement_signatures"))) TS_MessageSendEvent_send_announcement_signatures(int8_tArray node_id, uint64_t msg) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKAnnouncementSignatures 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 = AnnouncementSignatures_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_announcement_signatures(node_id_ref, msg_conv); 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 __attribute__((export_name("TS_MessageSendEvent_update_htlcs"))) TS_MessageSendEvent_update_htlcs(int8_tArray node_id, uint64_t updates) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKCommitmentUpdate updates_conv; + updates_conv.inner = untag_ptr(updates); + updates_conv.is_owned = ptr_is_owned(updates); + CHECK_INNER_FIELD_ACCESS_OR_NULL(updates_conv); + updates_conv = CommitmentUpdate_clone(&updates_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_update_htlcs(node_id_ref, updates_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 __attribute__((export_name("TS_MessageSendEvent_send_revoke_and_ack"))) TS_MessageSendEvent_send_revoke_and_ack(int8_tArray node_id, uint64_t msg) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKRevokeAndACK 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 = RevokeAndACK_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_revoke_and_ack(node_id_ref, msg_conv); 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 __attribute__((export_name("TS_MessageSendEvent_send_closing_signed"))) TS_MessageSendEvent_send_closing_signed(int8_tArray node_id, uint64_t msg) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKClosingSigned 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 = ClosingSigned_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_closing_signed(node_id_ref, msg_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); +uint64_t __attribute__((export_name("TS_MessageSendEvent_send_shutdown"))) TS_MessageSendEvent_send_shutdown(int8_tArray node_id, uint64_t msg) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + 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 = Shutdown_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_shutdown(node_id_ref, msg_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -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 __attribute__((export_name("TS_MessageSendEvent_send_channel_reestablish"))) TS_MessageSendEvent_send_channel_reestablish(int8_tArray node_id, uint64_t msg) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKChannelReestablish 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 = ChannelReestablish_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_channel_reestablish(node_id_ref, msg_conv); 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 __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(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_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_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 __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 = 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_channel_announcement(msg_conv, update_msg_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 __attribute__((export_name("TS_MessageSendEvent_broadcast_channel_update"))) TS_MessageSendEvent_broadcast_channel_update(uint64_t msg) { + LDKChannelUpdate 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 = ChannelUpdate_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_broadcast_channel_update(msg_conv); 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 __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_SendError_invalid_first_hop"))) TS_SendError_invalid_first_hop() { - LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); - *ret_copy = SendError_invalid_first_hop(); +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); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKChannelUpdate 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 = ChannelUpdate_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_channel_update(node_id_ref, msg_conv); 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 __attribute__((export_name("TS_MessageSendEvent_handle_error"))) TS_MessageSendEvent_handle_error(int8_tArray node_id, uint64_t action) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + void* action_ptr = untag_ptr(action); + CHECK_ACCESS(action_ptr); + LDKErrorAction action_conv = *(LDKErrorAction*)(action_ptr); + action_conv = ErrorAction_clone((LDKErrorAction*)untag_ptr(action)); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_handle_error(node_id_ref, action_conv); 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 __attribute__((export_name("TS_MessageSendEvent_send_channel_range_query"))) TS_MessageSendEvent_send_channel_range_query(int8_tArray node_id, uint64_t msg) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKQueryChannelRange 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 = QueryChannelRange_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_channel_range_query(node_id_ref, msg_conv); 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 __attribute__((export_name("TS_MessageSendEvent_send_short_ids_query"))) TS_MessageSendEvent_send_short_ids_query(int8_tArray node_id, uint64_t msg) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKQueryShortChannelIds 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 = QueryShortChannelIds_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_short_ids_query(node_id_ref, msg_conv); 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 __attribute__((export_name("TS_MessageSendEvent_send_reply_channel_range"))) TS_MessageSendEvent_send_reply_channel_range(int8_tArray node_id, uint64_t msg) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKReplyChannelRange 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 = ReplyChannelRange_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_reply_channel_range(node_id_ref, msg_conv); 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; +uint64_t __attribute__((export_name("TS_MessageSendEvent_send_gossip_timestamp_filter"))) TS_MessageSendEvent_send_gossip_timestamp_filter(int8_tArray node_id, uint64_t msg) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKGossipTimestampFilter 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 = GossipTimestampFilter_clone(&msg_conv); + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_send_gossip_timestamp_filter(node_id_ref, msg_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void __attribute__((export_name("TS_CustomOnionMessageHandler_free"))) TS_CustomOnionMessageHandler_free(uint64_t this_ptr) { +void __attribute__((export_name("TS_MessageSendEventsProvider_free"))) TS_MessageSendEventsProvider_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); + LDKMessageSendEventsProvider this_ptr_conv = *(LDKMessageSendEventsProvider*)(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); + MessageSendEventsProvider_free(this_ptr_conv); } -void __attribute__((export_name("TS_OnionMessageContents_free"))) TS_OnionMessageContents_free(uint64_t this_ptr) { +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); - LDKOnionMessageContents this_ptr_conv = *(LDKOnionMessageContents*)(this_ptr_ptr); + LDKOnionMessageProvider this_ptr_conv = *(LDKOnionMessageProvider*)(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; + OnionMessageProvider_free(this_ptr_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_EventsProvider_free"))) TS_EventsProvider_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); + LDKEventsProvider this_ptr_conv = *(LDKEventsProvider*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + EventsProvider_free(this_ptr_conv); } -void __attribute__((export_name("TS_CustomOnionMessageContents_free"))) TS_CustomOnionMessageContents_free(uint64_t this_ptr) { +void __attribute__((export_name("TS_EventHandler_free"))) TS_EventHandler_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); + LDKEventHandler this_ptr_conv = *(LDKEventHandler*)(this_ptr_ptr); FREE(untag_ptr(this_ptr)); - CustomOnionMessageContents_free(this_ptr_conv); + EventHandler_free(this_ptr_conv); } void __attribute__((export_name("TS_GossipSync_free"))) TS_GossipSync_free(uint64_t this_ptr) { @@ -47931,21 +50652,6 @@ uint64_t __attribute__((export_name("TS_RapidGossipSync_new"))) TS_RapidGossipS 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); @@ -48773,6 +51479,18 @@ jboolean __attribute__((export_name("TS_Sha256_eq"))) TS_Sha256_eq(uint64_t a, return ret_conv; } +uint64_t __attribute__((export_name("TS_Sha256_from_bytes"))) TS_Sha256_from_bytes(int8_tArray bytes) { + uint8_t bytes_arr[32]; + CHECK(bytes->arr_len == 32); + memcpy(bytes_arr, bytes->elems, 32); FREE(bytes); + uint8_t (*bytes_ref)[32] = &bytes_arr; + LDKSha256 ret_var = Sha256_from_bytes(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; +} + void __attribute__((export_name("TS_Description_free"))) TS_Description_free(uint64_t this_obj) { LDKDescription this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -49122,7 +51840,7 @@ uint64_t __attribute__((export_name("TS_Fallback_seg_wit_program"))) TS_Fallbac 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((LDKWitnessVersion){ ._0 = version }, program_ref); uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -49455,6 +52173,18 @@ int8_tArray __attribute__((export_name("TS_RawInvoice_payment_secret"))) TS_Raw return ret_arr; } +uint64_t __attribute__((export_name("TS_RawInvoice_payment_metadata"))) TS_RawInvoice_payment_metadata(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; + LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); + *ret_copy = RawInvoice_payment_metadata(&this_arg_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + uint64_t __attribute__((export_name("TS_RawInvoice_features"))) TS_RawInvoice_features(uint64_t this_arg) { LDKRawInvoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -49544,6 +52274,17 @@ int64_t __attribute__((export_name("TS_PositiveTimestamp_as_duration_since_epoc return ret_conv; } +int8_tArray __attribute__((export_name("TS_Invoice_signable_hash"))) TS_Invoice_signable_hash(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; + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, Invoice_signable_hash(&this_arg_conv).data, 32); + return ret_arr; +} + uint64_t __attribute__((export_name("TS_Invoice_into_signed_raw"))) TS_Invoice_into_signed_raw(uint64_t this_arg) { LDKInvoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -49622,6 +52363,18 @@ int8_tArray __attribute__((export_name("TS_Invoice_payment_secret"))) TS_Invoic return ret_arr; } +uint64_t __attribute__((export_name("TS_Invoice_payment_metadata"))) TS_Invoice_payment_metadata(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; + LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); + *ret_copy = Invoice_payment_metadata(&this_arg_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + uint64_t __attribute__((export_name("TS_Invoice_features"))) TS_Invoice_features(uint64_t this_arg) { LDKInvoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -49646,6 +52399,18 @@ int8_tArray __attribute__((export_name("TS_Invoice_recover_payee_pub_key"))) TS return ret_arr; } +uint64_t __attribute__((export_name("TS_Invoice_expires_at"))) TS_Invoice_expires_at(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; + LDKCOption_DurationZ *ret_copy = MALLOC(sizeof(LDKCOption_DurationZ), "LDKCOption_DurationZ"); + *ret_copy = Invoice_expires_at(&this_arg_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + int64_t __attribute__((export_name("TS_Invoice_expiry_time"))) TS_Invoice_expiry_time(uint64_t this_arg) { LDKInvoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -49656,6 +52421,16 @@ int64_t __attribute__((export_name("TS_Invoice_expiry_time"))) TS_Invoice_expir return ret_conv; } +int64_t __attribute__((export_name("TS_Invoice_expiration_remaining_from_epoch"))) TS_Invoice_expiration_remaining_from_epoch(uint64_t this_arg, int64_t time) { + 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_expiration_remaining_from_epoch(&this_arg_conv, time); + return ret_conv; +} + jboolean __attribute__((export_name("TS_Invoice_would_expire"))) TS_Invoice_would_expire(uint64_t this_arg, int64_t at_time) { LDKInvoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -49676,6 +52451,27 @@ int64_t __attribute__((export_name("TS_Invoice_min_final_cltv_expiry_delta"))) return ret_conv; } +ptrArray __attribute__((export_name("TS_Invoice_fallback_addresses"))) TS_Invoice_fallback_addresses(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; + LDKCVec_AddressZ ret_var = Invoice_fallback_addresses(&this_arg_conv); + ptrArray ret_arr = NULL; + ret_arr = init_ptrArray(ret_var.datalen, __LINE__); + jstring *ret_arr_ptr = (jstring*)(((uint8_t*)ret_arr) + 8); + for (size_t i = 0; i < ret_var.datalen; i++) { + LDKStr ret_conv_8_str = ret_var.data[i]; + jstring ret_conv_8_conv = str_ref_to_ts(ret_conv_8_str.chars, ret_conv_8_str.len); + Str_free(ret_conv_8_str); + ret_arr_ptr[i] = ret_conv_8_conv; + } + + FREE(ret_var.data); + return ret_arr; +} + uint64_tArray __attribute__((export_name("TS_Invoice_private_routes"))) TS_Invoice_private_routes(uint64_t this_arg) { LDKInvoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg);